Hello!
I input sorted and indexing bam file to LeftAlignIndels: ~/Soft/gatk-4.1.9.0/gatk LeftAlignIndels -I bam_fin/Exome_dups.bam -R /mnt/lapd/Index_hum/dna2/GRCh_2021.fa -O bam_fin/Exome.bam
And have this error:
'java.lang.IllegalArgumentException: Alignments added out of order in SAMFileWriterImpl.addAlignment for file:///mnt/lapd/Vika_data/RNF_raw/exome/bam_fin/Exome.bam. Sort order is coordinate. Offending records are at [1:152985370] and [1:152985347] at htsjdk.samtools.SAMFileWriterImpl.assertPresorted(SAMFileWriterImpl.java:197) at htsjdk.samtools.SAMFileWriterImpl.addAlignment(SAMFileWriterImpl.java:184) at htsjdk.samtools.AsyncSAMFileWriter.synchronouslyWrite(AsyncSAMFileWriter.java:36) at htsjdk.samtools.AsyncSAMFileWriter.synchronouslyWrite(AsyncSAMFileWriter.java:16) at htsjdk.samtools.util.AbstractAsyncWriter$WriterRunnable.run(AbstractAsyncWriter.java:123) at java.base/java.lang.Thread.run(Thread.java:829)'
I want to note that the unsorted file is the output bam.
I appreciate your help!
With best regards, Viktoriia
is Exome_dups.bam sorted and indexed ? what's the output of picard ValidateSamFile with Exome_dups.bam ?
Yes, the file was sorted and indexed.
you should try to re-sort and/or re-index your file.
your bam is not sorted. you got
Last read position: 16:2,971,202
and thenLast read position: 19:50,278,169
and then chr16 again16:31,473,305
...