Add pose IDs to mmCIF keywords via $PoseID token substitution - #82
Merged
Conversation
Reads the Fragalysis download metadata.csv (column 1 = pose code, column 3 = crystal name) to build a crystal→pose-codes mapping, then substitutes the $PoseID token wherever it appears in the mmcif-gen template output (handles both loop items and key-value pairs). Closes #81. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The CSV uses double-quoted fields so simple split(',') left quotes in the
parsed values, preventing dict lookups from matching crystal names. Switch to
csv.reader which strips the quotes correctly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
read_fragalysis_csv()to parse the Fragalysis downloadmetadata.csv(pose code in column 1, crystal name in column 3) into a{crystal_name: [pose_codes]}mapping--fragalysis-csv/fragalysis_csvargument (previously unused) throughrun()intoprocess_input()$PoseIDwith a comma-separated list of pose codes wherever the token appears in the mmcif-gen template output — handles loop items and key-value pair items, as well as the existing_struct.titleloopcsv.readerto correctly handle the quoted fields in the Fragalysis CSVCloses #81
Test plan
python -m pdbdepo.pdb_deposition -w <collator_dir> -m <metadata.csv> -f <fragalysis_metadata.csv>againstdata/std_test/lb32627-66_2026-04-28_struct_keywords.textin a generated_struc.cifcontains the expected pose IDs (e.g.A71EV2A-x0836a, A71EV2A-x0836bfor crystalA71EV2A-x0836)$PoseIDtokens remain in any output CIF:grep -r '\$PoseID' pdb_depo_files/🤖 Generated with Claude Code