limma_gls: fit a linear model to microarray data by generalized least...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/limma.R

Description

fit a linear model genewise to expression data from a series of microarrays, the fit is by generalized least squares method allowing for correlation between duplicate spots or related arrays, this function is a modified version of gls.series() from the limma package, it additionally returns effects and residuals from the fitted models in order to be used by limmaDE() to calculate genewise sums of squares, mean squares, degree of freedom, F-statistics and F p-values for the main effects of each linear model, this is a utility function for limma_fit()

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
limma_gls(
  M,
  design = NULL,
  ndups = 2,
  spacing = 1,
  block = NULL,
  correlation = NULL,
  weights = NULL,
  ...
)

Arguments

M

numeric matrix containing log-ratio or log-expression values for a series of microarrays, rows correspond to genes and columns to arrays

design

numeric design matrix defining the linear model, with rows corresponding to arrays and columns to comparisons to be estimated. The number of rows must match the number of columns of M. Defaults to the unit vector meaning that the arrays are treated as replicates

ndups

positive integer giving the number of times each gene is printed on an array. nrow(M) must be divisible by ndups. Ignored if block is not NULL

spacing

the spacing between the rows of M corresponding to duplicate spots, spacing=1 for consecutive spots. Ignored if block is not NULL

block

vector or factor specifying a blocking variable on the arrays. Same length as ncol(M)

correlation

numeric value specifying the inter-duplicate or inter-block correlation

weights

an optional numeric matrix of the same dimension as M containing weights for each spot. If it is of different dimension to M, it will be filled out to the same size

...

other optional arguments to be passed to dupcor.series()

Details

this is a utility function used by the higher level function limmaDE(), therefore most users should not use this function directly but should use limmaDE() instead, this function is for fitting gene-wise linear models when some of the expression values are correlated, the correlated groups may arise from replicate spots on the same array (duplicate spots) or from a biological or technical replicate grouping of the arrays, note that the correlation is assumed to be constant across genes. If correlation=NULL then a call is made to duplicateCorrelation() to estimate the correlation

Value

a list with components

coefficients numeric matrix containing the estimated coefficients for each linear model (same number of rows as M, same number of columns as design)
stdev.unscaled numeric matrix conformal with coef containing the unscaled standard deviations for the coefficient estimators, the standard errors are given by stdev.unscaled*sigma
sigma numeric vector containing the residual standard deviation for each gene
df.residual numeric vector giving the degrees of freedom corresponding to sigma
correlation inter-duplicate or inter-block correlation
qr QR decomposition of the generalized linear squares problem, i.e. the decomposition of design standardized by the Choleski-root of the correlation matrix defined by correlation
effects numeric matrix containing the estimated effects for each linear model (same number of rows and columns as M)
residuals numeric matrix containing the estimated residuals for each linear model (same number of rows and columns as M)

Author(s)

gerardo esteban antonicelli

See Also

'check_contrasts' 'omega_factorial'

Examples

1
data(gogglesData)

geantonicelli/GLM documentation built on Dec. 15, 2020, 3:05 p.m.