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 containadata.obs["tsse"].Do NOT interpret
min_fragmentas a filtering operation onadata. It only excludes cells from this visualization.
- param adata:
Annotated data matrix containing
obs["tsse"]andobs["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 asshow,interactive,out_file, andscale.- returns:
Returns a Plotly figure when
show=Falseandout_file=None; otherwise renders or saves the plot and returnsNone.- rtype:
plotly.graph_objects.Figure’ | None
See also
snapatac2.metrics.tsseCompute TSS enrichment scores.
render_plotRender, 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")