kaizhang / SnapATAC2

Single-cell epigenomics analysis tools
https://kzhang.org/SnapATAC2/
197 stars 20 forks source link

How to calculate TSS(UP 1K,DOWN 1K) score for gene of every cell? #304

Closed mengchengyao closed 2 months ago

mengchengyao commented 2 months ago

Hi, Thanks for your great tools with single analysis tool. Now I want to calculate TSS(Promoter region: UP 1K,DOWN 1K) score for gene of every cell, how can I do? snapatac2.pp.make_gene_matrix snapatac2.tl.init_network_from_annotation snapatac2.metrics.frip

which function to use? could you give an example ?

Yours

kaizhang commented 2 months ago

Currently, the closest function you can use is pp.make_gene_matrix which calculates the score using the whole gene body region: https://kzhang.org/SnapATAC2/api/_autosummary/snapatac2.pp.make_gene_matrix.html#snapatac2.pp.make_gene_matrix

But the feature you requested is relatively easy to implement.

kaizhang commented 2 months ago

In v2.6.4, you will be able to achieve this by:

>>> gene_mat = snap.pp.make_gene_matrix(data, gene_anno=snap.genome.hg38, upstream=1000, downstream=1000, include_gene_body=False)
mengchengyao commented 2 months ago

In v2.6.4, you will be able to achieve this by:

>>> gene_mat = snap.pp.make_gene_matrix(data, gene_anno=snap.genome.hg38, upstream=1000, downstream=1000, include_gene_body=False)

Many thanks.