Question: A faidx-indexed FASTA format file or a FASTA format file
0
gravatar for lisadavic66
3.9 years ago by
United States
lisadavic660 wrote:

Hi all,

 

I have a question about the usage of “SAMtools mpileup, -f”. From the SAMtools document (http://samtools.sourceforge.net/samtools.shtml), the option of SAMtools mpileup, -f, indicates the input is a faidx-indexed reference file in the FASTA format. But I found that many people didn’t use the faidx-indexed reference file, e.g., here (http://samtools.sourceforge.net/mpileup.shtml) the author just used a FASTA file, ref.fa, but not a faidx-indexed reference file such as ref.fa.fai:

 

samtools mpileup -uf ref.fa aln1.bam aln2.bam | bcftools view -bvcg - > var.raw.bcf  

 

However, the author said at the beginning: “Suppose we have reference sequences in ref.fa, indexed by samtools faidx”.

 

My question is what file we should use? ref.fasta.fai or ref.fasta?

 

Could you please help me with this question? Thank you very much in advance.

 

Sincerely,

snp • 2.8k views
ADD COMMENTlink modified 3.9 years ago by harold.smith.tarheel4.4k • written 3.9 years ago by lisadavic660
1
gravatar for Istvan Albert
3.9 years ago by
Istvan Albert ♦♦ 81k
University Park, USA
Istvan Albert ♦♦ 81k wrote:

The fasta file is indexed but what that means is that there is a second file the index that is next to the original file.

So one would list the original file but the programs will access both the original file and this second index file with the same name and with the .fai extension. Confusing but kind of a standard in bioinformatics indexing.

This is because we need to keep the original files in text mode.

 

ADD COMMENTlink modified 3.9 years ago • written 3.9 years ago by Istvan Albert ♦♦ 81k

Thank  you for your  help. But I am still not clear what file I should list in the command line. Do you mean even if I list a FASTA format file in a command line just like this:

 

samtools mpileup -f ref.fa 

 

the SAMtools works actually on the faidx-indexed file? Thanks.

ADD REPLYlink written 3.9 years ago by lisadavic660

Yes. The assumption is file is accompanied by file.fai. 

ADD REPLYlink written 3.9 years ago by Matt Shirley9.1k
0
gravatar for harold.smith.tarheel
3.9 years ago by
United States
harold.smith.tarheel4.4k wrote:

You should first index the the ref.fa with faidx (to create ref.fa.fai in the same directory as ref.fa), then use ref.fa on the command line for mpileup. Both files are required.

ADD COMMENTlink modified 3.9 years ago • written 3.9 years ago by harold.smith.tarheel4.4k
Please log in to add an answer.

Help
Access

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