I have single cell RNA-seq reads (from 10x Chromium) that have already been pre-processed. The cell-bacode and UMI tag were cut-and-pasted to the header (via umi-tools) and low quality reads were removed. Next, I mapped the reads (with STAR) and isolated the reads from a gene of interest (via samtools). At the end of the day I want to genotype each cell for a specific gene, using the cell-barcode and UMI pair, and call variants.
How do I split the BAM file into separate BAM files based on the cell-barcode and UMI pair? In other words, I want a bam file of aligned reads with the same cell-barcode and UMI pair.