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

@@ -623,6 +623,10 @@ inline void CBOR_ENC(CborEncoder &encoder, const char* key, const PlacedModelMes
CBOR_ENC(mapEncoder, "b_iso", m.b_iso);
CBOR_ENC(mapEncoder, "occupancy", m.occupancy);
CBOR_ENC(mapEncoder, "aniso", m.aniso);
CBOR_ENC(mapEncoder, "subchain", m.subchain);
CBOR_ENC(mapEncoder, "entity_id", m.entity_id);
CBOR_ENC(mapEncoder, "label_seq", m.label_seq);
CBOR_ENC(mapEncoder, "metadata_mmcif", m.metadata_mmcif);
cborErr(cbor_encoder_close_container(&encoder, &mapEncoder));
}