Skip to main content

MultiLayerIonMobilityFrame

Struct MultiLayerIonMobilityFrame 

Source
pub struct MultiLayerIonMobilityFrame<C = Feature<MZ, IonMobility>, D = ChargedFeature<Mass, IonMobility>>{
    pub arrays: Option<BinaryArrayMap3D>,
    pub features: Option<FeatureMap<MZ, IonMobility, C>>,
    pub deconvoluted_features: Option<FeatureMap<Mass, IonMobility, D>>,
    pub description: IonMobilityFrameDescription,
}
Expand description

An ion mobility dimension-equivalent of MultiLayerSpectrum.

An ion mobility frame is just like a mass spectrum, except the signal is spread across multiple ion mobility “points”. This means that instead producing “points” in the mass coordinate system, this produces traces-over-time or “features”.

An ion mobility frames can usually be inter-converted with spectra.

Fields§

§arrays: Option<BinaryArrayMap3D>

The raw data arrays, split by ion mobility point

§features: Option<FeatureMap<MZ, IonMobility, C>>

The (potentially absent) m/z coordinate feature map

§deconvoluted_features: Option<FeatureMap<Mass, IonMobility, D>>

The (potentially absent) neutral mass coordinate feature map

§description: IonMobilityFrameDescription

Implementations§

Source§

impl<C, D> MultiLayerIonMobilityFrame<C, D>

Source

pub fn try_build_features( &mut self, ) -> Result<RefFeatureDataLevel<'_, C, D>, SpectrumConversionError>

Try to build extracted feature maps from the raw BinaryArrayMap3D

This fails if the BinaryArrayMap3D is not present, or if the required arrays for C and D are absent.

Source§

impl<C, D> MultiLayerIonMobilityFrame<C, D>

Source

pub fn new( arrays: Option<BinaryArrayMap3D>, features: Option<FeatureMap<MZ, IonMobility, C>>, deconvoluted_features: Option<FeatureMap<Mass, IonMobility, D>>, description: IonMobilityFrameDescription, ) -> MultiLayerIonMobilityFrame<C, D>

Create a new MultiLayerIonMobilityFrame from a IonMobilityFrameDescription and any/all/none of the different levels of processing details for signal data.

Source§

impl<C, D> MultiLayerIonMobilityFrame<C, D>

When mzsignal is available, MultiLayerIonMobilityFrame supports performing feature extraction to construct ion mobility-distributed traces in the m/z dimension similar to MultiLayerSpectrum::pick_peaks.

Source

pub fn extract_features_with<E>( &mut self, error_tolerance: Tolerance, min_length: usize, maximum_gap_size: f64, peak_picker: Option<PeakPicker>, ) -> Result<(), ArrayRetrievalError>
where E: MapState<CentroidPeak, MZ, IonMobility, FeatureType = C> + Default,

Extract features using the provided MapState type to build the C-type features directly.

If the m/z dimension is not centroided, this will pick peaks for each ion mobility slice as well.

§Arguments
  • error_tolerance: The mass accuracy error accepted in the m/z dimension between members of the same feature or trace.
  • min_length: The minimum number of time points a feature must contain to be kept in the solution.
  • maximum_gap_size: The maximum time period between m/z observations to tolerate within a feature.
  • peak_picker: A configured PeakPicker instance to use to centroid profile m/z spectra. If not provided, the default configuration will be used.
§Type Arguments

If the m/z dimension is not centroided, this will pick peaks for each ion mobility slice as well.

§Note

This requires directly specifying the extraction type to use which opens up a wide range of customization options. For the simple cases and for convenience, see MultiLayerIonMobilityFrame::extract_features_simple.

Source§

impl<D> MultiLayerIonMobilityFrame<Feature<MZ, IonMobility>, D>

A simplified API for feature extraction is available for the basic Feature type where the default MapState type is known.

Source

pub fn extract_features_simple( &mut self, error_tolerance: Tolerance, min_length: usize, maximum_gap_size: f64, peak_picker: Option<PeakPicker>, ) -> Result<(), ArrayRetrievalError>

