plot_loadings_coordinatesV2: Plot Loadings Coordinates with Genomic Information

View source: R/Visualizations_SDA.R

plot_loadings_coordinatesV2R Documentation

Plot Loadings Coordinates with Genomic Information

Description

Generates a genomic coordinate plot of SDA component loadings. The function retrieves gene location data via biomaRt or uses a local file if provided and available, merges this with the loadings, and annotates the top positive and negative loading genes. Optionally, specific genes can be highlighted.

Usage

plot_loadings_coordinatesV2(
  SDARedDataLS,
  reduction,
  mart = NULL,
  genes = NULL,
  dimN,
  highlight_genes = NULL,
  TopNpos = 10,
  TopNneg = 10,
  data_set = "hsapiens_gene_ensembl",
  invertWeights = FALSE,
  includeUnMapped = TRUE,
  geneLocPath = NULL
)

Arguments

SDARedDataLS

A list containing SDA loadings.

reduction

Character or numeric value specifying which reduction to use from the loadings list.

mart

An optional biomaRt object; if NULL, it is initialized using useMart with data_set.

genes

An optional data frame of gene coordinates. If NULL, coordinates are retrieved via biomaRt.

dimN

Numeric value indicating the component (dimension) index to plot.

highlight_genes

Optional character vector of gene symbols to highlight in the plot.

TopNpos

Integer specifying the number of top positive loadings to annotate.

TopNneg

Integer specifying the number of top negative loadings to annotate.

data_set

Character string indicating the Ensembl dataset to use (e.g., "hsapiens_gene_ensembl").

invertWeights

Logical. If TRUE, inverts the loading weights.

includeUnMapped

Logical. If TRUE, includes unmapped genes in the plot.

geneLocPath

Optional character string specifying the file path for pre-saved gene location data.

Value

A ggplot2 object representing the genomic coordinate plot of loadings.


eisascience/scCustFx documentation built on June 2, 2025, 3:59 a.m.