Package nMOLDYN :: Package Analysis :: Module Analysis :: Class Analysis |
[hide private]
[frames] | no frames]

# Class Analysis

source code

Base class for all analysis defined in nMOLDYN.

The class Analysis is an abstract-base-class that defines attributes and methods common to all the analysis available in nMOLDYN. To set up an analysis object, use one of its subclass.

Instance Methods | [hide private]
__init__(self, parameters=None, statusBar=None) The constructor. | source code
setInputParameters(self, parameters) Sets the input parameters dictionnary. | source code
dict |
parseInputParameters(self) Parses the input parameters stored in |parameters| dictionnary. | source code
buildTimeInfo(self) Builds some attributes related to the frame selection string. | source code
preLoadTrajectory(self, structure, differentiation=1) | source code
saveAnalysis(self, filename) Saves the settings of an analysis to an output file. | source code
dict |
runAnalysis(self) Runs an analysis. | source code
updateJobProgress(self, norm) Check the progress of the running analysis and displays periodically on the console and the logfile how far is the analysis. | source code
buildJobInfo(self) Display on the console and in the log file the main ifnormation about the analysis to run. | source code
dict |
analysisTime(self, time) Converts a time in second in days, hours, minutes and seconds. | source code
an instance of MMTK.ParticleProperties.ParticledScalar |
weightingScheme(self, universe, atoms, deuter, scheme='equal') Returns the weights of |atoms| MMTK collection of |universe| MMTK universe using the weighting scheme |scheme|. | source code
instance of MMTK.Collections.Collection |
subsetSelection(self, universe, selection) Returns a MMTK collection of atoms that matches |selection| selection string. | source code
instance of MMTK.Collections.Collection |
deuterationSelection(self, universe, selection) Returns a MMTK collection of atoms that matches |selection| selection string. | source code
list |
groupSelection(self, universe, selection) Returns a list of MMTK collections where each collection defines a group on which will be applied collectively an analysis. | source code
__buildGroup(self, g, gSelection, gLevel) | source code
Python set for |selectionMode| = 'subset' or 'deuteration' and dict for |selectionMode| = 'group' |
__parseExpressionSelectionString(self, universe, selectionString, selectionMode) Parses a nMOLDYN selection string that starts with 'expression' keyword. | source code
Python set for |selectionMode| = 'subset' or 'deuteration' and dict for |selectionMode| = 'group' |
__parseFileSelectionString(self, universe, selectionString, selectionMode) Parses a nMOLDYN Selection file (nms file) in order to perform a subset, a deuteration or a group selection. | source code
set |
__parseObjectSelectionString(self, universe, selectionString) Parses a selection string. | source code
list |
__retrieveAtomIndexes(self, universe, objectClass, objectName, selectionKeyword, selectionValue) Retrieves the MMTK index of the atoms matching |objectClass| MMTK chemical object class, |objectName| nMOLDYN name, |selectionKeyword| selection keyword and |selectionValue| selection value. | source code
list |
__allClassParser(self, universe, selectionKeyword, selectionValue) Retrieves the MMTK indexes of the atoms whose nMOLDYN name is '*' matching |selectionKeyword| selection keyword and |selectionValue| selection value. | source code
list |
__atomParser(self, universe, objectName, selectionKeyword, selectionValue) Retrieves the MMTK index of the atoms whose MMTK chemical object class is 'Atom' matching |objectName| nMOLDYN name, |selectionKeyword| selection keyword and |selectionValue| selection value. | source code
list |
__atomClusterParser(self, universe, objectName, selectionKeyword, selectionValue) Retrieves the MMTK index of the atoms whose MMTK chemical object class is 'AtomCluster' matching |objectName| nMOLDYN name, |selectionKeyword| selection keyword and |selectionValue| selection value. | source code
list |
__moleculeParser(self, universe, objectName, selectionKeyword, selectionValue) Retrieves the MMTK index of the atoms whose MMTK chemical object class is 'Molecule' matching |objectName| nMOLDYN name, |selectionKeyword| selection keyword and |selectionValue| selection value. | source code
list |
__nucleotideChainParser(self, universe, objectName, selectionKeyword, selectionValue) Retrieves the MMTK index of the atoms whose MMTK chemical object class is 'NucleotideChain' matching |objectName| nMOLDYN name, |selectionKeyword| selection keyword and |selectionValue| selection value. | source code
list |
__peptideChainParser(self, universe, objectName, selectionKeyword, selectionValue) Retrieves the MMTK index of the atoms whose MMTK chemical object class is 'PeptideChain' matching |objectName| nMOLDYN name, |selectionKeyword| selection keyword and |selectionValue| selection value. | source code
list |
__proteinParser(self, universe, objectName, selectionKeyword, selectionValue) Retrieves the MMTK index of the atoms whose MMTK chemical object class is 'Protein' matching |objectName| nMOLDYN name, |selectionKeyword| selection keyword and |selectionValue| selection value. | source code

