Get the read count per genomic bin for each 10x barcode (10x Genomics Single Cell Gene Expression protocol)
0
0
Entering edit mode
5.1 years ago

Given the BAM output of Cell Ranger (that contains all reads for each barcodes-cells) I want to count reads mapped to genomic bins for each barcode. I combined answer from How do I get the read counts for each barcode? with option -L as in:

samtools view -L bins.bed possorted_genome_bam.bam | grep CB:Z: | sed 's/.*CB:Z:\([ACGT]*\).*/\1/' | sort | uniq -c > reads_per_barcode

It works but the output read count is not for each target region, but overall across bins.

Can you point me to a possible way to get an output like:

bin1 read_count barcodeA
bin1 read_count barcodeB
bin1 read_count barcodeC
...
binN read_count barcodeA
binN read_count barcodeB
binN read_count barcodeC

thanks.

RNA-Seq 10x genomics cell ranger bam read count • 2.3k views
ADD COMMENT
0
Entering edit mode

I think you'll need to make a loop that goes through the lines of bins.bed one at a time

ADD REPLY

Login before adding your answer.

Traffic: 2633 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6