pub struct ArrayWeightParams {
pub method: ArrayWeightMethod,
pub prior_n: f64,
pub max_iter: usize,
pub tol: f64,
pub var_design: Option<Vec<f64>>,
pub n_var_coef: usize,
}Expand description
Knobs for array_weights.
Fields§
§method: ArrayWeightMethodWhich sweep to run. See ArrayWeightMethod.
prior_n: f64Prior number of genes pulling the weights towards one.
Enters as a ridge prior_n * Z2' Z2 on the information and, for the REML
sweep, a matching prior_n * (w - 1) on the score. limma’s default is 10.
max_iter: usizeIteration budget for the REML sweep. Ignored by the gene-by-gene sweep.
tol: f64Convergence tolerance for the REML sweep, on the score-step product
scaled by the number of variance coefficients and effective gene count.
limma’s default is 1e-5.
var_design: Option<Vec<f64>>Variance design, row-major n_samples * n_var_coef.
None uses contr.sum(n_samples): one free weight per sample, logs
summing to zero. A coarser basis, such as group indicators, pools samples.
n_var_coef: usizeNumber of columns in var_design. Ignored when var_design is None.
Implementations§
Source§impl ArrayWeightParams
impl ArrayWeightParams
Sourcepub fn new(
method: ArrayWeightMethod,
prior_n: f64,
max_iter: usize,
tol: f64,
var_design: Option<Vec<f64>>,
n_var_coef: usize,
) -> Self
pub fn new( method: ArrayWeightMethod, prior_n: f64, max_iter: usize, tol: f64, var_design: Option<Vec<f64>>, n_var_coef: usize, ) -> Self
Builds a parameter set.
§Params
method- Which sweep to runprior_n- Prior gene count shrinking the weights towards one, limma’s 10max_iter- REML iteration budget, limma’s 50tol- REML convergence tolerance, limma’s 1e-5var_design- Optional variance design, row-majorn_samples * n_var_coefn_var_coef- Number of columns invar_design
§Returns
The parameters. Validation happens in array_weights, which knows the
sample count these have to agree with.
Trait Implementations§
Source§impl Clone for ArrayWeightParams
impl Clone for ArrayWeightParams
Source§impl Debug for ArrayWeightParams
impl Debug for ArrayWeightParams
Source§impl Default for ArrayWeightParams
impl Default for ArrayWeightParams
Source§fn default() -> Self
fn default() -> Self
limma’s defaults, with the method fixed at ArrayWeightMethod::Reml.
limma’s method = "auto" resolves to "reml" for a complete, unweighted
matrix and "genebygene" otherwise. There is no Auto variant, so the
default matches a bare arrayWeights(y, design); pass
ArrayWeightMethod::GeneByGene for weights or missing values.
Auto Trait Implementations§
impl Freeze for ArrayWeightParams
impl RefUnwindSafe for ArrayWeightParams
impl Send for ArrayWeightParams
impl Sync for ArrayWeightParams
impl Unpin for ArrayWeightParams
impl UnsafeUnpin for ArrayWeightParams
impl UnwindSafe for ArrayWeightParams
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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.