Skip to content
Snippets Groups Projects
Unverified Commit 1d2abe08 authored by Xavier Robin's avatar Xavier Robin
Browse files

fix: SCHWED-5783 element case is unspecified in OST

parent ed65571c
No related branches found
No related tags found
No related merge requests found
......@@ -738,12 +738,12 @@ def ResidueToGraph(residue, by_atom_index=False):
:type by_atom_index: :class:`bool`
:rtype: :class:`~networkx.classes.graph.Graph`
Nodes are labeled with the Atom's :attr:`~ost.mol.AtomHandle.element`.
Nodes are labeled with the Atom's :attr:`~ost.mol.AtomHandle.mass`.
"""
nxg = networkx.Graph()
for atom in residue.atoms:
nxg.add_node(atom.name, element=atom.element)
nxg.add_node(atom.name, element=atom.mass)
# This will list all edges twice - once for every atom of the pair.
# But as of NetworkX 3.0 adding the same edge twice has no effect, so we're good.
......
......@@ -167,6 +167,11 @@ class TestLigandScoring(unittest.TestCase):
sym = ost.mol.alg.ligand_scoring._ComputeSymmetries(mdl_g3d, trg_g3d1, by_atom_index=True)
assert len(sym) == 72
# Test that we can match ions read from SDF
sdf_lig = io.LoadEntity(os.path.join('testfiles', "1r8q_ligand_0.sdf"))
sym = ost.mol.alg.ligand_scoring._ComputeSymmetries(trg_mg1, sdf_lig.residues[0], by_atom_index=True)
assert len(sym) == 1
# Test that it works with views and only consider atoms in the view
# Skip PA, PB and O[1-3]A and O[1-3]B in target and model
# We assume atom index are fixed and won't change
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment