schrodinger.protein.predictors module¶
This module contains classes that wrap prime backends that predict sequence structures. Many of the parameters and class constants are from a time when documentation was sparse. In the future, it’s possible we’ll tweak these numbers as needed.
- class schrodinger.protein.predictors.AbstractPredictor(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.tasks.tasks.SubprocessCmdTask
Base class for all predictors. Derived classes are expected to implement class constants for:
EXE - A string that should match to the predictors executable. Most of the time this is the same as PREDICTOR_NAME
PREDICTOR_NAME - A string with the name of the predictor. This is used to find the Prime data directory that holds the model parameters used by the predictor.
CLASS_NUM - A parameter specific to the predictor. Usually found by looking through the Prime predictors source code.
NU - Another model parameter.
NY - Another model parameter.
In addition, derived classes should implement the following methods:
- generateInputFile - Should generate the required input file at
the file described by
input_fname
- prediction - Should read
self.getLogAsString()
and parse out the actual prediction from the backend
- makeCmd - This only needs to be implemented if the backend
- takes a command different from the form:
executable model_fname input_fname
- EXE = NotImplemented¶
- PREDICTOR_NAME = NotImplemented¶
- CLASS_NUM = NotImplemented¶
- NU = NotImplemented¶
- NY = NotImplemented¶
- class Input(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.models.parameters.CompoundParam
- seq: schrodinger.protein.sequence.ProteinSequence¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- aln: schrodinger.protein.alignment.ProteinAlignment¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- __init__(default_value=<object object>, _param_type=<object object>, **kwargs)¶
- classmethod addSubParam(name, param, update_owner=True)¶
- alnChanged¶
- alnReplaced¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
Override to dynamically set up the default value of the param. Useful for default values that are determined at runtime. This is called any time the param is reset.
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDefault()¶
Whether the current value of this instance matches the default value.
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- reset(*abstract_params)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- seqChanged¶
- seqReplaced¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- input: parameters.CompoundParam¶
- input_fname: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- model_fname: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- generateInputFile()¶
Generate the input file for the predictor. Typically includes a header (see
_getInputHeader
), the file name of the blast alignment, and the sequence to predict properties for.The input file should be written with the name
self.input_fname
.
- prediction()¶
Return the actual prediction. This can take various forms depending on the predictor.
- generateAlignmentFile()¶
Write the alignment file to be used as an input for the predictor. The file will be a temporary file and will be removed in
postprocess
.Gaps in the alignment file are represented as ‘.’.
- generateModelFile()¶
Generate the model definition file with the name
self.model_fname
. This is done by finding the Prime data directory for the predictor and getting the names of all the files in it.The model file includes a header describing the number of model files and the predictors class number (
self.CLASS_NUM
), and a list of the model files.
- makeCmd()¶
Return the command to run the predictor backend. The default implementation returns the predictor executable, the model file name, and the input file name.
- Return type
list[str]
- postprocess()¶
- AUTO_TASKDIR = 1¶
- CMDLINE = 1¶
- DEFAULT_TASKDIR_SETTING = None¶
- DONE = 3¶
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- FAILED = 2¶
- GUI = 2¶
- INTERRUPT_ENABLED = False¶
- RUNNING = 1¶
- TEMP_TASKDIR = 2¶
- WAITING = 0¶
- __init__(*args, **kwargs)¶
- addFuncToGroup(func, group=None, order=None)¶
Adds a function to the specified chain. Typically used for adding functions that are not methods of this object.
The function may optionally be decorated with a FuncGroupMarker. If so, the default group and order will be determined by the decorator. Any group or order explicitly passed in to addFuncToGroup will take precedence over the decorator settings.
- Parameters
func – the function to add
group (FuncGroupMarker or None) – the group marker. If the function is decorated with a FuncGoupMarker, that group marker will be the default.
order (float or None) – the sorting order. If the function is decorated with a FuncGoupMarker, the order specified in the decorator will be the default.
- addLicenseReservation(license, num_tokens=1)¶
Add a license reservation for this job. This information is used by job control to ensure the job is only started once the required licenses become available.
In a preprocessor, (i.e. before launching the backend), a reservation should be added for each license that will be checked out directly by that backend. Example:
class GlideTask(ComboJobTask): @preprocessor def _reserveGlideLicense(self): # Reserve a Glide license. self.addLicenseReservation(license.GLIDE_MAIN) def mainFunction(self): # Check out the Glide license lic = license.License(license.GLIDE_MAIN) # ... Do computations requiring Glide ... lic.checkin()
Licenses that will be checked out by subjobs of this job do not need reservations added here; subjobs are responsible for their own license reservations.
- Parameters
license (module-constant from schrodinger.utils.license (e.g. license.AUTODESIGNER)) – a license that will be used by the backend
num_tokens (int) – number of tokens for this license reservations
- addPostprocessor(func, order=0)¶
Adds a postproceessor function to this task instance. If the function has been decorated with
@postprocessor
, the order specified by the decorator will be used.- Parameters
func (typing.Callable) – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- addPreprocessor(func, order=None)¶
Adds a preproceessor function to this task instance. If the function has been decorated with @preprocessor, the order specified by the decorator will be used as the default.
- Parameters
func – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- classmethod addSubParam(name, param, update_owner=True)¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- calling_context: CallingContext¶
- calling_contextChanged¶
- calling_contextReplaced¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- cmd¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- exit_code¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- failure_info: FailureInfo¶
Dataclass for task failure information.
Printing an instance of this class will provide the minimum necessary human-readable representation of a recorded failure.
- failure_infoChanged¶
- failure_infoReplaced¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonFilename(filename)¶
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- getAddedFuncs(group=None)¶
- getDebugString()¶
- getFuncGroup(group=None)¶
Retrieve the functions belonging to the specified group.
- Parameters
group (FuncGroupMarker) – the group marker
- Returns
the functions in the specified group, in order
- Return type
list
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- getLogAsString() str ¶
- getLogFilename()¶
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTaskDir()¶
Returns the full path of the task directory. This is only available if the task directory exists (after creation of the taskdir or, if no task dir is specified, any time).
- getTaskFilename(fname)¶
Return the appropriate absolute path for an input or output file in the taskdir.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- guard()¶
Context manager that saves any Exception raised inside
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
@overrides: parameters.CompoundParam
- inputChanged¶
- inputReplaced¶
- input_fnameChanged¶
- input_fnameReplaced¶
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDebugEnabled()¶
- isDefault()¶
Whether the current value of this instance matches the default value.
- isInterruptionRequested()¶
- isRunning()¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isStartable()¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- kill()¶
@overrides: AbstractTask
Kill the subprocess and set the status to FAILED.
- killTimer(self, id: int)¶
- max_progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- max_progressChanged¶
- max_progressReplaced¶
- metaObject(self) QMetaObject ¶
- model_fnameChanged¶
- model_fnameReplaced¶
- moveToThread(self, thread: QThread)¶
- name: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- nameChanged¶
- nameReplaced¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- output: parameters.CompoundParam¶
All
CompoundParam
instances are automatically serializable if their subparams are serializable. To serialize and deserialize, use the schrodinger json module:from schrodinger.models import json class Coord(parameters.CompoundParam): x: int y: int c1 = Coord(x=1, y=2) c1_string = json.dumps(c1) c2 = json.loads(c1_string, DataClass=Coord) assert c1 == c2
- outputChanged¶
- outputReplaced¶
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- postprocessors()¶
- Returns
A list of postprocessors, both decorated methods on the task and external functions that have been added via
addPostprocessor()
- Return type
list[typing.Callable]
- preprocessors()¶
- Returns
A list of preprocessors (both decorated methods on the task and external functions that have been added via addPreprocessor)
- printDebug(*args)¶
- printingOutputToTerminal()¶
- Returns
whether the
StdOut
andStdErr
output from this task is being printed to the terminal- Return type
bool
- processFuncChain(chain=None, result_callback=None)¶
Execute each function in the specified chain sequentially in order.
The result_callback is called after each function with the return value of that function. This can be used to respond to the return value (e.g. present information to the user, get user feedback, log the result, etc.)
The return value of the result_callback determines whether processing will proceeed to the next function.
- Parameters
chain (FuncChainDecorator) – which chain to process
result_callback – the callback that will get called with the result of each function in the chain
- Returns
a list of the results from the functions
- progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progressChanged¶
- progressReplaced¶
- progress_string: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progress_stringChanged¶
- progress_stringReplaced¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- qprocess¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- replicate()¶
Create a new task with the same input and settings (but no output)
- requestInterruption()¶
Request the task to stop.
To enable this feature, subclasses should periodically check whether an interruption has been requested and terminate if it has been. If such logic has been included,
INTERRUPT_ENABLED
should be set toTrue
.
- reset(*args, **kwargs)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- run()¶
- runCmd(cmd)¶
- runPreprocessing(callback=None, calling_context=None)¶
Run the preprocessors one-by-one. By default, any failing preprocessor will raise a TaskFailure exception and terminate processing. This behavior may be customized by supplying a callback function which will be called after each preprocessor with the result of that preprocessor.
This method is “final” so that all preprocessing logic will be enclosed in the try/finally block.
- Parameters
callback – a function that takes result and returns a bool that indicates whether to continue on to the next preprocessor
calling_context – specify a value here to indicate the context in which this preprocessing is being called. This value will be stored in an instance variable, self.calling_context, which can be accessed from any preprocessor method on this task. Typically this value will be either self.GUI, self.CMDLINE, or None, but any value may be supplied here and checked for in the preprocessor methods. self.calling_context always reverts back to None at the end of runPreprocessing.
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setPrintingOutputToTerminal(print_to_terminal)¶
Set this task to print
StdOut
andStdErr
output to terminal, or not. This must be set before starting the task to enable terminal output.- Parameters
print_to_terminal (bool) – whether to send process output to terminal
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- specifyTaskDir(taskdir_spec)¶
Specify the taskdir creation behavior. Use one of the following options:
A directory name (string). This may be a relative or absolute path
None - no taskdir is requested. The task will use the CWD as its taskdir
AUTO_TASKDIR - a new subdirectory will be created in the CWD using the task name as the directory name.
TEMP_TASKDIR - a temporary directory will be created in the schrodinger temp dir. This directory is cleaned up when the task is deleted.
- Parameters
taskdir_spec – one of the four options listed above
- start(*args, **kwargs)¶
This is the main method for starting a task. Start will check if a task is not already running, run preprocessing, and then run the task.
Failures in preprocessing will interrupt the task start, and the task will never enter the RUNNING state.
- Parameters
skip_preprocessing (bool) – whether to skip preprocessing. This can be useful if preprocessing was already performed prior to calling start.
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- status: Status¶
- statusChanged¶
- statusReplaced¶
- taskDirSetting()¶
Returns the taskdir spec. See specifyTaskDir() for details.
- taskDone¶
- taskFailed¶
- taskStarted¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- wait(timeout=None)¶
Block until the task is finished executing or
timeout
seconds have passed.Warning
This should not be called directly from GUI code - see PANEL-18317. It is safe to call inside a subprocess or job. Run
git grep "task.wait("
to see safe examples annotated with “# OK”.- Parameters
timeout (NoneType or int) – Amount of time in seconds to wait before timing out. If None or a negative number, this method will wait until the task is finished.
- class schrodinger.protein.predictors.SsproPredictor(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.protein.predictors.AbstractPredictor
Secondary structure predictor.
- EXE = 'sspro4'¶
- PREDICTOR_NAME = 'sspro'¶
- CLASS_NUM = 3¶
- NU = 20¶
- NY = 3¶
- input_fname: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- model_fname: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- generateInputFile()¶
Generate the input file for the predictor. Typically includes a header (see
_getInputHeader
), the file name of the blast alignment, and the sequence to predict properties for.The input file should be written with the name
self.input_fname
.
- makeCmd()¶
Usage: $PSP_PATH/sspro4 model_definition dataset_file alignment_directory dataset_format
- rawPrediction()¶
- Returns
The raw prediction string containing one character per residue in the input sequence.
- Return type
str
- prediction()¶
- Returns
A list of ssa types from
structure
, one for each element inself.input.sequence
- Return type
list
- AUTO_TASKDIR = 1¶
- CMDLINE = 1¶
- DEFAULT_TASKDIR_SETTING = None¶
- DONE = 3¶
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- FAILED = 2¶
- GUI = 2¶
- INTERRUPT_ENABLED = False¶
- class Input(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.models.parameters.CompoundParam
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- __init__(default_value=<object object>, _param_type=<object object>, **kwargs)¶
- classmethod addSubParam(name, param, update_owner=True)¶
- aln: schrodinger.protein.alignment.ProteinAlignment¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- alnChanged¶
- alnReplaced¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
Override to dynamically set up the default value of the param. Useful for default values that are determined at runtime. This is called any time the param is reset.
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDefault()¶
Whether the current value of this instance matches the default value.
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- reset(*abstract_params)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- seq: schrodinger.protein.sequence.ProteinSequence¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- seqChanged¶
- seqReplaced¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- RUNNING = 1¶
- TEMP_TASKDIR = 2¶
- WAITING = 0¶
- __init__(*args, **kwargs)¶
- addFuncToGroup(func, group=None, order=None)¶
Adds a function to the specified chain. Typically used for adding functions that are not methods of this object.
The function may optionally be decorated with a FuncGroupMarker. If so, the default group and order will be determined by the decorator. Any group or order explicitly passed in to addFuncToGroup will take precedence over the decorator settings.
- Parameters
func – the function to add
group (FuncGroupMarker or None) – the group marker. If the function is decorated with a FuncGoupMarker, that group marker will be the default.
order (float or None) – the sorting order. If the function is decorated with a FuncGoupMarker, the order specified in the decorator will be the default.
- addLicenseReservation(license, num_tokens=1)¶
Add a license reservation for this job. This information is used by job control to ensure the job is only started once the required licenses become available.
In a preprocessor, (i.e. before launching the backend), a reservation should be added for each license that will be checked out directly by that backend. Example:
class GlideTask(ComboJobTask): @preprocessor def _reserveGlideLicense(self): # Reserve a Glide license. self.addLicenseReservation(license.GLIDE_MAIN) def mainFunction(self): # Check out the Glide license lic = license.License(license.GLIDE_MAIN) # ... Do computations requiring Glide ... lic.checkin()
Licenses that will be checked out by subjobs of this job do not need reservations added here; subjobs are responsible for their own license reservations.
- Parameters
license (module-constant from schrodinger.utils.license (e.g. license.AUTODESIGNER)) – a license that will be used by the backend
num_tokens (int) – number of tokens for this license reservations
- addPostprocessor(func, order=0)¶
Adds a postproceessor function to this task instance. If the function has been decorated with
@postprocessor
, the order specified by the decorator will be used.- Parameters
func (typing.Callable) – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- addPreprocessor(func, order=None)¶
Adds a preproceessor function to this task instance. If the function has been decorated with @preprocessor, the order specified by the decorator will be used as the default.
- Parameters
func – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- classmethod addSubParam(name, param, update_owner=True)¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- calling_context: CallingContext¶
- calling_contextChanged¶
- calling_contextReplaced¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- cmd¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- exit_code¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- failure_info: FailureInfo¶
Dataclass for task failure information.
Printing an instance of this class will provide the minimum necessary human-readable representation of a recorded failure.
- failure_infoChanged¶
- failure_infoReplaced¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonFilename(filename)¶
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- generateAlignmentFile()¶
Write the alignment file to be used as an input for the predictor. The file will be a temporary file and will be removed in
postprocess
.Gaps in the alignment file are represented as ‘.’.
- generateModelFile()¶
Generate the model definition file with the name
self.model_fname
. This is done by finding the Prime data directory for the predictor and getting the names of all the files in it.The model file includes a header describing the number of model files and the predictors class number (
self.CLASS_NUM
), and a list of the model files.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- getAddedFuncs(group=None)¶
- getDebugString()¶
- getFuncGroup(group=None)¶
Retrieve the functions belonging to the specified group.
- Parameters
group (FuncGroupMarker) – the group marker
- Returns
the functions in the specified group, in order
- Return type
list
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- getLogAsString() str ¶
- getLogFilename()¶
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTaskDir()¶
Returns the full path of the task directory. This is only available if the task directory exists (after creation of the taskdir or, if no task dir is specified, any time).
- getTaskFilename(fname)¶
Return the appropriate absolute path for an input or output file in the taskdir.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- guard()¶
Context manager that saves any Exception raised inside
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
@overrides: parameters.CompoundParam
- input: parameters.CompoundParam¶
- inputChanged¶
- inputReplaced¶
- input_fnameChanged¶
- input_fnameReplaced¶
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDebugEnabled()¶
- isDefault()¶
Whether the current value of this instance matches the default value.
- isInterruptionRequested()¶
- isRunning()¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isStartable()¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- kill()¶
@overrides: AbstractTask
Kill the subprocess and set the status to FAILED.
- killTimer(self, id: int)¶
- max_progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- max_progressChanged¶
- max_progressReplaced¶
- metaObject(self) QMetaObject ¶
- model_fnameChanged¶
- model_fnameReplaced¶
- moveToThread(self, thread: QThread)¶
- name: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- nameChanged¶
- nameReplaced¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- output: parameters.CompoundParam¶
All
CompoundParam
instances are automatically serializable if their subparams are serializable. To serialize and deserialize, use the schrodinger json module:from schrodinger.models import json class Coord(parameters.CompoundParam): x: int y: int c1 = Coord(x=1, y=2) c1_string = json.dumps(c1) c2 = json.loads(c1_string, DataClass=Coord) assert c1 == c2
- outputChanged¶
- outputReplaced¶
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- postprocess()¶
- postprocessors()¶
- Returns
A list of postprocessors, both decorated methods on the task and external functions that have been added via
addPostprocessor()
- Return type
list[typing.Callable]
- preprocessors()¶
- Returns
A list of preprocessors (both decorated methods on the task and external functions that have been added via addPreprocessor)
- printDebug(*args)¶
- printingOutputToTerminal()¶
- Returns
whether the
StdOut
andStdErr
output from this task is being printed to the terminal- Return type
bool
- processFuncChain(chain=None, result_callback=None)¶
Execute each function in the specified chain sequentially in order.
The result_callback is called after each function with the return value of that function. This can be used to respond to the return value (e.g. present information to the user, get user feedback, log the result, etc.)
The return value of the result_callback determines whether processing will proceeed to the next function.
- Parameters
chain (FuncChainDecorator) – which chain to process
result_callback – the callback that will get called with the result of each function in the chain
- Returns
a list of the results from the functions
- progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progressChanged¶
- progressReplaced¶
- progress_string: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progress_stringChanged¶
- progress_stringReplaced¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- qprocess¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- replicate()¶
Create a new task with the same input and settings (but no output)
- requestInterruption()¶
Request the task to stop.
To enable this feature, subclasses should periodically check whether an interruption has been requested and terminate if it has been. If such logic has been included,
INTERRUPT_ENABLED
should be set toTrue
.
- reset(*args, **kwargs)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- run()¶
- runCmd(cmd)¶
- runPreprocessing(callback=None, calling_context=None)¶
Run the preprocessors one-by-one. By default, any failing preprocessor will raise a TaskFailure exception and terminate processing. This behavior may be customized by supplying a callback function which will be called after each preprocessor with the result of that preprocessor.
This method is “final” so that all preprocessing logic will be enclosed in the try/finally block.
- Parameters
callback – a function that takes result and returns a bool that indicates whether to continue on to the next preprocessor
calling_context – specify a value here to indicate the context in which this preprocessing is being called. This value will be stored in an instance variable, self.calling_context, which can be accessed from any preprocessor method on this task. Typically this value will be either self.GUI, self.CMDLINE, or None, but any value may be supplied here and checked for in the preprocessor methods. self.calling_context always reverts back to None at the end of runPreprocessing.
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setPrintingOutputToTerminal(print_to_terminal)¶
Set this task to print
StdOut
andStdErr
output to terminal, or not. This must be set before starting the task to enable terminal output.- Parameters
print_to_terminal (bool) – whether to send process output to terminal
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- specifyTaskDir(taskdir_spec)¶
Specify the taskdir creation behavior. Use one of the following options:
A directory name (string). This may be a relative or absolute path
None - no taskdir is requested. The task will use the CWD as its taskdir
AUTO_TASKDIR - a new subdirectory will be created in the CWD using the task name as the directory name.
TEMP_TASKDIR - a temporary directory will be created in the schrodinger temp dir. This directory is cleaned up when the task is deleted.
- Parameters
taskdir_spec – one of the four options listed above
- start(*args, **kwargs)¶
This is the main method for starting a task. Start will check if a task is not already running, run preprocessing, and then run the task.
Failures in preprocessing will interrupt the task start, and the task will never enter the RUNNING state.
- Parameters
skip_preprocessing (bool) – whether to skip preprocessing. This can be useful if preprocessing was already performed prior to calling start.
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- status: Status¶
- statusChanged¶
- statusReplaced¶
- taskDirSetting()¶
Returns the taskdir spec. See specifyTaskDir() for details.
- taskDone¶
- taskFailed¶
- taskStarted¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- wait(timeout=None)¶
Block until the task is finished executing or
timeout
seconds have passed.Warning
This should not be called directly from GUI code - see PANEL-18317. It is safe to call inside a subprocess or job. Run
git grep "task.wait("
to see safe examples annotated with “# OK”.- Parameters
timeout (NoneType or int) – Amount of time in seconds to wait before timing out. If None or a negative number, this method will wait until the task is finished.
- class schrodinger.protein.predictors.SolventAccessibility(value)¶
Bases:
schrodinger.models.jsonable.JsonableEnum
An enumeration.
- BURIED = 1¶
- EXPOSED = 2¶
- class schrodinger.protein.predictors.AccproPredictor(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.protein.predictors.AbstractPredictor
Solvent accessibility predictor.
- EXE = 'accpro'¶
- PREDICTOR_NAME = 'accpro'¶
- CLASS_NUM = 20¶
- NU = 20¶
- NY = 3¶
- input_fname: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- model_fname: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- CHAR_TO_ACC_MAP = {'b': SolventAccessibility.BURIED, 'e': SolventAccessibility.EXPOSED}¶
- generateInputFile()¶
Generate the input file for the predictor. Typically includes a header (see
_getInputHeader
), the file name of the blast alignment, and the sequence to predict properties for.The input file should be written with the name
self.input_fname
.
- makeCmd()¶
Usage: $PSP_PATH/accpro model_definition dataset_file alignment_directory dataset_format threshold_index
- rawPrediction()¶
- Example:
eeebbbebebebebbebbebebeebbbbbbbeeeee
e = exposed b = buried
- prediction()¶
Return the actual prediction. This can take various forms depending on the predictor.
- AUTO_TASKDIR = 1¶
- CMDLINE = 1¶
- DEFAULT_TASKDIR_SETTING = None¶
- DONE = 3¶
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- FAILED = 2¶
- GUI = 2¶
- INTERRUPT_ENABLED = False¶
- class Input(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.models.parameters.CompoundParam
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- __init__(default_value=<object object>, _param_type=<object object>, **kwargs)¶
- classmethod addSubParam(name, param, update_owner=True)¶
- aln: schrodinger.protein.alignment.ProteinAlignment¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- alnChanged¶
- alnReplaced¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
Override to dynamically set up the default value of the param. Useful for default values that are determined at runtime. This is called any time the param is reset.
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDefault()¶
Whether the current value of this instance matches the default value.
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- reset(*abstract_params)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- seq: schrodinger.protein.sequence.ProteinSequence¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- seqChanged¶
- seqReplaced¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- RUNNING = 1¶
- TEMP_TASKDIR = 2¶
- WAITING = 0¶
- __init__(*args, **kwargs)¶
- addFuncToGroup(func, group=None, order=None)¶
Adds a function to the specified chain. Typically used for adding functions that are not methods of this object.
The function may optionally be decorated with a FuncGroupMarker. If so, the default group and order will be determined by the decorator. Any group or order explicitly passed in to addFuncToGroup will take precedence over the decorator settings.
- Parameters
func – the function to add
group (FuncGroupMarker or None) – the group marker. If the function is decorated with a FuncGoupMarker, that group marker will be the default.
order (float or None) – the sorting order. If the function is decorated with a FuncGoupMarker, the order specified in the decorator will be the default.
- addLicenseReservation(license, num_tokens=1)¶
Add a license reservation for this job. This information is used by job control to ensure the job is only started once the required licenses become available.
In a preprocessor, (i.e. before launching the backend), a reservation should be added for each license that will be checked out directly by that backend. Example:
class GlideTask(ComboJobTask): @preprocessor def _reserveGlideLicense(self): # Reserve a Glide license. self.addLicenseReservation(license.GLIDE_MAIN) def mainFunction(self): # Check out the Glide license lic = license.License(license.GLIDE_MAIN) # ... Do computations requiring Glide ... lic.checkin()
Licenses that will be checked out by subjobs of this job do not need reservations added here; subjobs are responsible for their own license reservations.
- Parameters
license (module-constant from schrodinger.utils.license (e.g. license.AUTODESIGNER)) – a license that will be used by the backend
num_tokens (int) – number of tokens for this license reservations
- addPostprocessor(func, order=0)¶
Adds a postproceessor function to this task instance. If the function has been decorated with
@postprocessor
, the order specified by the decorator will be used.- Parameters
func (typing.Callable) – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- addPreprocessor(func, order=None)¶
Adds a preproceessor function to this task instance. If the function has been decorated with @preprocessor, the order specified by the decorator will be used as the default.
- Parameters
func – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- classmethod addSubParam(name, param, update_owner=True)¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- calling_context: CallingContext¶
- calling_contextChanged¶
- calling_contextReplaced¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- cmd¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- exit_code¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- failure_info: FailureInfo¶
Dataclass for task failure information.
Printing an instance of this class will provide the minimum necessary human-readable representation of a recorded failure.
- failure_infoChanged¶
- failure_infoReplaced¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonFilename(filename)¶
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- generateAlignmentFile()¶
Write the alignment file to be used as an input for the predictor. The file will be a temporary file and will be removed in
postprocess
.Gaps in the alignment file are represented as ‘.’.
- generateModelFile()¶
Generate the model definition file with the name
self.model_fname
. This is done by finding the Prime data directory for the predictor and getting the names of all the files in it.The model file includes a header describing the number of model files and the predictors class number (
self.CLASS_NUM
), and a list of the model files.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- getAddedFuncs(group=None)¶
- getDebugString()¶
- getFuncGroup(group=None)¶
Retrieve the functions belonging to the specified group.
- Parameters
group (FuncGroupMarker) – the group marker
- Returns
the functions in the specified group, in order
- Return type
list
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- getLogAsString() str ¶
- getLogFilename()¶
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTaskDir()¶
Returns the full path of the task directory. This is only available if the task directory exists (after creation of the taskdir or, if no task dir is specified, any time).
- getTaskFilename(fname)¶
Return the appropriate absolute path for an input or output file in the taskdir.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- guard()¶
Context manager that saves any Exception raised inside
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
@overrides: parameters.CompoundParam
- input: parameters.CompoundParam¶
- inputChanged¶
- inputReplaced¶
- input_fnameChanged¶
- input_fnameReplaced¶
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDebugEnabled()¶
- isDefault()¶
Whether the current value of this instance matches the default value.
- isInterruptionRequested()¶
- isRunning()¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isStartable()¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- kill()¶
@overrides: AbstractTask
Kill the subprocess and set the status to FAILED.
- killTimer(self, id: int)¶
- max_progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- max_progressChanged¶
- max_progressReplaced¶
- metaObject(self) QMetaObject ¶
- model_fnameChanged¶
- model_fnameReplaced¶
- moveToThread(self, thread: QThread)¶
- name: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- nameChanged¶
- nameReplaced¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- output: parameters.CompoundParam¶
All
CompoundParam
instances are automatically serializable if their subparams are serializable. To serialize and deserialize, use the schrodinger json module:from schrodinger.models import json class Coord(parameters.CompoundParam): x: int y: int c1 = Coord(x=1, y=2) c1_string = json.dumps(c1) c2 = json.loads(c1_string, DataClass=Coord) assert c1 == c2
- outputChanged¶
- outputReplaced¶
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- postprocess()¶
- postprocessors()¶
- Returns
A list of postprocessors, both decorated methods on the task and external functions that have been added via
addPostprocessor()
- Return type
list[typing.Callable]
- preprocessors()¶
- Returns
A list of preprocessors (both decorated methods on the task and external functions that have been added via addPreprocessor)
- printDebug(*args)¶
- printingOutputToTerminal()¶
- Returns
whether the
StdOut
andStdErr
output from this task is being printed to the terminal- Return type
bool
- processFuncChain(chain=None, result_callback=None)¶
Execute each function in the specified chain sequentially in order.
The result_callback is called after each function with the return value of that function. This can be used to respond to the return value (e.g. present information to the user, get user feedback, log the result, etc.)
The return value of the result_callback determines whether processing will proceeed to the next function.
- Parameters
chain (FuncChainDecorator) – which chain to process
result_callback – the callback that will get called with the result of each function in the chain
- Returns
a list of the results from the functions
- progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progressChanged¶
- progressReplaced¶
- progress_string: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progress_stringChanged¶
- progress_stringReplaced¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- qprocess¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- replicate()¶
Create a new task with the same input and settings (but no output)
- requestInterruption()¶
Request the task to stop.
To enable this feature, subclasses should periodically check whether an interruption has been requested and terminate if it has been. If such logic has been included,
INTERRUPT_ENABLED
should be set toTrue
.
- reset(*args, **kwargs)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- run()¶
- runCmd(cmd)¶
- runPreprocessing(callback=None, calling_context=None)¶
Run the preprocessors one-by-one. By default, any failing preprocessor will raise a TaskFailure exception and terminate processing. This behavior may be customized by supplying a callback function which will be called after each preprocessor with the result of that preprocessor.
This method is “final” so that all preprocessing logic will be enclosed in the try/finally block.
- Parameters
callback – a function that takes result and returns a bool that indicates whether to continue on to the next preprocessor
calling_context – specify a value here to indicate the context in which this preprocessing is being called. This value will be stored in an instance variable, self.calling_context, which can be accessed from any preprocessor method on this task. Typically this value will be either self.GUI, self.CMDLINE, or None, but any value may be supplied here and checked for in the preprocessor methods. self.calling_context always reverts back to None at the end of runPreprocessing.
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setPrintingOutputToTerminal(print_to_terminal)¶
Set this task to print
StdOut
andStdErr
output to terminal, or not. This must be set before starting the task to enable terminal output.- Parameters
print_to_terminal (bool) – whether to send process output to terminal
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- specifyTaskDir(taskdir_spec)¶
Specify the taskdir creation behavior. Use one of the following options:
A directory name (string). This may be a relative or absolute path
None - no taskdir is requested. The task will use the CWD as its taskdir
AUTO_TASKDIR - a new subdirectory will be created in the CWD using the task name as the directory name.
TEMP_TASKDIR - a temporary directory will be created in the schrodinger temp dir. This directory is cleaned up when the task is deleted.
- Parameters
taskdir_spec – one of the four options listed above
- start(*args, **kwargs)¶
This is the main method for starting a task. Start will check if a task is not already running, run preprocessing, and then run the task.
Failures in preprocessing will interrupt the task start, and the task will never enter the RUNNING state.
- Parameters
skip_preprocessing (bool) – whether to skip preprocessing. This can be useful if preprocessing was already performed prior to calling start.
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- status: Status¶
- statusChanged¶
- statusReplaced¶
- taskDirSetting()¶
Returns the taskdir spec. See specifyTaskDir() for details.
- taskDone¶
- taskFailed¶
- taskStarted¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- wait(timeout=None)¶
Block until the task is finished executing or
timeout
seconds have passed.Warning
This should not be called directly from GUI code - see PANEL-18317. It is safe to call inside a subprocess or job. Run
git grep "task.wait("
to see safe examples annotated with “# OK”.- Parameters
timeout (NoneType or int) – Amount of time in seconds to wait before timing out. If None or a negative number, this method will wait until the task is finished.
- schrodinger.protein.predictors.encode_acc(acc)¶
- class schrodinger.protein.predictors.Disordered(value)¶
Bases:
schrodinger.models.jsonable.JsonableEnum
An enumeration.
- HIGHSCORE = 1¶
- MEDIUMSCORE = 2¶
- LOWSCORE = 3¶
- class schrodinger.protein.predictors.SsAccDependentPredictors(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.protein.predictors.AbstractPredictor
Base class for predictors that use secondary structure and solvent accessibility predictions as inputs.
- class Input(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.models.parameters.CompoundParam
- seq: schrodinger.protein.sequence.ProteinSequence¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- aln: schrodinger.protein.alignment.ProteinAlignment¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- ss_prediction: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- acc_prediction: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- __init__(default_value=<object object>, _param_type=<object object>, **kwargs)¶
- acc_predictionChanged¶
- acc_predictionReplaced¶
- classmethod addSubParam(name, param, update_owner=True)¶
- alnChanged¶
- alnReplaced¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
Override to dynamically set up the default value of the param. Useful for default values that are determined at runtime. This is called any time the param is reset.
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDefault()¶
Whether the current value of this instance matches the default value.
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- reset(*abstract_params)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- seqChanged¶
- seqReplaced¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- ss_predictionChanged¶
- ss_predictionReplaced¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- input: parameters.CompoundParam¶
- AUTO_TASKDIR = 1¶
- CLASS_NUM = NotImplemented¶
- CMDLINE = 1¶
- DEFAULT_TASKDIR_SETTING = None¶
- DONE = 3¶
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- EXE = NotImplemented¶
- FAILED = 2¶
- GUI = 2¶
- INTERRUPT_ENABLED = False¶
- NU = NotImplemented¶
- NY = NotImplemented¶
- PREDICTOR_NAME = NotImplemented¶
- RUNNING = 1¶
- TEMP_TASKDIR = 2¶
- WAITING = 0¶
- __init__(*args, **kwargs)¶
- addFuncToGroup(func, group=None, order=None)¶
Adds a function to the specified chain. Typically used for adding functions that are not methods of this object.
The function may optionally be decorated with a FuncGroupMarker. If so, the default group and order will be determined by the decorator. Any group or order explicitly passed in to addFuncToGroup will take precedence over the decorator settings.
- Parameters
func – the function to add
group (FuncGroupMarker or None) – the group marker. If the function is decorated with a FuncGoupMarker, that group marker will be the default.
order (float or None) – the sorting order. If the function is decorated with a FuncGoupMarker, the order specified in the decorator will be the default.
- addLicenseReservation(license, num_tokens=1)¶
Add a license reservation for this job. This information is used by job control to ensure the job is only started once the required licenses become available.
In a preprocessor, (i.e. before launching the backend), a reservation should be added for each license that will be checked out directly by that backend. Example:
class GlideTask(ComboJobTask): @preprocessor def _reserveGlideLicense(self): # Reserve a Glide license. self.addLicenseReservation(license.GLIDE_MAIN) def mainFunction(self): # Check out the Glide license lic = license.License(license.GLIDE_MAIN) # ... Do computations requiring Glide ... lic.checkin()
Licenses that will be checked out by subjobs of this job do not need reservations added here; subjobs are responsible for their own license reservations.
- Parameters
license (module-constant from schrodinger.utils.license (e.g. license.AUTODESIGNER)) – a license that will be used by the backend
num_tokens (int) – number of tokens for this license reservations
- addPostprocessor(func, order=0)¶
Adds a postproceessor function to this task instance. If the function has been decorated with
@postprocessor
, the order specified by the decorator will be used.- Parameters
func (typing.Callable) – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- addPreprocessor(func, order=None)¶
Adds a preproceessor function to this task instance. If the function has been decorated with @preprocessor, the order specified by the decorator will be used as the default.
- Parameters
func – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- classmethod addSubParam(name, param, update_owner=True)¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- calling_context: CallingContext¶
- calling_contextChanged¶
- calling_contextReplaced¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- cmd¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- exit_code¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- failure_info: FailureInfo¶
Dataclass for task failure information.
Printing an instance of this class will provide the minimum necessary human-readable representation of a recorded failure.
- failure_infoChanged¶
- failure_infoReplaced¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonFilename(filename)¶
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- generateAlignmentFile()¶
Write the alignment file to be used as an input for the predictor. The file will be a temporary file and will be removed in
postprocess
.Gaps in the alignment file are represented as ‘.’.
- generateInputFile()¶
Generate the input file for the predictor. Typically includes a header (see
_getInputHeader
), the file name of the blast alignment, and the sequence to predict properties for.The input file should be written with the name
self.input_fname
.
- generateModelFile()¶
Generate the model definition file with the name
self.model_fname
. This is done by finding the Prime data directory for the predictor and getting the names of all the files in it.The model file includes a header describing the number of model files and the predictors class number (
self.CLASS_NUM
), and a list of the model files.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- getAddedFuncs(group=None)¶
- getDebugString()¶
- getFuncGroup(group=None)¶
Retrieve the functions belonging to the specified group.
- Parameters
group (FuncGroupMarker) – the group marker
- Returns
the functions in the specified group, in order
- Return type
list
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- getLogAsString() str ¶
- getLogFilename()¶
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTaskDir()¶
Returns the full path of the task directory. This is only available if the task directory exists (after creation of the taskdir or, if no task dir is specified, any time).
- getTaskFilename(fname)¶
Return the appropriate absolute path for an input or output file in the taskdir.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- guard()¶
Context manager that saves any Exception raised inside
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
@overrides: parameters.CompoundParam
- inputChanged¶
- inputReplaced¶
- input_fname: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- input_fnameChanged¶
- input_fnameReplaced¶
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDebugEnabled()¶
- isDefault()¶
Whether the current value of this instance matches the default value.
- isInterruptionRequested()¶
- isRunning()¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isStartable()¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- kill()¶
@overrides: AbstractTask
Kill the subprocess and set the status to FAILED.
- killTimer(self, id: int)¶
- makeCmd()¶
Return the command to run the predictor backend. The default implementation returns the predictor executable, the model file name, and the input file name.
- Return type
list[str]
- max_progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- max_progressChanged¶
- max_progressReplaced¶
- metaObject(self) QMetaObject ¶
- model_fname: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- model_fnameChanged¶
- model_fnameReplaced¶
- moveToThread(self, thread: QThread)¶
- name: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- nameChanged¶
- nameReplaced¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- output: parameters.CompoundParam¶
All
CompoundParam
instances are automatically serializable if their subparams are serializable. To serialize and deserialize, use the schrodinger json module:from schrodinger.models import json class Coord(parameters.CompoundParam): x: int y: int c1 = Coord(x=1, y=2) c1_string = json.dumps(c1) c2 = json.loads(c1_string, DataClass=Coord) assert c1 == c2
- outputChanged¶
- outputReplaced¶
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- postprocess()¶
- postprocessors()¶
- Returns
A list of postprocessors, both decorated methods on the task and external functions that have been added via
addPostprocessor()
- Return type
list[typing.Callable]
- prediction()¶
Return the actual prediction. This can take various forms depending on the predictor.
- preprocessors()¶
- Returns
A list of preprocessors (both decorated methods on the task and external functions that have been added via addPreprocessor)
- printDebug(*args)¶
- printingOutputToTerminal()¶
- Returns
whether the
StdOut
andStdErr
output from this task is being printed to the terminal- Return type
bool
- processFuncChain(chain=None, result_callback=None)¶
Execute each function in the specified chain sequentially in order.
The result_callback is called after each function with the return value of that function. This can be used to respond to the return value (e.g. present information to the user, get user feedback, log the result, etc.)
The return value of the result_callback determines whether processing will proceeed to the next function.
- Parameters
chain (FuncChainDecorator) – which chain to process
result_callback – the callback that will get called with the result of each function in the chain
- Returns
a list of the results from the functions
- progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progressChanged¶
- progressReplaced¶
- progress_string: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progress_stringChanged¶
- progress_stringReplaced¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- qprocess¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- replicate()¶
Create a new task with the same input and settings (but no output)
- requestInterruption()¶
Request the task to stop.
To enable this feature, subclasses should periodically check whether an interruption has been requested and terminate if it has been. If such logic has been included,
INTERRUPT_ENABLED
should be set toTrue
.
- reset(*args, **kwargs)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- run()¶
- runCmd(cmd)¶
- runPreprocessing(callback=None, calling_context=None)¶
Run the preprocessors one-by-one. By default, any failing preprocessor will raise a TaskFailure exception and terminate processing. This behavior may be customized by supplying a callback function which will be called after each preprocessor with the result of that preprocessor.
This method is “final” so that all preprocessing logic will be enclosed in the try/finally block.
- Parameters
callback – a function that takes result and returns a bool that indicates whether to continue on to the next preprocessor
calling_context – specify a value here to indicate the context in which this preprocessing is being called. This value will be stored in an instance variable, self.calling_context, which can be accessed from any preprocessor method on this task. Typically this value will be either self.GUI, self.CMDLINE, or None, but any value may be supplied here and checked for in the preprocessor methods. self.calling_context always reverts back to None at the end of runPreprocessing.
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setPrintingOutputToTerminal(print_to_terminal)¶
Set this task to print
StdOut
andStdErr
output to terminal, or not. This must be set before starting the task to enable terminal output.- Parameters
print_to_terminal (bool) – whether to send process output to terminal
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- specifyTaskDir(taskdir_spec)¶
Specify the taskdir creation behavior. Use one of the following options:
A directory name (string). This may be a relative or absolute path
None - no taskdir is requested. The task will use the CWD as its taskdir
AUTO_TASKDIR - a new subdirectory will be created in the CWD using the task name as the directory name.
TEMP_TASKDIR - a temporary directory will be created in the schrodinger temp dir. This directory is cleaned up when the task is deleted.
- Parameters
taskdir_spec – one of the four options listed above
- start(*args, **kwargs)¶
This is the main method for starting a task. Start will check if a task is not already running, run preprocessing, and then run the task.
Failures in preprocessing will interrupt the task start, and the task will never enter the RUNNING state.
- Parameters
skip_preprocessing (bool) – whether to skip preprocessing. This can be useful if preprocessing was already performed prior to calling start.
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- status: Status¶
- statusChanged¶
- statusReplaced¶
- taskDirSetting()¶
Returns the taskdir spec. See specifyTaskDir() for details.
- taskDone¶
- taskFailed¶
- taskStarted¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- wait(timeout=None)¶
Block until the task is finished executing or
timeout
seconds have passed.Warning
This should not be called directly from GUI code - see PANEL-18317. It is safe to call inside a subprocess or job. Run
git grep "task.wait("
to see safe examples annotated with “# OK”.- Parameters
timeout (NoneType or int) – Amount of time in seconds to wait before timing out. If None or a negative number, this method will wait until the task is finished.
- class schrodinger.protein.predictors.DisproPredictor(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.protein.predictors.SsAccDependentPredictors
Disordered regions predictor.
- EXE = 'dispro'¶
- PREDICTOR_NAME = 'dispro'¶
- CLASS_NUM = 2¶
- NU = 25¶
- NY = 2¶
- input_fname: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- model_fname: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- makeCmd()¶
Return the command to run the predictor backend. The default implementation returns the predictor executable, the model file name, and the input file name.
- Return type
list[str]
- generateInputFile()¶
Generate the input file for the predictor. Typically includes a header (see
_getInputHeader
), the file name of the blast alignment, and the sequence to predict properties for.The input file should be written with the name
self.input_fname
.
- rawPrediction()¶
- prediction()¶
Return the actual prediction. This can take various forms depending on the predictor.
- AUTO_TASKDIR = 1¶
- CMDLINE = 1¶
- DEFAULT_TASKDIR_SETTING = None¶
- DONE = 3¶
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- FAILED = 2¶
- GUI = 2¶
- INTERRUPT_ENABLED = False¶
- class Input(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.models.parameters.CompoundParam
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- __init__(default_value=<object object>, _param_type=<object object>, **kwargs)¶
- acc_prediction: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- acc_predictionChanged¶
- acc_predictionReplaced¶
- classmethod addSubParam(name, param, update_owner=True)¶
- aln: schrodinger.protein.alignment.ProteinAlignment¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- alnChanged¶
- alnReplaced¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
Override to dynamically set up the default value of the param. Useful for default values that are determined at runtime. This is called any time the param is reset.
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDefault()¶
Whether the current value of this instance matches the default value.
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- reset(*abstract_params)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- seq: schrodinger.protein.sequence.ProteinSequence¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- seqChanged¶
- seqReplaced¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- ss_prediction: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- ss_predictionChanged¶
- ss_predictionReplaced¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- RUNNING = 1¶
- TEMP_TASKDIR = 2¶
- WAITING = 0¶
- __init__(*args, **kwargs)¶
- addFuncToGroup(func, group=None, order=None)¶
Adds a function to the specified chain. Typically used for adding functions that are not methods of this object.
The function may optionally be decorated with a FuncGroupMarker. If so, the default group and order will be determined by the decorator. Any group or order explicitly passed in to addFuncToGroup will take precedence over the decorator settings.
- Parameters
func – the function to add
group (FuncGroupMarker or None) – the group marker. If the function is decorated with a FuncGoupMarker, that group marker will be the default.
order (float or None) – the sorting order. If the function is decorated with a FuncGoupMarker, the order specified in the decorator will be the default.
- addLicenseReservation(license, num_tokens=1)¶
Add a license reservation for this job. This information is used by job control to ensure the job is only started once the required licenses become available.
In a preprocessor, (i.e. before launching the backend), a reservation should be added for each license that will be checked out directly by that backend. Example:
class GlideTask(ComboJobTask): @preprocessor def _reserveGlideLicense(self): # Reserve a Glide license. self.addLicenseReservation(license.GLIDE_MAIN) def mainFunction(self): # Check out the Glide license lic = license.License(license.GLIDE_MAIN) # ... Do computations requiring Glide ... lic.checkin()
Licenses that will be checked out by subjobs of this job do not need reservations added here; subjobs are responsible for their own license reservations.
- Parameters
license (module-constant from schrodinger.utils.license (e.g. license.AUTODESIGNER)) – a license that will be used by the backend
num_tokens (int) – number of tokens for this license reservations
- addPostprocessor(func, order=0)¶
Adds a postproceessor function to this task instance. If the function has been decorated with
@postprocessor
, the order specified by the decorator will be used.- Parameters
func (typing.Callable) – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- addPreprocessor(func, order=None)¶
Adds a preproceessor function to this task instance. If the function has been decorated with @preprocessor, the order specified by the decorator will be used as the default.
- Parameters
func – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- classmethod addSubParam(name, param, update_owner=True)¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- calling_context: CallingContext¶
- calling_contextChanged¶
- calling_contextReplaced¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- cmd¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- exit_code¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- failure_info: FailureInfo¶
Dataclass for task failure information.
Printing an instance of this class will provide the minimum necessary human-readable representation of a recorded failure.
- failure_infoChanged¶
- failure_infoReplaced¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonFilename(filename)¶
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- generateAlignmentFile()¶
Write the alignment file to be used as an input for the predictor. The file will be a temporary file and will be removed in
postprocess
.Gaps in the alignment file are represented as ‘.’.
- generateModelFile()¶
Generate the model definition file with the name
self.model_fname
. This is done by finding the Prime data directory for the predictor and getting the names of all the files in it.The model file includes a header describing the number of model files and the predictors class number (
self.CLASS_NUM
), and a list of the model files.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- getAddedFuncs(group=None)¶
- getDebugString()¶
- getFuncGroup(group=None)¶
Retrieve the functions belonging to the specified group.
- Parameters
group (FuncGroupMarker) – the group marker
- Returns
the functions in the specified group, in order
- Return type
list
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- getLogAsString() str ¶
- getLogFilename()¶
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTaskDir()¶
Returns the full path of the task directory. This is only available if the task directory exists (after creation of the taskdir or, if no task dir is specified, any time).
- getTaskFilename(fname)¶
Return the appropriate absolute path for an input or output file in the taskdir.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- guard()¶
Context manager that saves any Exception raised inside
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
@overrides: parameters.CompoundParam
- input: parameters.CompoundParam¶
- inputChanged¶
- inputReplaced¶
- input_fnameChanged¶
- input_fnameReplaced¶
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDebugEnabled()¶
- isDefault()¶
Whether the current value of this instance matches the default value.
- isInterruptionRequested()¶
- isRunning()¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isStartable()¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- kill()¶
@overrides: AbstractTask
Kill the subprocess and set the status to FAILED.
- killTimer(self, id: int)¶
- max_progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- max_progressChanged¶
- max_progressReplaced¶
- metaObject(self) QMetaObject ¶
- model_fnameChanged¶
- model_fnameReplaced¶
- moveToThread(self, thread: QThread)¶
- name: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- nameChanged¶
- nameReplaced¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- output: parameters.CompoundParam¶
All
CompoundParam
instances are automatically serializable if their subparams are serializable. To serialize and deserialize, use the schrodinger json module:from schrodinger.models import json class Coord(parameters.CompoundParam): x: int y: int c1 = Coord(x=1, y=2) c1_string = json.dumps(c1) c2 = json.loads(c1_string, DataClass=Coord) assert c1 == c2
- outputChanged¶
- outputReplaced¶
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- postprocess()¶
- postprocessors()¶
- Returns
A list of postprocessors, both decorated methods on the task and external functions that have been added via
addPostprocessor()
- Return type
list[typing.Callable]
- preprocessors()¶
- Returns
A list of preprocessors (both decorated methods on the task and external functions that have been added via addPreprocessor)
- printDebug(*args)¶
- printingOutputToTerminal()¶
- Returns
whether the
StdOut
andStdErr
output from this task is being printed to the terminal- Return type
bool
- processFuncChain(chain=None, result_callback=None)¶
Execute each function in the specified chain sequentially in order.
The result_callback is called after each function with the return value of that function. This can be used to respond to the return value (e.g. present information to the user, get user feedback, log the result, etc.)
The return value of the result_callback determines whether processing will proceeed to the next function.
- Parameters
chain (FuncChainDecorator) – which chain to process
result_callback – the callback that will get called with the result of each function in the chain
- Returns
a list of the results from the functions
- progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progressChanged¶
- progressReplaced¶
- progress_string: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progress_stringChanged¶
- progress_stringReplaced¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- qprocess¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- replicate()¶
Create a new task with the same input and settings (but no output)
- requestInterruption()¶
Request the task to stop.
To enable this feature, subclasses should periodically check whether an interruption has been requested and terminate if it has been. If such logic has been included,
INTERRUPT_ENABLED
should be set toTrue
.
- reset(*args, **kwargs)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- run()¶
- runCmd(cmd)¶
- runPreprocessing(callback=None, calling_context=None)¶
Run the preprocessors one-by-one. By default, any failing preprocessor will raise a TaskFailure exception and terminate processing. This behavior may be customized by supplying a callback function which will be called after each preprocessor with the result of that preprocessor.
This method is “final” so that all preprocessing logic will be enclosed in the try/finally block.
- Parameters
callback – a function that takes result and returns a bool that indicates whether to continue on to the next preprocessor
calling_context – specify a value here to indicate the context in which this preprocessing is being called. This value will be stored in an instance variable, self.calling_context, which can be accessed from any preprocessor method on this task. Typically this value will be either self.GUI, self.CMDLINE, or None, but any value may be supplied here and checked for in the preprocessor methods. self.calling_context always reverts back to None at the end of runPreprocessing.
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setPrintingOutputToTerminal(print_to_terminal)¶
Set this task to print
StdOut
andStdErr
output to terminal, or not. This must be set before starting the task to enable terminal output.- Parameters
print_to_terminal (bool) – whether to send process output to terminal
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- specifyTaskDir(taskdir_spec)¶
Specify the taskdir creation behavior. Use one of the following options:
A directory name (string). This may be a relative or absolute path
None - no taskdir is requested. The task will use the CWD as its taskdir
AUTO_TASKDIR - a new subdirectory will be created in the CWD using the task name as the directory name.
TEMP_TASKDIR - a temporary directory will be created in the schrodinger temp dir. This directory is cleaned up when the task is deleted.
- Parameters
taskdir_spec – one of the four options listed above
- start(*args, **kwargs)¶
This is the main method for starting a task. Start will check if a task is not already running, run preprocessing, and then run the task.
Failures in preprocessing will interrupt the task start, and the task will never enter the RUNNING state.
- Parameters
skip_preprocessing (bool) – whether to skip preprocessing. This can be useful if preprocessing was already performed prior to calling start.
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- status: Status¶
- statusChanged¶
- statusReplaced¶
- taskDirSetting()¶
Returns the taskdir spec. See specifyTaskDir() for details.
- taskDone¶
- taskFailed¶
- taskStarted¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- wait(timeout=None)¶
Block until the task is finished executing or
timeout
seconds have passed.Warning
This should not be called directly from GUI code - see PANEL-18317. It is safe to call inside a subprocess or job. Run
git grep "task.wait("
to see safe examples annotated with “# OK”.- Parameters
timeout (NoneType or int) – Amount of time in seconds to wait before timing out. If None or a negative number, this method will wait until the task is finished.
- class schrodinger.protein.predictors.DomainArrangement(value)¶
Bases:
schrodinger.models.jsonable.JsonableEnum
An enumeration.
- Interdomain = 1¶
- DomainForming = 2¶
- class schrodinger.protein.predictors.DomproPredictor(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.protein.predictors.SsAccDependentPredictors
Domain arrangement predictor.
- EXE = 'dompro'¶
- PREDICTOR_NAME = 'dompro'¶
- CLASS_NUM = 2¶
- NU = 25¶
- NY = 3¶
- input_fname: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- model_fname: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- makeCmd()¶
Return the command to run the predictor backend. The default implementation returns the predictor executable, the model file name, and the input file name.
- Return type
list[str]
- generateInputFile()¶
Generate the input file for the predictor. Typically includes a header (see
_getInputHeader
), the file name of the blast alignment, and the sequence to predict properties for.The input file should be written with the name
self.input_fname
.
- rawPrediction()¶
- prediction()¶
Return the actual prediction. This can take various forms depending on the predictor.
- AUTO_TASKDIR = 1¶
- CMDLINE = 1¶
- DEFAULT_TASKDIR_SETTING = None¶
- DONE = 3¶
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- FAILED = 2¶
- GUI = 2¶
- INTERRUPT_ENABLED = False¶
- class Input(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.models.parameters.CompoundParam
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- __init__(default_value=<object object>, _param_type=<object object>, **kwargs)¶
- acc_prediction: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- acc_predictionChanged¶
- acc_predictionReplaced¶
- classmethod addSubParam(name, param, update_owner=True)¶
- aln: schrodinger.protein.alignment.ProteinAlignment¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- alnChanged¶
- alnReplaced¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
Override to dynamically set up the default value of the param. Useful for default values that are determined at runtime. This is called any time the param is reset.
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDefault()¶
Whether the current value of this instance matches the default value.
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- reset(*abstract_params)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- seq: schrodinger.protein.sequence.ProteinSequence¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- seqChanged¶
- seqReplaced¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- ss_prediction: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- ss_predictionChanged¶
- ss_predictionReplaced¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- RUNNING = 1¶
- TEMP_TASKDIR = 2¶
- WAITING = 0¶
- __init__(*args, **kwargs)¶
- addFuncToGroup(func, group=None, order=None)¶
Adds a function to the specified chain. Typically used for adding functions that are not methods of this object.
The function may optionally be decorated with a FuncGroupMarker. If so, the default group and order will be determined by the decorator. Any group or order explicitly passed in to addFuncToGroup will take precedence over the decorator settings.
- Parameters
func – the function to add
group (FuncGroupMarker or None) – the group marker. If the function is decorated with a FuncGoupMarker, that group marker will be the default.
order (float or None) – the sorting order. If the function is decorated with a FuncGoupMarker, the order specified in the decorator will be the default.
- addLicenseReservation(license, num_tokens=1)¶
Add a license reservation for this job. This information is used by job control to ensure the job is only started once the required licenses become available.
In a preprocessor, (i.e. before launching the backend), a reservation should be added for each license that will be checked out directly by that backend. Example:
class GlideTask(ComboJobTask): @preprocessor def _reserveGlideLicense(self): # Reserve a Glide license. self.addLicenseReservation(license.GLIDE_MAIN) def mainFunction(self): # Check out the Glide license lic = license.License(license.GLIDE_MAIN) # ... Do computations requiring Glide ... lic.checkin()
Licenses that will be checked out by subjobs of this job do not need reservations added here; subjobs are responsible for their own license reservations.
- Parameters
license (module-constant from schrodinger.utils.license (e.g. license.AUTODESIGNER)) – a license that will be used by the backend
num_tokens (int) – number of tokens for this license reservations
- addPostprocessor(func, order=0)¶
Adds a postproceessor function to this task instance. If the function has been decorated with
@postprocessor
, the order specified by the decorator will be used.- Parameters
func (typing.Callable) – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- addPreprocessor(func, order=None)¶
Adds a preproceessor function to this task instance. If the function has been decorated with @preprocessor, the order specified by the decorator will be used as the default.
- Parameters
func – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- classmethod addSubParam(name, param, update_owner=True)¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- calling_context: CallingContext¶
- calling_contextChanged¶
- calling_contextReplaced¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- cmd¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- exit_code¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- failure_info: FailureInfo¶
Dataclass for task failure information.
Printing an instance of this class will provide the minimum necessary human-readable representation of a recorded failure.
- failure_infoChanged¶
- failure_infoReplaced¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonFilename(filename)¶
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- generateAlignmentFile()¶
Write the alignment file to be used as an input for the predictor. The file will be a temporary file and will be removed in
postprocess
.Gaps in the alignment file are represented as ‘.’.
- generateModelFile()¶
Generate the model definition file with the name
self.model_fname
. This is done by finding the Prime data directory for the predictor and getting the names of all the files in it.The model file includes a header describing the number of model files and the predictors class number (
self.CLASS_NUM
), and a list of the model files.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- getAddedFuncs(group=None)¶
- getDebugString()¶
- getFuncGroup(group=None)¶
Retrieve the functions belonging to the specified group.
- Parameters
group (FuncGroupMarker) – the group marker
- Returns
the functions in the specified group, in order
- Return type
list
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- getLogAsString() str ¶
- getLogFilename()¶
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTaskDir()¶
Returns the full path of the task directory. This is only available if the task directory exists (after creation of the taskdir or, if no task dir is specified, any time).
- getTaskFilename(fname)¶
Return the appropriate absolute path for an input or output file in the taskdir.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- guard()¶
Context manager that saves any Exception raised inside
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
@overrides: parameters.CompoundParam
- input: parameters.CompoundParam¶
- inputChanged¶
- inputReplaced¶
- input_fnameChanged¶
- input_fnameReplaced¶
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDebugEnabled()¶
- isDefault()¶
Whether the current value of this instance matches the default value.
- isInterruptionRequested()¶
- isRunning()¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isStartable()¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- kill()¶
@overrides: AbstractTask
Kill the subprocess and set the status to FAILED.
- killTimer(self, id: int)¶
- max_progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- max_progressChanged¶
- max_progressReplaced¶
- metaObject(self) QMetaObject ¶
- model_fnameChanged¶
- model_fnameReplaced¶
- moveToThread(self, thread: QThread)¶
- name: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- nameChanged¶
- nameReplaced¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- output: parameters.CompoundParam¶
All
CompoundParam
instances are automatically serializable if their subparams are serializable. To serialize and deserialize, use the schrodinger json module:from schrodinger.models import json class Coord(parameters.CompoundParam): x: int y: int c1 = Coord(x=1, y=2) c1_string = json.dumps(c1) c2 = json.loads(c1_string, DataClass=Coord) assert c1 == c2
- outputChanged¶
- outputReplaced¶
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- postprocess()¶
- postprocessors()¶
- Returns
A list of postprocessors, both decorated methods on the task and external functions that have been added via
addPostprocessor()
- Return type
list[typing.Callable]
- preprocessors()¶
- Returns
A list of preprocessors (both decorated methods on the task and external functions that have been added via addPreprocessor)
- printDebug(*args)¶
- printingOutputToTerminal()¶
- Returns
whether the
StdOut
andStdErr
output from this task is being printed to the terminal- Return type
bool
- processFuncChain(chain=None, result_callback=None)¶
Execute each function in the specified chain sequentially in order.
The result_callback is called after each function with the return value of that function. This can be used to respond to the return value (e.g. present information to the user, get user feedback, log the result, etc.)
The return value of the result_callback determines whether processing will proceeed to the next function.
- Parameters
chain (FuncChainDecorator) – which chain to process
result_callback – the callback that will get called with the result of each function in the chain
- Returns
a list of the results from the functions
- progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progressChanged¶
- progressReplaced¶
- progress_string: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progress_stringChanged¶
- progress_stringReplaced¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- qprocess¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- replicate()¶
Create a new task with the same input and settings (but no output)
- requestInterruption()¶
Request the task to stop.
To enable this feature, subclasses should periodically check whether an interruption has been requested and terminate if it has been. If such logic has been included,
INTERRUPT_ENABLED
should be set toTrue
.
- reset(*args, **kwargs)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- run()¶
- runCmd(cmd)¶
- runPreprocessing(callback=None, calling_context=None)¶
Run the preprocessors one-by-one. By default, any failing preprocessor will raise a TaskFailure exception and terminate processing. This behavior may be customized by supplying a callback function which will be called after each preprocessor with the result of that preprocessor.
This method is “final” so that all preprocessing logic will be enclosed in the try/finally block.
- Parameters
callback – a function that takes result and returns a bool that indicates whether to continue on to the next preprocessor
calling_context – specify a value here to indicate the context in which this preprocessing is being called. This value will be stored in an instance variable, self.calling_context, which can be accessed from any preprocessor method on this task. Typically this value will be either self.GUI, self.CMDLINE, or None, but any value may be supplied here and checked for in the preprocessor methods. self.calling_context always reverts back to None at the end of runPreprocessing.
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setPrintingOutputToTerminal(print_to_terminal)¶
Set this task to print
StdOut
andStdErr
output to terminal, or not. This must be set before starting the task to enable terminal output.- Parameters
print_to_terminal (bool) – whether to send process output to terminal
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- specifyTaskDir(taskdir_spec)¶
Specify the taskdir creation behavior. Use one of the following options:
A directory name (string). This may be a relative or absolute path
None - no taskdir is requested. The task will use the CWD as its taskdir
AUTO_TASKDIR - a new subdirectory will be created in the CWD using the task name as the directory name.
TEMP_TASKDIR - a temporary directory will be created in the schrodinger temp dir. This directory is cleaned up when the task is deleted.
- Parameters
taskdir_spec – one of the four options listed above
- start(*args, **kwargs)¶
This is the main method for starting a task. Start will check if a task is not already running, run preprocessing, and then run the task.
Failures in preprocessing will interrupt the task start, and the task will never enter the RUNNING state.
- Parameters
skip_preprocessing (bool) – whether to skip preprocessing. This can be useful if preprocessing was already performed prior to calling start.
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- status: Status¶
- statusChanged¶
- statusReplaced¶
- taskDirSetting()¶
Returns the taskdir spec. See specifyTaskDir() for details.
- taskDone¶
- taskFailed¶
- taskStarted¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- wait(timeout=None)¶
Block until the task is finished executing or
timeout
seconds have passed.Warning
This should not be called directly from GUI code - see PANEL-18317. It is safe to call inside a subprocess or job. Run
git grep "task.wait("
to see safe examples annotated with “# OK”.- Parameters
timeout (NoneType or int) – Amount of time in seconds to wait before timing out. If None or a negative number, this method will wait until the task is finished.
- class schrodinger.protein.predictors.DiproPredictor(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.protein.predictors.SsAccDependentPredictors
Disulfide bonds predictor.
- EXE = 'dipro'¶
- PREDICTOR_NAME = 'dipro'¶
- CLASS_NUM = 0.5¶
- input_fname: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- model_fname: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- class DiproFormat(value)¶
Bases:
enum.IntEnum
For use with command line invocation.
- Alessandro = 1¶
- NewDipro = 2¶
- makeCmd()¶
Usage: $PSP_PATH/dipro model_file sequence_file alignment_file format
- generateInputFile()¶
Generate the input file for the predictor. Typically includes a header (see
_getInputHeader
), the file name of the blast alignment, and the sequence to predict properties for.The input file should be written with the name
self.input_fname
.
- prediction()¶
- Returns
A list of disulfide bonds represented by 2-tuples with two residue indexes
- Return type
list[tuple[int]]
- AUTO_TASKDIR = 1¶
- CMDLINE = 1¶
- DEFAULT_TASKDIR_SETTING = None¶
- DONE = 3¶
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- FAILED = 2¶
- GUI = 2¶
- INTERRUPT_ENABLED = False¶
- class Input(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.models.parameters.CompoundParam
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- __init__(default_value=<object object>, _param_type=<object object>, **kwargs)¶
- acc_prediction: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- acc_predictionChanged¶
- acc_predictionReplaced¶
- classmethod addSubParam(name, param, update_owner=True)¶
- aln: schrodinger.protein.alignment.ProteinAlignment¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- alnChanged¶
- alnReplaced¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
Override to dynamically set up the default value of the param. Useful for default values that are determined at runtime. This is called any time the param is reset.
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDefault()¶
Whether the current value of this instance matches the default value.
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- reset(*abstract_params)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- seq: schrodinger.protein.sequence.ProteinSequence¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- seqChanged¶
- seqReplaced¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- ss_prediction: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- ss_predictionChanged¶
- ss_predictionReplaced¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- NU = NotImplemented¶
- NY = NotImplemented¶
- RUNNING = 1¶
- TEMP_TASKDIR = 2¶
- WAITING = 0¶
- __init__(*args, **kwargs)¶
- addFuncToGroup(func, group=None, order=None)¶
Adds a function to the specified chain. Typically used for adding functions that are not methods of this object.
The function may optionally be decorated with a FuncGroupMarker. If so, the default group and order will be determined by the decorator. Any group or order explicitly passed in to addFuncToGroup will take precedence over the decorator settings.
- Parameters
func – the function to add
group (FuncGroupMarker or None) – the group marker. If the function is decorated with a FuncGoupMarker, that group marker will be the default.
order (float or None) – the sorting order. If the function is decorated with a FuncGoupMarker, the order specified in the decorator will be the default.
- addLicenseReservation(license, num_tokens=1)¶
Add a license reservation for this job. This information is used by job control to ensure the job is only started once the required licenses become available.
In a preprocessor, (i.e. before launching the backend), a reservation should be added for each license that will be checked out directly by that backend. Example:
class GlideTask(ComboJobTask): @preprocessor def _reserveGlideLicense(self): # Reserve a Glide license. self.addLicenseReservation(license.GLIDE_MAIN) def mainFunction(self): # Check out the Glide license lic = license.License(license.GLIDE_MAIN) # ... Do computations requiring Glide ... lic.checkin()
Licenses that will be checked out by subjobs of this job do not need reservations added here; subjobs are responsible for their own license reservations.
- Parameters
license (module-constant from schrodinger.utils.license (e.g. license.AUTODESIGNER)) – a license that will be used by the backend
num_tokens (int) – number of tokens for this license reservations
- addPostprocessor(func, order=0)¶
Adds a postproceessor function to this task instance. If the function has been decorated with
@postprocessor
, the order specified by the decorator will be used.- Parameters
func (typing.Callable) – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- addPreprocessor(func, order=None)¶
Adds a preproceessor function to this task instance. If the function has been decorated with @preprocessor, the order specified by the decorator will be used as the default.
- Parameters
func – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- classmethod addSubParam(name, param, update_owner=True)¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- calling_context: CallingContext¶
- calling_contextChanged¶
- calling_contextReplaced¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- cmd¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- exit_code¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- failure_info: FailureInfo¶
Dataclass for task failure information.
Printing an instance of this class will provide the minimum necessary human-readable representation of a recorded failure.
- failure_infoChanged¶
- failure_infoReplaced¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonFilename(filename)¶
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- generateAlignmentFile()¶
Write the alignment file to be used as an input for the predictor. The file will be a temporary file and will be removed in
postprocess
.Gaps in the alignment file are represented as ‘.’.
- generateModelFile()¶
Generate the model definition file with the name
self.model_fname
. This is done by finding the Prime data directory for the predictor and getting the names of all the files in it.The model file includes a header describing the number of model files and the predictors class number (
self.CLASS_NUM
), and a list of the model files.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- getAddedFuncs(group=None)¶
- getDebugString()¶
- getFuncGroup(group=None)¶
Retrieve the functions belonging to the specified group.
- Parameters
group (FuncGroupMarker) – the group marker
- Returns
the functions in the specified group, in order
- Return type
list
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- getLogAsString() str ¶
- getLogFilename()¶
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTaskDir()¶
Returns the full path of the task directory. This is only available if the task directory exists (after creation of the taskdir or, if no task dir is specified, any time).
- getTaskFilename(fname)¶
Return the appropriate absolute path for an input or output file in the taskdir.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- guard()¶
Context manager that saves any Exception raised inside
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
@overrides: parameters.CompoundParam
- input: parameters.CompoundParam¶
- inputChanged¶
- inputReplaced¶
- input_fnameChanged¶
- input_fnameReplaced¶
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDebugEnabled()¶
- isDefault()¶
Whether the current value of this instance matches the default value.
- isInterruptionRequested()¶
- isRunning()¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isStartable()¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- kill()¶
@overrides: AbstractTask
Kill the subprocess and set the status to FAILED.
- killTimer(self, id: int)¶
- max_progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- max_progressChanged¶
- max_progressReplaced¶
- metaObject(self) QMetaObject ¶
- model_fnameChanged¶
- model_fnameReplaced¶
- moveToThread(self, thread: QThread)¶
- name: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- nameChanged¶
- nameReplaced¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- output: parameters.CompoundParam¶
All
CompoundParam
instances are automatically serializable if their subparams are serializable. To serialize and deserialize, use the schrodinger json module:from schrodinger.models import json class Coord(parameters.CompoundParam): x: int y: int c1 = Coord(x=1, y=2) c1_string = json.dumps(c1) c2 = json.loads(c1_string, DataClass=Coord) assert c1 == c2
- outputChanged¶
- outputReplaced¶
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- postprocess()¶
- postprocessors()¶
- Returns
A list of postprocessors, both decorated methods on the task and external functions that have been added via
addPostprocessor()
- Return type
list[typing.Callable]
- preprocessors()¶
- Returns
A list of preprocessors (both decorated methods on the task and external functions that have been added via addPreprocessor)
- printDebug(*args)¶
- printingOutputToTerminal()¶
- Returns
whether the
StdOut
andStdErr
output from this task is being printed to the terminal- Return type
bool
- processFuncChain(chain=None, result_callback=None)¶
Execute each function in the specified chain sequentially in order.
The result_callback is called after each function with the return value of that function. This can be used to respond to the return value (e.g. present information to the user, get user feedback, log the result, etc.)
The return value of the result_callback determines whether processing will proceeed to the next function.
- Parameters
chain (FuncChainDecorator) – which chain to process
result_callback – the callback that will get called with the result of each function in the chain
- Returns
a list of the results from the functions
- progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progressChanged¶
- progressReplaced¶
- progress_string: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progress_stringChanged¶
- progress_stringReplaced¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- qprocess¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- replicate()¶
Create a new task with the same input and settings (but no output)
- requestInterruption()¶
Request the task to stop.
To enable this feature, subclasses should periodically check whether an interruption has been requested and terminate if it has been. If such logic has been included,
INTERRUPT_ENABLED
should be set toTrue
.
- reset(*args, **kwargs)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- run()¶
- runCmd(cmd)¶
- runPreprocessing(callback=None, calling_context=None)¶
Run the preprocessors one-by-one. By default, any failing preprocessor will raise a TaskFailure exception and terminate processing. This behavior may be customized by supplying a callback function which will be called after each preprocessor with the result of that preprocessor.
This method is “final” so that all preprocessing logic will be enclosed in the try/finally block.
- Parameters
callback – a function that takes result and returns a bool that indicates whether to continue on to the next preprocessor
calling_context – specify a value here to indicate the context in which this preprocessing is being called. This value will be stored in an instance variable, self.calling_context, which can be accessed from any preprocessor method on this task. Typically this value will be either self.GUI, self.CMDLINE, or None, but any value may be supplied here and checked for in the preprocessor methods. self.calling_context always reverts back to None at the end of runPreprocessing.
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setPrintingOutputToTerminal(print_to_terminal)¶
Set this task to print
StdOut
andStdErr
output to terminal, or not. This must be set before starting the task to enable terminal output.- Parameters
print_to_terminal (bool) – whether to send process output to terminal
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- specifyTaskDir(taskdir_spec)¶
Specify the taskdir creation behavior. Use one of the following options:
A directory name (string). This may be a relative or absolute path
None - no taskdir is requested. The task will use the CWD as its taskdir
AUTO_TASKDIR - a new subdirectory will be created in the CWD using the task name as the directory name.
TEMP_TASKDIR - a temporary directory will be created in the schrodinger temp dir. This directory is cleaned up when the task is deleted.
- Parameters
taskdir_spec – one of the four options listed above
- start(*args, **kwargs)¶
This is the main method for starting a task. Start will check if a task is not already running, run preprocessing, and then run the task.
Failures in preprocessing will interrupt the task start, and the task will never enter the RUNNING state.
- Parameters
skip_preprocessing (bool) – whether to skip preprocessing. This can be useful if preprocessing was already performed prior to calling start.
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- status: Status¶
- statusChanged¶
- statusReplaced¶
- taskDirSetting()¶
Returns the taskdir spec. See specifyTaskDir() for details.
- taskDone¶
- taskFailed¶
- taskStarted¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- wait(timeout=None)¶
Block until the task is finished executing or
timeout
seconds have passed.Warning
This should not be called directly from GUI code - see PANEL-18317. It is safe to call inside a subprocess or job. Run
git grep "task.wait("
to see safe examples annotated with “# OK”.- Parameters
timeout (NoneType or int) – Amount of time in seconds to wait before timing out. If None or a negative number, this method will wait until the task is finished.
- class schrodinger.protein.predictors.BetaproPredictor(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.protein.predictors.AbstractPredictor
Beta strand contacts predictor
- EXE = 'betapro'¶
- PREDICTOR_NAME = 'betapro'¶
- CLASS_NUM = ''¶
- NU = 20¶
- NY = 3¶
- input_fname: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- model_fname: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- class Input(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.models.parameters.CompoundParam
- seq: schrodinger.protein.sequence.ProteinSequence¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- aln: schrodinger.protein.alignment.ProteinAlignment¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- ss_prediction: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- __init__(default_value=<object object>, _param_type=<object object>, **kwargs)¶
- classmethod addSubParam(name, param, update_owner=True)¶
- alnChanged¶
- alnReplaced¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
Override to dynamically set up the default value of the param. Useful for default values that are determined at runtime. This is called any time the param is reset.
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDefault()¶
Whether the current value of this instance matches the default value.
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- killTimer(self, id: int)¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- reset(*abstract_params)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- seqChanged¶
- seqReplaced¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- ss_predictionChanged¶
- ss_predictionReplaced¶
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- input: parameters.CompoundParam¶
- generateInputFile()¶
Generate the input file for the predictor. Typically includes a header (see
_getInputHeader
), the file name of the blast alignment, and the sequence to predict properties for.The input file should be written with the name
self.input_fname
.
- makeCmd()¶
Usage: $PSP_PATH/betapro model_file, protein_file, alignment_file
- prediction()¶
Return the actual prediction. This can take various forms depending on the predictor.
- AUTO_TASKDIR = 1¶
- CMDLINE = 1¶
- DEFAULT_TASKDIR_SETTING = None¶
- DONE = 3¶
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- FAILED = 2¶
- GUI = 2¶
- INTERRUPT_ENABLED = False¶
- RUNNING = 1¶
- TEMP_TASKDIR = 2¶
- WAITING = 0¶
- __init__(*args, **kwargs)¶
- addFuncToGroup(func, group=None, order=None)¶
Adds a function to the specified chain. Typically used for adding functions that are not methods of this object.
The function may optionally be decorated with a FuncGroupMarker. If so, the default group and order will be determined by the decorator. Any group or order explicitly passed in to addFuncToGroup will take precedence over the decorator settings.
- Parameters
func – the function to add
group (FuncGroupMarker or None) – the group marker. If the function is decorated with a FuncGoupMarker, that group marker will be the default.
order (float or None) – the sorting order. If the function is decorated with a FuncGoupMarker, the order specified in the decorator will be the default.
- addLicenseReservation(license, num_tokens=1)¶
Add a license reservation for this job. This information is used by job control to ensure the job is only started once the required licenses become available.
In a preprocessor, (i.e. before launching the backend), a reservation should be added for each license that will be checked out directly by that backend. Example:
class GlideTask(ComboJobTask): @preprocessor def _reserveGlideLicense(self): # Reserve a Glide license. self.addLicenseReservation(license.GLIDE_MAIN) def mainFunction(self): # Check out the Glide license lic = license.License(license.GLIDE_MAIN) # ... Do computations requiring Glide ... lic.checkin()
Licenses that will be checked out by subjobs of this job do not need reservations added here; subjobs are responsible for their own license reservations.
- Parameters
license (module-constant from schrodinger.utils.license (e.g. license.AUTODESIGNER)) – a license that will be used by the backend
num_tokens (int) – number of tokens for this license reservations
- addPostprocessor(func, order=0)¶
Adds a postproceessor function to this task instance. If the function has been decorated with
@postprocessor
, the order specified by the decorator will be used.- Parameters
func (typing.Callable) – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- addPreprocessor(func, order=None)¶
Adds a preproceessor function to this task instance. If the function has been decorated with @preprocessor, the order specified by the decorator will be used as the default.
- Parameters
func – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- classmethod addSubParam(name, param, update_owner=True)¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- calling_context: CallingContext¶
- calling_contextChanged¶
- calling_contextReplaced¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- cmd¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- exit_code¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- failure_info: FailureInfo¶
Dataclass for task failure information.
Printing an instance of this class will provide the minimum necessary human-readable representation of a recorded failure.
- failure_infoChanged¶
- failure_infoReplaced¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonFilename(filename)¶
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- generateAlignmentFile()¶
Write the alignment file to be used as an input for the predictor. The file will be a temporary file and will be removed in
postprocess
.Gaps in the alignment file are represented as ‘.’.
- generateModelFile()¶
Generate the model definition file with the name
self.model_fname
. This is done by finding the Prime data directory for the predictor and getting the names of all the files in it.The model file includes a header describing the number of model files and the predictors class number (
self.CLASS_NUM
), and a list of the model files.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- getAddedFuncs(group=None)¶
- getDebugString()¶
- getFuncGroup(group=None)¶
Retrieve the functions belonging to the specified group.
- Parameters
group (FuncGroupMarker) – the group marker
- Returns
the functions in the specified group, in order
- Return type
list
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- getLogAsString() str ¶
- getLogFilename()¶
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTaskDir()¶
Returns the full path of the task directory. This is only available if the task directory exists (after creation of the taskdir or, if no task dir is specified, any time).
- getTaskFilename(fname)¶
Return the appropriate absolute path for an input or output file in the taskdir.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- guard()¶
Context manager that saves any Exception raised inside
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
@overrides: parameters.CompoundParam
- inputChanged¶
- inputReplaced¶
- input_fnameChanged¶
- input_fnameReplaced¶
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDebugEnabled()¶
- isDefault()¶
Whether the current value of this instance matches the default value.
- isInterruptionRequested()¶
- isRunning()¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isStartable()¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- kill()¶
@overrides: AbstractTask
Kill the subprocess and set the status to FAILED.
- killTimer(self, id: int)¶
- max_progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- max_progressChanged¶
- max_progressReplaced¶
- metaObject(self) QMetaObject ¶
- model_fnameChanged¶
- model_fnameReplaced¶
- moveToThread(self, thread: QThread)¶
- name: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- nameChanged¶
- nameReplaced¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- output: parameters.CompoundParam¶
All
CompoundParam
instances are automatically serializable if their subparams are serializable. To serialize and deserialize, use the schrodinger json module:from schrodinger.models import json class Coord(parameters.CompoundParam): x: int y: int c1 = Coord(x=1, y=2) c1_string = json.dumps(c1) c2 = json.loads(c1_string, DataClass=Coord) assert c1 == c2
- outputChanged¶
- outputReplaced¶
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- postprocess()¶
- postprocessors()¶
- Returns
A list of postprocessors, both decorated methods on the task and external functions that have been added via
addPostprocessor()
- Return type
list[typing.Callable]
- preprocessors()¶
- Returns
A list of preprocessors (both decorated methods on the task and external functions that have been added via addPreprocessor)
- printDebug(*args)¶
- printingOutputToTerminal()¶
- Returns
whether the
StdOut
andStdErr
output from this task is being printed to the terminal- Return type
bool
- processFuncChain(chain=None, result_callback=None)¶
Execute each function in the specified chain sequentially in order.
The result_callback is called after each function with the return value of that function. This can be used to respond to the return value (e.g. present information to the user, get user feedback, log the result, etc.)
The return value of the result_callback determines whether processing will proceeed to the next function.
- Parameters
chain (FuncChainDecorator) – which chain to process
result_callback – the callback that will get called with the result of each function in the chain
- Returns
a list of the results from the functions
- progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progressChanged¶
- progressReplaced¶
- progress_string: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progress_stringChanged¶
- progress_stringReplaced¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- qprocess¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- replicate()¶
Create a new task with the same input and settings (but no output)
- requestInterruption()¶
Request the task to stop.
To enable this feature, subclasses should periodically check whether an interruption has been requested and terminate if it has been. If such logic has been included,
INTERRUPT_ENABLED
should be set toTrue
.
- reset(*args, **kwargs)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- run()¶
- runCmd(cmd)¶
- runPreprocessing(callback=None, calling_context=None)¶
Run the preprocessors one-by-one. By default, any failing preprocessor will raise a TaskFailure exception and terminate processing. This behavior may be customized by supplying a callback function which will be called after each preprocessor with the result of that preprocessor.
This method is “final” so that all preprocessing logic will be enclosed in the try/finally block.
- Parameters
callback – a function that takes result and returns a bool that indicates whether to continue on to the next preprocessor
calling_context – specify a value here to indicate the context in which this preprocessing is being called. This value will be stored in an instance variable, self.calling_context, which can be accessed from any preprocessor method on this task. Typically this value will be either self.GUI, self.CMDLINE, or None, but any value may be supplied here and checked for in the preprocessor methods. self.calling_context always reverts back to None at the end of runPreprocessing.
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setPrintingOutputToTerminal(print_to_terminal)¶
Set this task to print
StdOut
andStdErr
output to terminal, or not. This must be set before starting the task to enable terminal output.- Parameters
print_to_terminal (bool) – whether to send process output to terminal
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- specifyTaskDir(taskdir_spec)¶
Specify the taskdir creation behavior. Use one of the following options:
A directory name (string). This may be a relative or absolute path
None - no taskdir is requested. The task will use the CWD as its taskdir
AUTO_TASKDIR - a new subdirectory will be created in the CWD using the task name as the directory name.
TEMP_TASKDIR - a temporary directory will be created in the schrodinger temp dir. This directory is cleaned up when the task is deleted.
- Parameters
taskdir_spec – one of the four options listed above
- start(*args, **kwargs)¶
This is the main method for starting a task. Start will check if a task is not already running, run preprocessing, and then run the task.
Failures in preprocessing will interrupt the task start, and the task will never enter the RUNNING state.
- Parameters
skip_preprocessing (bool) – whether to skip preprocessing. This can be useful if preprocessing was already performed prior to calling start.
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- status: Status¶
- statusChanged¶
- statusReplaced¶
- taskDirSetting()¶
Returns the taskdir spec. See specifyTaskDir() for details.
- taskDone¶
- taskFailed¶
- taskStarted¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- wait(timeout=None)¶
Block until the task is finished executing or
timeout
seconds have passed.Warning
This should not be called directly from GUI code - see PANEL-18317. It is safe to call inside a subprocess or job. Run
git grep "task.wait("
to see safe examples annotated with “# OK”.- Parameters
timeout (NoneType or int) – Amount of time in seconds to wait before timing out. If None or a negative number, this method will wait until the task is finished.
- class schrodinger.protein.predictors.PredictorWrapperTask(*args, _param_type=<object object>, **kwargs)¶
Bases:
schrodinger.tasks.tasks.BlockingFunctionTask
Task to run a specific predictor.
- __init__(anno=None, seq=None, blast_aln=None)¶
- validateInput()¶
- mainFunction()¶
- AUTO_TASKDIR = 1¶
- CMDLINE = 1¶
- DEFAULT_TASKDIR_SETTING = None¶
- DONE = 3¶
- DataClass¶
This class can be used to declare a public attribute on a
CompoundParam
. Declared public attributes can be used without error.Example usage:
class Coord(CompoundParam): x: int y: int note = NonParamAttribute() coord = Coord() coord.note = "hello" # No error
- FAILED = 2¶
- GUI = 2¶
- INTERRUPT_ENABLED = False¶
- RUNNING = 1¶
- TEMP_TASKDIR = 2¶
- WAITING = 0¶
- addFuncToGroup(func, group=None, order=None)¶
Adds a function to the specified chain. Typically used for adding functions that are not methods of this object.
The function may optionally be decorated with a FuncGroupMarker. If so, the default group and order will be determined by the decorator. Any group or order explicitly passed in to addFuncToGroup will take precedence over the decorator settings.
- Parameters
func – the function to add
group (FuncGroupMarker or None) – the group marker. If the function is decorated with a FuncGoupMarker, that group marker will be the default.
order (float or None) – the sorting order. If the function is decorated with a FuncGoupMarker, the order specified in the decorator will be the default.
- addLicenseReservation(license, num_tokens=1)¶
Add a license reservation for this job. This information is used by job control to ensure the job is only started once the required licenses become available.
In a preprocessor, (i.e. before launching the backend), a reservation should be added for each license that will be checked out directly by that backend. Example:
class GlideTask(ComboJobTask): @preprocessor def _reserveGlideLicense(self): # Reserve a Glide license. self.addLicenseReservation(license.GLIDE_MAIN) def mainFunction(self): # Check out the Glide license lic = license.License(license.GLIDE_MAIN) # ... Do computations requiring Glide ... lic.checkin()
Licenses that will be checked out by subjobs of this job do not need reservations added here; subjobs are responsible for their own license reservations.
- Parameters
license (module-constant from schrodinger.utils.license (e.g. license.AUTODESIGNER)) – a license that will be used by the backend
num_tokens (int) – number of tokens for this license reservations
- addPostprocessor(func, order=0)¶
Adds a postproceessor function to this task instance. If the function has been decorated with
@postprocessor
, the order specified by the decorator will be used.- Parameters
func (typing.Callable) – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- addPreprocessor(func, order=None)¶
Adds a preproceessor function to this task instance. If the function has been decorated with @preprocessor, the order specified by the decorator will be used as the default.
- Parameters
func – the function to add
order (float) – the sorting order for the function relative to all other preprocessors. Takes precedence over order specified by the preprocessor decorator.
- classmethod addSubParam(name, param, update_owner=True)¶
- blockSignals(self, b: bool) bool ¶
- block_signal_propagation()¶
- calling_context: schrodinger.tasks.tasks.CallingContext¶
- calling_contextChanged¶
- calling_contextReplaced¶
- childEvent(self, a0: QChildEvent)¶
- children(self) List[QObject] ¶
- classmethod configureParam()¶
Override this class method to set up the abstract param class (e.g. setParamReference on child params.)
- connectNotify(self, signal: QMetaMethod)¶
- customEvent(self, a0: QEvent)¶
- classmethod defaultValue()¶
Returns the default value for this abstract param:
default_atom = Atom.defaultValue() assert Atom.coord.x == 0
- deleteLater(self)¶
- destroyed¶
destroyed(self, object: typing.Optional[QObject] = None) [signal]
- disconnect(a0: QMetaObject.Connection) bool ¶
- disconnect(self) None
- disconnectNotify(self, signal: QMetaMethod)¶
- dumpObjectInfo(self)¶
- dumpObjectTree(self)¶
- dynamicPropertyNames(self) List[QByteArray] ¶
- event(self, a0: QEvent) bool ¶
- eventFilter(self, a0: QObject, a1: QEvent) bool ¶
- failure_info: schrodinger.tasks.tasks.FailureInfo¶
Dataclass for task failure information.
Printing an instance of this class will provide the minimum necessary human-readable representation of a recorded failure.
- failure_infoChanged¶
- failure_infoReplaced¶
- findChild(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject ¶
- findChild(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) QObject
- findChildren(self, type: type, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject] ¶
- findChildren(self, types: Tuple, name: str = '', options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, type: type, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- findChildren(self, types: Tuple, re: QRegularExpression, options: Qt.FindChildOption = Qt.FindChildrenRecursively) List[QObject]
- classmethod fromJson(json_obj)¶
A factory method which constructs a new object from a given dict loaded from a json string or file.
- Parameters
json_obj (dict) – A json-loaded dictionary to create an object from.
- Returns
An instance of this class.
- Return type
cls
- classmethod fromJsonFilename(filename)¶
- classmethod fromJsonImplementation(json_dict)¶
Sets the value of this compound param value object from a JSON dict.
Warning
This should never be called directly.
- getAbstractParam()¶
Return the corresponding abstract param for this instance.
- getAddedFuncs(group=None)¶
- getDebugString()¶
- getFuncGroup(group=None)¶
Retrieve the functions belonging to the specified group.
- Parameters
group (FuncGroupMarker) – the group marker
- Returns
the functions in the specified group, in order
- Return type
list
- classmethod getJsonBlacklist()¶
Override to customize what params are serialized.
Implementations should return a list of abstract params that should be omitted from serialization.
- ..NOTE
Returned abstract params must be direct child params of
cls
, e.g.cls.name
, notcls.coord.x
.
- classmethod getParamSignal(obj, signal_type='Changed')¶
- classmethod getParamValue(obj)¶
Enables access to a param value on a compound param via an abstract param reference:
a = Atom() assert Atom.coord.x.getParamValue(a) == 0 # ints default to 0 a.coord.x = 3 assert Atom.coord.x.getParamValue(a) == 3
- Parameters
param (CompoundParam) – The owner param to get a param value from
- classmethod getSubParam(name)¶
Get the value of a subparam using the string name:
c = Coord() assert c.getSubParam('x') == 0
Note
Using the string name to access params is generally discouraged, but can be useful for serializing/deserializing param data.
- Parameters
name (str) – The name of the subparam to get the value for.
- classmethod getSubParams()¶
Return a dictionary mapping subparam names to their values.
- getTaskDir()¶
Returns the full path of the task directory. This is only available if the task directory exists (after creation of the taskdir or, if no task dir is specified, any time).
- getTaskFilename(fname)¶
Return the appropriate absolute path for an input or output file in the taskdir.
- getTypeHint()¶
- get_version()¶
Method to get the version of a particular object. Defaults to the current version of mmshare. This class can be overridden for custom versioning behavior.
- guard()¶
Context manager that saves any Exception raised inside
- inherits(self, classname: str) bool ¶
- initAbstract()¶
- initConcrete()¶
Override to customize initialization of concrete params.
- initializeValue()¶
@overrides: parameters.CompoundParam
- input: schrodinger.models.parameters.CompoundParam¶
All
CompoundParam
instances are automatically serializable if their subparams are serializable. To serialize and deserialize, use the schrodinger json module:from schrodinger.models import json class Coord(parameters.CompoundParam): x: int y: int c1 = Coord(x=1, y=2) c1_string = json.dumps(c1) c2 = json.loads(c1_string, DataClass=Coord) assert c1 == c2
- inputChanged¶
- inputReplaced¶
- installEventFilter(self, a0: QObject)¶
- classmethod isAbstract()¶
Whether the param is an “abstract” param.
- isDebugEnabled()¶
- isDefault()¶
Whether the current value of this instance matches the default value.
- isInterruptionRequested()¶
- isRunning()¶
- isSignalConnected(self, signal: QMetaMethod) bool ¶
- isStartable()¶
- isWidgetType(self) bool ¶
- isWindowType(self) bool ¶
- kill()¶
Implementations are responsible for immediately stopping the task. No threads or processes should be running after this method is complete.
This method should be called sparingly since in many contexts the task will be forced to terminate without a chance to clean up or free resources.
- killTimer(self, id: int)¶
- max_progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- max_progressChanged¶
- max_progressReplaced¶
- metaObject(self) QMetaObject ¶
- moveToThread(self, thread: QThread)¶
- name: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- nameChanged¶
- nameReplaced¶
- objectName(self) str ¶
- objectNameChanged¶
objectNameChanged(self, objectName: str) [signal]
- output: schrodinger.models.parameters.CompoundParam¶
All
CompoundParam
instances are automatically serializable if their subparams are serializable. To serialize and deserialize, use the schrodinger json module:from schrodinger.models import json class Coord(parameters.CompoundParam): x: int y: int c1 = Coord(x=1, y=2) c1_string = json.dumps(c1) c2 = json.loads(c1_string, DataClass=Coord) assert c1 == c2
- outputChanged¶
- outputReplaced¶
- classmethod owner()¶
Get the owner of the param:
# Can be called on an abstract param: assert Coord.x.owner() == Coord # ...or on an instance of a CompoundParam a = Atom() assert a.coord.owner() == a
- classmethod ownerChain()¶
Returns a list of param owners starting from the toplevel param and ending with self. Examples:
foo.bar.atom.coord.ownerChain()
will return[foo, bar, atom, coord]
where every item is a concrete param.Foo.bar.atom.coord.x.ownerChain()
will return[Foo, Foo.bar, Foo.atom.coord, Foo.atom.coord.x]
where every item is an abstract params.
- classmethod paramName()¶
Get the name of the param:
# Can be called on an abstract param: print(Coord.x.paramName()) # 'x' # ...or on an instance of a CompoundParam a = Atom() a.coord.paramName() # 'coord'
- parent(self) QObject ¶
- postprocessors()¶
- Returns
A list of postprocessors, both decorated methods on the task and external functions that have been added via
addPostprocessor()
- Return type
list[typing.Callable]
- preprocessors()¶
- Returns
A list of preprocessors (both decorated methods on the task and external functions that have been added via addPreprocessor)
- printDebug(*args)¶
- processFuncChain(chain=None, result_callback=None)¶
Execute each function in the specified chain sequentially in order.
The result_callback is called after each function with the return value of that function. This can be used to respond to the return value (e.g. present information to the user, get user feedback, log the result, etc.)
The return value of the result_callback determines whether processing will proceeed to the next function.
- Parameters
chain (FuncChainDecorator) – which chain to process
result_callback – the callback that will get called with the result of each function in the chain
- Returns
a list of the results from the functions
- progress: int¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progressChanged¶
- progressReplaced¶
- progress_string: str¶
Base class for all Param classes. A Param is a descriptor for storing data, which means that a single Param instance will manage the data values for multiple instances of the class that owns it. Example:
class Coord(CompoundParam): x: int y: int
An instance of the Coord class can be created normally, and Params can be accessed as normal attributes:
coord = Coord() coord.x = 4
When a Param value is set, the
valueChanged
signal is emitted. Params can be serialized and deserialized to and from JSON. Params can also be nested:class Atom(CompoundParam): coord: Coord element: str
- progress_stringChanged¶
- progress_stringReplaced¶
- property(self, name: str) Any ¶
- pyqtConfigure(...)¶
Each keyword argument is either the name of a Qt property or a Qt signal. For properties the property is set to the given value which should be of an appropriate type. For signals the signal is connected to the given value which should be a callable.
- receivers(self, signal: PYQT_SIGNAL) int ¶
- removeEventFilter(self, a0: QObject)¶
- replicate()¶
Create a new task with the same input and settings (but no output)
- requestInterruption()¶
Request the task to stop.
To enable this feature, subclasses should periodically check whether an interruption has been requested and terminate if it has been. If such logic has been included,
INTERRUPT_ENABLED
should be set toTrue
.
- reset(*args, **kwargs)¶
Resets this compound param to its default value:
class Line(CompoundParam): start = Coord(x=1, y=2) end = Coord(x=4, y=5) line = Line() line.start.x = line.end.x = 10 assert line.start.x == line.end.x == 10 line.reset() assert line.start.x == 1 assert line.end.x == 4
Any number of abstract params may be passed in to perform a partial reset of only the specified params:
line.start.x = line.end.x = 10 line.reset(Line.start.x) # resets just start.x assert line.start.x == 1 assert line.end.x == 10 line.reset(Line.end) # resets the entire end point assert line.end.x == 4 line.start.y = line.end.y = 10 line.reset(Line.start.y, Line.end.y) # resets the y-coord of both assert line.start.y == 2 assert line.end.y == 5
- run()¶
- runPreprocessing(callback=None, calling_context=None)¶
Run the preprocessors one-by-one. By default, any failing preprocessor will raise a TaskFailure exception and terminate processing. This behavior may be customized by supplying a callback function which will be called after each preprocessor with the result of that preprocessor.
This method is “final” so that all preprocessing logic will be enclosed in the try/finally block.
- Parameters
callback – a function that takes result and returns a bool that indicates whether to continue on to the next preprocessor
calling_context – specify a value here to indicate the context in which this preprocessing is being called. This value will be stored in an instance variable, self.calling_context, which can be accessed from any preprocessor method on this task. Typically this value will be either self.GUI, self.CMDLINE, or None, but any value may be supplied here and checked for in the preprocessor methods. self.calling_context always reverts back to None at the end of runPreprocessing.
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setObjectName(self, name: str)¶
- classmethod setParamValue(obj, value)¶
Set the value of a param on an object by specifying the instance and the value:
# Setting the param value of a basic param a = Atom() Atom.coord.x.setParamValue(a, 5) assert a.coord.x == 5 # setParamValue can also be used to set the value of CompoundParams c = Coord() c.x = 10 atom.coord.setParamValue(a, c) assert atom.coord.x == 10
- Parameters
param – The owner param to set a subparam value of.
value – The value to set the subparam value to.
- setParent(self, a0: QObject)¶
- setProperty(self, name: str, value: Any) bool ¶
- classmethod setReference(param1, param2)¶
Call this class method from configureParam to indicate that two params should be kept in sync. The initial values will start with the default value of
param1
. Example:class Square(CompoundParam): width: float = 5 height: float = 10 @classmethod def configureParam(cls): super().configureParam() cls.setReference(cls.width, cls.height) square = Square() assert square.width == square.height == 5 # Default value of width # takes priority square.height = 7 assert square.width == square.height == 7 square.width = 6 assert square.width == square.height == 6
- Parameters
param1 – The first abstract param to keep synced
param2 – The second abstract param. After instantiation, this param will take on the value of param1.
- setValue(value=None, **kwargs)¶
Set the value of this
CompoundParam
to matchvalue
.- Parameters
value – The value to set this
CompoundParam
to. It should be the same type as thisCompoundParam
.kwargs – For internal use only.
- signalsBlocked(self) bool ¶
- skip_eq_check()¶
- specifyTaskDir(taskdir_spec)¶
Specify the taskdir creation behavior. Use one of the following options:
A directory name (string). This may be a relative or absolute path
None - no taskdir is requested. The task will use the CWD as its taskdir
AUTO_TASKDIR - a new subdirectory will be created in the CWD using the task name as the directory name.
TEMP_TASKDIR - a temporary directory will be created in the schrodinger temp dir. This directory is cleaned up when the task is deleted.
- Parameters
taskdir_spec – one of the four options listed above
- start(skip_preprocessing=False)¶
This is the main method for starting a task. Start will check if a task is not already running, run preprocessing, and then run the task.
Failures in preprocessing will interrupt the task start, and the task will never enter the RUNNING state.
- Parameters
skip_preprocessing (bool) – whether to skip preprocessing. This can be useful if preprocessing was already performed prior to calling start.
- startTimer(self, interval: int, timerType: Qt.TimerType = Qt.CoarseTimer) int ¶
- staticMetaObject = <PyQt6.QtCore.QMetaObject object>¶
- status: schrodinger.tasks.tasks.Status¶
- statusChanged¶
- statusReplaced¶
- taskDirSetting()¶
Returns the taskdir spec. See specifyTaskDir() for details.
- taskDone¶
- taskFailed¶
- taskStarted¶
- thread(self) QThread ¶
- timerEvent(self, a0: QTimerEvent)¶
- toDict()¶
Return a dictionary version of this
CompoundParam
. The returned dictionary is fully nested and contains noCompoundParam
instancesa = Atom() a_dict = a.toDict() assert a_dict['coord']['x'] == 0 assert a_dict['coord'] == {'x':0, 'y':0}
- toJson(_mark_version=True)¶
Create and returns a data structure made up of jsonable items.
- Return type
An instance of one the classes from NATIVE_JSON_DATATYPES
- toJsonImplementation()¶
Returns a JSON representation of this value object.
Warning
This should never be called directly.
- tr(sourceText: str, disambiguation: typing.Optional[str] = None, n: int = - 1) str ¶
- valueChanged¶
- wait(timeout=None)¶
Block until the task is finished executing or
timeout
seconds have passed.Warning
This should not be called directly from GUI code - see PANEL-18317. It is safe to call inside a subprocess or job. Run
git grep "task.wait("
to see safe examples annotated with “# OK”.- Parameters
timeout (NoneType or int) – Amount of time in seconds to wait before timing out. If None or a negative number, this method will wait until the task is finished.
- schrodinger.protein.predictors.predict_secondary_structure(seq, aln, mutate_in_place=True)¶
- schrodinger.protein.predictors.predict_solvent_accessibility(seq, aln, mutate_in_place=True)¶
- schrodinger.protein.predictors.predict_disordered_regions(seq, aln, mutate_in_place=True)¶
- schrodinger.protein.predictors.predict_domain_arrangement(seq, aln, mutate_in_place=True)¶
- schrodinger.protein.predictors.predict_disulfide_bond(seq, aln, mutate_in_place=True)¶
- schrodinger.protein.predictors.encode_ssa(ssa)¶