Extract features using the default algorithm.

§Arguments
  • error_tolerance: The mass accuracy error accepted in the m/z dimension between members of the same feature or trace.
  • min_length: The minimum number of time points a feature must contain to be kept in the solution.
  • maximum_gap_size: The maximum time period between m/z observations to tolerate within a feature.
  • peak_picker: A configured PeakPicker instance to use to centroid profile m/z spectra. If not provided, the default configuration will be used.

If the m/z dimension is not centroided, this will pick peaks for each ion mobility slice as well.

Trait Implementations§

Source§

impl<C, D> Clone for MultiLayerIonMobilityFrame<C, D>

Source§

fn clone(&self) -> MultiLayerIonMobilityFrame<C, D>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C, D> Debug for MultiLayerIonMobilityFrame<C, D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<C, D> Default for MultiLayerIonMobilityFrame<C, D>

Source§

fn default() -> MultiLayerIonMobilityFrame<C, D>

Returns the “default value” for a type. Read more
Source§

impl<'de, C, D> Deserialize<'de> for MultiLayerIonMobilityFrame<C, D>

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<MultiLayerIonMobilityFrame<C, D>, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<C, D> IonMobilityFrameLike<C, D> for MultiLayerIonMobilityFrame<C, D>

Source§

fn description(&self) -> &IonMobilityFrameDescription

The method to access the spectrum description itself, which supplies the data for most other methods on this trait.
Source§

fn description_mut(&mut self) -> &mut IonMobilityFrameDescription

The method to access the spectrum descript itself, mutably.
Source§

fn raw_arrays(&self) -> Option<&BinaryArrayMap3D>

Obtain a reference to the BinaryArrayMap3D if one is available for the feature information. This may not be the most refined version of the feature signal if it has been processed further.
Source§

fn features(&self) -> RefFeatureDataLevel<'_, C, D>

Retrieve the most processed representation of the ion mobility frame’s signal
Source§

fn into_features_and_parts( self, ) -> (FeatureDataLevel<C, D>, IonMobilityFrameDescription)

Consume the ion mobility frame, decomposing it into the IonMobilityFrameDescription and an owning FeatureDataLevel. Read more
Source§

fn ion_mobility_unit(&self) -> Unit

The unit of measure of the ion mobility dimension
Source§

fn ion_mobility_unit_mut(&mut self) -> &mut Unit

Get a mutable reference to the ion mobility dimension’s unit
Source§

fn acquisition(&self) -> &Acquisition

Access the acquisition information for this frame.
Source§

fn precursor(&self) -> Option<&Precursor>

Access the precursor information, if it exists.
Source§

fn precursor_iter(&self) -> impl Iterator<Item = &Precursor> + ExactSizeIterator

Iterate over all precursors of the frame
Source§

fn precursor_count(&self) -> usize

The number of precursor levels recorded
Source§

fn precursor_mut(&mut self) -> Option<&mut Precursor>

Mutably access the precursor information, if it exists
Source§

fn precursor_iter_mut( &mut self, ) -> impl Iterator<Item = &mut Precursor> + ExactSizeIterator

Iterate over all precursors of the frame mutably
Source§

fn add_precursor(&mut self, precursor: Precursor)

Add a precursor to the list of precursors for this frame. Read more
Source§

fn remove_precursor(&mut self, index: usize) -> Precursor

Remove the precursor entry at index in the precursor list. Read more
Source§

fn start_time(&self) -> f64

A shortcut method to retrieve the scan start time of a spectrum
Source§

fn ms_level(&self) -> u8

Access the MS exponentiation level
Source§

fn id(&self) -> &str

Access the native ID string for the spectrum
Source§

fn index(&self) -> usize

Access the index of the spectrum in the source file
Source§

fn signal_continuity(&self) -> SignalContinuity

Access a description of how raw the signal is, whether a profile spectrum is available or only centroids are present. Read more
Source§

fn polarity(&self) -> ScanPolarity

Access a description of the spectrum polarity
Source§

impl<C, D> ParamDescribed for MultiLayerIonMobilityFrame<C, D>

