Cnv.plot_ploidy#

Cnv.plot_ploidy(cluster: str, features: Union[Sequence, str] = 'positions', collapse: bool = False) plotly.graph_objs._figure.Figure#

Plots the ploidy of the cluster

Parameters
clusterstr

Barcodes belonging to this label will be fetched for the plot.

featuresSequence / {‘genes’, ‘genes+amplicons’, ‘positions’} default: None
The features which are to be plotted.
  1. Sequence: The given features are plotted

  2. ‘positions’: The amplicons are sorted by

    position and all amplicons are drawn.

  3. ‘genes’: The amplicons are sorted based on their

    gene and position and all amplicons are drawn.

  4. ‘positions+amplicons’: Amplicons are grouped by

    their chromosome and the median value of the chromosome is also shown

  5. ‘genes+amplicons’: Amplicons are grouped by their

    gene and the median value of the gene is also shown

collapsebool

Whether the features are collapsed based on their category. collapse is set to True when “genes+amplicons” and “positions+amplicons” is passed.

Raises
ValueError:

When the cluster is not found in the labels

RuntimeError:

If ploidy is not found in the layers. Cnv.compute_ploidy() has to be executed before running this method.

Notes

If features == “genes”, the order of the amplicons is the position sorted order of the genes. The gene that comes first positionally, comes first. Some amplicons might not be position sorted because the gene was “Unknown” or there were genes in between genes resulting in all the amplicons for the gene that occurs first to be sorted before the amplicons of the other gene.