コード例 #1
0
ファイル: parser.py プロジェクト: frankmenglin/forcebalance
import re
import sys
import itertools
import traceback
from nifty import printcool, printcool_dictionary, which, isfloat
from copy import deepcopy
from collections import OrderedDict

from forcebalance.output import getLogger
logger = getLogger(__name__)

## Default general options.
## Note that the documentation is included in part of the key; this will aid in automatic doc-extraction. :)
## In the 5-tuple we have: Default value, priority (larger number means printed first), short docstring, description of scope, list of filter strings for pulling out pertinent targets (MakeInputFile.py)
gen_opts_types = {
    'strings' : {"gmxpath"      : (which('mdrun'), 60, 'Path for GROMACS executables (if not the default)', 'All targets that use GROMACS', ['GMX']),
                 "gmxsuffix"    : ('', 60, 'The suffix of GROMACS executables', 'All targets that use GROMACS', ['GMX']),
                 "tinkerpath"   : (which('testgrad'), 60, 'Path for TINKER executables (if not the default)', 'All targets that use TINKER', ['TINKER']),
                 "penalty_type" : ("L2", 100, 'Type of the penalty, L2 or Hyp in the optimizer', 'All optimizations'),
                 "scan_vals"    : (None, -100, 'Values to scan in the parameter space, given like this: -0.1:0.1:11', 'Job types scan_mvals and scan_pvals'),
                 "readchk"      : (None, -50, 'Name of the restart file we read from', 'Restart jobtype "newton" with "writechk" set'),
                 "writechk"     : (None, -50, 'Name of the restart file we write to (can be same as readchk)', 'Main optimizer'),
                 "ffdir"        : ('forcefield', 100, 'Directory containing force fields, relative to project directory', 'All'),
                 "amoeba_pol"   : (None, 0, 'The AMOEBA polarization type, either direct, mutual, or nonpolarizable.', 'Targets in OpenMM / TINKER that use the AMOEBA force field', ['OPENMM','TINKER'])
                 },
    'allcaps' : {"jobtype"      : ("single", 200, 'The calculation type, defaults to a single-point evaluation of objective function.', 
                                   'All (important); choose "single", "gradient", "hessian", "newton" (Main Optimizer), "bfgs", "powell", "simplex", "anneal", "genetic", "conjugategradient", "scan_mvals", "scan_pvals", "fdcheck[gh]"'),
                 },
    'lists'   : {"forcefield"     : ([],  200, 'The names of force fields, corresponding to directory forcefields/file_name.(itp,xml,prm,frcmod,mol2)', 'All (important)'),
                 "scanindex_num"  : ([], -100, 'Numerical index of the parameter to scan over', 'Job types scan_mvals and scan_pvals'),
                 "scanindex_name" : ([], -100, 'Parameter name to scan over (should convert to a numerical index)', 'Job types scan_mvals and scan_pvals'),
コード例 #2
0
# OpenMM import
import simtk.unit as u
import simtk.openmm as mm
import simtk.openmm.app as app

parser = argparse.ArgumentParser()
parser.add_argument(
    '-a',
    '--amber',
    action='store_true',
    help='Pass this flag to run AMBER tests along with Gromacs / OpenMM.')
args, sys.argv = parser.parse_known_args(sys.argv)

# Gromacs settings
gmxsuffix = "_d"
if which('gmx' + gmxsuffix) != '':
    logger.info("Using double precision GROMACS version 5\n")
    gmxpath = which('gmx' + gmxsuffix)
    GMXVERSION = 5
elif which('mdrun' + gmxsuffix) != '':
    logger.info("Using double precision GROMACS version 4\n")
    gmxpath = which('mdrun' + gmxsuffix)
    GMXVERSION = 4
else:
    gmxsuffix = ""
    if which('gmx' + gmxsuffix) != '':
        logger.info("Using single precision GROMACS version 5\n")
        gmxpath = which('gmx' + gmxsuffix)
        GMXVERSION = 5
    elif which('mdrun' + gmxsuffix) != '':
        logger.info("Using single precision GROMACS version 4\n")
コード例 #3
0
ファイル: parser.py プロジェクト: kmckiern/forcebalance
import re
import sys
import itertools
import traceback
from nifty import printcool, printcool_dictionary, which, isfloat
from copy import deepcopy
from collections import OrderedDict

from forcebalance.output import getLogger
logger = getLogger(__name__)

## Default general options.
## Note that the documentation is included in part of the key; this will aid in automatic doc-extraction. :)
## In the 5-tuple we have: Default value, priority (larger number means printed first), short docstring, description of scope, list of filter strings for pulling out pertinent targets (MakeInputFile.py)
gen_opts_types = {
    'strings' : {"gmxpath"      : (which('mdrun'), 60, 'Path for GROMACS executables (if not the default)', 'All targets that use GROMACS', ['GMX']),
                 "gmxsuffix"    : ('', 60, 'The suffix of GROMACS executables', 'All targets that use GROMACS', ['GMX']),
                 "tinkerpath"   : (which('testgrad'), 60, 'Path for TINKER executables (if not the default)', 'All targets that use TINKER', ['TINKER']),
                 "penalty_type" : ("L2", 100, 'Type of the penalty, L2 or Hyp in the optimizer', 'All optimizations'),
                 "scan_vals"    : (None, -100, 'Values to scan in the parameter space, given like this: -0.1:0.1:11', 'Job types scan_mvals and scan_pvals'),
                 "readchk"      : (None, -50, 'Name of the restart file we read from', 'Restart jobtype "newton" with "writechk" set'),
                 "writechk"     : (None, -50, 'Name of the restart file we write to (can be same as readchk)', 'Main optimizer'),
                 "ffdir"        : ('forcefield', 100, 'Directory containing force fields, relative to project directory', 'All'),
                 "amoeba_pol"   : (None, 0, 'The AMOEBA polarization type, either direct, mutual, or nonpolarizable.', 'Targets in OpenMM / TINKER that use the AMOEBA force field', ['OPENMM','TINKER']),
                 "amberhome"    : (None, -10, 'Path to AMBER installation directory (leave blank to use AMBERHOME environment variable.', 'Targets that use AMBER', 'AMBER'),
                 },
    'allcaps' : {"jobtype"      : ("single", 200, 'The calculation type, defaults to a single-point evaluation of objective function.', 
                                   'All (important); choose "single", "gradient", "hessian", "newton" (Main Optimizer), "bfgs", "powell", "simplex", "anneal", "genetic", "conjugategradient", "scan_mvals", "scan_pvals", "fdcheck[gh]"'),
                 },
    'lists'   : {"forcefield"     : ([],  200, 'The names of force fields, corresponding to directory forcefields/file_name.(itp,xml,prm,frcmod,mol2)', 'All (important)'),
                 "scanindex_num"  : ([], -100, 'Numerical index of the parameter to scan over', 'Job types scan_mvals and scan_pvals'),
コード例 #4
0
import sys
import itertools
import traceback
from nifty import printcool, printcool_dictionary, which, isfloat
from copy import deepcopy
from collections import OrderedDict

from forcebalance.output import getLogger
logger = getLogger(__name__)

## Default general options.
## Note that the documentation is included in part of the key; this will aid in automatic doc-extraction. :)
## In the 5-tuple we have: Default value, priority (larger number means printed first), short docstring, description of scope, list of filter strings for pulling out pertinent targets (MakeInputFile.py)
gen_opts_types = {
    'strings': {
        "gmxpath": (which('mdrun'), 60,
                    'Path for GROMACS executables (if not the default)',
                    'All targets that use GROMACS', ['GMX']),
        "gmxsuffix": ('', 60, 'The suffix of GROMACS executables',
                      'All targets that use GROMACS', ['GMX']),
        "tinkerpath": (which('testgrad'), 60,
                       'Path for TINKER executables (if not the default)',
                       'All targets that use TINKER', ['TINKER']),
        "penalty_type":
        ("L2", 100, 'Type of the penalty, L2 or Hyp in the optimizer',
         'All optimizations'),
        "scan_vals":
        (None, -100,
         'Values to scan in the parameter space, given like this: -0.1:0.1:11',
         'Job types scan_mvals and scan_pvals'),
        "readchk": (None, -50, 'Name of the restart file we read from',
コード例 #5
0
ファイル: ctest.py プロジェクト: kmckiern/AMBER-FB15
parser = argparse.ArgumentParser()
parser.add_argument(
    "-a", "--amber", action="store_true", help="Pass this flag to run AMBER tests along with Gromacs / OpenMM."
)
parser.add_argument(
    "-c",
    "--charmm",
    action="store_true",
    help="Pass this flag to run CHARMM tests along with Gromacs / OpenMM and maybe AMBER.",
)
args, sys.argv = parser.parse_known_args(sys.argv)

# Gromacs settings
gmxsuffix = "_d"
if which("gmx" + gmxsuffix) != "":
    logger.info("Using double precision GROMACS version 5\n")
    gmxpath = which("gmx" + gmxsuffix)
    GMXVERSION = 5
elif which("mdrun" + gmxsuffix) != "":
    logger.info("Using double precision GROMACS version 4\n")
    gmxpath = which("mdrun" + gmxsuffix)
    GMXVERSION = 4
else:
    gmxsuffix = ""
    if which("gmx" + gmxsuffix) != "":
        logger.info("Using single precision GROMACS version 5\n")
        gmxpath = which("gmx" + gmxsuffix)
        GMXVERSION = 5
    elif which("mdrun" + gmxsuffix) != "":
        logger.info("Using single precision GROMACS version 4\n")
コード例 #6
0
ファイル: atest.py プロジェクト: kmckiern/AMBER-FB15
# ParmEd import
from parmed import gromacs, amber
from parmed.amber.mdin import Mdin

# OpenMM import
import simtk.unit as u
import simtk.openmm as mm
import simtk.openmm.app as app

parser = argparse.ArgumentParser()
parser.add_argument('-a', '--amber', action='store_true', help='Pass this flag to run AMBER tests along with Gromacs / OpenMM.')
args, sys.argv = parser.parse_known_args(sys.argv)

# Gromacs settings
gmxsuffix="_d"
if which('gmx'+gmxsuffix) != '':
    logger.info("Using double precision GROMACS version 5\n")
    gmxpath = which('gmx'+gmxsuffix)
    GMXVERSION = 5
elif which('mdrun'+gmxsuffix) != '':
    logger.info("Using double precision GROMACS version 4\n")
    gmxpath = which('mdrun'+gmxsuffix)
    GMXVERSION = 4
else:
    gmxsuffix=""
    if which('gmx'+gmxsuffix) != '':
        logger.info("Using single precision GROMACS version 5\n")
        gmxpath = which('gmx'+gmxsuffix)
        GMXVERSION = 5
    elif which('mdrun'+gmxsuffix) != '':
        logger.info("Using single precision GROMACS version 4\n")
コード例 #7
0
ファイル: parser.py プロジェクト: rmcgibbo/forcebalance
import os
import re
import sys
import itertools
import traceback
from nifty import printcool, printcool_dictionary, which
from copy import deepcopy
from collections import OrderedDict

## Default general options.
## Note that the documentation is included in part of the key; this will aid in automatic doc-extraction. :)
## In the 5-tuple we have: Default value, priority (larger number means printed first), short docstring, description of scope, list of filter strings for pulling out pertinent targets (MakeInputFile.py)
gen_opts_types = {
    'strings': {
        "gmxpath": (which('mdrun'), 60,
                    'Path for GROMACS executables (if not the default)',
                    'All targets that use GROMACS', ['GMX']),
        "gmxsuffix": ('', 60, 'The suffix of GROMACS executables',
                      'All targets that use GROMACS', ['GMX']),
        "tinkerpath": (which('testgrad'), 60,
                       'Path for TINKER executables (if not the default)',
                       'All targets that use TINKER', ['TINKER']),
        "penalty_type": ("L2", 100,
                         'Type of the penalty, L2 or Hyp in the optimizer',
                         'All optimizations'),
        "scan_vals":
        (None, -100,
         'Values to scan in the parameter space, given like this: -0.1:0.1:11',
         'Job types scan_mvals and scan_pvals'),
        "readchk": (None, -50, 'Name of the restart file we read from',