View source: R/mult_lm_count_mat.R
mult_lm_count_mat | R Documentation |
Calculated associtation gene counts matrix with the pehonotype where each of gene counts on multiple traits
mult_lm_count_mat(
count_matrix,
pheno,
covariates_string,
traits,
gene_IDs = NULL,
log_transform = "log_replace_half_min"
)
count_matrix |
A matrix of gene counts (possibly transformed). rows are genes, columns are individuals |
pheno |
A data frame of phenotype data, includes the trait and covariates. |
covariates_string |
A character string with specifying the covariates, include "as.factor" statements. example: covariates_string = "age + as.factor(sex)" |
traits |
Characters, the name of the exposure variables. The traits should columns in pheno. |
gene_IDs |
A vector of selection of gene IDs, NULL if all genes are tested |
log_transform |
One of the transformations log_replace_half_min, log_add_min, log_add_0.5, or NULL (default) |
Linear regression results as a data frame with columns geneID, adjLogFC.Trait.1,adjLogFC.Trait.2 ,se,chisq_stat,chisq_stat_df,p_value(join p-value),fdr_bh
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"
mult_lm_count_mat(count_matrix=rnaseq_count_matrix,pheno = phenotype,traits = traits,
covariates_string=covars)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.