This function is run, if the enrichment pipeline wants to be called afterwards. Setting reference genome to the same genome which cinaR was run should be given to this function!
Usage
run_enrichment(
results,
geneset = NULL,
experiment.type = "ATAC-Seq",
reference.genome = NULL,
enrichment.method = NULL,
enrichment.FDR.cutoff = 1,
background.genes.size = 20000,
verbose = TRUE
)Arguments
- results
list, DA peaks list for different contrasts
- geneset
Pathways to be used in enrichment analyses. If not set vp2008 (Chaussabel, 2008) immune modules will be used. This can be set to any geneset using `read.gmt` function from `qusage` package. Different modules are available: https://www.gsea-msigdb.org/gsea/downloads.jsp.
- experiment.type
The type of experiment either set to "ATAC-Seq" or "RNA-Seq"
- reference.genome
genome of interested species. It should be 'hg38', 'hg19' or 'mm10'.
- enrichment.method
There are two methodologies for enrichment analyses, Hyper-geometric p-value (HPEA) or Geneset Enrichment Analyses (GSEA).
- enrichment.FDR.cutoff
FDR cut-off for enriched terms, p-values are corrected by Benjamini-Hochberg procedure
- background.genes.size
number of background genes for hyper-geometric p-value calculations. Default is 20,000.
- verbose
prints messages through running the pipeline
Examples
# \donttest{
library(cinaR)
data(atac_seq_consensus_bm) # calls 'bed'
# a vector for comparing the examples
contrasts <- sapply(strsplit(colnames(bed), split = "-", fixed = TRUE),
function(x){x[1]})[4:25]
results <- cinaR(bed, contrasts, reference.genome = "mm10", run.enrichment = FALSE)
#> >> Experiment type: ATAC-Seq
#> >> Matrix is filtered!
#> Package "ChIPseeker" needed for this function to work. Please install it.
#> Error in abs(cp.filtered.annotated$distanceToTSS): non-numeric argument to mathematical function
results_with_enrichment <- run_enrichment(results, reference.genome = "mm10")
#> Error: object 'results' not found
# }