pegasus.demultiplex

pegasus.demultiplex(rna_data, hashing_data, min_signal=10.0, alpha=0.0, alpha_noise=1.0, tol=1e-06, n_threads=1)[source]

Demultiplexing cell/nucleus-hashing data, using the estimated antibody background probability calculated in demuxEM.estimate_background_probs.

Parameters
  • rna_data (UnimodalData) – Data matrix for gene expression matrix.

  • hashing_data (UnimodalData) – Data matrix for HTO count matrix.

  • min_signal (float, optional, default: 10.0) – Any cell/nucleus with less than min_signal hashtags from the signal will be marked as unknown.

  • alpha (float, optional, default: 0.0) – The Dirichlet prior concentration parameter (alpha) on samples. An alpha value < 1.0 will make the prior sparse.

  • alpha_noise (float, optional, default: 1.0) – The Dirichlet prior concenration parameter on the background noise.

  • tol (float, optional, default: 1e-6) – Threshold used for the EM convergence.

  • n_threads (int, optional, default: 1) – Number of threads to use. Must be a positive integer.

Returns

  • None

  • Update data.obs

    • data.obs["demux_type"]: Demultiplexed types of the cells. Either singlet, doublet, or unknown.

    • data.obs["assignment"]: Assigned samples of origin for each cell barcode.

    • data.obs["assignment.dedup"]: Only exist if one sample name can correspond to multiple feature barcodes. In this case, each feature barcode is assigned a unique sample name.

Examples

>>> demultiplex(rna_data, hashing_data)