snapatac2.pl.tsse#

snapatac2.pl.tsse(adata, min_fragment=500, width=500, height=400, **kwargs)[source]#

Plot TSS enrichment against unique fragment counts.

Use this function after computing TSS enrichment scores to assess cell quality and identify low-quality cells with low fragment counts or low TSS enrichment.

Anti-Patterns#

  • Do NOT call this before running snapatac2.metrics.tsse; the input must contain adata.obs["tsse"].

  • Do NOT interpret min_fragment as a filtering operation on adata. It only excludes cells from this visualization.

param adata:

Annotated data matrix containing obs["tsse"] and obs["n_fragment"].

type adata:

AnnData

param min_fragment:

Minimum number of unique fragments required for a cell to be included in the plot.

type min_fragment:

int

param width:

Width of the rendered plot in pixels.

type width:

int

param height:

Height of the rendered plot in pixels.

type height:

int

type **kwargs:

param **kwargs:

Additional rendering options passed to snapatac2.pl.render_plot, such as show, interactive, out_file, and scale.

returns:

Returns a Plotly figure when show=False and out_file=None; otherwise renders or saves the plot and returns None.

rtype:

plotly.graph_objects.Figure’ | None

See also

snapatac2.metrics.tsse

Compute TSS enrichment scores.

render_plot

Render, show, or save Plotly figures.

Examples

>>> import snapatac2 as snap
>>> data = snap.read(snap.datasets.pbmc5k(type="h5ad"))
>>> snap.metrics.tsse(data, snap.genome.hg38)
>>> fig = snap.pl.tsse(data, show=False)
>>> fig.update_layout(title="TSS enrichment")