Skip to content

Commit

Permalink
Fix for Ryan upload_2
Browse files Browse the repository at this point in the history
  • Loading branch information
ConorFWild committed Dec 4, 2024
1 parent 0f81ea3 commit 0a979c1
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/xchemalign/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ def gen_mols_from_cif(cif_file):
:param cif_file: The CIF file to read
:return: A list of molecules found in the CIF
"""
print(cif_file)
doc = cif.read(str(cif_file))

ligand_blocks = []
Expand All @@ -386,14 +385,14 @@ def gen_mols_from_cif(cif_file):
atom_symbols = block.find_loop('_chem_comp_atom.type_symbol')
# coordinates are sometimes called "x" and sometimes "model_Cartn_x" etc.
x = block.find_loop('_chem_comp_atom.x')
# if not x:
# x = block.find_loop('_chem_comp_atom.model_Cartn_x')
if not x:
x = block.find_loop('_chem_comp_atom.model_Cartn_x')
y = block.find_loop('_chem_comp_atom.y')
# if not y:
# y = block.find_loop('_chem_comp_atom.model_Cartn_y')
if not y:
y = block.find_loop('_chem_comp_atom.model_Cartn_y')
z = block.find_loop('_chem_comp_atom.z')
# if not z:
# z = block.find_loop('_chem_comp_atom.model_Cartn_z')
if not z:
z = block.find_loop('_chem_comp_atom.model_Cartn_z')
charges = [0] * len(atom_ids)
if block.find_loop('_chem_comp_atom.charge'):
charges = list(block.find_loop('_chem_comp_atom.charge'))
Expand Down Expand Up @@ -434,7 +433,6 @@ def gen_mols_from_cif(cif_file):

try:
for a1, a2, bt in zip(atom1, atom2, bond_type):
print([a1, a2, bt])
mol.AddBond(
atoms[strip_quotes(a1)].GetIntProp('idx'), atoms[strip_quotes(a2)].GetIntProp('idx'), BOND_TYPES[bt]
)
Expand Down

0 comments on commit 0a979c1

Please sign in to comment.