This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Picard Error with SAM File

Hi

I'm new in bioinformatics. I was trying to add Read Group to a SAM file by Picard and I got this error:

{Exception in thread "main" htsjdk.samtools.SAMFormatException: Error parsing text SAM file. MRNM not specified but flags indicate mate mapped; File /home/masoud/NGS/Samples/54992.sam; Line 744
Line: MISEQ:131:000000000-A565J:1:1101:12427:6217    65    chr13    32904990    219    214M36S    *    0    0    GGGGACTACTACTGTATGTGCATTGAGAGTTTTTATACTAGTGATTTTAAACTATAATTTTTGCAGAATGTGAAAAGCTATTTTTCCAATCATGATGAAGGTCTGAAGAAAAATGATAGATTTATCGCTTCTGTGACAGACAGTGAAAACACAAATCAAAGAGAAGCTGCAAGTCATGGTAAGTCCTCTGTTTAGTTGAACTACAGGTTTTTTTTTGTTGTTGTTTTGCTTTTTTTTTTTTTTGATGTGG    1AAAADCCFFFFGGG3FGGDFAGHBHHGH1FGHGHHHHHGCDDGHGHHGAEGHHHHHHHHHHGGHHFEGHHG22DAAGHHHFHHHHHHGHHHHH2GHHDFFGHHFHHGFHHGHFHHHHHHHHHHHHHGHHGHHHHHHHHHHHHHHF>GHHFGHFGHHHFFHHHGHHHGHHGFHGDDG>GF2FGGGHHHHGHHHGHHF1F1?GHFFGFHDGGGGGGGCHHFHHHCGHHG0;CFHHGGGGG@@@?#######    AS:i:206    XS:i:0    XF:i:0    XE:i:5    NM:i:2}

What is this? What should I do to solve it?

Thank you

Masoud

sam picard

How did you create that SAM file? Whichever aligner you used has a bug. I or someone else here could write a little python program to get around this particular error, but I worry about the validity of the alignments in general if the output is broken like this.

Hi,

Please use appropriate tags when you create posts. You'd used "forum" (which is not relevant here), and I changed it to "sam" and "picard". The system is designed to alert people subscribed to certain tags when new posts are created with those tags, so you stand a better chance of getting faster responses if you use the right tags.

1 answer

This is one of the known discrepancies between the SAMtools specification and Picard's validation of the format: see http://sourceforge.net/p/samtools/mailman/samtools-devel/thread/AB0E0502-911B-444C-B112-AA9248C7AA00@sanger.ac.uk/

Log in to answer this question.