Bedops Bam2Bed Error With Gatk Recalibrated Bam-File
0
0
Entering edit mode
10.4 years ago
Irsan ★ 7.8k

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?

error gatk • 3.6k views
ADD COMMENT
1
Entering edit mode

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 REPLY
1
Entering edit mode

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 REPLY

Login before adding your answer.

Traffic: 2457 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6