plot_gam() plots gam model fit for multiple features (genes) and archetypes

plot_gam(gam_deriv = NULL, gam_fit, data, feature = NULL,
  archetype = NULL, groupCovs = NULL, title_size = 10,
  point_size = 1, point_alpha = 0.1, point_position = c("identity",
  "jitter"), rug_size = 1, rug_alpha = 0.1,
  title = "GAM model: gene expression = function(distance from archetype)")

Arguments

gam_deriv

object with multiple gam fits (many arhetypes, many features). Either gam_deriv or gam_fit must be provided.

gam_fit

a fitted gam object as produced by gam().

data

data.table dim(examples, dimensions) that includes distance of each example to archetype in columns given by arc_col and feature values given by feature. Must be provided.

feature

character vector, which features (e.g. genes) to plot?

archetype

character vector, which archetypes to plot?

groupCovs

argument for plotGAM

title_size

size of individial plot titles and axis titles

point_position

point position option, a way to add jitter but "identity" by default

title

main title for all features and archetypes

point_size/rug_size/point_alpha/rug_alpha

size and alpha controls for points and geom_rug.

Value

plot_gam() list (S3 object, plot_gam) containing data.table-s for each predictor in gam model

Details

Plotting of multiple gam fits is inspired by https://stackoverflow.com/questions/49471300/gam-plots-with-ggplot