gsea_replot | R Documentation |
# This is a function to speed up GSEA plotting in batch execution. A global gsea_res object will be created by using gsea_plotter function. This script is an excerpt from gsea_plotter function to recycle results file to create graphs quickly. Only the graphing engine is used from gsea_plotter function preventing recalculation of the results.
gsea_replot(
res = NULL,
pos_marker = NULL,
neg_marker = NULL,
sample_id = NULL,
sample_cluster = NULL,
reference_id = NULL,
reference_cluster = NULL,
gene_set = "hallmark",
gseaParam = 1,
plot_individual = NULL,
append_title = T,
top_plots_title = T,
save_png = F,
png_units = "in",
png_width = 4,
png_height = 3,
append_to_filename = "",
verbose = T,
annot_text_color = "black",
annot_text_size = 4,
annot_text_fontface = 2
)
res |
Previously calculated gsea results (global object created with 'gsea_plotter()' works) |
pos_marker |
A character vector of gene names to positively gate cells (cells expressing these genes will be included in sample and reference) |
neg_marker |
A character vector of gene names to negatively gate cells (cells expressing these genes will be excluded from sample and reference ) |
sample_id |
String. Name of the samples to use for the ranking. As the genes will be ranked from sample to reference in decreasing order, samples will be on the left side of enrichment plots. Regex based string matching can be applied including logic operations such as '|'. Data for this parameter should match to entries under 'sample' column from the 'expr' data frame. Make sure you escape special characters such as parantheses and periods. |
sample_cluster |
Which clusters to include in the analysis. Data for this parameter should match to entried under 'cluster' column from 'expr' data frame. |
reference_id |
Same as 'sample_id', but for reference (right side of the enrichment plots i.e. tail end of the ranking) |
reference_cluster |
Same as sample_cluster but for reference (right side of the enrichment plots) |
gene_set |
A geneset (list object) by which gsea is calculated. Can be one of 'hallmark'go', 'curated', 'immune', 'motif', 'all'. Or the user can provide a list object containing reference genesets. |
gseaParam |
fgsea parameter for changing the bar size in top-plots |
plot_individual |
String to plot enrichment results for a desired pathway. Must be an exact match to gene list |
append_title |
Add informative titles to the enrichment plot |
top_plots_title |
Add informative titles to summary enrichment plots |
save_png |
Export image as png |
png_units |
Png size units. Defults to 'in' |
png_width |
Png width. Defaults to 4 |
png_height |
Png height. Defaults to 3 |
append_to_filename |
Add custom string to png file |
verbose |
Logical. Tells you what's going on |
annot_text_color |
Color of the NES-p val annotations on graph. You can use ‘adjustcolor(’red', alpha.f = 0)' to hide annotation text (by making it transparent) |
annot_text_size |
Size of the NES-p val annotations on graph |
annot_text_font |
Fontface of the annotation text (1,2,3,4, plain-bold-italic-bold and italic) |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.