chapmanb / bcbb

Incubator for useful bioinformatics code, primarily in Python and R
http://bcbio.wordpress.com
610 stars 243 forks source link

test_2_rnaseq - Error: "Aligned record iterator [...] is behind the unmapped reads..." #53

Closed vals closed 12 years ago

vals commented 12 years ago

Hey Brad, recently when I've been running the test suite the test AutomatedAnalysisTest.test_2_rnaseq the command

java -Xmx6g -jar /bubo/sw/apps/bioinfo/picard/1.41/MergeBamAlignment.jar UNMAPPED=/bubo/home/h10/vale/bcbb/nextgen/tests/test_automated_output/alignments/1_110907_ERP000591_tophat/1_110907_ERP000591_1_fastq-fastq.bam ALIGNED=/bubo/home/h10/vale/bcbb/nextgen/tests/test_automated_output/alignments/1_110907_ERP000591_tophat/1_110907_ERP000591.sam OUTPUT=/bubo/home/h10/vale/bcbb/nextgen/tests/test_automated_output/alignments/1_110907_ERP000591_tophat/tx/1_110907_ERP000591.bam REFERENCE_SEQUENCE=/bubo/nobackup/uppnex/reference/biodata/genomes/Mmusculus/mm9/seq/mm9.fa TMP_DIR=/bubo/home/h10/vale/bcbb/nextgen/tests/test_automated_output/tmp/tmpD2zhfL PAIRED_RUN=true VALIDATION_STRINGENCY=SILENT

is run and fails with the error

Exception in thread "main" java.lang.IllegalStateException: Aligned record iterator (ERR032227.10000043) is behind the unmapped reads (ERR032227.10000043)
        at net.sf.picard.sam.AbstractAlignmentMerger.mergeAlignment(AbstractAlignmentMerger.java:178)
        at net.sf.picard.sam.SamAlignmentMerger.mergeAlignment(SamAlignmentMerger.java:148)
        at net.sf.picard.sam.MergeBamAlignment.doWork(MergeBamAlignment.java:128)
        at net.sf.picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:156)
        at net.sf.picard.sam.MergeBamAlignment.main(MergeBamAlignment.java:102)

I can't figure out with this is referring to, searching on the internet I just found the source code for MergeBamAlignment.

Do you know what might be going wrong?

And by the way, which version if Picard are you using and recommend? We are running Picard 1.41 over here, could this be due to us using an old version?

We always appreciate your help!

chapmanb commented 12 years ago

Valentine; I put in a fix for this one:

https://github.com/chapmanb/bcbb/blob/master/nextgen/bcbio/pipeline/alignment.py#L53

but it doesn't appear to have made it in your branch yet. If you pull/merge that it should clean it up.

Independently it is a good idea to upgrade Picard. You want to keep current with it, like GATK, as they're continuously pulling in new features and adding bug fixes.

Brad

vals commented 12 years ago

Thanks Brad! I had missed in your commits that there had been a fix.

First I merged in your changes, but I still got the same error, then I installed Picard 1.64, and the error disappeared.