Skip to contents

Generates boxplots of scaled feature values across data splits (X, Y, R) stratified by a grouping column, optionally for specified features.

Usage

plot_stratified_feature(
  X,
  Y,
  R,
  MX,
  MY,
  MR,
  features = NULL,
  g_col,
  id_col = NULL,
  title = NULL,
  point_size = 0.5
)

Arguments

X

A numeric matrix or data frame for the test split

Y

A numeric matrix or data frame for the inference split

R

A numeric matrix or data frame for the train split

MX

Metadata for X, containing IDs and group information

MY

Metadata for Y, containing IDs and group information

MR

Metadata for R, containing IDs and group information

features

Character vector of feature names to plot. Defaults to first 9 common features if NULL.

g_col

Column name in metadata indicating the grouping (e.g., condition)

id_col

Column name in metadata for sample identifiers (assumes rownames of matrix are ids)

title

Optional title for the plot

point_size

Numeric value controlling point/label size (currently not used in plotting directly).

Value

A ggplot2 object containing the faceted boxplot