Command
picard-tools-1.118/MarkDuplicates.jar I=file.Aligned.sortedByCoord.bam O=file_out.bam METRICS_FILE=file_out.metrics
Error Message
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
file.Aligned.sortedByCoord.bam was created by STAR.
Has anyone else encountered a similar error? If so, what was the fix? Thanks!
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.