View source: R/plotting-functions.R
fisher_scatterplot | R Documentation |
Plots results of Fisher's exact test on gene frequency obtained via
gene_frequency_fisher()
as a scatterplot.
fisher_scatterplot(
fisher_df,
p_value_col = "Fisher_p_value_fdr",
annot_threshold = 0.05,
annot_color = "red",
gene_sym_col = "GeneName",
do_not_highlight = NULL,
keep_not_highlighted = TRUE
)
fisher_df |
Test results obtained via |
p_value_col |
Name of the column containing the p-value to consider |
annot_threshold |
Annotate with a different color if a point is below the significance threshold. Single numerical value. |
annot_color |
The color in which points below the threshold should be annotated |
gene_sym_col |
The name of the column containing the gene symbol |
do_not_highlight |
Either |
keep_not_highlighted |
If present, how should not highlighted genes
be treated? If set to |
In some cases, users might want to avoid highlighting certain genes
even if their p-value is below the threshold. To do so, use the
argument do_not_highlight
: character vectors are appropriate for specific
genes that are to be excluded, expressions or lambdas allow a finer control.
For example we can supply:
expr <- rlang::expr(!stringr::str_starts(GeneName, "MIR") & average_TxLen_1 >= 300)
with this expression, genes that have a p-value < threshold and start with
"MIR" or have an average_TxLen_1 lower than 300 are excluded from the
highlighted points.
NOTE: keep in mind that expressions are evaluated inside a dplyr::filter
context.
Similarly, lambdas are passed to the filtering function but only operate on the column containing the gene symbol.
lambda <- ~ stringr::str_starts(.x, "MIR")
A plot
Other Plotting functions:
CIS_volcano_plot()
,
HSC_population_plot()
,
circos_genomic_density()
,
integration_alluvial_plot()
,
sharing_heatmap()
,
sharing_venn()
,
top_abund_tableGrob()
,
top_cis_overtime_heatmap()
data("integration_matrices", package = "ISAnalytics")
data("association_file", package = "ISAnalytics")
aggreg <- aggregate_values_by_key(
x = integration_matrices,
association_file = association_file,
value_cols = c("seqCount", "fragmentEstimate")
)
cis <- CIS_grubbs(aggreg, by = "SubjectID")
fisher <- gene_frequency_fisher(cis$cis$PT001, cis$cis$PT002,
min_is_per_gene = 2
)
fisher_scatterplot(fisher)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.