This is a test version of Biostars. For the public version, visit https://www.biostars.org.
BWA cufflink error

I used BWA for alignment and then used the sam generated by BWA for alignment, but I am getting the following error

Error: this SAM file doesn't appear to be correctly sorted!
current hit is at IWGSC_CSS_1DL_scaff_2280152:6081, last one was at IWGSC_CSS_1DL_scaff_2280152:6084
Cufflinks requires that if your file has SQ records in the SAM header that they appear in the same order as the chromosomes names in the alignments.
If there are no SQ records in the header, or if the header is missing, the alignments must be sorted lexicographically by chromosome name and by position.
cufflinks bwa

I have only SAM file which was generated by BWA. Also I tried with bowtie and it says

the reference sequence has more than 2^32-1 characters! Please divide the reference into batches or chunks of about 3.6 billion character or less each and index each independently.

So convert it to a BAM file and sort it (or use picard tools and just directly sort the SAM file).

Recent versions of bowtie2 wouldn't produce the error that you're reporting.

1 answer

Just sort the BAM file. It's funny how often doing what an error message says will make said error message disappear...

Log in to answer this question.