Skip to content

Commit

Permalink
Merge pull request #35 from xchem/ryan_broken_cifs
Browse files Browse the repository at this point in the history
Ryan broken cifs
  • Loading branch information
ConorFWild authored Dec 4, 2024
2 parents c263cc7 + 0a979c1 commit b47bb78
Showing 1 changed file with 23 additions and 4 deletions.
27 changes: 23 additions & 4 deletions src/xchemalign/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,10 +431,29 @@ def gen_mols_from_cif(cif_file):
if not bond_type:
bond_type = block.find_loop('_chem_comp_bond.value_order')

for a1, a2, bt in zip(atom1, atom2, bond_type):
mol.AddBond(
atoms[strip_quotes(a1)].GetIntProp('idx'), atoms[strip_quotes(a2)].GetIntProp('idx'), BOND_TYPES[bt]
)
try:
for a1, a2, bt in zip(atom1, atom2, bond_type):
mol.AddBond(
atoms[strip_quotes(a1)].GetIntProp('idx'), atoms[strip_quotes(a2)].GetIntProp('idx'), BOND_TYPES[bt]
)
except:
print('atoms')
print(atoms)
print('comp ids')
print(comp_ids)
print('atom symbols')
print(atom_symbols)
print('atom ids')
print(atom_ids)
print('x')
print(x)
print('y')
print(y)
print('z')
print(z)
print('charges')
print(charges)
raise Exception

Chem.SanitizeMol(mol)
mol.AddConformer(conf)
Expand Down

0 comments on commit b47bb78

Please sign in to comment.