I'm having issues with the mergeBam function from Picard. I getting the following error:
Exception in thread "main" java.lang.IllegalStateException: Aligned record iterator (A00419:256:HK7NFDRXX:1:2101:10294:3850) is behind the unmapped reads (A00419:256:HK7NFDRXX:1:2101:10294:4038)
I saw that many people got this same error and this is potentially due to the ubam file is not sorted by queryname, however my unmapped bam files were all sorted by queryname when I converted my fastq using the function FastqToSam. I even try to sort it again using SortSam, but I am still getting the error.
My mapped files came from a two pass STAR step and they were sorted by coordinate by STAR. I don't think this is the problem because I already merge files using the same pipeline and they worked fine.
Any ideas why and what can I do about this error?
Please sign in to leave a comment.