Skip to content

Commit

Permalink
Merge branch 'devlp' version 1.25.
Browse files Browse the repository at this point in the history
  • Loading branch information
alanrogers committed Apr 12, 2018
2 parents b39bb69 + 7f3b246 commit bed27f0
Show file tree
Hide file tree
Showing 46 changed files with 3,272 additions and 430 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
*~
core
depend
doc
raf
version.h
xboot
xdtnorm
xexopar
Expand All @@ -19,6 +19,7 @@ xpopnode
xpopnodetab
xsampndx
xsimsched
xstate
xstrtab
xterm
xbranchtab
Expand All @@ -29,11 +30,14 @@ xjobqueue
xdafreader
xrafreader
xmisc
xscrmreader
xstrint
joinraf
legosim
numcores
legofit
tabpat
scrmpat
sitepat
tabpat.log
daf
Expand Down
26 changes: 18 additions & 8 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
destination := $(HOME)/bin
global_destination := $(HOME)/group/bin
opt := -DNDEBUG -O3 -finline-functions # For full optimization
#opt := -O0 -fno-inline-functions -rdynamic -DDEBUG # For debugging
#opt := -O0 -fno-inline-functions -rdynamic -DDEBUG # For debugging
#opt := -O3 -finline-functions # Optimization + debugging
#prof := -pg -rdynamic # For profiling
prof :=
incl := -I/usr/local/include -I/opt/local/include

targets := legosim legofit tabpat sitepat daf raf numcores
pytargets := diverg.py bootci.py flatfile.py
targets := legosim legofit tabpat sitepat scrmpat daf raf numcores joinraf \
raf2daf
pytargets := diverg.py bootci.py flatfile.py axt2raf.py
tests := xzeroin xbinary

CC := gcc
Expand Down Expand Up @@ -43,9 +44,6 @@ test : $(tests)
-./xzeroin
@echo "ALL UNIT TESTS WERE COMPLETED."

version.h:
./mkversion.py > version.h

LEGOSIM := legosim.o patprob.o gptree.o binary.o jobqueue.o misc.o parse.o \
branchtab.o popnodetab.o lblndx.o tokenizer.o parstore.o parkeyval.o \
popnode.o gene.o dprintf.o rngseed.o dtnorm.o tinyexpr.o
Expand All @@ -55,7 +53,7 @@ legosim : $(LEGOSIM)
LEGOFIT := legofit.o patprob.o gptree.o binary.o jobqueue.o misc.o \
parse.o branchtab.o popnodetab.o lblndx.o tokenizer.o parstore.o \
parkeyval.o popnode.o gene.o cost.o diffev.o dprintf.o rngseed.o \
simsched.o dtnorm.o tinyexpr.o
simsched.o dtnorm.o tinyexpr.o state.o
legofit : $(LEGOFIT)
$(CC) $(CFLAGS) -o $@ $(LEGOFIT) $(lib)

Expand All @@ -69,6 +67,19 @@ SITEPAT := sitepat.o misc.o binary.o lblndx.o parkeyval.o rafreader.o \
sitepat : $(SITEPAT)
$(CC) $(CFLAGS) -o $@ $(SITEPAT) $(lib)

JOINRAF := joinraf.o rafreader.o error.o tokenizer.o misc.o
joinraf : $(JOINRAF)
$(CC) $(CFLAGS) -o $@ $(JOINRAF) $(lib)

RAF2DAF := raf2daf.o rafreader.o error.o tokenizer.o misc.o
raf2daf : $(RAF2DAF)
$(CC) $(CFLAGS) -o $@ $(RAF2DAF) $(lib)

SCRMPAT := scrmpat.o misc.o binary.o lblndx.o parkeyval.o scrmreader.o \
tokenizer.o boot.o error.o
scrmpat : $(SCRMPAT)
$(CC) $(CFLAGS) -o $@ $(SCRMPAT) $(lib)

DAF := daf.o misc.o
daf : $(DAF)
$(CC) $(CFLAGS) -o $@ $(DAF) $(lib)
Expand Down Expand Up @@ -107,5 +118,4 @@ include depend

.SUFFIXES:
.SUFFIXES: .c .o
.PHONY: clean

35 changes: 26 additions & 9 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,29 @@ Legofit is a computer package that uses counts of nucleotide site
patterns to estimate the history of population size, subdivision, and
gene flow. The package consists of the following programs

* @ref daf "daf", which writes genetic data into the ".daf" format,
* @ref daf "daf" writes genetic data into the ".daf" format,
which is used by @ref tabpat "tabpat".
* @ref tabpat "tabpat", which reads ".daf" files for several
* @ref tabpat "tabpat" reads ".daf" files for several
populations, tabulates "nucleotide site patterns" (explained below),
and generates moving-blocks bootstrap replicates.
* @ref raf "raf", which writes genetic data into the ".raf" format,
* @ref raf "raf" writes genetic data into the ".raf" format,
which is used by @ref sitepat "sitepat".
* @ref sitepat "sitepat", which reads ".raf" files for several
* @ref sitepat "sitepat" reads ".raf" files for several
populations, tabulates "nucleotide site patterns" (explained below),
and generates moving-blocks bootstrap replicates.
* @ref legosim "legosim", which predicts site pattern counts from
* @ref scrmpat "scrmpat" tabulates site patterns from output generated
by the `scrm` coalescent simulator.
* @ref legosim "legosim" predicts site pattern counts from
assumptions about population history.
* @ref legofit "legofit", which estimates parameters from site pattern
* @ref legofit "legofit" estimates parameters from site pattern
counts.
* @ref bootci "bootci.py", which uses multiple legofit output files
* @ref bootci "bootci.py" uses multiple legofit output files
(one for the real data and one for each bootstrap replicate) to
generate bootstrap confidence intervals for estimated parameters.
* @ref flatfile "flatfile.py", which reads a list of legofit output
* @ref flatfile "flatfile.py" reads a list of legofit output
files and writes a flat file with a row for each legofit file and a
column for each parameter.
* @ref diverg "diverg.py", which compares two distributions of site
* @ref diverg "diverg.py" compares two distributions of site
pattern frequencies, using the Kullback-Leibler (KL) divergence.

# Nucleotide site patterns {#sitepat}
Expand Down Expand Up @@ -453,6 +455,21 @@ format is described above. Then, you can execute `legosim` by typing:

See the @ref legosim "legosim" documentation for details.

## Simulating site patterns

The preferred approach is to do simulations using
[scrm](https://scrm.github.io/), a software package written by Paul
R. Staab, Sha Zhu, Dirk Metzler and Gerton Lunter. It does coalescent
simulations with linkage and recombination. Our own program @ref
scrmpat "scrmpat" tabulates site pattern frequencies from `scrm`
output.

For less sophisticated simulations, use the `-U` option of @ref
legosim "legosim". This assumes free recombination between nucleotide
sites. This is not ideal, because it ignores genetic linkage, but it
reads the same input files as `legosim`, is very fast, and generates
output in the form of site pattern frequencies.

## Estimating parameters from genetic data

This involves several programs. The first step is to generate input
Expand Down
Loading

0 comments on commit bed27f0

Please sign in to comment.