Package schrodinger :: Package test :: Package stu :: Package outcomes :: Module desmond
[hide private]
[frames] | no frames]

Module desmond

This is a module for use in the backend test utility's workup routine. General tools are set in the functions and each class contains Desmond jobtype-specific methods for determining if a job is acceptable.

$Revision: 1.4 $

Copyright (c) Schrodinger, LLC. All rights reserved

Classes [hide private]
  Adaptive
Class created to define it's base class at runtime.
  SystemBuilder
General class used for system builder workups.
  Desmond
General class used for Desmond workups.
  Fep
A Class to help with Demsond's FEP-specifc workup
Functions [hide private]
 
getConfig(config_file)
Get the config parameters
 
sendEmailNotice(msg, mail_serv='pdx-mail.schrodinger.com', recipient_name=None, recipient_addr='schrodinger.com', subj_add='')
Send an email to yourself, with "msg" attached.
 
cleanWorkup(results, msg)
Easy way to get the pass/fail and return a message that looks decent.
 
assertByNumber(actual, required, buffer=0, xmsg='')
Used to compare two values given a certain error margin.
 
assertLessThan(actual, required, xmsg='')
Used to compare two values asserting "actual" is less than "required".
 
assertBetween(actual, min_req, max_req, buffer=0, xmsg='')
Used to assert "actual" is within two numbers, "min_req" and "max_req".
 
assertByPercent(actual, required, buffer=0, xmsg='')
The same function as assertByNumber except the error margin is a percentage.
tuple
assertStr(req, act, xmsg='')
Compares two strings, or checks for a given string in a file.
 
falseAssert(test_message, value_message)
 
trueAssert(test_message, value_message)
 
_printAsserts(val, msg1, msg2)
 
getStats(ilist, *types)
Returns a list of stats calculated on columns of provided list.
 
rsq(initial, new)
Calculates r-squared of two arrays
 
grpStats(data)
Returns: avg, stdev and max value for values in dict "data"
 
lineCt(ifile)
Return the number of lines in file
 
checkFiles(files)
Checks to see if a list of files exist.
 
isFile(ifile)
 
isDir(idir)
 
getLines(ifile)
Returns a file's lines as a list
 
getBlocksFrom(ifile)
 
listBlocksFrom(ifile)
 
extractData(text, sub1, sub2, start=0, direction='down')
Extract a substring between two substrings sub1 and sub2 in text It will cut at the first instance of sub1 and return text after that until is recognizes sub2.
 
findData(text, initial_marker, end_marker='\n', clean=False)
Returns line containing
 
byColumn(ifile, headers, make_float=False, precision=0)
Returns a dictionary with keys equal to the headers and thier values equal to their column number plus the actual values for that column.
 
byColumnB(ifile, headers=[], make_float=False, precision=0)
Returns a dictionary with keys equal to the headers and their values equal to their column number plus the actual values for that column.
dict
byLine(ifile, delim=' ')
Used to glean data structured in rows.
 
pullEne(efile, **kwargs)
Returns the a list of values for the volume found in the ene file
 
pullSimbox(sfile, **kwargs)
Extracts values from each column of the _simbox.dat file as a dict
 
pullEneDat(ifile)
Extracts the values in the EGRP keys from the _enegrp.dat file for each time step.
 
pullExchangeInfo(ifile)
Extracts all replica exchange information from desmond log file
 
pullIter(log_file)
 
pullRate(log_file)
Grab the ns/day rate from a desmond simulation log
 
getMolCountByFile(ifile, index=1, format='maestro')
Returns the mol count on the indicated structure.
 
getMolCount(st)
Returns the mol count on "st"
 
getTotalWeight(st)
Returns the atomic weight of "st"
 
checkResNameByFile(ifile, index=1, format='maestro')
Searches structures in a file and gathers the unique pdb residue names and returns them.
 
getResName(st, uniques=False)
Searches "st" and gathers the unique pdb residue names and returns them.
 
getAtomPropsByFile(ifile, prop, index=1, format='maestro')
Gathers the values for the provided property.
 
getAtomProps(st, prop)
Gathers the values for the provided properties of "st" (a structure.Structure instance).
 
getStructsByProp(ifile, ct_prop, format='maestro', filter_list=None)
Gets all cts in a file and separates them based on ct-level property.
 
checkDist(st1, st2, asl1, asl2, cutoff)
Gets all atoms within a certain distance of asl1 in st1 from asl2 in st2.
 
volFromLattice(ifile)
Calculates the volume of the unit cell based on the structure properies.
 
getdG(structs)
Returns property name and dG value (for each dG found) as a list of lists
 
getDihedrals(cms, trj, ref_atoms, mut_atoms)
Return a list of dihedral angles for the simulation
 
getWaterModel(ifile)
Returns the pdb residue name for the first atom in the solvent CT
 
getDesmondHosts(log_file=None, multisim=False)
Parses the desmond log files for host names.
 
getLastTime(ifile)
Gets the last time from either a cfg file or ene file
 
