feat: widen chain IDs from u8 to String for multi-char CIF support - #44
feat: widen chain IDs from u8 to String for multi-char CIF support#44adobles96 wants to merge 1 commit into
Conversation
Large cryo-EM structures (e.g. PDB 9A1O) have multi-character chain IDs
like "10" in auth_asym_id. Previously these were truncated to a single
byte. This commit widens chain storage to String throughout the pipeline:
- AtomVector, Structure, CompactStructure chain fields: u8 -> String
- ResidueMatch type: (u8, u64) -> (String, u64)
- CIF parser: replace get_one_char with get_text_string (preserves full chain name)
- PDB/FCZ parsers: convert at boundary, Atom struct unchanged for FFI compat
- Query format: underscore separator (e.g. "AA_250") for unambiguous multi-char chains,
with backward compat for single-char legacy format ("A250")
- All output formatting uses CHAIN_RESIDUE separator
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Probably need to propagate the new motif format through documentation if approved. I can do that after/if you green light. I introduced the separator b/c there may be multichar chain IDs with numbers (eg |
|
Ah I was thinking of the same query format with underscore separator with backward compatibility. |
|
@khb7840 just bumping this. Are you still interested in merging this? |
|
Yes. Sorry for the delaying. |
|
I found the default output format has been changed with your fork and the underscore between the chain ID and the residue indices is not compatible with the query grammar. To keep backward compatibility, I think the output formatting can be kept as the old version by default & new formatting activated with flags or numeric ID discovered. I'm also considering both format to be enabled in querying grammer. Could you make a pull request to And thank you for the contribution. |
Summary
u8toStringthroughout the pipeline to support multi-character chain IDs (e.g."10"inauth_asym_idfrom large cryo-EM structures like PDB 9A1O)AtomVector,Structure,CompactStructurechain fields andResidueMatchtype accordinglyget_one_charwithget_text_stringto preserve full chain namesAtomstruct unchanged for FFI compatAA_250) for unambiguous multi-char chains, with backward compat for single-char legacy format (A250)Test plan
🤖 Generated with Claude Code