pub enum ComplexPeptide {
    Singular(LinearPeptide),
    Multimeric(Vec<LinearPeptide>),
}
Expand description

A single pro forma entry, can contain multiple peptides

Variants§

§

Singular(LinearPeptide)

A single linear peptide

§

Multimeric(Vec<LinearPeptide>)

A multimeric spectrum, multiple peptides coexist in a single spectrum indicated with ‘+’ in pro forma

Implementations§

source§

impl ComplexPeptide

source

pub fn pro_forma(value: &str) -> Result<Self, CustomError>

Pro Forma specification Only supports a subset of the specification (see proforma_grammar.md for an overview of what is supported), some functions are not possible to be represented.

Errors

It fails when the string is not a valid Pro Forma string, with a minimal error message to help debug the cause.

source

pub fn sloppy_pro_forma( line: &str, location: Range<usize> ) -> Result<LinearPeptide, CustomError>

Read sloppy pro forma like sequences. Defined by the use of square or round braces to indicate modifications and missing any particular method of defining the N or C terminal modifications. Additionally any underscores will be ignored both on the ends and inside the sequence.

All modifications follow the same definitions as the strict pro forma syntax.

Errors

If it does not fit the above description.

source

pub fn assume_linear(self) -> LinearPeptide

Assume there is exactly one peptide in this collection

Panics

If there are no or multiple peptides.

source

pub fn peptides(&self) -> &[LinearPeptide]

Get all peptides making up this ComplexPeptide, regardless of its type

source

pub fn generate_theoretical_fragments( &self, max_charge: Charge, model: &Model ) -> Option<Vec<Fragment>>

Generate the theoretical fragments for this peptide collection.

Trait Implementations§

source§

impl Clone for ComplexPeptide

source§

fn clone(&self) -> ComplexPeptide

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for ComplexPeptide

source§

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

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

impl Display for ComplexPeptide

source§

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

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

impl PartialEq for ComplexPeptide

source§

fn eq(&self, other: &ComplexPeptide) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for ComplexPeptide

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<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

§

type Output = T

Should always be Self
§

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

§

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

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

fn is_in_subset(&self) -> bool

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

fn to_subset_unchecked(&self) -> SS

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

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,

§

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,