I have a BAM file that looks like this:
As you notice that the barcodes are included as part of read names.
Then I'm trying to use a tool called chromVAR that require
RG tag to be included in the BAM file. RG tags are used to distinguish reads from different cells or samples (this is single cell ATAC-seq). Note this is not
@RG header but tag for every reads as optional fields.
This is the example of RG tag as optional field (taken from another BAM file):
The value of that RG tag could be just the corresponding BARCODE id of that read.
My question is how can I add the the RG tag into it? I looked at PICARD AddOrReplaceReadGroups but it seems only to add as header not for every read.