pegasus.plot_infercnv
- pegasus.plot_infercnv(data, groupby, ref_cat=None, tumor_cat=None, rep='cnv', panel_size=(16, 10), cmap='bwr', legend_fontsize=10.0, show_groupby_border=False, return_fig=False, dpi=300.0, output_file=None, **kwargs)[source]
Generate InferCNV plot based on the results calculate by
calc_infercnvfunction.- Parameters
data (
MultimodalDataorUnimodalDataobject) – Single-cell data matrix.groupby (
str) – Specify the key for grouping cells in the heatmap. Must exist indata.obs.ref_cat (
str, optional, default:None) – Specify the categories indata.obs[groupby]that is treated as reference (i.e. non-malignant cell groups). IfNone, which is the default, treat all cell groups as tumor, and only show one heatmap for all groups.tumor_cat (
str, optional, default:None) – Specify the categories indata.obs[groupby]that is treated as tumor (i.e. malignant cell groups). IfNone, which is the default, and ifref_catis notNone, then treat all cell groups not inref_catas tumor groups. In this case, there will be 2 heatmaps: one for reference, one for tumor. Otherwise, if there are still cell groups not inref_catortumor_cat, then there will be 3 heatmaps: one for reference on top, one for tumor on bottom, and one for the rest groups in middle.rep (
str, optional, default:cnv) – Specify the key for CNV results stored in data. By default, use the default result key ofcalc_infercnvfunction.panel_size (
(int, int), optional, default:(16, 10)) – Specify the figure size in(width, height)format.cmap (
str, optional, default:bwr) – Color map for plotting heatmap. Available options are in Matplotlib colormaps manual.legend_fontsize (
float, optional, default:10.0) – Font size of legend, as well as chromosome names shown at the bottom of plot.show_groupby_border (
bool, optional, default:False) – If show cell group borders as horizontal lines in each heatmap. Do not show them by default.return_fig (
bool, optional, default:False) – Return aFigureobject ifTrue; returnNoneotherwise.dpi (
float, optional, default:300.0) – The resolution in dots per inch.output_file (
str, optional, default:None) – The filename when saving the plot as file. IfNone, which is the default, do not save to file.
- Return type
Optional[Figure]- Returns
Figure object – A
matplotlib.figure.Figureobject containing the dot plot ifreturn_fig == True.
Examples
>>> plot_infercnv(data, groupby="anno", ref_cat=["Macrophage", "T", "B", "Plasma"])