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

introduce termini modelling in default pipeline and build-model action

parent f39fc282
Branches
Tags
No related merge requests found
...@@ -45,6 +45,12 @@ parser.AssembleParser() ...@@ -45,6 +45,12 @@ parser.AssembleParser()
parser.add_argument('-o', '--model-file', metavar='<FILENAME>', type=str, parser.add_argument('-o', '--model-file', metavar='<FILENAME>', type=str,
default='model.pdb', help='File to store model coordinates'+ default='model.pdb', help='File to store model coordinates'+
' (default: %(default)s).') ' (default: %(default)s).')
parser.add_argument('-t', '--model-termini', help="Enforce modelling of " +
"terminal stretches without template coverage with a " +
"crude Monte Carlo approach. The accuracy of those " +
"termini is likely to be limited.", action="store_true")
# lots of checking being done here -> see PM3ArgumentParser # lots of checking being done here -> see PM3ArgumentParser
opts = parser.Parse() opts = parser.Parse()
...@@ -78,7 +84,8 @@ try: ...@@ -78,7 +84,8 @@ try:
if len(opts.fragger_handles) > 0: if len(opts.fragger_handles) > 0:
modelling.SetFraggerHandles(mhandle, opts.fragger_handles) modelling.SetFraggerHandles(mhandle, opts.fragger_handles)
# build final model # build final model
final_model = modelling.BuildFromRawModel(mhandle) final_model = modelling.BuildFromRawModel(mhandle,
model_termini=opts.model_termini)
except Exception as ex: except Exception as ex:
helper.MsgErrorAndExit("Failed to perform modelling! An exception of type "+ helper.MsgErrorAndExit("Failed to perform modelling! An exception of type "+
type(ex).__name__ + " occured: " + str(ex), 3) type(ex).__name__ + " occured: " + str(ex), 3)
......
...@@ -430,7 +430,8 @@ def CheckFinalModel(mhandle): ...@@ -430,7 +430,8 @@ def CheckFinalModel(mhandle):
ost.LogInfo("Stereo-chemical problem in sidechain " + \ ost.LogInfo("Stereo-chemical problem in sidechain " + \
"of residue " + str(res)) "of residue " + str(res))
def BuildFromRawModel(mhandle, use_amber_ff=False, extra_force_fields=list()): def BuildFromRawModel(mhandle, use_amber_ff=False, extra_force_fields=list(),
model_termini=False):
'''Build a model starting with a raw model (see :func:`BuildRawModel`). '''Build a model starting with a raw model (see :func:`BuildRawModel`).
This function implements a recommended pipeline to generate complete models This function implements a recommended pipeline to generate complete models
...@@ -474,6 +475,19 @@ def BuildFromRawModel(mhandle, use_amber_ff=False, extra_force_fields=list()): ...@@ -474,6 +475,19 @@ def BuildFromRawModel(mhandle, use_amber_ff=False, extra_force_fields=list()):
existing parametrization are skipped. existing parametrization are skipped.
:type extra_force_fields: :class:`list` of :class:`ost.mol.mm.Forcefield` :type extra_force_fields: :class:`list` of :class:`ost.mol.mm.Forcefield`
:param model_termini: The default modelling pipeline in ProMod3 is optimized
to generate a gap-free model of the region in the
target sequence(s) that is covered with template
information. Terminal extensions without template
coverage are negelected.
You can activate this flag to enforce a model of the
full target sequence(s). The terminal parts will be
modelled with a crude Monte Carlo approach. Be aware
that the accuracy of those termini is likely to be
limited. Termini of length 1 won't be modelled.
:type model_termini: :class:`bool`
:return: Delivers the model as an |ost_s| entity. :return: Delivers the model as an |ost_s| entity.
:rtype: :class:`Entity <ost.mol.EntityHandle>` :rtype: :class:`Entity <ost.mol.EntityHandle>`
''' '''
...@@ -493,8 +507,9 @@ def BuildFromRawModel(mhandle, use_amber_ff=False, extra_force_fields=list()): ...@@ -493,8 +507,9 @@ def BuildFromRawModel(mhandle, use_amber_ff=False, extra_force_fields=list()):
rotamer_library = sidechain.LoadBBDepLib() rotamer_library = sidechain.LoadBBDepLib()
merge_distance = 4 merge_distance = 4
# remove terminal gaps if not model_termini:
RemoveTerminalGaps(mhandle) # remove terminal gaps
RemoveTerminalGaps(mhandle)
# check whether we have fragger handles # check whether we have fragger handles
fragger_handles = None fragger_handles = None
...@@ -507,6 +522,10 @@ def BuildFromRawModel(mhandle, use_amber_ff=False, extra_force_fields=list()): ...@@ -507,6 +522,10 @@ def BuildFromRawModel(mhandle, use_amber_ff=False, extra_force_fields=list()):
fragment_db=fragment_db, structure_db=structure_db, fragment_db=fragment_db, structure_db=structure_db,
torsion_sampler=torsion_sampler, fragger_handles=fragger_handles) torsion_sampler=torsion_sampler, fragger_handles=fragger_handles)
if model_termini:
ModelTermini(mhandle, torsion_sampler, fragger_handles=fragger_handles)
RemoveTerminalGaps(mhandle) # length=1 ignored above
# build sidechains # build sidechains
BuildSidechains(mhandle, merge_distance, fragment_db, BuildSidechains(mhandle, merge_distance, fragment_db,
structure_db, torsion_sampler, rotamer_library) structure_db, torsion_sampler, rotamer_library)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment