gsea_plotter | R Documentation |
A wrapper function to create gsea plots.
gsea_plotter(
exprs = NULL,
preranked_genes = NULL,
pos_marker = NULL,
neg_marker = NULL,
sample_id = NULL,
sample_cluster = NULL,
reference_id = NULL,
reference_cluster = NULL,
method = "s2n",
gene_set = "hallmark",
top_n = 10,
gseaParam = 1,
plot_individual = NULL,
append_title = F,
top_plots_title = T,
seed = 123,
keep_results = 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,
...
)
exprs |
A data frame containing the gene expression values, samples and cluster information (in columns) from single cells (rows). It must include lower case column name for 'sample' and 'cluster'. This can be generated from a Seurat object using 'df_extractor' function. |
preranked_genes |
A named numeric vector for ranked gene expression values. This can be obtained using 'gene_ranker' function. When this is provided, the arguments for subsetting and ranking 'exprs' data frame is ignored. The idea behind this argument is to speed up GSEA analyses on the same ranked gene expression data using different gene sets without the need to recalculate the ranking in each iteration. |
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. |
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) |
method |
Specify method to use for gene ranking. It can be one of the following: 's2n' (default), 'ttest', 'difference', 'ratio', 'welch', 'mwt', 'bws'. See PMID: 18344518 |
gene_set |
reference pathway sets. It can be one of "all", "hallmark", "go", "curated", "immune", "motif", or a named list object containing genes for specific pathways. |
top_n |
Specify how many of the top enriched pathways are shown |
gseaParam |
fgsea parameter to change bar sizes |
plot_individual |
Select pathway to plot |
append_title |
Add informative titles to individual plots |
top_plots_title |
Add informative titles to summary plots |
seed |
Random seed |
keep_results |
Logical to store results globally |
save_png |
Save resulting plot as png |
png_units |
Png size units |
png_width |
width |
png_height |
height |
append_to_filename |
Custom string to add to png file |
verbose |
Prints the analysis details |
annot_text_color |
color of NES-p val annotation text |
annot_text_size |
size of NES-pval annotation text |
annot_text_fontface |
fontface of annotation text (1,2,3,4, plain-bold-italic-bold and italic) |
... |
Additional parameters to pass into fgsea function call. This can include things like nperm (omit for the recommended 'fgseaMultilevel' call, provide a value for 'fgseaSimple' function call), minSize, maxSize etc. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.