I have four vcf files, SNPs_s1.vcf
, SNPs_s2.vcf
, SNPs_s3.vcf
, and SNPs_s4.vcf
, which contain information about SNPs. These vcf files were obtained by using the following methods: the initial input files were short-paired reads
I did mapping with minimap2
./minimap2 -ax sr ref.fa read1.fq.gz read2.fq.gz > aln.sam
converted to bam file
samtools view -Sb aln.sam > aln.bam
Sorted the bam file
samtools sort aln.bam > aln_sorted.bam
created an index file
samtools index aln_sorted.bam
created an index file of reference
samtools faidx ref.fa
extracted the raw variants using freebayes
freebayes -f ref.fa aln_sorted.bam > out_var_s1.vcf
extracted SNPs using vcf tools
vcftools --vcf out_var_s1.vcf --remove-indels --recode \ --recode-INFO-all --out SNPs_s1.vcf
I would like to calculate the fixation index (Fst) between SNPs_s1.vcf
and SNPs_s2.vcf
, SNPs_s1.vcf
and SNPs_s3.vcf
etc. I attempted to calculate Fst using bcftools
, but I have to provide the id list. I tried the code below for that.
bcftools query -l snps_s1.vcf
The output was "unknown".
How do I calculate Fst using the above vcf files? Your suggestions would be appreciated.
snps_s1.vcf
is set tounknown
. You can fix that bit withsed -i '/^#CHROM/s/unknown/sample1/' snps_s1.vcf
. But gringer's points are the main issue. What are you really trying to do here with only 4 individuals? $\endgroup$