Module dadi

For examples of dadi's usage, see the examples directory in the source distribution.

Documentation of all methods can be found in doc/api/index.html of the source distribution.

Expand source code
"""
For examples of dadi's usage, see the examples directory in the source
distribution.

Documentation of all methods can be found in doc/api/index.html of the source
distribution.
"""
import logging
logging.basicConfig()

from . import Demographics1D, Demographics2D, Inference, Integration
from . import Misc, Numerics, PhiManip, Spectrum_mod, tridiag

# We do it this way so it's easier to reload.
Spectrum = Spectrum_mod.Spectrum

# Protect import of Plotting in case matplotlib not installed.
try:
    from . import Plotting
except ImportError:
    pass

# When doing arithmetic with Spectrum objects (which are masked arrays), we
# often have masked values which generate annoying arithmetic warnings. Here
# we tell numpy to ignore such warnings. This puts greater onus on the user to
# check results, but for our use case I think it's the better default.
import numpy
numpy.seterr(all='ignore')

Sub-modules

dadi.DFE

Fitting Distributions of Fitness Effects to population genomic data, both single-population and joint.

dadi.Demographics1D

Single population demographic models.

dadi.Demographics2D

Two population demographic models.

dadi.Godambe

Parameter uncertainties and likelihood ratio tests using Godambe information.

dadi.Inference

Comparison and optimization of model spectra to data.

dadi.Integration

Functions for integrating population frequency spectra.

dadi.Misc

Miscellaneous utility functions. Including ms simulation.

dadi.NLopt_mod
dadi.Numerics

Numerically useful functions, including extrapolation and default grid.

dadi.PhiManip

Manipulating population frequency spectra phi. e.g. population splittings and admixture

dadi.Plotting

Routines for Plotting comparisons between model and data …

dadi.Spectrum_mod

Contains Spectrum object, which represents frequency spectra.

dadi.Triallele

Modeling triallelic data.

dadi.TwoLocus

Fitting models to data summarized by pairs of loci, incorporating both allele frequencies and linkage disequilibrium