Struct mzdata::io::mzml::MzMLWriterType
source · pub struct MzMLWriterType<W: Write, C: CentroidLike + Default + BuildArrayMapFrom + 'static = CentroidPeak, D: DeconvolutedCentroidLike + Default + BuildArrayMapFrom + 'static = DeconvolutedPeak> {Show 18 fields
pub offset: usize,
pub spectrum_count: u64,
pub spectrum_counter: u64,
pub chromatogram_count: u64,
pub chromatogram_counter: u64,
pub data_array_compression: BinaryCompressionType,
pub file_description: FileDescription,
pub softwares: Vec<Software>,
pub data_processings: Vec<DataProcessing>,
pub instrument_configurations: HashMap<u32, InstrumentConfiguration>,
pub state: MzMLWriterState,
pub write_index: bool,
pub spectrum_offset_index: OffsetIndex,
pub chromatogram_offset_index: OffsetIndex,
pub tic_collector: ChromatogramCollector,
pub bic_collector: ChromatogramCollector,
pub wrote_summaries: bool,
pub run: MassSpectrometryRun,
/* private fields */
}
Expand description
An indexed mzML writer that writes MultiLayerSpectrum
.
Does not buffer spectra in-memory, writing them out immediately but summary chromatogram information is accumulated.
Fields§
§offset: usize
The current offset from the stream start
spectrum_count: u64
The total number of spectra this mzML document will contain.
This value will appear in the spectrumList
element’s count attribute
spectrum_counter: u64
The number of spectrum
elements written so far.
chromatogram_count: u64
The total number of chromatograms this mzML document will contain.
This value will appear in the chromatogramList
element’s count attribute
chromatogram_counter: u64
The number of chromatograms written so far
data_array_compression: BinaryCompressionType
The compression type to use when generating binary data arrays.
file_description: FileDescription
The file-level metadata describing the provenance of the original data
softwares: Vec<Software>
The list of software components that were used to process the data into its current state
data_processings: Vec<DataProcessing>
The types of data transformations applied to (parts of) the data
instrument_configurations: HashMap<u32, InstrumentConfiguration>
The different instrument configurations that were in use during the data acquisition.
state: MzMLWriterState
§write_index: bool
§spectrum_offset_index: OffsetIndex
§chromatogram_offset_index: OffsetIndex
§tic_collector: ChromatogramCollector
§bic_collector: ChromatogramCollector
§wrote_summaries: bool
§run: MassSpectrometryRun
Implementations§
source§impl<W: Write, C, D> MzMLWriterType<W, C, D>where
C: BuildArrayMapFrom + CentroidLike + Default,
D: BuildArrayMapFrom + DeconvolutedCentroidLike + Default,
impl<W: Write, C, D> MzMLWriterType<W, C, D>where
C: BuildArrayMapFrom + CentroidLike + Default,
D: BuildArrayMapFrom + DeconvolutedCentroidLike + Default,
pub const fn get_indent_size() -> u64
pub fn new_with_index_and_compression( file: W, write_index: bool, data_array_compression: BinaryCompressionType ) -> MzMLWriterType<W, C, D>
pub fn new_with_index(file: W, write_index: bool) -> MzMLWriterType<W, C, D>
sourcepub fn new(file: W) -> MzMLWriterType<W, C, D>
pub fn new(file: W) -> MzMLWriterType<W, C, D>
Wrap a new std::io::Write
-able type, constructing a new MzMLWriterType
sourcepub fn stream_position(&mut self) -> Result<u64>
pub fn stream_position(&mut self) -> Result<u64>
Imitate the io::Seek
method using an internal byte counter
pub fn start_spectrum_list(&mut self) -> Result<(), MzMLWriterError>
pub fn write_summary_chromatograms(&mut self) -> Result<(), MzMLWriterError>
pub fn start_chromatogram_list(&mut self) -> Result<(), MzMLWriterError>
sourcepub fn close(&mut self) -> Result<(), MzMLWriterError>
pub fn close(&mut self) -> Result<(), MzMLWriterError>
Close the wrapping <indexedmzML>
document, which will trigger writing
out the offset indices and file checksum at the tail of the document.
pub fn write_scan_list( &mut self, acq: &Acquisition ) -> Result<(), MzMLWriterError>
pub fn write_isolation_window( &mut self, iw: &IsolationWindow ) -> Result<(), MzMLWriterError>
pub fn write_selected_ions( &mut self, precursor: &Precursor ) -> Result<(), MzMLWriterError>
pub fn write_activation( &mut self, precursor: &Precursor ) -> Result<(), MzMLWriterError>
pub fn write_precursor( &mut self, precursor: &Precursor ) -> Result<(), MzMLWriterError>
pub fn write_binary_data_array_pre_encoded( &mut self, array: &DataArray, default_array_len: usize, encoded_array: &[u8] ) -> Result<(), MzMLWriterError>
pub fn write_binary_data_array( &mut self, array: &DataArray, default_array_len: usize ) -> Result<(), MzMLWriterError>
pub fn write_binary_data_arrays( &mut self, arrays: &BinaryArrayMap, default_array_len: usize ) -> Result<(), MzMLWriterError>
pub fn start_spectrum<S: SpectrumLike<C, D> + 'static>( &mut self, spectrum: &S, outer: &mut BytesStart<'_> ) -> Result<usize, MzMLWriterError>
pub fn write_spectrum_descriptors<S: SpectrumLike<C, D> + 'static>( &mut self, spectrum: &S ) -> Result<(), MzMLWriterError>
sourcepub fn write_spectrum<S: SpectrumLike<C, D> + 'static>(
&mut self,
spectrum: &S
) -> Result<(), MzMLWriterError>
pub fn write_spectrum<S: SpectrumLike<C, D> + 'static>( &mut self, spectrum: &S ) -> Result<(), MzMLWriterError>
Write a spectrum out to the mzML file, encoding the highest procressing degree peak data present.
§Side-Effects
If the writer has not already started writing the spectra, this will cause all the metadata
to be written out and the <spectrumList>
element will be opened, preventing no new metadata
from being written to this stream. Furthermore, this writes the spectrum count out, so the value
may no longer be changed.
pub fn start_chromatogram( &mut self, chromatogram: &Chromatogram, outer: &mut BytesStart<'_> ) -> Result<usize, MzMLWriterError>
pub fn write_chromatogram( &mut self, chromatogram: &Chromatogram ) -> Result<(), MzMLWriterError>
sourcepub fn spectrum_count(&self) -> &u64
pub fn spectrum_count(&self) -> &u64
Get a reference to the mzML writer’s spectrum count.
sourcepub fn set_spectrum_count(&mut self, spectrum_count: u64)
pub fn set_spectrum_count(&mut self, spectrum_count: u64)
Set the mzML writer’s spectrum count.
sourcepub fn spectrum_count_mut(&mut self) -> &mut u64
pub fn spectrum_count_mut(&mut self) -> &mut u64
Get a mutable reference to the mzML writer’s spectrum count to modify in-place.
pub fn get_mut(&mut self) -> Result<&mut W>
pub fn write_event(&mut self, event: Event<'_>) -> Result<(), MzMLWriterError>
pub fn write_param<P: ParamLike>( &mut self, param: &P ) -> Result<(), MzMLWriterError>
pub fn write_param_list<'a, P: ParamLike + 'a, T: Iterator<Item = &'a P>>( &mut self, params: T ) -> Result<(), MzMLWriterError>
pub fn get_ms_cv(&self) -> &ControlledVocabulary
Trait Implementations§
source§impl<W: Debug + Write, C: Debug + CentroidLike + Default + BuildArrayMapFrom + 'static, D: Debug + DeconvolutedCentroidLike + Default + BuildArrayMapFrom + 'static> Debug for MzMLWriterType<W, C, D>
impl<W: Debug + Write, C: Debug + CentroidLike + Default + BuildArrayMapFrom + 'static, D: Debug + DeconvolutedCentroidLike + Default + BuildArrayMapFrom + 'static> Debug for MzMLWriterType<W, C, D>
source§impl<W: Write, C: CentroidLike + Default + BuildArrayMapFrom, D: DeconvolutedCentroidLike + Default + BuildArrayMapFrom> Drop for MzMLWriterType<W, C, D>
impl<W: Write, C: CentroidLike + Default + BuildArrayMapFrom, D: DeconvolutedCentroidLike + Default + BuildArrayMapFrom> Drop for MzMLWriterType<W, C, D>
source§impl<W: Write, C: CentroidLike + Default + BuildArrayMapFrom, D: DeconvolutedCentroidLike + Default + BuildArrayMapFrom> MSDataFileMetadata for MzMLWriterType<W, C, D>
impl<W: Write, C: CentroidLike + Default + BuildArrayMapFrom, D: DeconvolutedCentroidLike + Default + BuildArrayMapFrom> MSDataFileMetadata for MzMLWriterType<W, C, D>
source§fn data_processings(&self) -> &Vec<DataProcessing>
fn data_processings(&self) -> &Vec<DataProcessing>
DataProcessing
workflows applied to spectra in
this data file.source§fn instrument_configurations(&self) -> &HashMap<u32, InstrumentConfiguration>
fn instrument_configurations(&self) -> &HashMap<u32, InstrumentConfiguration>
InstrumentConfiguration
modes that spectra
were acquired under.source§fn file_description(&self) -> &FileDescription
fn file_description(&self) -> &FileDescription
source§fn softwares(&self) -> &Vec<Software>
fn softwares(&self) -> &Vec<Software>
Software
applied to the data file to apply different
DataProcessing
methods.source§fn data_processings_mut(&mut self) -> &mut Vec<DataProcessing>
fn data_processings_mut(&mut self) -> &mut Vec<DataProcessing>
DataProcessing
list for this data filesource§fn instrument_configurations_mut(
&mut self
) -> &mut HashMap<u32, InstrumentConfiguration>
fn instrument_configurations_mut( &mut self ) -> &mut HashMap<u32, InstrumentConfiguration>
InstrumentConfiguration
mapping for this data filesource§fn file_description_mut(&mut self) -> &mut FileDescription
fn file_description_mut(&mut self) -> &mut FileDescription
FileDescription
description of the contents and the
sources for this mass spectrometry data file.source§fn softwares_mut(&mut self) -> &mut Vec<Software>
fn softwares_mut(&mut self) -> &mut Vec<Software>
Software
of this data file.source§fn copy_metadata_from(&mut self, source: &impl MSDataFileMetadata)
fn copy_metadata_from(&mut self, source: &impl MSDataFileMetadata)
MSDataFileMetadata
implementation into
this one.source§fn run_description(&self) -> Option<&MassSpectrometryRun>
fn run_description(&self) -> Option<&MassSpectrometryRun>
MassSpectrometryRun
metadata record if it is availablesource§fn run_description_mut(&mut self) -> Option<&mut MassSpectrometryRun>
fn run_description_mut(&mut self) -> Option<&mut MassSpectrometryRun>
MassSpectrometryRun
metadata record if it is availablesource§fn spectrum_count_hint(&self) -> Option<u64>
fn spectrum_count_hint(&self) -> Option<u64>
source§fn source_file_name(&self) -> Option<&str>
fn source_file_name(&self) -> Option<&str>
source§impl<W: Write, C: CentroidLike + Default + BuildArrayMapFrom, D: DeconvolutedCentroidLike + Default + BuildArrayMapFrom> SpectrumWriter<C, D> for MzMLWriterType<W, C, D>
impl<W: Write, C: CentroidLike + Default + BuildArrayMapFrom, D: DeconvolutedCentroidLike + Default + BuildArrayMapFrom> SpectrumWriter<C, D> for MzMLWriterType<W, C, D>
source§fn write<S: SpectrumLike<C, D> + 'static>(
&mut self,
spectrum: &S
) -> Result<usize>
fn write<S: SpectrumLike<C, D> + 'static>( &mut self, spectrum: &S ) -> Result<usize>
source§fn close(&mut self) -> Result<()>
fn close(&mut self) -> Result<()>
source§fn write_owned<S: SpectrumLike<C, D> + 'static>(
&mut self,
spectrum: S
) -> Result<usize>
fn write_owned<S: SpectrumLike<C, D> + 'static>( &mut self, spectrum: S ) -> Result<usize>
source§fn write_all<'b, S: SpectrumLike<C, D> + 'static, T: Iterator<Item = &'b S>>(
&mut self,
iterator: T
) -> Result<usize>
fn write_all<'b, S: SpectrumLike<C, D> + 'static, T: Iterator<Item = &'b S>>( &mut self, iterator: T ) -> Result<usize>
source§fn write_group<S: SpectrumLike<C, D> + 'static, G: SpectrumGrouping<C, D, S> + 'static>(
&mut self,
group: &G
) -> Result<usize>
fn write_group<S: SpectrumLike<C, D> + 'static, G: SpectrumGrouping<C, D, S> + 'static>( &mut self, group: &G ) -> Result<usize>
SpectrumGroup
out in ordersource§fn write_group_owned<S: SpectrumLike<C, D> + 'static, G: SpectrumGrouping<C, D, S> + 'static>(
&mut self,
group: G
) -> Result<usize>
fn write_group_owned<S: SpectrumLike<C, D> + 'static, G: SpectrumGrouping<C, D, S> + 'static>( &mut self, group: G ) -> Result<usize>
SpectrumGroup
out in order Read moresource§fn write_all_groups<'b, S: SpectrumLike<C, D> + 'static, G: SpectrumGrouping<C, D, S> + 'static, T: Iterator<Item = &'b G>>(
&mut self,
iterator: T
) -> Result<usize>
fn write_all_groups<'b, S: SpectrumLike<C, D> + 'static, G: SpectrumGrouping<C, D, S> + 'static, T: Iterator<Item = &'b G>>( &mut self, iterator: T ) -> Result<usize>
Iterator
over SpectrumGroup
referencesAuto Trait Implementations§
impl<W, C, D> Freeze for MzMLWriterType<W, C, D>where
W: Freeze,
impl<W, C, D> RefUnwindSafe for MzMLWriterType<W, C, D>
impl<W, C, D> Send for MzMLWriterType<W, C, D>
impl<W, C, D> Sync for MzMLWriterType<W, C, D>
impl<W, C, D> Unpin for MzMLWriterType<W, C, D>
impl<W, C, D> UnwindSafe for MzMLWriterType<W, C, D>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.