Code for counting insertsize/fragmentsize from scATAC
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 :-)