Cnv.compute_ploidy

Cnv.compute_ploidy#

missionbio.mosaic.cnv.Cnv.compute_ploidy

Cnv.compute_ploidy(diploid_cells: ndarray, normalized_counts: Union[str, ndarray, DataFrame] = 'normalized_counts')#

Computes the ploidy of the cells

This method adds a layer called ‘ploidy’

Parameters:
diploid_cellsnp.ndarray

If a 1D array is passed, it is assumed to be the barcodes of the diploid cells within the same assay. If a 2D array is passed, it is assumed to be the read counts of the diploid cells from another assay. All cells will be normalized to the median counts of the diploid cells.

normalized_countsstr / np.ndarray, default: constants.NORMALIZED_READS

Changed in version 3.6: Not used. The read_counts layer is used to calculate the ploidy.

Name of the layer which is to be used for ploidy calculations. A numpy array with the same shape as the assay can also be passed.

Raises:
ValueError

When the length of diploid_cells is zero


< Class Cnv