Skip to content

Commit f7e0991

Browse files
authored
Update inputs.py (#226)
1 parent 14c5318 commit f7e0991

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

alphafold3_pytorch/inputs.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2187,7 +2187,15 @@ def extract_canonical_molecules_from_biomolecule_chains(
21872187
# construct canonical molecule for post-mapping bond orders
21882188

21892189
smile = seq_mapping[seq]
2190-
canonical_mol = mol_from_smile(smile)
2190+
try:
2191+
canonical_mol = mol_from_smile(smile)
2192+
except Exception as e:
2193+
if verbose:
2194+
logger.warning(
2195+
f"Failed to construct canonical RDKit molecule from the SMILES string for residue {seq} due to: {e}. "
2196+
"Skipping canonical molecule construction."
2197+
)
2198+
canonical_mol = None
21912199

21922200
# find all atom positions and masks for the current atomized residue
21932201

0 commit comments

Comments
 (0)