Package schrodinger :: Package application :: Package matsci :: Package genetic_optimization :: Module genetic_optimization :: Class CanvasKPLS
[hide private]
[frames] | no frames]

Class CanvasKPLS

    object --+    
             |    
ClassEvaluator --+
                 |
                CanvasKPLS

Manage Canvas KPLS jobs.

Instance Methods [hide private]
 
__init__(self, structs, properties, copy_models=True, fp_options_dict=None)
Create an instance.
 
copyCanvasKPLSModelFiles(self)
Copy the Canvas KPLS model files to the CWD.
str
makeMaestroInfile(self, struct)
Make Maestro infile.
str
makeFingerPrintInfile(self, mae_infile, name, key)
Make fingerprint infile.
float
getPropertyValue(self, property_outfile)
Get the property value.
 
runCanvasKPLS(self, struct)
Run the Canvas KPLS.
 
runIt(self)
Run it.
 
makeFpOptionsDict(self)
Make the fingerprint options dictionary.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
int, str, int or None
getFpOptions(model_file)
Return fingerprint options obtained from the given Canvas KPLS model file.
 
checkCanvasKPLSModelFile(model_file)
Check the given Canvas KPLS model file.
list
getValidCanvasKPLSModelFiles(property_lists)
Return file names of any valid Canvas KPLS model files.
dict
addCanvasKPLSOptions(property_string, options, name, known_name, index)
Add any Canvas KPLS options found in the given property string to the given property options dictionary.
Class Variables [hide private]
  KPLS_EXT = 'kpls.tar.gz'
  FP_TEXT_FILE = 'fpInfo.txt'
  MODEL_OPTION = 'kpls_model'
  EXTRA_OPTIONS = ['kpls_model']
  CUSTOM_KEY = 'r_matsci_KPLS_%s/%s'
  TG_KEY = 'r_matsci_KPLS_Tg/C'
  TG_PROP = 'kpls_tg'
  DIR = 'genetic_optimization/canvas_kpls_models'
  PATH = '/scr/buildbot/savedbuilds/NB/2016-4/build-126/mmshare-...
  TG_PARAMETERS = OrderedDict([('kpls_model', '/scr/buildbot/sav...
  CLASS_KWARGS = OrderedDict([('kpls_tg', 'kpls_model>/scr/build...
  CELSIUS = 'C'
  UNKNOWN_UNITS = 'unknown'
  TG_UNITS = 'C'
  TAG = '_kpls'
  IN_FP_EXT = '-in.fp'
  OUT_EXT = '.out'
  VALUE_PATTERN = re.compile(r'\s*1\s+unknown.*\s+(\d+\.?\d*)$')
  ALLOWED_FP_TYPES = ['linear', 'maccs', 'radial', 'molprint2D',...
  SINGLE_PRECISION = 32
  DOUBLE_PRECISION = 64
  FP_OPTIONS_DICT_KEY = 'fp_options_dict'
  BIT_EXT = '-bit'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, structs, properties, copy_models=True, fp_options_dict=None)
(Constructor)

 

Create an instance.

Parameters:
  • structs (list of schrodinger.structure.Structure) - contains input structures for Canvas KPLS
  • properties (dict) - keys are (name, key) tuples with name and key the property name and structure property key to be created, values are dicts of kwargs, for example containing self.EXTRA_OPTIONS as keys
  • copy_models (bool) - specifies that Canvas KPLS model files specified in the properties argument be copied to the CWD, this will be necessary if wanting to make calls to .runIt in parallel (in that case it will also be necessary to call .runIt from within a subdirectory which contains all input files but this currently is not handled by this class)
  • fp_options_dict (dict) - fingerprint options dictionary, keys are (name, key) tuples with name and key the property name and structure property key to be created, values are (precision, fptype, atomtypes) tuples to be used in fingerprint generation
Overrides: object.__init__

makeMaestroInfile(self, struct)

 

Make Maestro infile.

Parameters:
  • struct (schrodinger.structure.Structure) - the structure for which to prepare the Maestro input file
Returns: str
the Maestro input file name

makeFingerPrintInfile(self, mae_infile, name, key)

 

Make fingerprint infile.

Parameters:
  • mae_infile (str) - the Maestro input file name
  • name (str) - the property name
  • key (str) - the structure property key
Returns: str
the Canvas fingerprint input file name
Raises:
  • RuntimeError - if canvasFPGen fails

getPropertyValue(self, property_outfile)

 

Get the property value.

Parameters:
  • property_outfile (str) - the Canvas KPLS output file
Returns: float
the property value
Raises:
  • RuntimeError - if property output file doesn't exist or doesn't contain the property value

runCanvasKPLS(self, struct)

 

Run the Canvas KPLS.

Parameters:
  • struct (schrodinger.structure.Structure) - the structure on which to run Canvas KPLS
Raises:
  • RuntimeError - if canvasKPLS fails

runIt(self)

 

Run it.

Raises:
  • RuntimeError - for any issue
Overrides: ClassEvaluator.runIt

getFpOptions(model_file)
Static Method

 

Return fingerprint options obtained from the given Canvas KPLS model file.

Parameters:
  • model_file (str) - the name of the Canvas KPLS model file
Returns: int, str, int or None
contains (1) precision, (2) fingerprint type, and (3) atom type if present
Raises:
  • RuntimeError - if there is anything wrong with the Canvas KPLS model file

checkCanvasKPLSModelFile(model_file)
Static Method

 

Check the given Canvas KPLS model file.

Parameters:
  • model_file (str) - the name of the Canvas KPLS model file
Raises:
  • RuntimeError - if there is anything wrong with the Canvas KPLS model file

getValidCanvasKPLSModelFiles(property_lists)
Static Method

 

Return file names of any valid Canvas KPLS model files.

Parameters:
  • property_lists (list) - contains lists of property specifications
Returns: list
file names of valid Canvas KPLS model files

addCanvasKPLSOptions(property_string, options, name, known_name, index)
Static Method

 

Add any Canvas KPLS options found in the given property string to the given property options dictionary.

Parameters:
  • property_string (str) - the string representation of the property specifications, containing options as '<option_substring>=<value>'
  • options (dict) - contains property options
  • name (str) - the property name
  • known_name (bool) - if the given property name is a known name
  • index (int) - the property index
Returns: dict
the given property options with Canvas KPLS options added
Raises:

Class Variable Details [hide private]

PATH

Value:
'/scr/buildbot/savedbuilds/NB/2016-4/build-126/mmshare-v3.6/data/genet\
ic_optimization/canvas_kpls_models'

TG_PARAMETERS

Value:
OrderedDict([('kpls_model', '/scr/buildbot/savedbuilds/NB/2016-4/build\
-126/mmshare-v3.6/data/genetic_optimization/canvas_kpls_models/Tg250.k\
pls.tar.gz')])

CLASS_KWARGS

Value:
OrderedDict([('kpls_tg', 'kpls_model>/scr/buildbot/savedbuilds/NB/2016\
-4/build-126/mmshare-v3.6/data/genetic_optimization/canvas_kpls_models\
/Tg250.kpls.tar.gz')])

ALLOWED_FP_TYPES

Value:
['linear',
 'maccs',
 'radial',
 'molprint2D',
 'torsion',
 'pairwise',
 'triplet',
 'quartet',
...