show gene or cell distribution after filtering on expression threshold

filterDistributions(
  gobject,
  feat_type = NULL,
  spat_unit = NULL,
  expression_values = c("raw", "normalized", "scaled", "custom"),
  method = c("threshold", "sum", "mean"),
  expression_threshold = 1,
  detection = c("feats", "cells"),
  plot_type = c("histogram", "violin"),
  scale_y = NULL,
  nr_bins = 30,
  fill_color = "lightblue",
  scale_axis = "identity",
  axis_offset = 0,
  show_plot = NULL,
  return_plot = NULL,
  save_plot = NULL,
  save_param = list(),
  default_save_name = "filterDistributions"
)

Arguments

gobject

giotto object

feat_type

feature type

spat_unit

spatial unit

expression_values

expression values to use

method

method to create distribution (see details)

expression_threshold

threshold to consider a gene expressed

detection

consider features (e.g. genes) or cells

plot_type

type of plot

scale_y

scale y-axis (e.g. "log"), NULL = no scaling

nr_bins

number of bins for histogram plot

fill_color

fill color for plots

scale_axis

ggplot transformation for axis (e.g. log2)

axis_offset

offset to be used together with the scaling transformation

show_plot

logical. show plot

return_plot

logical. return ggplot object

save_plot

logical. directly save the plot

save_param

list of saving parameters from GiottoVisuals::all_plots_save_function

default_save_name

default save name for saving, don't change, change save_name in save_param

Value

ggplot object

Details

There are 3 ways to create a distribution profile and summarize it for either the features or the cells (spatial units)

  • 1. threshold: calculate features that cross a thresold (default)

  • 2. sum: summarize the features, i.e. total of a feature

  • 3. mean: calculate mean of the features, i.e. average expression

Examples

g <- GiottoData::loadGiottoMini("visium")
#> 1. read Giotto object
#> 2. read Giotto feature information
#> 3. read Giotto spatial information
#> 3.1 read Giotto spatial shape information
#> cell_spatInfo_spatVector.shp
#> cell
#> 
#> 3.2 read Giotto spatial centroid information
#> cell
#> 
#> 3.3 read Giotto spatial overlap information
#> No overlaps were found, overlap loading will be
#>  skipped
#> 
#> 4. read Giotto image information
#> a giotto python environment was found
#> Using python path:
#>  "/Users/yuanlab/Library/r-miniconda/envs/giotto_env/bin/pythonw"

filterDistributions(g)