This heatmap summarizes, for each group level (e.g., Depth), the percentage of MAGs where each discriminant feature is present (presence defined as Abundance > 0).

plot_disc_heatmap(
  disc_obj,
  metadata,
  group_col,
  feature_col = "KO",
  top_n = 40
)

Arguments

disc_obj

Object stored as attr(, "rbims_disc") from get_subset_discriminant().

metadata

Metadata table with columns Bin_name and group_col.

group_col

Grouping variable in metadata (e.g. "Depth").

feature_col

...

top_n

Number of top features to display (ranked by consensus score).

Value

A ggplot object.

Details

This function is robust to an empty tibble_disc because it uses disc_obj$mat_counts (generated by the discriminant pipeline).