.fai file generation for a vcf file containing snps
2
0
Entering edit mode
8.6 years ago

I would like to generate a .fai file for all the snps belonging to a specific gene. How I'll be able to do that?

Do I have to download all the sequences belonging to each snps (e.g. rs124536) from NCBI and make a .fa file and then use samtools to convert it to .fai?

fai snps • 4.7k views
ADD COMMENT
2
Entering edit mode
8.6 years ago

Your question is confusing.

  1. Fasta indexing generates .fai files. There are several tools to index fasta files.
  2. If you want to generate fasta file from VCF (using a reference), the same question is answered several times in this forum. E.g., Introducing Known Mutations (From A Vcf) Into A Fasta File
  3. If you are looking for indexing VCF (standard format for storing SNVs/MNVs/DIVs), there are several tools.

Downloading all SNVs (in general as VCF) and indexing won't generate a sequence file (.fasta) with all the SNPs.

ADD COMMENT
0
Entering edit mode

The software I am working with (ANGSD) requires .fai file along with a .vcf file as input.

Would you please tell me how I will be able to get the .fai file for a .vcf file?

ADD REPLY
0
Entering edit mode

The .fai file mentioned in page: http://www.popgen.dk/angsd/index.php/Input corresponds to reference fasta file. Index your reference fasta file and this would create a fai file. This fai file should be supplied to the command. Example command would be (assuming that your reference sequence used in alignment is reference.fa and vcf file is sample.vcf):

#for using GL tags
./angsd -vcf-gl sample.vcf -fai reference.fa.fai -nind <sample numbers in your VCF> -domaf 1 -out <output_file_name>
#for using GP tags
./angsd -vcf-gp sample.vcf -fai reference.fa.fai -nind <sample numbers in your VCF> -domaf 1 -out <output_file_name>

One cannot create a fai from VCF file. VCF indexing produces idx files and fasta indexing generates fai files, in general.

ADD REPLY
1
Entering edit mode
8.6 years ago

.fai files are specific to fasta files. If you have a VCF file then google "tabix".

ADD COMMENT

Login before adding your answer.

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