plot_corr_heatmap: Plot a heatmap with all correlations (many vs many) between...

plot_corr_heatmapR Documentation

Plot a heatmap with all correlations (many vs many) between an AS event PSI and a set of genes.

Description

The order of the genes in the lower triangle heatmap are defined as the input order of gene_ids.

Usage

plot_corr_heatmap(
  inclusion_tbl,
  vst_id,
  quality_thrshld,
  vst_expression_tbl,
  min_mean_count = 1,
  gene_ids,
  map_ID_2_names = TRUE,
  species,
  event_position = "first",
  corr_method = c("spearman", "pearson", "kendall"),
  return_data = FALSE,
  verbose,
  ...
)

Arguments

inclusion_tbl

path to vast-tools inclusion table that contains a vst_id event.

vst_id

vast-tools alternative splicing event to grep in the inclusion_tbl.

quality_thrshld

vast-tools event quantification quality score threshold. Must be one of "N", "VLOW", "LOW", "OK", "SOK". For more info read the official documentation here under "Column 8, score 1".

vst_expression_tbl

Path to a vast-tools expression table (either cRPKM or TPM).

min_mean_count

Filter out low expressed genes in the table read from inclusion_tbl. Defines the minimum row mean expression value across all samples that a gene must have to be selected.

gene_ids

Character vector containing valid ENSEMBL gene IDs to be used for calculating the correlations.

map_ID_2_names

Logical. Whether or not to map the ENSEMBL gene IDs to gene names. Can be used only if num_genes is specified and the table contains ENSEMBL gene ID (check automatically). Default TRUE.

species

Species character to use to map the ENSEMBL gene ID. Used by gimme_mart() to built a bioMaRt object. Default is guessed from vst_id.

event_position

Where the place the vst_id in the heatmap. Either first for placing it as a first plotted element, or middle to plot it in the middle.

corr_method

Either spearman, pearson, or kendall passed to the function cor().

return_data

Logical. Return the heatmap or the dataframe. Default is FALSE returning the heatmap.

verbose
...

Value

A ggplot2 plot or a tibble.

Examples

# Create a gene ID mapping object.
ensembl <- gimme_mart()

# Map SRSF1-12 gene names to ENSEMBL GENE IDs.
SRSF_IDs <- gene_name_2_ensembl_id(gene_name = paste0("SRSF", 1:12))

# Plot the correlations between all SRSFs genes expressions and one AS event
plot_corr_heatmap(inclusion_tbl = psi_path, vst_id = "HsaEX0000001",
                  quality_thrshld = "VLOW",
                  vst_expression_tbl = expr_path,
                  corr_method = "spearman", use = "complete.obs",
                  gene_ids = SRSF_IDs, verbose = F,
                  event_position = "middle")

Ni-Ar/niar documentation built on Feb. 3, 2025, 9:25 a.m.