ols.eblup.trim: The main function for the FastMix pipeline.

Description Usage Arguments Value Author(s) Examples

View source: R/FastMix.r View source: R/FastMix.R

Description

A new analytic pipeline, dubbed as FastMix, that combines the deconvolution step with the downstream analyses based on linear mixed effects regression (LMER) model and a moment-matching algorithm.

Usage

1
ols.eblup.trim (Des, Y, random = "all", independent = TRUE, trim = 0.5, robust = FALSE, trim.fix = FALSE)

Arguments

Des

the design matrix ordered by gene subject by subject. First column should be identification variable, e.g., ID or subject, and the rest columns are covariates.

Y

vectorized gene expression data.

random

'random' is an index vector that specifies which variable(s) requires random effects – by default, all covariates are paired with a random effect.

independent

specify the correlation structure among random effects. If TRUE, random effects are assumed to be independent.

trim

the trimming percentage when accounting for outliers. Default valie is 0.5 (50%).

test

the test method for DEGs. "1" is Gaussian mixture model, "2" is Anderson-darling normal test. Default valie is "1".

robust

Specifies whether robust covariance estimation is implemented and which method to use: "FALSE" for non-robust estimation; "mcd" for the MCD algorithm of Rousseeuw and Van Driessen; "weighted" for the Reweighted MCD; "donostah" for the Donoho-Stahel projection based estimator; "pairwiseQC" for the orthogonalized quadrant correlation pairwise estimator. All these algorithms come from the R package 'robust'. "FastMix" is the proposed trimming method.

trim.fix

Whether only consider trimmed subjects in fix effect estiamtion. The default value is FALSE.

Value

fixed.results

the estimated fix effects and their p-values. They are overall effects shared by all genes.

beta.mat

individual coefficient estimation.

Yhat

fitted response.

sigma.beta

the covariance estimation of fixed effect.

VC

variance component estimation. The first column is the one for common random error. The second column is the one for random effects.

eta

the chi sqiare type statsitics used for p-value calculation.

re.pvalue

the overall p-value for detecting outliers in random effects.

re.ind.pvalue

the individual p-value for outlier detection for each random effect.

out_idx

he potential covariates with outliers when robust = "FastMix. It is NULL when robust != "FastMix"

Author(s)

Hao Sun

Examples

1
2
3
4
5
6
7
8
9
## load the data example and transform the data
gnames <- rownames(GeneExp); m <- nrow(GeneExp)
if (is.null(gnames)) {
  rownames(GeneExp) <- gnames <- paste0("Gene", 1:m)
}
Data2 <- DataPrep(GeneExp, CellProp, Demo)

## fit the model
mod <- ols.eblup.trim(Des=Data2$X, Y=Data2$Y, random="all", robust = "FastMix")

terrysun0302/FastMix documentation built on Feb. 4, 2019, 12:15 p.m.