Method Details | [hide private]

### __init__(self, parameters=None, statusBar=None) (Constructor) | source code
The constructor. Parameters: `parameters` (dict) - a dictionnary that contains parameters of the selected analysis. `statusBar` (instance of nMOLDYN.GUI.Widgets.StatusBar) - if not None, an instance of nMOLDYN.GUI.Widgets.StatusBar. Will attach a status bar to the selected analysis.

### parseInputParameters(self) | source code
Parses the input parameters stored in |parameters| dictionnary. Returns: dict a dictionnary of the parsed parameters.

### buildTimeInfo(self) | source code
Builds some attributes related to the frame selection string. They will be used to define at which times a given analysis should be run.

### saveAnalysis(self, filename) | source code
Saves the settings of an analysis to an output file. Parameters: `filename` - the name of the output file. If the extension is '.nmi' the output file will be a nMOLDYN input script otherwise the output file will be a nMOLDYN autostart script.

### runAnalysis(self) | source code
Runs an analysis. Returns: dict a dictionnary of the form {'days' : d, 'hours' : h, 'minutes' : m, 'seconds' : s} specifying the time the analysis took in dayx, hours, minutes and seconds.

### updateJobProgress(self, norm) | source code
Check the progress of the running analysis and displays periodically on the console and the logfile how far is the analysis. Called each time a step of an analysis loop is achieved. Parameters: `norm` - the maximum number of steps of the analysis.

### analysisTime(self, time) | source code
Converts a time in second in days, hours, minutes and seconds. Parameters: `time` (integer.) - the time (in seconds) to convert. Returns: dict a dictionnary of the form {'days' : d, 'hours' : h, 'minutes' : m, 'seconds' : s} where d, h, m and s are integers resulting respectively from the conversion of |time| in days, hours, minutes and seconds.

### weightingScheme(self, universe, atoms, deuter, scheme='equal') | source code
Returns the weights of |atoms| MMTK collection of |universe| MMTK universe using the weighting scheme |scheme|. Parameters: `universe` (instance of MMTK.Universe) - the MMTK universe. `atoms` (instance of MMTK.Collections.Collection) - the atoms to take into account when defining the weights. `deuter` (instance of MMTK.Collections.Collection) - the hydrogen atoms that will be parametrized as deuterium atoms. `scheme` (string) - a string equal to 'equal', 'mass', 'coherent' , 'incoherent' or 'atomicNumber' that specifies the weighting scheme to use. Returns: an instance of MMTK.ParticleProperties.ParticledScalar the weights of the selected atoms.

### subsetSelection(self, universe, selection) | source code
Returns a MMTK collection of atoms that matches |selection| selection string. Used to apply an analysis to a subset of atoms. Parameters: `universe` (instance of MMTK.Universe) - the universe on which the selection will be performed. `selection` (string) - the selection string that will define the atoms to select. Returns: instance of MMTK.Collections.Collection a MMTK Collection of the atoms that matches |selection| selection string.

### deuterationSelection(self, universe, selection) | source code
Returns a MMTK collection of atoms that matches |selection| selection string. Used to switch the parameters of a subset (or all) of hydrogen atoms to the parameters of deuterium in order to simulate deuterated system. Parameters: `universe` (instance of MMTK.Universe) - the universe on which the selection will be performed. `selection` (string) - the selection string that will define the atoms to select. Returns: instance of MMTK.Collections.Collection a MMTK Collection of the atoms that matches |selection| selection string.

### groupSelection(self, universe, selection) | source code
Returns a list of MMTK collections where each collection defines a group on which will be applied collectively an analysis. Parameters: `universe` (instance of MMTK.Universe) - the universe on which the selection will be performed. `selection` (string) - the selection string that will define the contents of each group. Returns: list a list of MMTK Collection where each collection defines a group..

### __parseExpressionSelectionString(self, universe, selectionString, selectionMode) | source code
Parses a nMOLDYN selection string that starts with 'expression' keyword. Parameters: `universe` (instance of MMTK.Universe) - the universe on which the selection will be performed. `selectionString` (string) - the selection string to parse. `selectionMode` (string) - a string being one of 'subset', 'deuteration' or 'group' that will specify which kind of selection should be performed. Returns: Python set for |selectionMode| = 'subset' or 'deuteration' and dict for |selectionMode| = 'group' will depend on |selectionMode|.

### __parseFileSelectionString(self, universe, selectionString, selectionMode) | source code
Parses a nMOLDYN Selection file (nms file) in order to perform a subset, a deuteration or a group selection. Parameters: `universe` (instance of MMTK.Universe) - the universe on which the selection will be performed. `selectionString` (string) - the selection string to parse. `selectionMode` (string) - a string being one of 'subset', 'deuteration' or 'group' that will specify which kind of selection should be performed. Returns: Python set for |selectionMode| = 'subset' or 'deuteration' and dict for |selectionMode| = 'group' will depend on |selectionMode|.

