pub fn array_weights_gene_by_gene(
exprs: &Array2<f64>,
design: &Array2<f64>,
weights: Option<&Array2<f64>>,
var_design: Option<&Array2<f64>>,
prior_n: f64,
) -> Array1<f64>Expand description
Estimate array quality weights by the gene-by-gene update algorithm
(.arrayWeightsGeneByGene).
A single forward pass over genes, each performing one Newton step of the
log-linear array-variance model log(sigma_array^2) = Z2 gamma, with array
weights w = exp(-Z2 gamma). This is the path limma’s arrayWeights takes
for method = "genebygene" (and for method = "auto" when observation
weights or missing values are present), and the estimator used inside
voomWithQualityWeights.
exprs—ngenes x narraysexpression matrix (NaNmarks missing observations, which are dropped per gene as inlm.wfit).design—narrays x pdesign matrix (assumed full column rank).weights— optionalngenes x narraysobservation weights, multiplied into the running array weights per gene.var_design— optionalnarrays x ngamvariance designZ2; defaults tocontr.sum(narrays).prior_n— prior support pulling weights toward 1 (limma default10).
Returns a length-narrays vector of array weights.