Skip to content
Snippets Groups Projects
Commit 74d0d18e authored by Gerardo Tauriello's avatar Gerardo Tauriello
Browse files

Merge branch 'hotfix-1.0.1'

parents 4191d567 7b5b82a3
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,7 @@ include(PROMOD3) ...@@ -15,7 +15,7 @@ include(PROMOD3)
set(PROMOD3_VERSION_MAJOR 1) set(PROMOD3_VERSION_MAJOR 1)
set(PROMOD3_VERSION_MINOR 0) set(PROMOD3_VERSION_MINOR 0)
set(PROMOD3_VERSION_PATCH 0) set(PROMOD3_VERSION_PATCH 1)
set(PROMOD3_VERSION_STRING ${PROMOD3_VERSION_MAJOR}.${PROMOD3_VERSION_MINOR}) set(PROMOD3_VERSION_STRING ${PROMOD3_VERSION_MAJOR}.${PROMOD3_VERSION_MINOR})
set(PROMOD3_VERSION_STRING ${PROMOD3_VERSION_STRING}.${PROMOD3_VERSION_PATCH}) set(PROMOD3_VERSION_STRING ${PROMOD3_VERSION_STRING}.${PROMOD3_VERSION_PATCH})
......
...@@ -13,7 +13,7 @@ from _ring_punches import * ...@@ -13,7 +13,7 @@ from _ring_punches import *
import ost import ost
from ost import mol from ost import mol
from ost.mol import mm from ost.mol import mm
import os import os, math
def BuildSidechains(mhandle, merge_distance=4, scorer=None, fragment_db=None, def BuildSidechains(mhandle, merge_distance=4, scorer=None, fragment_db=None,
structure_db=None, torsion_sampler=None): structure_db=None, torsion_sampler=None):
...@@ -140,6 +140,11 @@ def MinimizeModelEnergy(mhandle, max_iterations=12, max_iter_sd=20, ...@@ -140,6 +140,11 @@ def MinimizeModelEnergy(mhandle, max_iterations=12, max_iter_sd=20,
settings.platform = mm.Platform.Reference settings.platform = mm.Platform.Reference
sim = mm.Simulation(mhandle.model, settings) sim = mm.Simulation(mhandle.model, settings)
ost.LogWarning("Switched to slower reference platform of OpenMM!") ost.LogWarning("Switched to slower reference platform of OpenMM!")
# check for certain failure -> we get NaN if atoms are on top each other
if math.isnan(sim.GetEnergy()):
ost.LogError("OpenMM could not minimize energy as atoms are on top of "
"each other!")
return
# settings to check for stereochemical problems # settings to check for stereochemical problems
clashing_distances = mol.alg.DefaultClashingDistances() clashing_distances = mol.alg.DefaultClashingDistances()
bond_stereo_chemical_param = mol.alg.DefaultBondStereoChemicalParams() bond_stereo_chemical_param = mol.alg.DefaultBondStereoChemicalParams()
......
...@@ -46,8 +46,25 @@ bool CheckBackboneAtoms(ResidueView res) ...@@ -46,8 +46,25 @@ bool CheckBackboneAtoms(ResidueView res)
return true; return true;
} }
void CleanupAtomConflicts(ResidueView& res) {
// remove atoms which are on top of any other atoms in the tpl entity
EntityView tpl = res.GetEntity();
AtomViewList atom_views = res.GetAtomList();
for (uint i = 0; i < atom_views.size(); ++i) {
AtomViewList on_top_atoms = tpl.FindWithin(atom_views[i].GetPos(), 0.0);
if (on_top_atoms.size() > 1) {
res.RemoveAtom(atom_views[i]);
// report
std::stringstream ss;
ss << "residue " << res.GetQualifiedName() << " has conflicting atom "
<< atom_views[i].GetName() << " - skipping atom.";
LOG_WARNING(ss.str());
}
}
} }
} // anon ns
int CountEnclosedGaps(ModellingHandle& mhandle, const StructuralGap& gap, int CountEnclosedGaps(ModellingHandle& mhandle, const StructuralGap& gap,
bool insertions_only) bool insertions_only)
{ {
...@@ -541,6 +558,8 @@ void BuildRawChain(const ost::seq::AlignmentHandle& aln, ...@@ -541,6 +558,8 @@ void BuildRawChain(const ost::seq::AlignmentHandle& aln,
src_res.GetOneLetterCode() << "'"; src_res.GetOneLetterCode() << "'";
throw promod3::Error(ss.str()); throw promod3::Error(ss.str());
} }
// remove atoms with conflicting positions (i.e. on top of each other)
CleanupAtomConflicts(src_res);
// check for complete backbone, or in case of Calpha only model building, // check for complete backbone, or in case of Calpha only model building,
// if the src_res has a Calpha atom // if the src_res has a Calpha atom
if(!CheckBackboneAtoms(src_res)){ if(!CheckBackboneAtoms(src_res)){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment