Issue creating BAM index file

719 views
Skip to first unread message

munasur12

unread,
Mar 2, 2016, 2:58:25 PM3/2/16
to last-align
Hi,


I am having issues creating index file for my BAM file. The error I am getting is : [E::hts_idx_push] unsorted positions. samtools index: "L003.trimmed_adapt_qual_PAIRED_results_sorted_fixmate_sorted.bam" is corrupted or unsorted

Here are the commands I am running:
1. maf-convert sam $indir/LAST/$fprefix.trimmed_adapt_qual_PAIRED_results.maf > $indir/LAST/$fprefix.trimmed_adapt_qual_PAIRED_results.sam 

2. samtools view -bt SWS484SPF_PBJ_ScaffoldsF500.fasta.fai $indir/LAST/$fprefix.trimmed_adapt_qual_PAIRED_results.sam > $indir/LAST/$fprefix.trimmed_adapt_qual_PAIRED_results.bam

3. samtools sort --reference SWS484SPF_PBJ_ScaffoldsF500.fasta -n $indir/LAST/$fprefix.trimmed_adapt_qual_PAIRED_results.bam -T $fprefix -O bam -o $indir/LAST/$fprefix.trimmed_adapt_qual_PAIRED_results_sorted.bam

4. samtools fixmate --reference SWS484SPF_PBJ_ScaffoldsF500.fasta $indir/LAST/$fprefix.trimmed_adapt_qual_PAIRED_results_sorted.bam -O bam $indir/LAST/$fprefix.trimmed_adapt_qual_PAIRED_results_sorted_fixmate.bam

5. samtools sort --reference SWS484SPF_PBJ_ScaffoldsF500.fasta -n $indir/LAST/$fprefix.trimmed_adapt_qual_PAIRED_results_sorted_fixmate.bam -T $fprefix -O bam -o $indir/LAST/$fprefix.trimmed_adapt_qual_PAIRED_results_sorted_fixmate_sorted.bam

6. samtools index $indir/LAST/$fprefix.trimmed_adapt_qual_PAIRED_results_sorted_fixmate_sorted.bam $indir/LAST/$fprefix.trimmed_adapt_qual_PAIRED_results_sorted_fixmate_sorted.bai


I am using LAST version 7.19 and samtools version 1.3. 


I would appreciate any insight you can give.

Thanks,
Muna

munasur12

unread,
Mar 3, 2016, 10:59:28 AM3/3/16
to last-align
Hi,

I have tried include the no header flag when running  maf-convert and the error still persists.

Any insight you can provide would be great.

Thanks,
Muna

FrithMartin

unread,
Mar 7, 2016, 12:29:34 AM3/7/16
to munasur12, last-align

Hi:


I'm no sam-ology expert, just guessing here: maybe you need to remove "-n" from your final sort step, to get the needed sort order?


Have a nice day,

Martin Frith



From: last-...@googlegroups.com <last-...@googlegroups.com> on behalf of munasur12 <anuradha...@gmail.com>
Sent: Friday, March 4, 2016 12:59 AM
To: last-align
Subject: [last-align] Re: Issue creating BAM index file
 
--
You received this message because you are subscribed to the Google Groups "last-align" group.
To unsubscribe from this group and stop receiving emails from it, send an email to last-align+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

geis...@gmail.com

unread,
Jun 9, 2016, 5:35:02 AM6/9/16
to last-align
Op woensdag 2 maart 2016 20:58:25 UTC+1 schreef munasur12:
> Hi,
>
>
> I am having issues creating index file for my BAM file. The error I am getting is : [E::hts_idx_push] unsorted positions. samtools index: "L003.trimmed_adapt_qual_PAIRED_results_sorted_fixmate_sorted.bam" is corrupted or unsorted
> .......
would appreciate any insight you can give.
>
>
> Thanks,
> Muna

Dear Muna,
I'm having similar problems, from a maf file I cannot create a sam file, that I can converto to a bam file. Your second step, already fails in my case.
Did you get any answers, or have solved the issue?
Kidn regards,

Raymond

Frith, Martin

unread,
Jun 11, 2016, 3:44:03 AM6/11/16
to geis...@gmail.com, last-align
Hi Raymond,

could you tell us the exact error message (and what software versions you used)?

Have a nice day,
Martin Frith

Reply all
Reply to author
Forward
0 new messages