SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
picard error seq_GA Bioinformatics 2 07-15-2014 04:50 AM
error with sam output ->Parse error at line xxxxx: missing colon in auxiliary data manore Bioinformatics 11 11-25-2013 01:50 PM
Picard error JohnK Bioinformatics 14 12-14-2012 05:41 AM
Picard AddOrReplaceReadGroups Error ercfrtz Bioinformatics 1 03-28-2011 05:21 AM
Picard rmdup error kapoormanav Illumina/Solexa 2 09-07-2010 01:11 PM

Reply
 
Thread Tools
Old 11-18-2011, 09:42 PM   #1
dongshenglulv
Member
 
Location: Shanghai

Join Date: May 2011
Posts: 15
Default error in picard (SAM validation error)

Hi, I had a error message when I use picard to replace read groups in a BAM file, like this:

$ java -jar AddOrReplaceReadGroups.jar I=SRX020270.sorted.bam O=SRX020270.resorted.bam SORT_ORDER=coordinate RGID=SRX020270 RGLB=bar RGPL=illumina RGSM=SRX020270 RGPU='run barcode' CREATE_INDEX=True

[Sat Nov 19 13:17:11 CST 2011] net.sf.picard.sam.AddOrReplaceReadGroups INPUT=SRX020270.sorted.bam OUTPUT=SRX020270.resorted.bam SORT_ORDER=coordinate RGID=SRX020270 RGLB=bar RGPL=illumina RGPU=run barcode RGSM=SRX020270 CREATE_INDEX=true TMP_DIR=/tmp/ludongsheng VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_MD5_FILE=false
INFO 2011-11-19 13:17:11 AddOrReplaceReadGroups Created read group ID=SRX020270 PL=illumina LB=bar SM=SRX020270

[Sat Nov 19 13:18:34 CST 2011] net.sf.picard.sam.AddOrReplaceReadGroups done. Elapsed time: 1.39 minutes.
Runtime.totalMemory()=5798559744
Exception in thread "main" java.lang.RuntimeException: SAM validation error: ERROR: Record 8404072, Read name SRX020270.6546275, MAPQ should be 0 for unmapped read.
at net.sf.samtools.SAMUtils.processValidationErrors(SAMUtils.java:334)
at net.sf.samtools.BAMFileReader$BAMFileIterator.advance(BAMFileReader.java:469)
at net.sf.samtools.BAMFileReader$BAMFileIterator.next(BAMFileReader.java:450)
at net.sf.samtools.BAMFileReader$BAMFileIterator.next(BAMFileReader.java:417)
at net.sf.samtools.SAMFileReader$AssertableIterator.next(SAMFileReader.java:629)
at net.sf.samtools.SAMFileReader$AssertableIterator.next(SAMFileReader.java:607)
at net.sf.picard.sam.AddOrReplaceReadGroups.doWork(AddOrReplaceReadGroups.java:91)
at net.sf.picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:158)
at net.sf.picard.cmdline.CommandLineProgram.instanceMainWithExit(CommandLineProgram.java:118)
at net.sf.picard.sam.AddOrReplaceReadGroups.main(AddOrReplaceReadGroups.java:61)

I was told that read name SRX020270.6546275 was an unmapped read, so I checked out the entry for this read, and also the head line in SRX020270.sorted.bam.

$ samtools view SRX020270.sorted.bam | grep "SRX020270.6546275"
SRX020270.6546275 4 GL000198.1 90085 37 43M1D37M * 0 AGAATTCTTCAAAGAGTTCCAGATATCCACAGGCAGATTCTACAAATAAGTGTTTCAATACTGCTCTATCAAAAGACGTA [email protected][email protected]@[email protected];[email protected]<[email protected]@A>?AAA?>[email protected]>@@?>A>@@@[email protected];;@?>@>@?:>A>@=<[email protected]@[email protected]??>?;@ XT:A:U NM:i:4 X0:i:1 X1:i:0 XM:i:3 XO:i:1 XG:i:1 MD:Z:0C42^A3G29T3

