Question: problem converting indexed fasta file to SAM format using bowtie2
gravatar for jamessemaj712
3.0 years ago by
jamessemaj71210 wrote:


1)I downloaded asi_ref_ASM45574v1_chrMT.fa file from NCBI. 2)I created reads using wgsim using the following command: wgsim -N1000 -S1 asi_ref_ASM45574v1_chrMT.fa sim_reads.fq /dev/null

3)Then I created index file of the .fa file mentioned above by using the following command samtools faidx asi_ref_ASM45574v1_chrMT.fa

I got a asi_ref_ASM45574v1_chrMT.fa.fai

4)After this I tried to convert the .fai file to sam for further analysis but received an error. Here is the command bowtie2 -x asi_ref_ASM45574v1_chrMT.fa.fai -U sim_reads.fq -S sim_reads_aligned.sam

and here is the error: Could not locate a Bowtie index corresponding to basename "asi_ref_ASM45574v1_chrMT.fa.fai" Error: Encountered internal Bowtie 2 exception (#1) Command: /usr/bin/bowtie2-align-s --wrapper basic-0 -x asi_ref_ASM45574v1_chrMT.fa.fai -S sim_reads_aligned.sam -U sim_reads.fq (ERR): bowtie2-align exited with value 1

I am not understanding why the error.Where am I wrong?

snp sam fasta index bowtie2 • 979 views
ADD COMMENTlink modified 3.0 years ago by mastal5112.0k • written 3.0 years ago by jamessemaj71210

You need to index the fasta file using bowtie2-build:

bowtie2-build asi_ref_ASM45574v1_chrMT.fa asi_ref_ASM45574v1_chrMT

Then align using:

bowtie2 -x asi_ref_ASM45574v1_chrMT -U sim_reads.fq -S sim_reads_aligned.sam
ADD REPLYlink written 3.0 years ago by fanli.gcb660

Thanks.It works.But may I know why didn't samtols faidx not work?

ADD REPLYlink written 3.0 years ago by jamessemaj71210
gravatar for mastal511
3.0 years ago by
mastal5112.0k wrote:

The two types of index are different.

ADD COMMENTlink written 3.0 years ago by mastal5112.0k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2525 users visited in the last hour