Skip to content

Code for counting insertsize/fragmentsize from scATAC

Mette Bentsen requested to merge atac-insertsize-dist into dev

Hi @Jan.Detleffsen ,

I have added the code that we discussed for fast counting of the insertsizes. The main function is:
sctoolbox.atac.add_insertsize(adata, fragments="fragments.bed")

which adds the mean insertsize to adata.obs and the full distribution as a table to adata.uns["insertsize_distribution"].

The distribution can be plotted with:
sctoolbox.atac.plot_insertsize(adata)
for all or a subset of barcodes via barcodes=["ACGG(...)",(...)]

It runs in ~1 minute for a CATLAS fragments file.

Please have a look if it is of use - if, then you are free to merge, thanks :-)

Merge request reports

Loading