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§
Provided Methods§
sourcefn estimate_mgf_size(&self, _: MgfKind) -> usize
fn estimate_mgf_size(&self, _: MgfKind) -> usize
Estimate the size of the resulting MGF output to avoid reallocations.
sourcefn to_mgf_string(&self, kind: MgfKind) -> Result<String, Box<dyn StdError>>
fn to_mgf_string(&self, kind: MgfKind) -> Result<String, Box<dyn StdError>>
Export model to MGF string.
sourcefn to_mgf_file<P: AsRef<Path>>(
&self,
path: P,
kind: MgfKind
) -> Result<(), Box<dyn StdError>>
fn to_mgf_file<P: AsRef<Path>>(
&self,
path: P,
kind: MgfKind
) -> Result<(), Box<dyn StdError>>
Export model to MGF output file.