Hi Alistair,
The problem is that for a coordinate-sorted BAM, the records with
chromosome=* and coordinate=0 must go after all the records that have
non-empty chromosome and coordinate. In your case, a read with
chromosome=* and coordinate=0 came before a read with chromosome=1 and
coordinate=10001.
-Alec
On 9/27/11 2:12 PM, Alistair Ward wrote:
> Hi,
>
> I am trying to mark duplicate reads in a large BAM file in which there
> are many unmapped reads. If I run the tool, I get the following error:
>
> Exception in thread "main" java.lang.IllegalArgumentException:
> Alignments added out of order in SAMFileWriterImpl.addAlignment for
> <file>. Sort order is coordinate. Offending records are at [*:0] and
> [1:10001]
>
> As far as I am aware, it is not breaking spec for the BAM file to
> contain unmapped records with the chromosome set to * and the
> coordinate 0. Is this true? Obviously, I would expect all of these
> unmapped reads to be ignored by the duplicate marker. I removed the
> unmapped reads from the BAM file and tried to mark duplicates without
> any problems, so it seems clear that it is the unmapped reads that are
> causing the problems.
>
> Please could you advise me on how Picard is constructed to handle this
> situation and if I am using things incorrectly. Thank you for your help,
>
> Alistair Ward
>
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2dcopy1
>
>
> _______________________________________________
> Samtools-help mailing list
> Sam...@li...
> https://lists.sourceforge.net/lists/listinfo/samtools-help
|