6.4 calculateF2

Calculate F2 between different samples, and within and between populations

calculateF2 estimates F2 based on the number of different sites and the total number of compared sites for each pairwise comparison from a multi-sample VCF. It can calculate F2 between different samples, and within and between populations. A VCF file used as input for calculateF2 can be created with the ATLAS task majorMinor or call.

6.4.1 Parameters

6.4.1.1 Input

--vcf file.vcf.gz Input VCF file (see majorMinor or call for generating such a file).

Optional

--samples samples_Populations.txt Text file containing the samples to be used and their population affiliation. Different values will be estimated for different populations. If no populations are provided, all samples are considered to come from the same population.

Example samples_Populations.txt file:

sample1 1
sample2 1
sample5 2
sample8 2

6.4.2 Output

*_counts.txt A n*n matrix containing the counts of different sites in the upper triangle and the total number of compared sites in the lower triangle for all possible pair of samples.
*_sampleF2.txt A n*n matrix containing the pairwise sample F2 (#diff Sites/#compared Sites) for all possible pair of samples.
*_popF2.txt A p*p matrix containing the average F2 within and between populations for all possible pairs.

6.4.3 Usage Example

# Simulate 5 samples in Hardy–Weinberg Equilibrium and write vcf file
atlas simulate --vcf --type HW --sampleSize 5

# calculate F2 between samples
atlas calculateF2 --vcf ATLAS_simulations.vcf.gz