6.9 saf
Estimating Site Allele Frequencies
Site Allele Frequency files generated using the are saf task can be used as input files to generate SFS (site frequency spectra) with tools such as winsfs. If the goal is to generate folded SFS, --fasta should be the reference genome. If the goal is to generate unfolded SFS, --fasta should contain the ancestral alleles of outgroup data (the ancestral state), which can be generated using the task alleleCounts followed by ancestralAlleles. This task requires the sample-specific genotype likelihoods in glf format, which can be created with the ATLAS task GLF.
6.9.1 Input
Required inputs :
--glf glf_file1.glf.gz,glf_file2.glf. or --glf glf_file.txt |
Input glf files for every sample of the population. Can be provided on the command line or with an input text file (one file name per line). |
--fasta Input.fasta |
Reference genome or ancestral states fasta. |
Example input file listing all glf files:
glf_file_1.glf.gz
glf_file_2.glf.gz
glf_file_3.glf.gz
glf_file_4.glf.gz
Optional inputs :
None
Specific Parameters :
--minSamplesWithData integer_value |
To keep only sites for which at least the indicated number of samples have data. Default = 1. |
6.9.3 Usage Example
#! /bin/bash
# Set atlas path
atlas=$(dirname "$0")/../build/atlas
# Simulate 5 BAM files in Hardy–Weinberg equilibrium
$atlas simulate --type HW --sampleSize 5
# Create GLF files
for f in *.bam; do
$atlas GLF --bam $f
done
samples=$(ls -1 *.glf.gz | paste -s -d ',' -)
# Create site allele frequencies file
$atlas saf --glf $samples --fasta ATLAS_simulations.fasta