Source§

fn params(&self) -> &[Param]

Obtain an immutable slice over the encapsulated Param list
Source§

fn params_mut(&mut self) -> &mut Vec<Param>

Obtain an mutable slice over the encapsulated Param list
Source§

fn add_param(&mut self, param: Param)

Add a new Param to the entity
Source§

fn extend_params(&mut self, it: impl IntoIterator<Item = Param>)

Add all parameters from an iterator of Param to the entity
Source§

fn remove_param(&mut self, index: usize) -> Param

Remove the ith Param from the entity.
Source§

fn get_param_by_name(&self, name: &str) -> Option<&Param>

Find the first Param whose name matches name
Source§

fn get_param_by_curie(&self, curie: &CURIE) -> Option<&Param>

Find the first Param whose CURIE matches curie
Source§

fn get_param_by_accession(&self, accession: &str) -> Option<&Param>

Find the first Param whose Param::accession matches accession Read more
Source§

fn iter_params(&self) -> Iter<'_, Param> ⓘ

Iterate over the encapsulated parameter list
Source§

fn iter_params_mut(&mut self) -> IterMut<'_, Param> ⓘ

Iterate mutably over the encapsulated parameter list
Source§

impl<C, D> Serialize for MultiLayerIonMobilityFrame<C, D>

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<C, D> TryFrom<MultiLayerIonMobilityFrame<C, D>> for RawSpectrum

A MultiLayerIonMobilityFrame can be converted to RawSpectrum by flattening the feature data into a BinaryArrayMap.

Source§

type Error = ArrayRetrievalError

The type returned in the event of a conversion error.
Source§

fn try_from( value: MultiLayerIonMobilityFrame<C, D>, ) -> Result<RawSpectrum, <RawSpectrum as TryFrom<MultiLayerIonMobilityFrame<C, D>>>::Error>

Performs the conversion.
Source§

impl<CFeat, DFeat, CPeak, DPeak> TryFrom<MultiLayerIonMobilityFrame<CFeat, DFeat>> for MultiLayerSpectrum<CPeak, DPeak>

A MultiLayerIonMobilityFrame can be converted to MultiLayerSpectrum by flattening the feature data into a BinaryArrayMap.

Source§

type Error = ArrayRetrievalError

The type returned in the event of a conversion error.
Source§

fn try_from( value: MultiLayerIonMobilityFrame<CFeat, DFeat>, ) -> Result<MultiLayerSpectrum<CPeak, DPeak>, <MultiLayerSpectrum<CPeak, DPeak> as TryFrom<MultiLayerIonMobilityFrame<CFeat, DFeat>>>::Error>

Performs the conversion.
Source§

impl<CFeat, DFeat, CPeak, DPeak> TryFrom<MultiLayerSpectrum<CPeak, DPeak>> for MultiLayerIonMobilityFrame<CFeat, DFeat>

§Errors

This will fail if BinaryArrayMap3D::stack fails

Source§

type Error = ArrayRetrievalError

The type returned in the event of a conversion error.
Source§

fn try_from( value: MultiLayerSpectrum<CPeak, DPeak>, ) -> Result<MultiLayerIonMobilityFrame<CFeat, DFeat>, <MultiLayerIonMobilityFrame<CFeat, DFeat> as TryFrom<MultiLayerSpectrum<CPeak, DPeak>>>::Error>

Performs the conversion.
Source§

impl<CFeat, DFeat> TryFrom<RawSpectrum> for MultiLayerIonMobilityFrame<CFeat, DFeat>

RawSpectrum instances can be converted to MultiLayerIonMobilityFrame by using BinaryArrayMap3D::stack on the flat RawSpectrum::arrays.

§Errors

This will fail if BinaryArrayMap3D::stack fails

Source§

type Error = ArrayRetrievalError

The type returned in the event of a conversion error.
Source§

fn try_from( value: RawSpectrum, ) -> Result<MultiLayerIonMobilityFrame<CFeat, DFeat>, <MultiLayerIonMobilityFrame<CFeat, DFeat> as TryFrom<RawSpectrum>>::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more