This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Tracks of single cell data in a heatmap form

I am working with single-cell datatset where I have the BedGraph files for each cell and I can generate single cell profiles in IGV like the screenshot. I have been looking for any command line based tools I can use to recreate this so that I can reproduce my figures. I have tried coolbox but it does not seem to have a heatmap feature for tracks (or maybe I am not aware of).

Any help would be greatly appreciated as I am stuck to create pretty plots :/ enter image description here

genomics sortchic deeptools single-cell

1 answer

Rather annoying, but typically your fragment file will have the barcodes in column 4.

chr1    3003761 3003928 TTTGCGACAGTAGGTG-1      48
chr1    3008963 3009663 AAGGTGCAGTCAATTG-1      3
chr1    3012286 3013245 AACCTAATCCCGTTGT-1      2

You can combine awk and bedtools via something like

zcat fragments.tsv.gz | awk '{print > $4".tsv"}'
for fn in `ls *.tsv`; do
    base="${fn%%.*}"
    bedtools genomecov -bg -g /path/to/ref.fa.contigs -i "${fn}" > "${base}.bdg"
done

which will split the fragments into per-cell tsv files, and convert each to bedgraphs. You can use gnu parallel to speed up the process (after splitting the fragment file). Bedops might be able to do this all in one go; but I didn't find an option the last time I looked.

Thanks for the reply but I already have the bedgraph files for each cell where column 4 has the score. I want to recreate the igv figure using any command line based tool. But good to know :)

Thanks a lot. But I've been looking for some python or command line based tools which makes prettier plots :)

Log in to answer this question.