This is a test version of Biostars. For the public version, visit https://www.biostars.org.
extracting cell specific reads from cellranger BAM output file

Is it possible to isolate reads belonging to cells in a cluster of interest from the Cell Ranger BAM output file? Are reads in Cell Ranger BAM output files indexed? I want to extract reads from specific cells and align them again to the reference sequence to determine parent-of-origin-specific expression. Is this approach feasible?

bam cellranger seurat

1 answer

Yes, in the BAM file, you can find the cell barcodes in the BAM tag "CB:Z:" which is followed by the barcode sequence.

For all cells within your cluster of interest, you'll need to curate all cell barcodes within that cluster, then use samtools view (or another tool) to extract them from your BAM file.

I believe you can use samtools view -D CB:cells.txt and then put your barcodes into a file named cells.txt (haven't tested it myself though).

Log in to answer this question.