Hi Nils,

Thanks for the reply.  I ultimately tracked this down to an error on my
end.  The gist is that my script was recombining orphan paired reads and
trying to convert to SAM.  While the data were technically paired end (and
named accordingly), they were not being used as such.  When I stepped
through the picard code it became clear what was going wrong.  It works as
it should.

As an aside: in FastqToSam, for my application it would have been
convenient if STRIP_UNPAIRED_MATE_NUMBER also removed "/2" in addition to
"\1".  I worked around it though.

-Ben



On Thu, Nov 20, 2014 at 2:16 PM, Nils Homer <nho...@broadinstitute.org>
wrote:

> Hey Ben,
>
> the resulting SAM should not have a trailing "/1" or "/2", and if that is
> the case using SamToFastq, then I believe that is a bug.  Could you send a
> minimal test case and I can help debug?
>
> N
>
> On Fri, Nov 7, 2014 at 9:44 AM, Ben Bimber <bbim...@gmail.com> wrote:
>
>> 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
>>
>>
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Samtools-help mailing list
Samtools-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/samtools-help

Reply via email to