The current GATK version is 3.7-0
Examples: Monday, today, last week, Mar 26, 3/26/04

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Get notifications!


You can opt in to receive email notifications, for example when your questions get answered or when there are new announcements, by following the instructions given here.

Did you remember to?


1. Search using the upper-right search box, e.g. using the error message.
2. Try the latest version of tools.
3. Include tool and Java versions.
4. Tell us whether you are following GATK Best Practices.
5. Include relevant details, e.g. platform, DNA- or RNA-Seq, WES (+capture kit) or WGS (PCR-free or PCR+), paired- or single-end, read length, expected average coverage, somatic data, etc.
6. For tool errors, include the error stacktrace as well as the exact command.
7. For format issues, include the result of running ValidateSamFile for BAMs or ValidateVariants for VCFs.
8. For weird results, include an illustrative example, e.g. attach IGV screenshots according to Article#5484.
9. For a seeming variant that is uncalled, include results of following Article#1235.

Did we ask for a bug report?


Then follow instructions in Article#1894.

Formatting tip!


Wrap blocks of code, error messages and BAM/VCF snippets--especially content with hashes (#)--with lines with three backticks ( ``` ) each to make a code block as demonstrated here.

Jump to another community
Picard 2.9.0 is now available. Download and read release notes here.
GATK 3.7 is here! Be sure to read the Version Highlights and optionally the full Release Notes.

Help with samtools problem "Error parsing text SAM file. MAPQ should be 0 for unmapped read"?

kshorttkshortt Member Posts: 1
edited August 2016 in Ask the GATK team

Hello, I am trying to convert a sam file to bam and am getting the below error. Can you help me with how I can fix this?

Exception in thread "main" net.sf.samtools.SAMFormatException: Error parsing text SAM file. MAPQ should be 0 for unmapped read.; Line 30415
Line: SNL160:121:HNWM3BCXX:2:1103:5604:21129_1 4 chrM 16071 37 233M1D13M * 0 0 TACCAAATTTTAACTCTCCAAACCCCCCACCCCCTCCTCTTAATGCCAAACCCCAAAAACACTAAGAACTTGAAAGACATATAATATTAACTATCAAACCCTATGTCCTGATCAA
TTCTAGTAGTTCCCAAAATATGACTTATATTTTAGTACTTGTAAAAATTTTACAAAATCATGTTCCGTGAACCAAAACTCTAATCATACTCTATTACGCAATAAACATTAACAAGTTAATGTAGCTTAATA DDDDDIHIIIIIIIIIIIIIIIIIIIIIIIIIIIIHIIIIIIIIIIIIHIEHHIHIIIIHEHHIIIIGHIHIIIGIHIHIIIIIIIIIIIHHIIGHHIH
IIHHIIIIIIIIIIIIHIHHHIIIIIIIIIIHIIIIIIIHIIHHHHIIIGIGFHIIFHIIIIIIHIIIHIIHHHHIHIHIIHHHHHIIHEHHIHHCGHH@?GGHGFHHGIIIH.@EHIIHHCHEHEHCHEB.BHEFEHIH.FHH..A XT:A:N NM:i:9 XN:i:18 X0:i:1 X1:i:0 XM:i:8 XO:i:1 XG:i:1 MD:Z:229A3^C2C1C1G0
G0A0G2C0
at net.sf.samtools.SAMLineParser.reportErrorParsingLine(SAMLineParser.java:427)
at net.sf.samtools.SAMLineParser.parseLine(SAMLineParser.java:331)
at net.sf.samtools.SAMTextReader$RecordIterator.parseLine(SAMTextReader.java:237)
at net.sf.samtools.SAMTextReader$RecordIterator.next(SAMTextReader.java:225)
at net.sf.samtools.SAMTextReader$RecordIterator.next(SAMTextReader.java:201)
at net.sf.samtools.SAMFileReader$AssertableIterator.next(SAMFileReader.java:672)
at net.sf.samtools.SAMFileReader$AssertableIterator.next(SAMFileReader.java:650)
at net.sf.picard.sam.SortSam.doWork(SortSam.java:68)
at net.sf.picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:177)
at net.sf.picard.cmdline.CommandLineProgram.instanceMainWithExit(CommandLineProgram.java:119)
at net.sf.picard.sam.SortSam.main(SortSam.java:57)
"

Edit: I ran ValidateSamFile and obtained the following output:

ValidateSamFile1_ks_18423.out

HISTOGRAM java.lang.String

Error Type Count
ERROR:INVALID_MAPPING_QUALITY 26
ERROR:MISSING_READ_GROUP 1
WARNING:RECORD_MISSING_READ_GROUP 1864385

What do I need to do to correct these errors in the sam file and how can I avoid these errors in the future?

Post edited by kshortt on

Answers

Sign In or Register to comment.