Holiday Notice:
The Frontline Support team will be offline February 18 for President's Day but will be back February 19th. Thank you for your patience as we get to all of your questions!

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

kshorttkshortt Member
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
IIHHIIIIIIIIIIIIHIHHHIIIIIIIIIIHIIIIIIIHIIHHHHIIIGIGFHIIFHIIIIIIHIIIHIIHHHHIHIHIIHHHHHIIHEHHIH[email protected]?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.