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.

RealSFS: Difference between revisions

From angsd
Jump to navigation Jump to search
Line 24: Line 24:
=2dsfs=
=2dsfs=
<pre>
<pre>
./emOptim2 pop1.saf pop2.saf nChr_pop1 nChr_pop2 [-start FNAME -P nThreads -tole tole -maxIter  -nSites -use-BFGS ]
./emOptim2 pop1.saf pop2.saf nChr_pop1 nChr_pop2 [-start FNAME -P nThreads -tole tole -maxIter  -nSites ]
</pre>
</pre>
nChr_pop1 and nChr_pop2 are the number of chromosomes in population1 and population2 respectively see [[2d SFS Estimation]] for full example.
nChr_pop1 and nChr_pop2 are the number of chromosomes in population1 and population2 respectively see [[2d SFS Estimation]] for full example.

Revision as of 22:34, 12 March 2014

This program will estimate the SFS based on a .saf file generated from the ./angsd [options] -doSaf .

Or use it to estimate a 2dsfs by supplying 2 .saf files (also generated from ./angsd [options] -doSaf).

Brief overview

./emOptim2 afile.saf nChr [-start FNAME -P nThreads -tole tole -maxIter  -nSites -use-BFGS ]
nChr is the number of chromosomes. (twice the number of diploid invididuals)

Program defaults to use the EM algorithm for the optimisation. See example below for using the bfgs optimisation.

emOptim2 sfstest.saf 20 -P 4 >sfs.em
emOptim2 fstest.saf 20 -P 4 -use-BFGS 1 >sfs.bfgs


The emOptim2 program will read in a block of the genome (from the .saf) file, and for this region it will estimate the SFS.

The size of the block can be choosen using -nSites argument, otherwise it will try to read in the entire saf file.

If you have .saf file larger than -nSites (you can check the number of sites in the .saf.pos file), then the program will loop over the genome and output the results for each block. So each line in your Whit.saf.ml, is an SFS for a region.

2dsfs

./emOptim2 pop1.saf pop2.saf nChr_pop1 nChr_pop2 [-start FNAME -P nThreads -tole tole -maxIter  -nSites  ]

nChr_pop1 and nChr_pop2 are the number of chromosomes in population1 and population2 respectively see 2d SFS Estimation for full example.

Output

Main results are printed to the stdout. Values are in logspace.

NB

Use as many sites as possible, for more reliable estimates.