writer: _model.cif from rugnux live keeps the input model's metadata, as the served model.cif does

The placed-model END block lost everything but the atoms, so the writer's _model.cif had no sequence
references, authors, software or secondary structure, and gemmi relabelled the subchains. The block now
also carries label_asym_id, label_entity_id and label_seq_id per atom and the input model's metadata as the
mmCIF categories gemmi writes without coordinates (metadata_mmcif), which the writer parses with gemmi and
puts back. The writer's _model.cif is now the same text as the one rugnux writes itself and as
/rugnux/model.cif serves. Older blocks without the new fields are read as before.

Test: a predicted myoglobin model through END -> CBOR -> writer gives byte-identical _model.cif/_model.pdb
to WritePlacedModel and to PlacedModelMmcif, with its _struct_ref, _entity_poly_seq, _audit_author,
_software and _struct_conf.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015CeEGgpKdfkCTJb3YNMJcu
(cherry picked from commit 29d752e6a107e3b8bc71ad6e9af0d81064966537)
This commit is contained in:
leonarski_f committed 2026-10-22 20:18:51 +02:00
1 parent a105c67f62
commit 90bbba33bc
13 files changed
+117 -18

No files matched your search

@@ -1669,6 +1669,10 @@ namespace {
else if (key == "b_iso") GetCBORFloatArray(map_value, m.b_iso);
else if (key == "occupancy") GetCBORFloatArray(map_value, m.occupancy);
else if (key == "aniso") GetCBORFloatArray(map_value, m.aniso);
else if (key == "subchain") GetCBORStringArray(map_value, m.subchain);
else if (key == "entity_id") GetCBORStringArray(map_value, m.entity_id);
else if (key == "label_seq") GetCBORInt32Array(map_value, m.label_seq);
else if (key == "metadata_mmcif") m.metadata_mmcif = GetCBORString(map_value);
else SkipCBORValue(map_value);
}
cborErr(cbor_value_leave_container(&value, &map_value));