View source: R/permutation_lm_count_mat.R
lm_count_mat_permute | R Documentation |
Calculated associtation single gene count with multiple residual permutation as outcome
lm_count_mat_permute(
residual_permutation,
covariates_string,
pheno,
single_transcript
)
residual_permutation |
Matrix of residual of permuation |
covariates_string |
A character string with specifying the covariats, include "as.factor" statements. example: covariate_string = "age,as.factor(sex)" |
pheno |
Phenotype data, includes the trait and covariates. |
single_transcript |
A vector of single transcript |
Linear regression results of single gene permutation a data frame with columns permute(number of permute), beta,se,t_stat (t-statistic),p_value (permutation)
data(phenotype)
data(rnaseq_count_matrix)
rnaseq_count_matrix<- rnaseq_count_matrix[rowSums(rnaseq_count_matrix)>0,]
data("ENSG00000000003")
covariates_string<-"Age+Sex"
trait<-"Trait.1"
n_permute<- 100
permuted_trait<- sapply(seq_len(n_permute), function(x){
permute_resids_trait(pheno = phenotype,
trait = trait,
covariates_string = covariates_string)})
lm_count_mat_permute(residual_permutation=permuted_trait ,covariates_string=covariates_string,
pheno=phenotype ,single_transcript= ENSG00000000003)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.