pegasus.run_scrublet

pegasus.run_scrublet(data, channel_attr=None, expected_doublet_rate=0.1, nPC=30, output_plot_prefix=None, random_state=0, verbose=True)[source]

Calculate doublet scores using Scrublet for each channel on the current associated data.X matrix.

This is a wrapper of Scrublet package.

See [Wolock18] for details on this method.

Parameters
  • data (MultimodalData object.) – Annotated data matrix with rows for cells and columns for genes.

  • channel_attr (str, optional, default: None) – Attribute indicating sample channels. If None, consider all data as one channel.

  • expected_doublet_rate (float, optional, default: 0.1) – The expected doublet rate for the experiment.

  • output_plot_prefix (str, optional, default: None) – If this option is not None, output Scrublet histogram plots using output_plot_prefix as file name prefix.

  • nPC (int, optional, default: 30) – Number of principal components used to embed the transcriptomes prior to k-nearest-neighbor graph construction.

  • random_state (int, optional, default: 0) – Random state for doublet simulation, approximate nearest neighbor search, and PCA/TruncatedSVD if needed.

  • verbose (bool, optional, default: True) – If True, print progress updates.

Return type

None

Returns

  • None

  • Update data.obs

    • data.obs['scrublet_score']: The calculated doublet scores on cells.

  • Update data.uns

    • data.uns['scrublet_stats']: Overall stats during the calculation.

  • If output_plot_prefix is not None, save doublet histogram as PDF files named output_plot_prefix.scrublet.pdf or output_plot_prefix_{channel}.scrublet.pdf

Examples

>>> pg.run_scrublet(data)