$ samtools view -H SRX020270.sorted.bam
@SQ SN:1 LN:249250621
@SQ SN:2 LN:243199373
@SQ SN:3 LN:198022430
@SQ SN:4 LN:191154276
@SQ SN:5 LN:180915260
@SQ SN:6 LN:171115067
@SQ SN:7 LN:159138663
@SQ SN:8 LN:146364022
@SQ SN:9 LN:141213431
@SQ SN:10 LN:135534747
@SQ SN:11 LN:135006516
@SQ SN:12 LN:133851895
@SQ SN:13 LN:115169878
@SQ SN:14 LN:107349540
@SQ SN:15 LN:102531392
@SQ SN:16 LN:90354753
@SQ SN:17 LN:81195210
@SQ SN:18 LN:78077248
@SQ SN:19 LN:59128983
@SQ SN:20 LN:63025520
@SQ SN:21 LN:48129895
@SQ SN:22 LN:51304566
@SQ SN:X LN:155270560
@SQ SN:Y LN:59373566
@SQ SN:MT LN:16569
@SQ SN:GL000207.1 LN:4262
@SQ SN:GL000226.1 LN:15008
@SQ SN:GL000229.1 LN:19913
@SQ SN:GL000231.1 LN:27386
@SQ SN:GL000210.1 LN:27682
@SQ SN:GL000239.1 LN:33824
@SQ SN:GL000235.1 LN:34474
@SQ SN:GL000201.1 LN:36148
@SQ SN:GL000247.1 LN:36422
@SQ SN:GL000245.1 LN:36651
@SQ SN:GL000197.1 LN:37175
@SQ SN:GL000203.1 LN:37498
@SQ SN:GL000246.1 LN:38154
@SQ SN:GL000249.1 LN:38502
@SQ SN:GL000196.1 LN:38914
@SQ SN:GL000248.1 LN:39786
@SQ SN:GL000244.1 LN:39929
@SQ SN:GL000238.1 LN:39939
@SQ SN:GL000202.1 LN:40103
@SQ SN:GL000234.1 LN:40531
@SQ SN:GL000232.1 LN:40652
@SQ SN:GL000206.1 LN:41001
@SQ SN:GL000240.1 LN:41933
@SQ SN:GL000236.1 LN:41934
@SQ SN:GL000241.1 LN:42152
@SQ SN:GL000243.1 LN:43341
@SQ SN:GL000242.1 LN:43523
@SQ SN:GL000230.1 LN:43691
@SQ SN:GL000237.1 LN:45867
@SQ SN:GL000233.1 LN:45941
@SQ SN:GL000204.1 LN:81310
@SQ SN:GL000198.1 LN:90085
@SQ SN:GL000208.1 LN:92689
@SQ SN:GL000191.1 LN:106433
@SQ SN:GL000227.1 LN:128374
@SQ SN:GL000228.1 LN:129120
@SQ SN:GL000214.1 LN:137718
@SQ SN:GL000221.1 LN:155397
@SQ SN:GL000209.1 LN:159169
@SQ SN:GL000218.1 LN:161147
@SQ SN:GL000220.1 LN:161802
@SQ SN:GL000213.1 LN:164239
@SQ SN:GL000211.1 LN:166566
@SQ SN:GL000199.1 LN:169874
@SQ SN:GL000217.1 LN:172149
@SQ SN:GL000216.1 LN:172294
@SQ SN:GL000215.1 LN:172545
@SQ SN:GL000205.1 LN:174588
@SQ SN:GL000219.1 LN:179198
@SQ SN:GL000224.1 LN:179693
@SQ SN:GL000223.1 LN:180455
@SQ SN:GL000195.1 LN:182896
@SQ SN:GL000212.1 LN:186858
@SQ SN:GL000222.1 LN:186861
@SQ SN:GL000200.1 LN:187035
@SQ SN:GL000193.1 LN:189789
@SQ SN:GL000194.1 LN:191469
@SQ SN:GL000225.1 LN:211173
@SQ SN:GL000192.1 LN:547496
@PG ID:bwa PN:bwa VN:0.5.9-r16

So, my question is, is there a way to fix this problem?

Last edited by dongshenglulv; 11-18-2011 at 09:44 PM.
dongshenglulv is offline   Reply With Quote
Old 11-19-2011, 07:02 AM   #2
swbarnes2
Senior Member
 
Location: San Diego

Join Date: May 2008
Posts: 912
Default

Add VALIDATION_STRINGENCY=LENIENT to your command line.

This is a pretty minor problem. It's just like it says...you've got a read that's flagged as unmapped, yet has a mapping quality. This is technically allowable in the .sam format, but Picard is being strict by default and refusing to handle it. bwa, for instance, will output reads like this, because it concatenates reference sequences together, and when a read hangs off of one sequence and on to another, bwa will mark it as mapped, but will also throw the unampped flag in there as a sign that something is a bit off.

So change the strictness and you'll be fine. On lenient, it'll output all the read names that it has problems with.
swbarnes2 is offline   Reply With Quote
Old 11-20-2011, 05:06 AM   #3
dongshenglulv
Member
 
Location: Shanghai

Join Date: May 2011
Posts: 15
Default

Thanks very much, I've already done by what you've suggested.
dongshenglulv is offline   Reply With Quote
Old 07-05-2013, 12:58 PM   #4
bwubb
Member
 
Location: Philadelphia

Join Date: Jan 2012
Posts: 55
Default

Ok so this use to not be a problem for me. VALIDATION_STRINGENCY=LENIENT ( OR SILENT) use to work.

Recently though, perhaps since upgrading to picard tools 1.94 I have not been able to get passed this error.

It happens at the end of AddOrReplaceReadGroups

Code:
...
INFO	2013-07-05 16:34:17	AddOrReplaceReadGroups	Processed    20,000,000 records.  Elapsed time: 00:06:16s.  Time for last 1,000,000:   18s.  Last read position: X:71,599,822
[Fri Jul 05 16:34:33 EDT 2013] net.sf.picard.sam.AddOrReplaceReadGroups done. Elapsed time: 6.55 minutes.
Runtime.totalMemory()=2851209216
To get help, see http://picard.sourceforge.net/index.shtml#GettingHelp
Exception in thread "main" net.sf.samtools.SAMFormatException: SAM validation error: ERROR: Record 20570683, Read name HWI-ST965:305:C0MR9ACXX:7:2212:16408:51025, MAPQ should be 0 for unmapped read.
	at net.sf.samtools.SAMUtils.processValidationErrors(SAMUtils.java:448)
	at net.sf.samtools.BAMFileReader$BAMFileIterator.advance(BAMFileReader.java:541)
	at net.sf.samtools.BAMFileReader$BAMFileIterator.next(BAMFileReader.java:522)
	at net.sf.samtools.BAMFileReader$BAMFileIterator.next(BAMFileReader.java:481)
	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.AddOrReplaceReadGroups.doWork(AddOrReplaceReadGroups.java:98)
	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.AddOrReplaceReadGroups.main(AddOrReplaceReadGroups.java:66)
Is anyone else running into this issue again? Im trying to use CleamSam first right now, but that has never seemed to work for anyone ever, as far as I can tell.
bwubb is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 05:22 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO