Instrument Configuration¶
mzmlpy.elems.instrument_config.InstrumentConfiguration
dataclass
¶
Bases: _ParamGroup
Complete description of a mass spectrometer hardware configuration.
Includes source, analyzer, and detector components.
id
property
¶
Get the instrument configuration's id attribute.
Raises:
| Type | Description |
|---|---|
ValueError
|
If the |
software_ref
property
¶
Get the referenced software's id, if a software reference is present.
source_components
property
¶
source_components: tuple[SourceComponent, ...]
Get the ion source components of this instrument configuration.
analyzer_components
property
¶
analyzer_components: tuple[AnalyzerComponent, ...]
Get the mass analyzer components of this instrument configuration.
detector_components
property
¶
detector_components: tuple[DetectorComponent, ...]
Get the detector components of this instrument configuration.
cv_params
cached
property
¶
cv_params: tuple[CvParam, ...]
The element's cvParams, in document order.
user_params
cached
property
¶
user_params: tuple[UserParam, ...]
The element's userParams, in document order.
ref_params
cached
property
¶
ref_params: tuple[ReferenceableParamGroupRef, ...]
The element's referenceableParamGroupRefs, in document order.
serialize
¶
Return the element as nested dicts: tag, attributes, text, children.
The result is a fresh copy; changing it does not change the wrapped element.
Source code in src/mzmlpy/elems/dtree_wrapper.py
get_attribute
¶
get_cv_param
¶
get_cv_param(id: str) -> CvParam | None
Get a cvParam by accession or name, or None if absent.
has_cv_param
¶
Check if a cvParam with the given accession or name exists.
cv_float
¶
Return a cvParam's value as a float, or None if the term is absent or has no value.
Raises MzmlError naming the term and its bad value if the value is present but not numeric — more actionable than a bare "could not convert string to float".
Source code in src/mzmlpy/elems/dtree_wrapper.py
cv_int
¶
Return a cvParam's value as an int, or None if absent or valueless (see :meth:cv_float).
Source code in src/mzmlpy/elems/dtree_wrapper.py
has_user_param
¶
get_ref_param
¶
get_ref_param(
ref: str,
) -> ReferenceableParamGroupRef | None
Get a referenceable parameter by ref.
has_ref_param
¶
SourceComponent¶
mzmlpy.elems.instrument_config.SourceComponent
dataclass
¶
Bases: _Component
Ion source component of an instrument configuration (e.g. ESI, MALDI).
cv_params
cached
property
¶
cv_params: tuple[CvParam, ...]
The element's cvParams, in document order.
user_params
cached
property
¶
user_params: tuple[UserParam, ...]
The element's userParams, in document order.
ref_params
cached
property
¶
ref_params: tuple[ReferenceableParamGroupRef, ...]
The element's referenceableParamGroupRefs, in document order.
order
property
¶
Get the component's position in the acquisition order, if present.
serialize
¶
Return the element as nested dicts: tag, attributes, text, children.
The result is a fresh copy; changing it does not change the wrapped element.
Source code in src/mzmlpy/elems/dtree_wrapper.py
get_attribute
¶
get_cv_param
¶
get_cv_param(id: str) -> CvParam | None
Get a cvParam by accession or name, or None if absent.
has_cv_param
¶
Check if a cvParam with the given accession or name exists.
cv_float
¶
Return a cvParam's value as a float, or None if the term is absent or has no value.
Raises MzmlError naming the term and its bad value if the value is present but not numeric — more actionable than a bare "could not convert string to float".
Source code in src/mzmlpy/elems/dtree_wrapper.py
cv_int
¶
Return a cvParam's value as an int, or None if absent or valueless (see :meth:cv_float).
Source code in src/mzmlpy/elems/dtree_wrapper.py
has_user_param
¶
get_ref_param
¶
get_ref_param(
ref: str,
) -> ReferenceableParamGroupRef | None
Get a referenceable parameter by ref.
has_ref_param
¶
AnalyzerComponent¶
mzmlpy.elems.instrument_config.AnalyzerComponent
dataclass
¶
Bases: _Component
Mass analyzer component of an instrument configuration (e.g. quadrupole, Orbitrap).
cv_params
cached
property
¶
cv_params: tuple[CvParam, ...]
The element's cvParams, in document order.
user_params
cached
property
¶
user_params: tuple[UserParam, ...]
The element's userParams, in document order.
ref_params
cached
property
¶
ref_params: tuple[ReferenceableParamGroupRef, ...]
The element's referenceableParamGroupRefs, in document order.
order
property
¶
Get the component's position in the acquisition order, if present.
serialize
¶
Return the element as nested dicts: tag, attributes, text, children.
The result is a fresh copy; changing it does not change the wrapped element.
Source code in src/mzmlpy/elems/dtree_wrapper.py
get_attribute
¶
get_cv_param
¶
get_cv_param(id: str) -> CvParam | None
Get a cvParam by accession or name, or None if absent.
has_cv_param
¶
Check if a cvParam with the given accession or name exists.
cv_float
¶
Return a cvParam's value as a float, or None if the term is absent or has no value.
Raises MzmlError naming the term and its bad value if the value is present but not numeric — more actionable than a bare "could not convert string to float".
Source code in src/mzmlpy/elems/dtree_wrapper.py
cv_int
¶
Return a cvParam's value as an int, or None if absent or valueless (see :meth:cv_float).
Source code in src/mzmlpy/elems/dtree_wrapper.py
has_user_param
¶
get_ref_param
¶
get_ref_param(
ref: str,
) -> ReferenceableParamGroupRef | None
Get a referenceable parameter by ref.
has_ref_param
¶
DetectorComponent¶
mzmlpy.elems.instrument_config.DetectorComponent
dataclass
¶
Bases: _Component
Detector component of an instrument configuration (e.g. electron multiplier, focal plane array).
cv_params
cached
property
¶
cv_params: tuple[CvParam, ...]
The element's cvParams, in document order.
user_params
cached
property
¶
user_params: tuple[UserParam, ...]
The element's userParams, in document order.
ref_params
cached
property
¶
ref_params: tuple[ReferenceableParamGroupRef, ...]
The element's referenceableParamGroupRefs, in document order.
order
property
¶
Get the component's position in the acquisition order, if present.
serialize
¶
Return the element as nested dicts: tag, attributes, text, children.
The result is a fresh copy; changing it does not change the wrapped element.
Source code in src/mzmlpy/elems/dtree_wrapper.py
get_attribute
¶
get_cv_param
¶
get_cv_param(id: str) -> CvParam | None
Get a cvParam by accession or name, or None if absent.
has_cv_param
¶
Check if a cvParam with the given accession or name exists.
cv_float
¶
Return a cvParam's value as a float, or None if the term is absent or has no value.
Raises MzmlError naming the term and its bad value if the value is present but not numeric — more actionable than a bare "could not convert string to float".
Source code in src/mzmlpy/elems/dtree_wrapper.py
cv_int
¶
Return a cvParam's value as an int, or None if absent or valueless (see :meth:cv_float).
Source code in src/mzmlpy/elems/dtree_wrapper.py
has_user_param
¶
get_ref_param
¶
get_ref_param(
ref: str,
) -> ReferenceableParamGroupRef | None
Get a referenceable parameter by ref.