View source: R/mult_lm_count_mat.R
lm_mult_count_mat_emp_pval | R Documentation |
The function is to calculate DEG (Differential Expression Genes) analysis for multiple exposure using residual permuation approach to calculate empirical p-value
lm_mult_count_mat_emp_pval(
count_matrix,
pheno,
traits,
covariates_string,
n_permute = 100,
gene_IDs = NULL,
seed = NULL,
log_transform = "log_replace_half_min",
outcome_type = "continuous"
)
count_matrix |
A matrix of gene counts (possibly transformed). rows are genes, columns are individuals |
pheno |
A data frame phenotype data, includes the trait and covariates. |
traits |
Characters, the name of the exposure variable. The traits should be a column in pheno. |
covariates_string |
A character string with specifying the covariats, include "as.factor" statements. example: covariate_string = "age+as.factor(sex)" |
n_permute |
number of computing residual permutation. Default is 100 times |
gene_IDs |
: vector of selection of geneID, NULL if all genes are tested |
seed |
Random seed |
log_transform |
One of the transformations log_replace_half_min, log_add_min, log_add_0.5, or NULL (default) |
outcome_type |
continuous and binary.Default is continuous |
Linear regression results as a data frame with columns geneID, adjLogFC.Trait1,adjLogFC.Trait2 ,se, chisq_stat,chisq_stat_df(degree of freedom),p_value(join p-value),emp_pvals,bh_emp_pvals
set.seed(123)
library(dplyr)
data(phenotype)
data(rnaseq_count_matrix)
rnaseq_count_matrix<- rnaseq_count_matrix[rowSums(rnaseq_count_matrix)>0,]
traits<-c("Trait.1","Trait.2")
covars<- "Age+Sex"
lm_mult_count_mat_emp_pval(count_matrix=rnaseq_count_matrix, pheno=phenotype, traits=traits, covariates_string=covars,
outcome_type="continuous")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.