scanpy.pl.scrublet_score_distribution

scanpy.pl.scrublet_score_distribution#

scanpy.pl.scrublet_score_distribution(adata, *, scale_hist_obs='log', scale_hist_sim='linear', figsize=(8, 3), return_fig=False, show=True, save=None)[source]#

Plot histogram of doublet scores for observed transcriptomes and simulated doublets.

The histogram for simulated doublets is useful for determining the correct doublet score threshold.

Scrublet must have been run previously with the input object.

Parameters:
adata AnnData

An AnnData object resulting from scrublet().

scale_hist_obs Union[Literal['linear', 'log', 'symlog', 'logit'], str] (default: 'log')

Set y axis scale transformation in matplotlib for the plot of observed transcriptomes

scale_hist_sim Union[Literal['linear', 'log', 'symlog', 'logit'], str] (default: 'linear')

Set y axis scale transformation in matplotlib for the plot of simulated doublets

figsize tuple[float | int, float | int] (default: (8, 3))

width, height

show bool (default: True)

Show the plot, do not return axis.

save str | bool | None (default: None)

If True or a str, save the figure. A string is appended to the default filename. Infer the filetype if ending on {'.pdf', '.png', '.svg'}.

Return type:

Figure | Sequence[tuple[Axes, Axes]] | tuple[Axes, Axes] | None

Returns:

If return_fig is True, a Figure. If show==False a list of Axes.

See also

scrublet()

Main way of running Scrublet, runs preprocessing, doublet simulation and calling.

scrublet_simulate_doublets()

Run Scrublet’s doublet simulation separately for advanced usage.