Samtools mpileup fasta index problem
1
0
Entering edit mode
9.4 years ago
JW ▴ 10

Hi,

I have a directory of .fasta files and .fasta.fai files. I am trying to use those as a reference sequence to the samtools mpileup command for reads in a different directory (BAM-Format):

for I in *
do
../../../../../../samtools-1.2/samtools mpileup ../Sorted_bam/Sorted_Aligned_$i.bam.bam -f $i -d 16847 -g -P flat > $i.bcf
done

But when I run it I get the error:

[mpileup] 1 samples in 1 input files
[fai_load] build FASTA index.
[fai_load] fail to open FASTA index.

​14 times (there are 14 files). What am I be doing wrong?

Thanks in advance.

fasta next-gen samtools • 6.2k views
ADD COMMENT
0
Entering edit mode

To to run samtools faidx $i by itself and see if you get the same error.

ADD REPLY
1
Entering edit mode
9.4 years ago

if your directory has both .fasta and .fasta.fai files, the for loop needs to avoid the .fasta.fai ones:

for i in *.fasta
ADD COMMENT
0
Entering edit mode

Yup it worked. Thanks!

ADD REPLY

Login before adding your answer.

Traffic: 1869 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