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

fix: SCHWED-5783 add bonds to copied ligand

parent ba860473
Branches
Tags
No related merge requests found
......@@ -258,6 +258,11 @@ class LigandScorer:
new_chain = new_editor.InsertChain(handle.chain.name)
# Add the residue with its original residue number
new_res = new_editor.AppendResidue(new_chain, handle, deep=True)
for old_atom in handle.atoms:
for old_bond in old_atom.bonds:
new_first = new_res.FindAtom(old_bond.first.name)
new_second = new_res.FindAtom(old_bond.second.name)
new_editor.Connect(new_first, new_second)
return new_res
def _process_ligand_residue(res):
......
......@@ -232,7 +232,8 @@ class TestLigandScoring(unittest.TestCase):
"""
trg, trg_seqres = io.LoadMMCIF(os.path.join('testfiles', "1r8q.cif.gz"), seqres=True)
mdl, mdl_seqres = io.LoadMMCIF(os.path.join('testfiles', "P84080_model_02.cif.gz"), seqres=True)
sc = LigandScorer(mdl, trg, None, None)
mdl_lig = io.LoadEntity(os.path.join('testfiles', "P84080_model_02_ligand_0.sdf"))
sc = LigandScorer(mdl, trg, [mdl_lig], None)
# Note: expect warning about Binding site of H.ZN1 not mapped to the model
sc._compute_scores()
......@@ -246,7 +247,7 @@ class TestLigandScoring(unittest.TestCase):
[np.inf],
[np.inf],
[0.29399303],
[np.inf]]))
[np.inf]]), decimal=5)
# Check lDDT-PLI
self.assertEqual(sc.lddt_pli_matrix.shape, (7, 1))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment