Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyMol saves mmCIF without auth_seq_id, fall back to label_seq_id #325

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/mmcif.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ Structure make_structure_from_block(const cif::Block& block_) {
"occupancy",
"B_iso_or_equiv",
"?pdbx_formal_charge",
"auth_seq_id",
"?auth_seq_id",
"?auth_comp_id",
"?auth_asym_id",
"?auth_atom_id",
Expand All @@ -715,10 +715,13 @@ Structure make_structure_from_block(const cif::Block& block_) {
// we use only one comp (residue) and one atom name
const int kCompId = atom_table.first_of(kAuthCompId, kLabelCompId);
const int kAtomId = atom_table.first_of(kAuthAtomId, kLabelAtomId);
const int kSeqId = atom_table.first_of(kAuthSeqId, kLabelSeqId);
if (!atom_table.has_column(kCompId))
fail("Neither _atom_site.label_comp_id nor auth_comp_id found");
if (!atom_table.has_column(kAtomId))
fail("Neither _atom_site.label_atom_id nor auth_atom_id found");
if (!atom_table.has_column(kSeqId))
fail("Neither _atom_site.label_seq_id nor auth_seq_id found");

st.has_d_fraction = atom_table.has_column(kDeuterium);

Expand All @@ -740,7 +743,7 @@ Structure make_structure_from_block(const cif::Block& block_) {
resi = nullptr;
}
ResidueId rid = make_resid(cif::as_string(row[kCompId]),
cif::as_string(row[kAuthSeqId]),
cif::as_string(row[kSeqId]),
row.has(kInsCode) ? &row[kInsCode] : nullptr);
if (!resi || !resi->matches(rid)) {
resi = chain->find_or_add_residue(rid);
Expand Down