Sample.signaturemap#
missionbio.mosaic.sample.Sample.signaturemap
- Sample.signaturemap(clusterby: Optional[Sequence[str]] = None, attributes: Optional[Sequence[str]] = None, features: Optional[Sequence[Union[Sequence, str]]] = None, x_groups: Optional[Sequence[Union[Sequence, str]]] = None, labels: Optional[Sequence] = None, signature_kind: Optional[Sequence[str]] = None, nan_value: Optional[Sequence[float]] = None, widths: Optional[Sequence[float]] = None, order: Tuple[str] = ('dna', 'protein', 'cnv', 'rna'), quantify_mut: Optional[str] = None)#
Multi-assay flattened heatmap.
Plots heatmaps (cluster vs target) for each available assay next to each other.
- Parameters:
- clusterbylist, str
The assays to plot. If None, all assays are plotted.
- attributestuple
The layers or row attributes to plot for each assay
- featurestuple
The features to plot for each assay. If None, all features are plotted. For CNV, the additional options are described in
missionbio.mosaic.cnv.Cnv.heatmap()
. It includes {“positions”, “genes”} or a subset of positions or genes.- x_groupstuple
The groups to plot on the x-axis for each assay. If None, the x-axis is not grouped.
- labelsSequence
The labels to plot. If None, the labels are automatically determined.
- signature_kindtuple
The signature kind to plot for each assay. This is passed to
_Assay.signature()
. If None, then the median is plotted.- nan_valuetuple
The value to ignore when calculating the signature. This is passed to
_Assay.signature()
. If None, none of the values are ignored.- widthslist
The width of each heatmap. If None, the width is automatically determined.
- ordertuple
The order of the assays to plot.
- quantify_mut{None, “count”, “fraction”, “count+fraction”, “fraction+count”}
If not None then it will output a bargraph to quantify the per-cluster value and per cluster text. The value and text can correspond to the number (“count”) or fraction of cells that are mutated for any single variant shown in the heatmap. If the value is “count” or “fraction” then the x-axis and the text shown are the same. If the value is “count+fraction” or “fraction+count” then the x-axis data is the first value and the text shown is the second value.
- Returns:
- figplotly.graph_objects.Figure
- Raises:
- ValueError:
If quantify_mut is not None and clusterby[0] != ‘protein’ or ‘dna’ not in clusterby
< Class Sample