I am using picard's MergeBamAlignment w/ a BAM generated by bwa-sw and illumina paired-end FASTQ data. Note: the reads contain trailing a "/1" or "/2" in the names. The process is:
1) generate BAM using bwa-sw. When this runs, the resulting BAM has alignments names that stripped off the trailing "/1" or "/2". 2) use FastqToSam to convert all reads from FASTQ1 + FASTQ2 into a single SAM. The read name contain trailing a "/1" or "/2". 3) run MergeBamAlignment using the BAMs created above I believe the problem is that the names dont match up. I get an error along the lines of: 07 Nov 2014 14:19:13,639 DEBUG: Exception in thread "main" java.lang.IllegalStateException: Aligned record iterator (M00370:96:000000000-AAU0P:1:1101:10136:22111) is behind the unmapped reads (M00370:96:000000000-AAU0P:1:1101:10136:22111/1) 07 Nov 2014 14:19:13,643 DEBUG: at picard.sam.AbstractAlignmentMerger.mergeAlignment(AbstractAlignmentMerger.java:375) 07 Nov 2014 14:19:13,646 DEBUG: at picard.sam.SamAlignmentMerger.mergeAlignment(SamAlignmentMerger.java:173) 07 Nov 2014 14:19:13,650 DEBUG: at picard.sam.MergeBamAlignment.doWork(MergeBamAlignment.java:244) 07 Nov 2014 14:19:13,654 DEBUG: at picard.cmdline.CommandLineProgram.instanceMain(CommandLineProgram.java:183) 07 Nov 2014 14:19:13,659 DEBUG: at picard.sam.MergeBamAlignment.main(MergeBamAlignment.java:213) 07 Nov 2014 14:19:13,664 WARN : process exited with non-zero value: 1 Looking at the code, we have 2 iterators, each running over the alignment names in the respective BAMs. One is using names w/o the trailing numbers and one kept them. I see options like STRIP_UNPAIRED_MATE_NUMBER in FastqToSam, but that doesnt seem like it applies to my paired end FASTQs. Did I miss a step or option in preparing these files? Is there a standard way to handle this? Thanks for any help. -Ben
------------------------------------------------------------------------------
_______________________________________________ Samtools-help mailing list Samtools-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/samtools-help