Question: Bedops Bam2Bed Error With Gatk Recalibrated Bam-File
0
gravatar for Irsan
6.6 years ago by
Irsan7.2k
Amsterdam
Irsan7.2k wrote:

Whey I try to convert one of my bam-files with bam2bed from the bedops suite (version 2.3.0) I get an error saying that my bam-file contains tags that are not in the samtools specification.

bam2bed < myfile.bam

My bam-file is made with bwa and quality scores are recalibrated with GATK that ads BD and BI tags to the bam file

Traceback (most recent call last): File "/home/irsan/programs/bedops/version_2.3.0/bin/bam2bed", line 716, in <module> sys.exit(main(*sys.argv)) File "/home/irsan/programs/bedops/version_2.3.0/bin/bam2bed", line 637, in main samTags.append(elems[idx]) File "/home/irsan/programs/bedops/version_2.3.0/bin/bam2bed", line 159, in append raise Exception("Appended tag (%s) is not valid per SAMtools specification" % tagName) Exception: Appended tag (BD) is not valid per SAMtools specification

allValidSamTags = ['AM', 
                   'AS', 
                   'BC',
                   'BD', # <-- added by me
                   'BI', # <-- added by me
                   'BQ', 
                   'CC', 
                   'CM', 
                   'CO', 
                   'CP', 
                   'CQ', 
                   'CS', 
                   'CT', 
                   'E2', 
                   'FI', 
                   'FS', 
                   'FZ', 
                   'LB', 
                   'H0', 
                   'H1', 
                   'H2', 
                   'HI', 
                   'IH', 
                   'MD', 
                   'MQ', 
                   'NH', 
                   'NM', 
                   'OQ', 
                   'OP', 
                   'OC', 
                   'PG', 
                   'PQ', 
                   'PT', 
                   'PU', 
                   'QT', 
                   'Q2', 
                   'R2', 
                   'RG', 
                   'RT', 
                   'SA', 
                   'SM', 
                   'TC', 
                   'U2', 
                   'UQ']

Should I just add 'BD' and 'BI' to the list of allValidSamTags in bam2bed script or is there a better way?

gatk error • 2.4k views
ADD COMMENTlink modified 6.6 years ago • written 6.6 years ago by Irsan7.2k
1

I may add custom tags support, so that the end user can specify those as a command-line option. You could edit this script, in the meantime, as you describe.

ADD REPLYlink modified 6.6 years ago • written 6.6 years ago by Alex Reynolds30k
1

This is fixed in v2.4. See BEDOPS v2.4 released and http://bedops.readthedocs.org/en/latest/content/reference/file-management/conversion/bam2bed.html for a description of the --custom-tags option.

ADD REPLYlink written 6.5 years ago by Alex Reynolds30k
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: 1075 users visited in the last hour