Question: Add tags to BAM/SAM file
0
gravatar for dzb
2.2 years ago by
dzb0
dzb0 wrote:

I'm working with some RNA-seq data. I have alignments done in STAR and the resultant BAM file. I'd like to annotate this BAM alignment data with custom tags using data that are stored in a separate file. The data in the second file contain are a read ID, a barcode, and a UMI. I want to add the barcode and UMI to all reads in the BAM file that match the read ID in the second file.

To summarise:

First file: BAM output from STAR

Second file: Read ID (matching those in STAR BAM file), UMI, barcode.

How do I get the UMI and barcode in file 2 tagged onto the reads in the BAM file?

Intensive Google and forum searching have yielded little info about this but I have a feeling there's a simple answer. Can anyone help?

ADD COMMENTlink modified 2.2 years ago by Matt Shirley9.1k • written 2.2 years ago by dzb0

Please post example lines from the two files.

ADD REPLYlink written 2.2 years ago by genomax73k
2
gravatar for Matt Shirley
2.2 years ago by
Matt Shirley9.1k
Cambridge, MA
Matt Shirley9.1k wrote:

I don't think there's a simple answer for this question, but if you want to write a script you might find simplesam (https://github.com/mdshw5/simplesam) useful:

ADD COMMENTlink written 2.2 years ago by Matt Shirley9.1k

This looks like an excellent starting point, thanks for sending it my way.

ADD REPLYlink written 2.2 years ago by dzb0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 749 users visited in the last hour