getLamWin(path)
Gets the lambda window for a path with "lambda" in it
 
runBennett(base_name, last_time, last_lambda=11, precision=None)
Run bennett.py with simulation stage results.
 
getRoot(from_file='log', multisim=False)
Gets the root name (common basename) from files in the current working directory based on the extension indicated.
 
getSysBldFiles(jobname)
Make a dictionary of all files associated with the job
 
getMultisimFiles(jobname)
Make a dictionary of all files associated with the job
 
getDesmondFiles(jobname)
Make a dictionary of all files associated with the job
Variables [hide private]
  __doc__ = ...
  _version = '$Revision: 1.4 $'
  REPOSITORY = '/home/stationw/IMS/results'
  CTS = ['full_system', 'membrane', 'ion', 'positive salt', 'neg...
  ENE = ['Time', 'E', 'E_p', 'E_k', 'E_x', 'E_f', 'P', 'V', 'T',...
  SIM = ['Time', 'ax', 'ay', 'az', 'bx', 'by', 'bz', 'cx', 'cy',...
  EGRP = ['time', 'pres', 'vol', 'ke', 'v', 'pe', 'xe', 'Corr_En...
  REEX = ['time', 'exchange', 'rep_1', 'rep_2', 'T_1', 'T_2', 'U...
  REAL_RE = '[+\\-]?(\\d+(\\.\\d*)?|\\d*\\.\\d+)([eE][+\\-]?\\d+)?'
  INT_RE = '[+\\-]?\\d+'
  FLOAT_RE = '[+\\-]?(\\d+\\.\\d*|\\d*\\.\\d+)'
  __package__ = 'schrodinger.test.stu.outcomes'
Function Details [hide private]

sendEmailNotice(msg, mail_serv='pdx-mail.schrodinger.com', recipient_name=None, recipient_addr='schrodinger.com', subj_add='')

 

Send an email to yourself, with "msg" attached.

Parameters:
  • msg - Main message sent in email
  • mail_serv - smpt server
  • recipient_name - Username for receiver's email
  • recipient_addr - Server address for receiver's email
  • subj_add - Extra info to add to subject, e.g. timestamp

cleanWorkup(results, msg)

 

Easy way to get the pass/fail and return a message that looks decent. Usually used for builtin workups.

Parameters:
  • results (list of tuples) - Results from tests (val, msg)
  • msg - Header for test

assertByNumber(actual, required, buffer=0, xmsg='')

 

Used to compare two values given a certain error margin. Returns a bool with a message, "false" is a failure and "true" is a success.

Parameters:
  • actual (float, int) - Value being checked
  • required (float, int) - Value "actual" is being checked against
  • buffer (float, int) - Absolute value margin at which the difference check is still considered a success.

assertLessThan(actual, required, xmsg='')

 

Used to compare two values asserting "actual" is less than "required". Returns a bool with a message, "false" is a failure and "true" is a success.

Parameters:
  • actual (float, int) - Value being checked
  • required (float, int) - Value "actual" is being checked against

assertBetween(actual, min_req, max_req, buffer=0, xmsg='')

 

Used to assert "actual" is within two numbers, "min_req" and "max_req". Returns a bool with a message, "false" is a failure and "true" is a success.

Parameters:
  • actual (float, int) - Value being checked
  • min_req (float, int) - Lower boundary "actual" is being checked against
  • max_req (float, int) - Upper boundary "actual" is being checked against

assertByPercent(actual, required, buffer=0, xmsg='')

 

The same function as assertByNumber except the error margin is a percentage.

Parameters:
  • buffer - Percentage margin at which the difference check is still considered a success.

assertStr(req, act, xmsg='')

 

Compares two strings, or checks for a given string in a file.

@return : line with string instead of bool, and msg

Returns: tuple

getStats(ilist, *types)

 

Returns a list of stats calculated on columns of provided list.

Options for *types avg : Returns average for each column max : Returns the max value in each column min : Returns the min value in each column stdev : Returns the standard deviation of each column

Parameters:
  • ilist (list, array)

rsq(initial, new)

 

Calculates r-squared of two arrays

Parameters:
  • new (N.array)
  • initial (N.array)

grpStats(data)

 
Parameters:
  • data (dict) - A dictionary where each key's values are a list of floats
Returns:
avg, stdev and max value for values in dict "data"

checkFiles(files)

 

Checks to see if a list of files exist.

Parameters:
  • files (list)
Returns:
bool

extractData(text, sub1, sub2, start=0, direction='down')

 

Extract a substring between two substrings sub1 and sub2 in text It will cut at the first instance of sub1 and return text after that until is recognizes sub2.

Parameters:
  • start (integer) - Designates the sequence of matches to extract.

findData(text, initial_marker, end_marker='\n', clean=False)

 

Returns line containing

Parameters:
  • text - Block of text to search
  • initial_marker - First string to search for in text
  • end_marker - Last string to search for in text

byColumn(ifile, headers, make_float=False, precision=0)

 

Returns a dictionary with keys equal to the headers and thier values equal to their column number plus the actual values for that column. So if you want the values for the column only (most cases) then you would get the list of these via: column_data['header'][1:]

Parameters:
  • headers (list) - All of the column headers. They do not need to be present in the "in_file"; they are simply for organizing data.

byColumnB(ifile, headers=[], make_float=False, precision=0)

 

Returns a dictionary with keys equal to the headers and their values equal to their column number plus the actual values for that column. So if you want the values for the column only (most cases) then you would get the list of these via: column_data['header'][1:]

Parameters:
  • headers (list) - All of the column headers. They do not need to be present in the "in_file"; they are simply for organizing data. This is a dummy for backwards compatibility

byLine(ifile, delim=' ')

 

Used to glean data structured in rows. Keywords are taken as the first word (separated by "delim") of the line.

Returns: dict

getMolCountByFile(ifile, index=1, format='maestro')

 

Returns the mol count on the indicated structure.

Parameters:
  • ifile - The file name containing the structure.
  • index - The index number used in StructureReader
  • format - File's format

getMolCount(st)

 

Returns the mol count on "st"

Parameters:
  • st (structure.Structure)

getTotalWeight(st)

 

Returns the atomic weight of "st"

Parameters:
  • st (structure.Structure)

checkResNameByFile(ifile, index=1, format='maestro')

 

Searches structures in a file and gathers the unique pdb residue names and returns them.

Parameters:
  • ifile - The file name containing the structure.
  • index - The index number used in StructureReader
  • format - File's format

getResName(st, uniques=False)

 

Searches "st" and gathers the unique pdb residue names and returns them.

Parameters:
  • st (structure.Structure)

getAtomPropsByFile(ifile, prop, index=1, format='maestro')

 

Gathers the values for the provided property. Returns a dict with atom indices as keys and their values as values.

Parameters:
  • ifile - The file name containing the structure.
  • prop (string) - Atom-level property
  • index (int) - The index number used in StructureReader
  • format - File's format

getAtomProps(st, prop)

 

Gathers the values for the provided properties of "st" (a structure.Structure instance). Returns a dict with atom indices as keys and their values as values.

Parameters:
  • prop (string) - Atom-level property

getStructsByProp(ifile, ct_prop, format='maestro', filter_list=None)

 

Gets all cts in a file and separates them based on ct-level property. The property is intended to be unique, in that you get 1 ct per property value. The property value is the key in the returned dict. All cts that do not have the "ct_prop" are given a None key.

Parameters:
  • ifile - Structure file
  • ct_prop (string) - CT-level property
  • filter_list (list) - Only keep cts with these values

checkDist(st1, st2, asl1, asl2, cutoff)

 

Gets all atoms within a certain distance of asl1 in st1 from asl2 in st2.

Parameters:
  • st1 (structure.Structure) - ct containing atoms of interest
  • asl1 - ASL expression of atoms of interest
  • cutoff - Distance in A to query
Returns:
set of atoms from "st2" within "cutoff" A from "st1"

volFromLattice(ifile)

 

Calculates the volume of the unit cell based on the structure properies. Should work on all boundary conditions

getDihedrals(cms, trj, ref_atoms, mut_atoms)

 

Return a list of dihedral angles for the simulation

Parameters:
  • cms - cms file name
  • trj - trj file name
  • ref_atoms (list) - reference atoms for dihedral calculations
  • mut_atoms (list) - mutant atoms for dihedral calculations
Returns:
A list of angles, from 0 to 360, for the indicated reference and mutant atoms.

getDesmondHosts(log_file=None, multisim=False)

 

Parses the desmond log files for host names.

Parameters:
  • log_file - The single log file name to pull hosts from
  • multisim - If True all logs in all .tgz files will be gleaned

getRoot(from_file='log', multisim=False)

 

Gets the root name (common basename) from files in the current working directory based on the extension indicated.

Parameters:
  • from_file - The extension used to get the root (don't add a dot)

Variables Details [hide private]

__doc__

Value:
"""
This is a module for use in the backend test utility's workup routine.\
 General
tools are set in the functions and each class contains Desmond jobtype\
-specific
methods for determining if a job is acceptable.

$Revision: 1.4 $
...

CTS

Value:
['full_system',
 'membrane',
 'ion',
 'positive salt',
 'negative salt',
 'solvent',
 'solute']

ENE

Value:
['Time', 'E', 'E_p', 'E_k', 'E_x', 'E_f', 'P', 'V', 'T', 'T_0']

SIM

Value:
['Time', 'ax', 'ay', 'az', 'bx', 'by', 'bz', 'cx', 'cy', 'cz']

EGRP

Value:
['time',
 'pres',
 'vol',
 'ke',
 'v',
 'pe',
 'xe',
 'Corr_Energy',
...

REEX

Value:
['time',
 'exchange',
 'rep_1',
 'rep_2',
 'T_1',
 'T_2',
 'U_1(x_1)',
 'U_2(x_2)',
...