Skip to main content

FeatureMatrix

Struct FeatureMatrix 

Source
pub struct FeatureMatrix {
    pub run_names: Vec<String>,
    pub features: Vec<Feature>,
    pub matrix_evidence: Option<Vec<[f32; 9]>>,
    pub joint_evidence: Option<Vec<Vec<Observation>>>,
    pub joint_cell_evidence: Option<Vec<[f32; 12]>>,
}
Expand description

A single-run or aligned multi-run feature set.

Fields§

§run_names: Vec<String>

Run intensity column names in vector order.

§features: Vec<Feature>§matrix_evidence: Option<Vec<[f32; 9]>>

Optional LFQ evidence, one vector per retained consensus feature. Absent for ordinary matrices and single-run inputs: their classifier vectors keep the exact original dimensions and column order.

§joint_evidence: Option<Vec<Vec<Observation>>>

Original, aligned observations per consensus row for one joint search. Quantitative cells remain on features; observations never duplicate them.

§joint_cell_evidence: Option<Vec<[f32; 12]>>

Extraction summaries per joint row, independent of candidate identity.

Implementations§

Source§

impl FeatureMatrix

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn n_samples(&self) -> usize

Number of runs; 1 for single-run input.

Source

pub fn load(features_path: impl AsRef<Path>) -> Result<Self>

Load a single-run biosaur2 feature file (*.features.tsv).

Source

pub fn load_matrix(path: impl AsRef<Path>, min_runs: u32) -> Result<Self>

Load a koth-aligned consensus matrix (intensity_matrix.tsv): one row per consensus feature, with the leading columns massCalib, mz, charge, rtApex, im, combined_score, seed_run, n_contributing_runs followed by one intensity column per run. Unlike single-run input, each feature carries the FULL per-run intensity vector (intensities) — that’s what the multi-sample quant rollup consumes, and the ID featurizer already reads n_detected (runs with signal) and sum_int from it. The per-feature single-run quality columns (cosine/isotope/ppm/nScans) are absent here and read as None (inert in the featurizer); combined_score and n_contributing_runs survive alignment and are used.

min_runs drops consensus features detected in fewer than that many runs. This filter is REQUIRED for aligned-matrix search, not cosmetic: alignment discards the per-feature nIsotopes column that uno’s single-run path uses to reject junk, so without a reproducibility floor the random-match background p climbs to ~0.83 and the binomial finds nothing. A real peptide is detected across replicates; single-run features are dominated by noise. min_runs = 2 is a safe floor (won’t drop a condition-specific peptide that has ≥2 replicates).

Trait Implementations§

Source§

impl Clone for FeatureMatrix

Source§

fn clone(&self) -> Self

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 Debug for FeatureMatrix

Source§

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

Formats the value using the given formatter. Read more

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> 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> 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> 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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V