xEnrichBarplot | R Documentation |
xEnrichBarplot
is supposed to visualise enrichment results using
a barplot. It returns an object of class "ggplot".
xEnrichBarplot(eTerm, top_num = 10, displayBy = c("fc", "adjp", "fdr", "zscore", "pvalue"), FDR.cutoff = 0.05, bar.label = TRUE, bar.label.size = 3, wrap.width = NULL)
eTerm |
an object of class "eTerm" |
top_num |
the number of the top terms (sorted according to FDR or adjusted p-values). If it is 'auto', only the significant terms (see below FDR.cutoff) will be displayed |
displayBy |
which statistics will be used for displaying. It can be "fc" for enrichment fold change (by default), "adjp" or "fdr" for adjusted p value (or FDR), "pvalue" for p value, "zscore" for enrichment z-score |
FDR.cutoff |
FDR cutoff used to declare the significant terms. By default, it is set to 0.05. This option only works when setting top_num (see above) is 'auto' |
bar.label |
logical to indicate whether to label each bar with FDR. By default, it sets to true for bar labelling |
bar.label.size |
an integer specifying the bar labelling text size. By default, it sets to 3 |
wrap.width |
a positive integer specifying wrap width of name |
an object of class "ggplot"
none
xEnricherGenes
, xEnricherSNPs
,
xEnrichViewer
## Not run: # Load the library library(XGR) RData.location="~/Sites/SVN/github/bigdata" # 1) load eQTL mapping results: cis-eQTLs significantly induced by IFN cis <- xRDataLoader(RData.customised='JKscience_TS2A', RData.location=RData.location) ind <- which(cis$IFN_t > 0 & cis$IFN_fdr < 0.05) df_cis <- cis[ind, c('variant','Symbol','IFN_t','IFN_fdr')] data <- df_cis$variant # 2) Enrichment analysis using Experimental Factor Ontology (EFO) # Considering LD SNPs and respecting ontology tree eTerm <- xEnricherSNPs(data, ontology="EF", include.LD="EUR", LD.r2=0.8, ontology.algorithm="lea", RData.location=RData.location) # 3) Barplot of enrichment results bp <- xEnrichBarplot(eTerm, top_num="auto", displayBy="fc") #pdf(file="enrichment_barplot.pdf", height=6, width=12, compress=TRUE) print(bp) #dev.off() ## modify y axis text bp + theme(axis.text.y=element_text(size=10,color="blue")) ## modify x axis title bp + theme(axis.title.x=element_text(color="blue")) ## End(Not run)