Skip to content
arundurvasula edited this page Nov 7, 2014 · 22 revisions

Welcome! This page will walk you through basic population genetic analysis using ANGSD and angsd-wrapper.

Data preparation

There are 3 types of data needed for analysis in ANGSD:

  • A reference sequence (.fasta)
  • An ancestral reference sequence (.fasta)
  • Individual sequences mapped to the reference sequence (.bam)

In order to simplify the input, ANGSD requires that the file paths to the bam files be placed in one file. For example, the data/BKN_samples.txt included in the repository has a list of paths to bam files. Thus, to get started with ANGSD analysis, our data folder will contain the following files:

data/{TAXON}_samples.txt
data/refseq.fasta
data/ancseq.fasta

NOTE: The {TAXON} part of the samples file is important. angsd-wrapper will look for files named exactly like that. See the wiki page for more information.

Site frequency spectrum

Now we are ready to do our first analysis, a site frequency spectrum. In ANGSD, this takes 2 steps that have been simplified in angsd-wrapper:

  1. create a binary file containing a prior for the SFS
  2. obtain a maximum likelihood estimate of the SFS

Using angsd-wrapper, we can accomplish this by modifying the included configuration file (or creating a new one) to include the path to the ancestral sequence, the reference sequence, and the TAXON variable (which will point to the list of bams).

Once you have modified the configuration file to include this information, you can begin the analysis. If you are just running the analysis on your local computer, you can begin it by running (from the angsd directory):

$ bash scripts/ANGSD_SFS.sh scripts/sfs_example.conf

If you are running it on a cluster, you will likely need to create a submission script. In slurm, you can do something like the following:

sfs_submit.sh:

#!/bin/bash
#SBATCH -D /home/adurvasu/angsd-wrapper
#SBATCH -J Slurm-SFS
#SBATCH -o /home/adurvasu/angsd-wrapper/results/out-%j.txt
#SBATCH -e /home/adurvasu/angsd-wrapper/results/error-%j.txt

bash scripts/ANGSD_SFS.sh scripts/sfs_example.conf

Then submit the script to your cluster's queue:

$ sbatch -p serial scripts/sfs_submit.sh

Clone this wiki locally