R/mc_plot_by_factor.r
mcell_mc_plot_by_factor.Rd
plot a heatmap of number of cells per metacell and metadata factor (e.g. patient, condition, sample etc.)
mcell_mc_plot_by_factor(
mc_id,
meta_field,
mat_id = mc_id,
fig_fn = NULL,
meta_field_annotate_by = NULL,
meta_field_min_count = 0,
norm_by_factor = T,
hclust_mcs = F,
ord_mcs = NULL,
filter_values = NULL,
hclust_values = T,
custom_made_fields = NULL
)
id of metacell object ina scdb
metdata column name used to break down cells on metacells
matrix object to us (default is the mc_id - assuming they use the same ID), if some cells in the mc object are missing from the matrix, the function will generate an error
file name for the figure. Color bars are generated in separate files with names starting with fig_fn. If null figures will be created under <mc_id>.mc_comp_by_<meta_field> directory, with name composed of the plotting parameters.
metadata column names describing the meta_field (should be a one-to-one match between each meta_field_value and the values in these columns). Expecting a yaml parameter named mcp_metadata_annot_colors which is a list mapping meta_field_annotate_by values to list of value-color mapping.
Minimal number of cells per meta_field value
Normalize cell counts by factor (default) or by metacell
If true, re-order metacells by clustering the heatmap. Otherwise, use original metacells ordering (default)
vector of meta_field values to display
Hierarchical cluster of value in value-mc matrix
project specific metadata fields, that the code handles specifically.