ANGSD: Analysis of next generation Sequencing Data
Latest tar.gz version is (0.938/0.939 on github), see Change_log for changes, and download it here.
Quick Start
This page contains some random examples that shows some aspect of the ANGSD program. There is also an old Tutorial, but this is somewhat outdated. We assume you will have SAMtools installed.
Many of the examples in the individual subpages are based on this test data set. The examples below are just some random examples.
Download and prepare
First download some test data of random small BAM files which contains some regions from different chromosomes for 10 samples from the 1000genomes project. The file size is around 100megabytes.
wget http://popgen.dk/software/download/angsd/bams.tar.gz tar xf bams.tar.gz
This has made a folder called bams/, which contains our 10 samples. Now download and install angsd you can follow the guidelines at the Installation page which basicly says:
wget http://popgen.dk/software/download/angsd/angsd0.570.tar.gz tar xfz angsd0.570.tar.gz cd angsd0.570 make cd ..
We will also index the BAM files in case we need to do random access, for this we will use SAMtools.
for i in bams/*.bam;do samtools index $i;done
We make a file containing a list of the locations of the 10 bamfiles
ls bams/*.bam > bam.filelist
Examples
Calculate Allele frequencies
Assuming you have a list of bamfiles in in file: 'bam.filelist' and you want the MAF using all reads and inferring the major and minor from the GL, we will use SAMtools genotype likelihoods, and will allow for 5 threads: See details on Allele Frequencies, Major Minor and Genotype Likelihoods.
./angsd0.570/angsd -b list -GL 1 -doMajorMinor 1 -doMaf 2 -P 5
Command: ./angsd0.574/angsd -b bam.filelist -GL 1 -doMajorMinor 1 -doMaf 2 -P 5 -> angsd version: 0.574 build(Jan 10 2014 17:44:41) -> No '-out' argument given, output files will be called 'angsdput' -> Parsing 10 number of samples -> Printing at chr: 20 pos:14095816 chunknumber 3500 -> Done reading data waiting for calculations to finish -> Calling destroy -> Done waiting for threads -> Output filenames: ->"angsdput.arg" ->"angsdput.mafs.gz" -> Fri Jan 10 17:46:15 2014 -> Arguments and parameters for all analysis are located in .arg file [ALL done] cpu-time used = 130.67 sec [ALL done] walltime used = 55.00 sec