Instrument Configuration
mzmlpy.elems.instrument_config.InstrumentConfiguration
dataclass
InstrumentConfiguration(element: ElementTree.Element)
Bases: _ParamGroup
Complete description of a mass spectrometer hardware configuration.
Includes source, analyzer, and detector components.
id
property
id: str
Get the instrument configuration's id attribute.
Raises:
| Type | Description |
|---|---|
ValueError
|
If the |
software_ref
property
software_ref: str | None
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.
ns
cached
property
ns: str
Get XML namespace from the element tag.
accessions
cached
property
accessions: set[str]
Get a set of all accession numbers from the cvParams.
names
cached
property
names: set[str]
Get a set of all names from the cvParams.
ref_params
property
ref_params: list[ReferenceableParamGroupRef]
Get a list of all referenceable parameters from the XML element.
serialize
serialize() -> dict
return the full element content
Source code in src/mzmlpy/elems/dtree_wrapper.py
63 64 65 66 67 68 69 70 | |
get_attribute
get_attribute(attr_name: str) -> str | None
Get an attribute value from the element.
Source code in src/mzmlpy/elems/dtree_wrapper.py
72 73 74 | |
get_cvparm
get_cvparm(id: str) -> CvParam | None
Get a cvParam by accession or name.
Source code in src/mzmlpy/elems/dtree_wrapper.py
100 101 102 103 104 105 | |
has_cvparm
has_cvparm(id: str) -> bool
Check if a cvParam with the given accession or name exists.
Source code in src/mzmlpy/elems/dtree_wrapper.py
107 108 109 | |
cv_float
cv_float(id: str) -> float | None
Return a cvParam's value as a float, or None if the term is absent or has no value.
Raises ValueError 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
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
cv_int
cv_int(id: str) -> int | None
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
127 128 129 130 131 132 133 134 135 136 137 | |
get_user_param
get_user_param(name: str) -> UserParam | None
Get a userParam by name.
Source code in src/mzmlpy/elems/dtree_wrapper.py
167 168 169 170 171 172 | |
has_user_param
has_user_param(name: str) -> bool
Check if a userParam with the given name exists.
Source code in src/mzmlpy/elems/dtree_wrapper.py
174 175 176 | |
get_ref_param
get_ref_param(
ref: str,
) -> ReferenceableParamGroupRef | None
Get a referenceable parameter by ref.
Source code in src/mzmlpy/elems/dtree_wrapper.py
187 188 189 190 191 192 | |
has_ref_param
has_ref_param(ref: str) -> bool
Check if a referenceable parameter with the given ref exists.
Source code in src/mzmlpy/elems/dtree_wrapper.py
194 195 196 | |
SourceComponent
mzmlpy.elems.instrument_config.SourceComponent
dataclass
SourceComponent(element: ElementTree.Element)
Bases: _Component
Ion source component of an instrument configuration (e.g. ESI, MALDI).
ns
cached
property
ns: str
Get XML namespace from the element tag.
accessions
cached
property
accessions: set[str]
Get a set of all accession numbers from the cvParams.
names
cached
property
names: set[str]
Get a set of all names from the cvParams.
ref_params
property
ref_params: list[ReferenceableParamGroupRef]
Get a list of all referenceable parameters from the XML element.
order
property
order: int | None
Get the component's position in the acquisition order, if present.
serialize
serialize() -> dict
return the full element content
Source code in src/mzmlpy/elems/dtree_wrapper.py
63 64 65 66 67 68 69 70 | |
get_attribute
get_attribute(attr_name: str) -> str | None
Get an attribute value from the element.
Source code in src/mzmlpy/elems/dtree_wrapper.py
72 73 74 | |
get_cvparm
get_cvparm(id: str) -> CvParam | None
Get a cvParam by accession or name.
Source code in src/mzmlpy/elems/dtree_wrapper.py
100 101 102 103 104 105 | |
has_cvparm
has_cvparm(id: str) -> bool
Check if a cvParam with the given accession or name exists.
Source code in src/mzmlpy/elems/dtree_wrapper.py
107 108 109 | |
cv_float
cv_float(id: str) -> float | None
Return a cvParam's value as a float, or None if the term is absent or has no value.
Raises ValueError 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
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
cv_int
cv_int(id: str) -> int | None
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
127 128 129 130 131 132 133 134 135 136 137 | |
get_user_param
get_user_param(name: str) -> UserParam | None
Get a userParam by name.
Source code in src/mzmlpy/elems/dtree_wrapper.py
167 168 169 170 171 172 | |
has_user_param
has_user_param(name: str) -> bool
Check if a userParam with the given name exists.
Source code in src/mzmlpy/elems/dtree_wrapper.py
174 175 176 | |
get_ref_param
get_ref_param(
ref: str,
) -> ReferenceableParamGroupRef | None
Get a referenceable parameter by ref.
Source code in src/mzmlpy/elems/dtree_wrapper.py
187 188 189 190 191 192 | |
has_ref_param
has_ref_param(ref: str) -> bool
Check if a referenceable parameter with the given ref exists.
Source code in src/mzmlpy/elems/dtree_wrapper.py
194 195 196 | |
AnalyzerComponent
mzmlpy.elems.instrument_config.AnalyzerComponent
dataclass
AnalyzerComponent(element: ElementTree.Element)
Bases: _Component
Mass analyzer component of an instrument configuration (e.g. quadrupole, Orbitrap).
ns
cached
property
ns: str
Get XML namespace from the element tag.
accessions
cached
property
accessions: set[str]
Get a set of all accession numbers from the cvParams.
names
cached
property
names: set[str]
Get a set of all names from the cvParams.
ref_params
property
ref_params: list[ReferenceableParamGroupRef]
Get a list of all referenceable parameters from the XML element.
order
property
order: int | None
Get the component's position in the acquisition order, if present.
serialize
serialize() -> dict
return the full element content
Source code in src/mzmlpy/elems/dtree_wrapper.py
63 64 65 66 67 68 69 70 | |
get_attribute
get_attribute(attr_name: str) -> str | None
Get an attribute value from the element.
Source code in src/mzmlpy/elems/dtree_wrapper.py
72 73 74 | |
get_cvparm
get_cvparm(id: str) -> CvParam | None
Get a cvParam by accession or name.
Source code in src/mzmlpy/elems/dtree_wrapper.py
100 101 102 103 104 105 | |
has_cvparm
has_cvparm(id: str) -> bool
Check if a cvParam with the given accession or name exists.
Source code in src/mzmlpy/elems/dtree_wrapper.py
107 108 109 | |
cv_float
cv_float(id: str) -> float | None
Return a cvParam's value as a float, or None if the term is absent or has no value.
Raises ValueError 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
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
cv_int
cv_int(id: str) -> int | None
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
127 128 129 130 131 132 133 134 135 136 137 | |
get_user_param
get_user_param(name: str) -> UserParam | None
Get a userParam by name.
Source code in src/mzmlpy/elems/dtree_wrapper.py
167 168 169 170 171 172 | |
has_user_param
has_user_param(name: str) -> bool
Check if a userParam with the given name exists.
Source code in src/mzmlpy/elems/dtree_wrapper.py
174 175 176 | |
get_ref_param
get_ref_param(
ref: str,
) -> ReferenceableParamGroupRef | None
Get a referenceable parameter by ref.
Source code in src/mzmlpy/elems/dtree_wrapper.py
187 188 189 190 191 192 | |
has_ref_param
has_ref_param(ref: str) -> bool
Check if a referenceable parameter with the given ref exists.
Source code in src/mzmlpy/elems/dtree_wrapper.py
194 195 196 | |
DetectorComponent
mzmlpy.elems.instrument_config.DetectorComponent
dataclass
DetectorComponent(element: ElementTree.Element)
Bases: _Component
Detector component of an instrument configuration (e.g. electron multiplier, focal plane array).
ns
cached
property
ns: str
Get XML namespace from the element tag.
accessions
cached
property
accessions: set[str]
Get a set of all accession numbers from the cvParams.
names
cached
property
names: set[str]
Get a set of all names from the cvParams.
ref_params
property
ref_params: list[ReferenceableParamGroupRef]
Get a list of all referenceable parameters from the XML element.
order
property
order: int | None
Get the component's position in the acquisition order, if present.
serialize
serialize() -> dict
return the full element content
Source code in src/mzmlpy/elems/dtree_wrapper.py
63 64 65 66 67 68 69 70 | |
get_attribute
get_attribute(attr_name: str) -> str | None
Get an attribute value from the element.
Source code in src/mzmlpy/elems/dtree_wrapper.py
72 73 74 | |
get_cvparm
get_cvparm(id: str) -> CvParam | None
Get a cvParam by accession or name.
Source code in src/mzmlpy/elems/dtree_wrapper.py
100 101 102 103 104 105 | |
has_cvparm
has_cvparm(id: str) -> bool
Check if a cvParam with the given accession or name exists.
Source code in src/mzmlpy/elems/dtree_wrapper.py
107 108 109 | |
cv_float
cv_float(id: str) -> float | None
Return a cvParam's value as a float, or None if the term is absent or has no value.
Raises ValueError 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
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
cv_int
cv_int(id: str) -> int | None
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
127 128 129 130 131 132 133 134 135 136 137 | |
get_user_param
get_user_param(name: str) -> UserParam | None
Get a userParam by name.
Source code in src/mzmlpy/elems/dtree_wrapper.py
167 168 169 170 171 172 | |
has_user_param
has_user_param(name: str) -> bool
Check if a userParam with the given name exists.
Source code in src/mzmlpy/elems/dtree_wrapper.py
174 175 176 | |
get_ref_param
get_ref_param(
ref: str,
) -> ReferenceableParamGroupRef | None
Get a referenceable parameter by ref.
Source code in src/mzmlpy/elems/dtree_wrapper.py
187 188 189 190 191 192 | |
has_ref_param
has_ref_param(ref: str) -> bool
Check if a referenceable parameter with the given ref exists.
Source code in src/mzmlpy/elems/dtree_wrapper.py
194 195 196 | |