xmipp3.base module
- class xmipp3.base.HelicalFinder[source]
Bases:
object
Base class for protocols that find helical symmetry
- runCoarseSearch(fnVol, dihedral, heightFraction, z0, zF, zStep, rot0, rotF, rotStep, Nthr, fnOut, cylinderInnerRadius, cylinderOuterRadius, height, Ts, Cn='c1')[source]
- class xmipp3.base.XmippProtocol[source]
Bases:
object
This class groups some common functionalities that share some Xmipp protocols, like converting steps.
- convertInputToXmipp(inputName, xmippClass, resultFn)[source]
This step can be used whenever a conversion is needed. It will receive the inputName and get this attribute from self, invoke the convert function and check the result files if conversion was done (otherwise the input was already in Xmipp format).
- classmethod getCondaEnv(**kwargs)[source]
Returns the environ corresponding to the condaEnv of the protocol. kwargs can contain:
‘env’: Any environ (the xmipp one is the default)
‘_conda_env’: An installed condaEnv name
> _conda_env preference: kwargs > protocol default > general default
- getConvertedInput(inputName)[source]
Retrieve the converted input, it can be the case that it is the same as input, when not conversion was done.
- classmethod getModel(*modelPath, **kwargs)[source]
- Returns the path to the models folder followed by
the given relative path.
…/xmipp/models/myModel/myFile.h5 <= getModel(‘myModel’, ‘myFile.h5’)
- NOTE: it raise and exception when model not found, set doRaise=False
in the arguments to skip that raise, especially in validation asserions!
- validateDLtoolkit(errors=None, **kwargs)[source]
Validates if the deepLearningToolkit is installed. Additionally, it assert if a certain models is present when kwargs are present, following:
- _conda_env: The conda env to be load
(default: the protocol._conda_env or CONDA_DEFAULT_ENVIRON)
assertModel: if models should be evaluated or not (default: True).
errorMsg: a custom message error (default: ‘’).
model: a certain model name/route/list (default: no model assert) + model=’myModel’: asserts if myModel exists + model=(‘myModel’, ‘myFile.h5’): asserts is myModel/myFile.h5 exists + model=[‘myModel1’, ‘myModel2’, (‘myModel3’, ‘myFile3.h5’)]: a combination
- usage (3 examples):
- errors = validateDLtoolkit(errors, doAssert=self.useModel.get(),
model=”myModel”)
errors = validateDLtoolkit(model=(“myModel2”, “myFile.h5”))
- errors = validateDLtoolkit(doAssert=self.mode.get()==PREDICT,
model=(“myModel3”, “subFolder”, “model.h5”), errorMsg=”myModel3 is required for the “
“prediction mode”)
- class xmipp3.base.XmippSet(itemClass)[source]
Bases:
object
Support class to store sets in Xmipp base on a MetaData.
Create new set, base on a Metadata. itemClass: Class that represent the items. A method .getFileName should be available to store the md. Items contained in XmippSet are supposed to inherit from Row.
- append(item)[source]
Add a new item to the set, the item can be of a base class (EM) and will be try to convert it to the respective _itemClass.
- xmipp3.base.findRow(md, label, value)[source]
Query the metadata for a row with label=value. Params:
md: metadata to query. label: label to check value value: value for equal condition
- Returns:
Row object of the row found. None if no row is found with label=value
- xmipp3.base.getMdFirstRow(filename)[source]
Create a MetaData but only read the first row. This method should be used for validations of labels or metadata size, but the full metadata is not needed.