Sample.heatmap#

Sample.heatmap(clusterby: str, sortby: Optional[str] = None, drop: Optional[Union[Iterable, str]] = None, flatten: bool = True, quantify_dna_mut: bool = True, flatten_samples: bool = False)#

Multi-assay heatmap.

Plots heatmaps (cluster vs target) for each available assay next to each other. The plots can either be “flattened”, in which case the heatmap shows the median target value for all barcodes in the cluster. Or “not flattened”, in which case all barcodes are shown within each cluster.

Parameters
clusterbystr

The assay name (‘dna’, ‘protein’) whose labels will be used to cluster the barcodes.

sortbystr

The assay name (‘dna’, ‘protein’) whose labels will be used to sort the barcodes within each cluster.

dropstr

At most one of (‘dna’, ‘protein’, ‘cnv’) that is to be dropped.

flattenboolean

Determines whether to display the median of barcodes for each cluster at each target (True) or plot each barcode, grouped by cluster, at each target (False).

quantify_dna_mutboolean

If True (and clusterby==’protein’, drop != ‘dna’, and flatten==True), then it will output bargraph(s) to quantify the per-cluster percentage and number of cells that are mutated. These statistics are aggregated across all mutations. If there are multiple samples then it will output separate bargraphs for each sample and one for all samples.

flatten_samplesboolean

If True (and quantify_dna_mut is also True), then it displays just one barplot for all samples merged together.

Returns
figplotly.graph_objects.Figure