Skip to content

Commit

Permalink
Handle charged atoms in smiles generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ConorFWild committed Oct 23, 2023
1 parent 3babbd5 commit a5a10bc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions xchemalign/xchemalign/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,14 +295,14 @@ def gen_mol_from_cif(cif_file):
x = block.find_loop('_chem_comp_atom.x')
y = block.find_loop('_chem_comp_atom.y')
z = block.find_loop('_chem_comp_atom.z')
charge = [0]*len(atom_ids)
charges = [0]*len(atom_ids)
if block.find_loop('_chem_comp_atom.charge'):
charge = list(block.find_loop('_chem_comp_atom.charge'))
charges = list(block.find_loop('_chem_comp_atom.charge'))
elif block.find_loop('_chem_comp_atom.partial_charge'):
charge = list(block.find_loop('_chem_comp_atom.partial_charge'))
charges = list(block.find_loop('_chem_comp_atom.partial_charge'))

atoms = {}
for s, i, px, py, pz in zip(atom_symbols, atom_ids, x, y, z, charge):
for s, i, px, py, pz, charge in zip(atom_symbols, atom_ids, x, y, z, charges):
if len(s) == 2:
s = s[0] + s[1].lower()

Expand Down

0 comments on commit a5a10bc

Please sign in to comment.