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

Fixing a bug when more than one ligand is used, entities are recognized as same by ihm #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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: 3 additions & 4 deletions src/boltz/data/write/mmcif.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def to_mmcif(structure: Structure) -> str: # noqa: C901

# Create entity objects
entities_map = {}
for entity, sequence in sequences.items():
for k,(entity, sequence) in enumerate(sequences.items()):
mol_type = entity_to_moltype[entity]

if mol_type == const.chain_type_ids["PROTEIN"]:
Expand All @@ -69,11 +69,10 @@ def to_mmcif(structure: Structure) -> str: # noqa: C901
chem_comp = lambda x: ihm.RNAChemComp(id=x, code=x, code_canonical="N") # noqa: E731
elif len(sequence) > 1:
alphabet = {}
chem_comp = lambda x: ihm.SaccharideChemComp(id=x) # noqa: E731
chem_comp = lambda x: ihm.SaccharideChemComp(id=x,code_canonical=f"X{k}") # noqa: E731
else:
alphabet = {}
chem_comp = lambda x: ihm.NonPolymerChemComp(id=x) # noqa: E731

chem_comp = lambda x: ihm.NonPolymerChemComp(id=x,code_canonical=f"X{k}") # noqa: E731
seq = [
alphabet[item] if item in alphabet else chem_comp(item) for item in sequence
]
Expand Down