networkcommons.visual.plot_density
- networkcommons.visual.plot_density(df, gene_ids, metadata=None, id_column='idx', sample_id_column='sample_ID', group_column='group', quantiles=[10, 90], title='Density Plot of Intensity Values', xlabel='Intensity', ylabel='Density')
Plots density of intensity values for specified genes, including mean and quantile lines, and separates distributions by groups if metadata is provided. Each gene is displayed in a separate subplot.
- Parameters:
df (pd.DataFrame) – Input DataFrame containing gene data.
gene_ids (list of str) – List of specific genes to highlight.
metadata (pd.DataFrame) – Optional DataFrame containing metadata (sample_ID, group).
id_column (str) – Column name for identifying the gene.
sample_id_column (str) – Column name in metadata for sample IDs.
group_column (str) – Column name in metadata for groups.
title (str) – Title of the plot.
xlabel (str) – Label for the x-axis.
ylabel (str) – Label for the y-axis.
- Returns:
None