Trait bdb::traits::Mgf

source ·
pub trait Mgf: Sized {
    fn to_mgf<T: Write>(
        &self,
        writer: &mut T,
        kind: MgfKind
    ) -> Result<(), Box<dyn StdError>>; fn from_mgf<T: BufRead>(
        reader: &mut T,
        kind: MgfKind
    ) -> Result<Self, Box<dyn StdError>>; fn estimate_mgf_size(&self, _: MgfKind) -> usize { ... } fn to_mgf_string(&self, kind: MgfKind) -> Result<String, Box<dyn StdError>> { ... } fn to_mgf_file<P: AsRef<Path>>(
        &self,
        path: P,
        kind: MgfKind
    ) -> Result<(), Box<dyn StdError>> { ... } fn from_mgf_string(
        text: &str,
        kind: MgfKind
    ) -> Result<Self, Box<dyn StdError>> { ... } fn from_mgf_file<P: AsRef<Path>>(
        path: P,
        kind: MgfKind
    ) -> Result<Self, Box<dyn StdError>> { ... } }
Expand description

Serialize to and from MGF.

MGF, or Mascot General Format, is generic format with a start and end scan delimiter, along with metadata along 1 or multiple header lines, followed by individual scans (usually with tab-delimited data). There are many MGF flavors, however, a sample (MSConvert) format is shown below.

Serialized Format

BEGIN IONS
TITLE=Sample.33450.33450.4 File:"Sample.raw", NativeID:"controllerType=0 controllerNumber=1 scan=33450"
RTINSECONDS=8692.657303
PEPMASS=775.15625 170643.953125
CHARGE=4+
205.9304178 0.0
205.9320046 0.0
205.9335913 0.0
205.9351781 0.0
END IONS

Required Methods§

Export model to MGF.

Note that many small writers are made to the writer, so the writer should be buffered.

Import model from MGF.

Provided Methods§

Estimate the size of the resulting MGF output to avoid reallocations.

Export model to MGF string.

Export model to MGF output file.

Import model from MGF string.

Import model from MGF file.

Implementors§