GrScoreHistogram: Histogram Visualization of Granule Scores with Threshold

View source: R/gruffi.R

GrScoreHistogramR Documentation

Histogram Visualization of Granule Scores with Threshold

Description

Plots a histogram of granule scores from a specified column within a Seurat object, with a vertical line denoting a threshold. The function allows for an optional inversion of filtering logic based on the miscname and auto parameters.

Usage

GrScoreHistogram(
  obj = combined.obj,
  colname = i1,
  miscname = "thresh.stress.ident1",
  per_granule = TRUE,
  auto = TRUE,
  show.q90 = TRUE,
  w = 8,
  h = 5,
  ...
)

Arguments

obj

A Seurat object containing metadata with granule scores and miscellaneous information. Defaults to combined.obj.

colname

The name of the column within obj@meta.data containing granule scores. Typically something like is 'RNA_snn_res.6.reassigned_cl.av_GO:0042063'.

miscname

The key within obj@misc$gruffi for retrieving the threshold value. Default is 'thresh.stress.ident1'.

per_granule

Show granule- or cell count on the Y axis? Default is granules (TRUE).

auto

A logical flag indicating whether to automatically invert the filtering logic for a specific miscname condition. Default is TRUE.

show.q90

Show 90th quantile of the distribution

...

Additional parameters to be passed to ggExpress::qhistogram.

Details

The function first verifies the structure and content of the provided obj, ensuring it contains the necessary components for threshold retrieval and score extraction. The histogram is plotted using ggExpress::qhistogram, with customization options available through additional arguments. The auto parameter's effect is noted, particularly for the thresh.notstress.ident3 condition, although it primarily impacts plotting logic interpretation.

Value

The function directly calls ggExpress::qhistogram for plotting, hence does not return a value but generates a histogram plot as a side effect.

Examples

GrScoreHistogram(
  obj = combined.obj,
  colname = "RNA_snn_res.6.reassigned_cl.av_GO:0042063",
  miscname = "thresh.stress.ident1"
)

jn-goe/gruffi documentation built on Nov. 7, 2024, 10:38 p.m.