R/PLOT-disc_heatmap.R
plot_disc_heatmap.RdThis 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
)A ggplot object.
This function is robust to an empty tibble_disc because it uses
disc_obj$mat_counts (generated by the discriminant pipeline).