Thanks Stefan, I'm glad it was something simple. Normally samtools index would spot an unsorted file much earlier in the sorting process, and give an explicit and helpful error message.
It looks like the much rarer error message you got could be made more user friendly... The error message is actually from htslib, line 974 of file hts.c, but without studying the code more carefully I don't immediately see what it is checking, and how best to rephrase the message. Regards, Peter On Tue, Feb 17, 2015 at 8:48 PM, Stefan Nordlander <stefan.o.nordlan...@gmail.com> wrote: > Finally had time to try this, you we're absolutely right Peter! Running a > sort on the .bam file fixed our problem. > Thanks a lot, now we have a lot of work to do :) > > Cheers, > /Stefan > > On Fri, Feb 13, 2015 at 3:43 PM, Peter Cock <p.j.a.c...@googlemail.com> > wrote: >> >> On Fri, Feb 13, 2015 at 1:55 PM, Stefan Nordlander >> <stefan.o.nordlan...@gmail.com> wrote: >> > Greetings samtools-list members, >> > >> > I'm assisting an associate with some calculations, and we've run into >> > some problems with samtools. >> > What I'm trying to do is to generate a .bai index file but I get the >> > following error message: >> > >> > NO_COOR reads not in a single block at the end 0 -1 >> >> If your BAM file is sorted, then all the reads with no POS >> value (i.e. NO_COOR) should be at the end. Are they? >> >> > I found the suggestion to add -c to samtools which did not help. I also >> > found at http://sourceforge.net/p/samtools/mailman/message/33155863/ the >> > suggestion that samtools only supports chromosome length of 512Mbp for >> > index >> > generation. However our longest chromosome is +248Mbp, far from 512Mbp. >> > >> > Any help would be appreciated! >> >> Yes, this does not look like a problem with the reference length. >> >> Peter > ------------------------------------------------------------------------------ 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=190641631&iu=/4140/ostg.clktrk _______________________________________________ Samtools-help mailing list Samtools-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/samtools-help