### __parseObjectSelectionString(self, universe, selectionString) | source code
Parses a selection string. Parameters: `universe` (instance of MMTK.Universe) - the universe on which the selection will be performed. `selectionString` (string) - the selection strin to parse. Returns: set a set of the atoms that match |selectionString| selection string.

### __retrieveAtomIndexes(self, universe, objectClass, objectName, selectionKeyword, selectionValue) | source code
Retrieves the MMTK index of the atoms matching |objectClass| MMTK chemical object class, |objectName| nMOLDYN name, |selectionKeyword| selection keyword and |selectionValue| selection value. Parameters: `universe` (instance of MMTK.Universe) - the universe on which the selection will be performed. `objectClass` (string) - the MMTK chemical object to match. `objectName` (string) - the nMOLDYN name to match. `selectionKeyword` (string) - the selection keyword to match. `selectionValue` (string) - the selection value to match. Returns: list a list of MMTK indexes of the selected atoms.

### __allClassParser(self, universe, selectionKeyword, selectionValue) | source code
Retrieves the MMTK indexes of the atoms whose nMOLDYN name is '*' matching |selectionKeyword| selection keyword and |selectionValue| selection value. Parameters: `universe` (instance of MMTK.Universe) - the universe on which the selection will be performed. `selectionKeyword` (string) - the selection keyword to match. `selectionValue` (string) - the selection value to match. Returns: list a list of MMTK indexes of the selected atoms.

### __atomParser(self, universe, objectName, selectionKeyword, selectionValue) | source code
Retrieves the MMTK index of the atoms whose MMTK chemical object class is 'Atom' matching |objectName| nMOLDYN name, |selectionKeyword| selection keyword and |selectionValue| selection value. Parameters: `universe` (instance of MMTK.Universe) - the universe on which the selection will be performed. `objectName` (string) - the nMOLDYN name to match. `selectionKeyword` (string) - the selection keyword to match. `selectionValue` (string) - the selection value to match. Returns: list a list of MMTK indexes of the selected atoms.

### __atomClusterParser(self, universe, objectName, selectionKeyword, selectionValue) | source code
Retrieves the MMTK index of the atoms whose MMTK chemical object class is 'AtomCluster' matching |objectName| nMOLDYN name, |selectionKeyword| selection keyword and |selectionValue| selection value. Parameters: `universe` (instance of MMTK.Universe) - the universe on which the selection will be performed. `objectName` (string) - the nMOLDYN name to match. `selectionKeyword` (string) - the selection keyword to match. `selectionValue` (string) - the selection value to match. Returns: list a list of MMTK indexes of the selected atoms.

### __moleculeParser(self, universe, objectName, selectionKeyword, selectionValue) | source code
Retrieves the MMTK index of the atoms whose MMTK chemical object class is 'Molecule' matching |objectName| nMOLDYN name, |selectionKeyword| selection keyword and |selectionValue| selection value. Parameters: `universe` (instance of MMTK.Universe) - the universe on which the selection will be performed. `objectName` (string) - the nMOLDYN name to match. `selectionKeyword` (string) - the selection keyword to match. `selectionValue` (string) - the selection value to match. Returns: list a list of MMTK indexes of the selected atoms.

### __nucleotideChainParser(self, universe, objectName, selectionKeyword, selectionValue) | source code
Retrieves the MMTK index of the atoms whose MMTK chemical object class is 'NucleotideChain' matching |objectName| nMOLDYN name, |selectionKeyword| selection keyword and |selectionValue| selection value. Parameters: `universe` (instance of MMTK.Universe) - the universe on which the selection will be performed. `objectName` (string) - the nMOLDYN name to match. `selectionKeyword` (string) - the selection keyword to match. `selectionValue` (string) - the selection value to match. Returns: list a list of MMTK indexes of the selected atoms.

### __peptideChainParser(self, universe, objectName, selectionKeyword, selectionValue) | source code
Retrieves the MMTK index of the atoms whose MMTK chemical object class is 'PeptideChain' matching |objectName| nMOLDYN name, |selectionKeyword| selection keyword and |selectionValue| selection value. Parameters: `universe` (instance of MMTK.Universe) - the universe on which the selection will be performed. `objectName` (string) - the nMOLDYN name to match. `selectionKeyword` (string) - the selection keyword to match. `selectionValue` (string) - the selection value to match. Returns: list a list of MMTK indexes of the selected atoms.

### __proteinParser(self, universe, objectName, selectionKeyword, selectionValue) | source code
Retrieves the MMTK index of the atoms whose MMTK chemical object class is 'Protein' matching |objectName| nMOLDYN name, |selectionKeyword| selection keyword and |selectionValue| selection value. Parameters: `universe` (instance of MMTK.Universe) - the universe on which the selection will be performed. `objectName` (string) - the nMOLDYN name to match. `selectionKeyword` (string) - the selection keyword to match. `selectionValue` (string) - the selection value to match. Returns: list a list of MMTK indexes of the selected atoms.