Skip to content
Snippets Groups Projects
Commit a297b934 authored by Studer Gabriel's avatar Studer Gabriel
Browse files

bugfix: run Molck before any selection statement

Corrupt residues may have some properties missing => Select("peptide=true")
may give an empty view.
parent 654a0bdc
No related branches found
No related tags found
No related merge requests found
......@@ -130,11 +130,29 @@ class Scorer:
molck_settings = None, naive_chain_mapping_thresh=12,
cad_score_exec = None, custom_mapping=None):
model = model.Select("peptide=True or nucleotide=True")
self._model = mol.CreateEntityFromView(model, False)
if isinstance(model, mol.EntityView):
model = mol.CreateEntityFromView(model, False)
else:
model = model.Copy()
target = target.Select("peptide=True or nucleotide=True")
self._target = mol.CreateEntityFromView(target, False)
if isinstance(target, mol.EntityView):
target = mol.CreateEntityFromView(target, False)
else:
target = target.Copy()
if molck_settings is None:
molck_settings = MolckSettings(rm_unk_atoms=True,
rm_non_std=False,
rm_hyd_atoms=True,
rm_oxt_atoms=True,
rm_zero_occ_atoms=False,
colored=False,
map_nonstd_res=True,
assign_elem=True)
Molck(model, conop.GetDefaultLib(), molck_settings)
Molck(target, conop.GetDefaultLib(), molck_settings)
self._model = model.Select("peptide=True or nucleotide=True")
self._target = target.Select("peptide=True or nucleotide=True")
# catch models which have empty chain names
for ch in self._model.chains:
......@@ -174,17 +192,6 @@ class Scorer:
"must be strictly increasing if "
"resnum_alignments are enabled")
if molck_settings is None:
molck_settings = MolckSettings(rm_unk_atoms=True,
rm_non_std=False,
rm_hyd_atoms=True,
rm_oxt_atoms=True,
rm_zero_occ_atoms=False,
colored=False,
map_nonstd_res=True,
assign_elem=True)
Molck(self._model, conop.GetDefaultLib(), molck_settings)
Molck(self._target, conop.GetDefaultLib(), molck_settings)
self.resnum_alignments = resnum_alignments
self.naive_chain_mapping_thresh = naive_chain_mapping_thresh
self.cad_score_exec = cad_score_exec
......
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