test_gene_enrichment {tidybulk} | R Documentation |
test_gene_enrichment() takes as input a 'tbl' formatted as | <SAMPLE> | <ENSEMBL_ID> | <COUNT> | <...> | and returns a 'tbl' with the additional transcript symbol column
test_gene_enrichment( .data, .formula, .sample = NULL, .entrez, .abundance = NULL, .contrasts = NULL, method = c("camera", "roast", "safe", "gage", "padog", "globaltest", "ora"), species, cores = 10 ) ## S4 method for signature 'spec_tbl_df' test_gene_enrichment( .data, .formula, .sample = NULL, .entrez, .abundance = NULL, .contrasts = NULL, method = c("camera", "roast", "safe", "gage", "padog", "globaltest", "ora"), species, cores = 10 ) ## S4 method for signature 'tbl_df' test_gene_enrichment( .data, .formula, .sample = NULL, .entrez, .abundance = NULL, .contrasts = NULL, method = c("camera", "roast", "safe", "gage", "padog", "globaltest", "ora"), species, cores = 10 ) ## S4 method for signature 'tidybulk' test_gene_enrichment( .data, .formula, .sample = NULL, .entrez, .abundance = NULL, .contrasts = NULL, method = c("camera", "roast", "safe", "gage", "padog", "globaltest", "ora"), species, cores = 10 )
.data |
A 'tbl' formatted as | <SAMPLE> | <TRANSCRIPT> | <COUNT> | <...> | |
.formula |
A formula with no response variable, representing the desired linear model |
.sample |
The name of the sample column |
.entrez |
The ENTREZ ID of the transcripts/genes |
.abundance |
The name of the transcript/gene abundance column |
.contrasts |
= NULL, |
method |
A character vector. The methods to be included in the ensembl. Type EGSEA::egsea.base() to see the supported GSE methods. |
species |
A character. For example, human or mouse |
cores |
An integer. The number of cores available |
This wrapper execute ensemble gene enrichment analyses of the dataset using EGSEA (DOI:0.12688/f1000research.12544.1)
dge = data keep_abundant( factor_of_interest = !!as.symbol(parse_formula(.formula)[[1]]), !!.sample, !!.entrez, !!.abundance )
# Make sure transcript names are adjacent [...] as_matrix(rownames = !!.entrez) edgeR::DGEList(counts = .)
idx = buildIdx(entrezIDs = rownames(dge), species = species)
dge
# Calculate weights limma::voom(design, plot = FALSE)
# Execute EGSEA egsea( contrasts = my_contrasts, baseGSEAs = method, sort.by = "med.rank", num.threads = cores, report = FALSE )
A 'tbl' object
A 'tbl' object
A 'tbl' object
A 'tbl' object
## Not run: df_entrez = symbol_to_entrez(tidybulk::counts_mini, .transcript = transcript, .sample = sample) df_entrez = aggregate_duplicates(df_entrez, aggregation_function = sum, .sample = sample, .transcript = entrez, .abundance = count) library("EGSEA") test_gene_enrichment( df_entrez, ~ condition, .sample = sample, .entrez = entrez, .abundance = count, method = c("roast" , "safe", "gage" , "padog" , "globaltest", "ora" ), species="human", cores = 2 ) ## End(Not run)