inmoose.limma.lm_series
- inmoose.limma.lm_series(M, design=None, ndups=1, spacing=1, weights=None)
Fit linear model to microarray data by ordinary least squares
Fit a linear model genewise to expression data from a series of arrays. This function uses ordinary least squares and is a utility function for
lmFit(). Most users should not use this function directly but should uselmFit()instead.The linear model is fit for each gene by calling the function
lm_fit()orlm_wfit().- Parameters:
M (pd.DataFrame) – numeric matrix containing log-ratio or log-expression values for a series of microarrays, rows correspond to genes and columns to arrays
design – design matrix defining the linear model. The number of rows should agree with the number of columns of M. The number of columns will determine the number of coefficients estimated for each gene.
ndups (int) – number of duplicate spots. Each gene is printed
ndupstimes in adjacent spots on each arrayspacing (int) – the spacing between the rows of
Mcorresponding to duplicate spots,spacing=1for consecutive spots.weights (array_like) – an optional matrix of the same dimension as
Mcontaining weights for each spot. If it is of different dimension toM, it will be filled out to the same size.
- Returns:
an object with attributes
coefficients: matrix containing the estimated coefficients for each linear model. Same number of rows as
M, same number of columns asdesign.stdev_unscaled: matrix conformal with
coefcontaining the unscaled standard deviations for the coefficient estimators. The standard errors are given bystdev_unscaled * sigma.sigma: numeric vector containing the residual standard deviation for each gene.
df_residual: vector giving the degrees of freedom corresponding to
sigma.qr: QR-decomposition of
design
- Return type: