From 346d90c4448e36dc81cb495a33a20b7308ee4399 Mon Sep 17 00:00:00 2001 From: Gabriel Studer <gabriel.studer@unibas.ch> Date: Sat, 10 Nov 2018 00:36:26 +0100 Subject: [PATCH] add some options to build-sidechains action --- actions/doc/index.rst | 14 ++++++++++++-- actions/pm-build-sidechains | 20 ++++++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/actions/doc/index.rst b/actions/doc/index.rst index 3e3c611b..450ffa57 100644 --- a/actions/doc/index.rst +++ b/actions/doc/index.rst @@ -147,8 +147,8 @@ You can (re-)construct the sidechains in a model from the command line. .. code-block:: console - $ usage: build-sidechains [-h] (-p <FILE> | -e <FILE>) [-o <FILENAME>] [-k] - [-n] [-r] + $ usage: build-sidechains [-h] (-p <FILE> | -e <FILE>) [-o <FILENAME>] [-k] [-n] + [-r] [-i] [-s] Example usage: @@ -180,3 +180,13 @@ Several flags control the modelling behaviour: Do not use rotamers with subrotamers +.. option:: -i, --backbone-independent + + Use backbone independent rotamer library + (from :meth:`promod3.sidechain.LoadLib`) instead of the default backbone + dependent one (from :meth:`promod3.sidechain.LoadBBDepLib`) + +.. option:: -s, --no-subrotamer-optimization + + Dont do subrotamer optimization if flexible rotamer model is used + diff --git a/actions/pm-build-sidechains b/actions/pm-build-sidechains index a04cd7b1..c7ceb244 100644 --- a/actions/pm-build-sidechains +++ b/actions/pm-build-sidechains @@ -11,7 +11,7 @@ Example usage: import os import ost from ost import io, settings -from promod3 import modelling +from promod3 import modelling, sidechain from promod3.core import pm3argparse, helper # make sure we see output when passing '-h' @@ -32,6 +32,12 @@ parser.add_argument('-n', '--no-disulfids', action='store_true', 'optimization') parser.add_argument('-r', '--rigid-rotamers', action='store_true', help='Do not use rotamers with subrotamers') +parser.add_argument('-i', '--backbone-independent', action='store_true', + help='Use backbone independent rotamer library instead ' + + 'of the default backbone dependent one') +parser.add_argument('-s', '--no-subrotamer-optimization', action='store_true', + help='Dont do subrotamer optimization if flexible ' + + 'rotamer model is used.') opts = parser.Parse() @@ -45,10 +51,20 @@ rotamer_model = "frm" if opts.rigid_rotamers: rotamer_model = "rrm" +lib = None +if opts.backbone_independent: + lib = sidechain.LoadLib() + +opt_subrot = True +if opts.no_subrotamer_optimization: + opt_subrot = False + # do sidechain modelling modelling.ReconstructSidechains(prot, keep_sidechains=opts.keep_sidechains, build_disulfids=opts.no_disulfids==False, - rotamer_model=rotamer_model) + rotamer_model=rotamer_model, + rotamer_library=lib, + optimize_subrotamers=opt_subrot) # output ost.PopVerbosityLevel() -- GitLab