problem converting indexed fasta file to SAM format using bowtie2
1
0
Entering edit mode
8.7 years ago

Hi,

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?

fasta index SAM bowtie2 SNP • 1.9k views
ADD COMMENT
1
Entering edit mode

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 REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode
8.7 years ago
mastal511 ★ 2.1k

The two types of index are different.

ADD COMMENT

Login before adding your answer.

Traffic: 1626 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6