Upgraded to picard-2.8.2 and re-ran using VALIDATION_STRINGENCY=LENIENT, as recommended above. The job failed after ~7 hours, created a 68 GB BAM, 13 MB BAI, and a 200 MB log file.
The log contains a ton of "Ignoring SAM validation error" messages. Below is the last few lines of the log:
Ignoring SAM validation error: ERROR: Record 805313152, Read name K00135:43:H3VC2BBXX:2:2228:1681:49107, Mate Alignment start (1916272743) must be <= reference sequence length (90354753) on reference chr16
INFO 2017-01-27 17:56:07 MarkDuplicates Before output close freeMemory: 18524841008; totalMemory: 18696110080; maxMemory: 22487236608
INFO 2017-01-27 17:56:10 MarkDuplicates After output close freeMemory: 18524838000; totalMemory: 18696110080; maxMemory: 22487236608
[Fri Jan 27 17:56:10 EST 2017] picard.sam.markduplicates.MarkDuplicates done. Elapsed time: 398.98 minutes.
Runtime.totalMemory()=18696110080
real 399m0.405s
user 384m57.886s
sys 9m45.964s
[Fri Jan 27 17:56:11 EST 2017] picard.sam.BuildBamIndex INPUT=dedup_CB1_valstr.bam VERBOSITY=INFO QUIET=false VALIDATION_STRINGENCY=STRICT COMPRESSION_LEVEL=5 MAX_RECORDS_IN_RAM=500000 CREATE_INDEX=false CREATE_MD5_FILE=false GA4GH_CLIENT_SECRETS=client_secrets.json
[Fri Jan 27 17:56:11 EST 2017] Executing as me@comp205t on Linux 2.6.32-642.el6.x86_64 amd64; OpenJDK 64-Bit Server VM 1.8.0_101-b13; Picard version: 2.8.2-SNAPSHOT
[Fri Jan 27 18:29:42 EST 2017] picard.sam.BuildBamIndex done. Elapsed time: 33.51 minutes.
Runtime.totalMemory()=2044723200
To get help, see http://broadinstitute.github.io/picard/index.html#GettingHelp
Exception in thread "main" htsjdk.samtools.SAMFormatException: SAM validation error: ERROR: Record 801397832, Read name K00135:24:H3V7TBBXX:1:1101:13078:1332, Mate Alignment start (1651771652) must be <= reference sequence length (59128983) on reference chr19
at htsjdk.samtools.SAMUtils.processValidationErrors(SAMUtils.java:448)
at htsjdk.samtools.BAMFileReader$BAMFileIterator.advance(BAMFileReader.java:665)
at htsjdk.samtools.BAMFileReader$BAMFileIterator.next(BAMFileReader.java:650)
at htsjdk.samtools.BAMFileReader$BAMFileIterator.next(BAMFileReader.java:620)
at htsjdk.samtools.SamReader$AssertingIterator.next(SamReader.java:569)
at htsjdk.samtools.SamReader$AssertingIterator.next(SamReader.java:543)
at htsjdk.samtools.BAMIndexer.createIndex(BAMIndexer.java:305)
at htsjdk.samtools.BAMIndexer.createIndex(BAMIndexer.java:289)
at picard.sam.BuildBamIndex.doWork(BuildBamIndex.java:147)
at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:205)
at picard.cmdline.PicardCommandLine.instanceMain(PicardCommandLine.java:94)
at picard.cmdline.PicardCommandLine.main(PicardCommandLine.java:104)
What happens if you
samtools view file.Aligned.sortedByCoord.bam chr19 | grep K00135:24:H3V7TBBXX:1:1101:13078:1332?What was the STAR command that created this (it's probably in the BAM header)?
What version of STAR is this?
The SAMtools command returns:
STAR command in BAM header:
STAR version 2.5.1b
Index the file and then try the samtools command again.
Results:
If that still happens in the most recent version of picard then it's a bug in it.