Python C XSLT PostScript TeX Makefile Other
Switch branches/tags
yetAnotherRunForOctober-2002-09-08 xsltBugFix-2002-09-20 working_version stillRunningForOctober-2002-08-30 start runForOctober2002-08-29-2002-08-29 runForOctober_1-2002-08-11 runForOctober0-2002-07-26 fixForEmbeddedSpaces-2002-09-25 fixForArlequin-2002-09-11 XMLed-haplotypes-for-real-this-time-2002-04-22 XMLed-haplos-2002-04-22 Working_fix-2002-03-21 VERSION_FOR_RUN-2002-03-13 TEST_TAG TAG-2001-07-03 RunWithLD-2002-04-25 Run-without-LD-2002-04-19-2002-04-19 ReleaseCandidate01-2003-09-26 RESPIN-12TH-WS-2002-04-05 PYPOP_SRC-0_7_0 PYPOP_SRC-0_7_0rc3 PYPOP_SRC-0_7_0rc2 PYPOP_SRC-0_7_0rc1 PYPOP_SRC-0_6_0 PYPOP_SRC-0_5_2 PYPOP_SRC-0_5_1 PYPOP_SRC-0_5 PYPOP_SRC-0_4_3beta PYPOP_SRC-0_4_2beta PYPOP_SRC-0_4_1beta PYPOP_SRC-0_4beta PSB2003_INITIAL_SUBMISSION PSB2003_CAMERA_READY_SUBMISSION_2 PSB2003_CAMERA_READY_SUBMISSION PSB2003_AFTER_CORRECTIONS_BY_RICH October_Final_F-2002-11-14 October_Final_E-2002-11-14 October_Final_D-2002-11-14 October_Final_C-2002-10-21 October_Final_B-2002-10-19 October_Final_A-2002-10-11 November_Final_B-2002-11-21 November_Final_A-2002-11-16 New-run-for-output-without-LD-2002-04-18 May-2003-Final-2003-05-15 MONTYS_ORIGINAL-2002-08-16 KIRK_HAPLO_RUN_2001-08-31 KIRK_HAPLO_RUN_2001-04-12 InterimInstallWithPatchesforKristie-2002-06-21 FIX_FOR_EMHAPLOFREQ_XML-2002-04-10 FIRST-SUBMISSION-2002-03-13 End-of-May-2003-05-29 DIOGO-FIXES-2002-03-22 BEFORE_WORKSHOP_BOOK BEFORE_PHASE1_XMLIFYING_2001_03_08 BEFORE_ALLELE_LUMPING_CHANGE_2006_02_16 AprilWeekOne-2002-04-04 AFTER_XML_BRANCH_MERGE
Nothing to show
Clone or download
rsingle Added ALD to the .txt output (in place of the permutation values whic…
…h were currently not being used).

Added emhaplofreq_ORIG.xsl just in case there is an issue that needs to be addressed immediately.
Latest commit 8f005ac Aug 27, 2017
Failed to load latest commit information.
haplo-stats renaming Aug 22, 2017

Python for Population Genomics (PyPop)

PyPop is a framework for processing genotype and allele data and running population genetic analyses.


1. Install OS-specific development environment


  1. install developer command-line tools: (includes git, gcc)
  2. Visit and follow the instructions there to install the latest version of MacPorts for your version of MacOS X.
  3. Set environment variables to use macports version of Python and other packages, packages add the following to ~/.bash_profile
export PATH=/opt/local/bin:$PATH
export LIBRARY_PATH=/opt/local/lib/:$LIBRARY_PATH
export CPATH=/opt/local/include:$CPATH
  1. Rerun your bash shell login in order to make these new exports active in your environment. At the command line type:
exec bash -login

2. Clone the repository:

git clone

3. Install dependencies


Install the MacPorts packages

  sudo port install swig-python gsl py27-numpy py-libxml2 py27-libxslt py-setuptools py27-pip

Set MacPorts to use the just-installed 2.7 MacPorts version of Python and pip:

  sudo port select --set python python27
  sudo port select --set pip pip27

Check that the MacPorts version of Python is active by typing: which python, if it is working correctly you should see the following:


Linux (Fedora/Centos/RHEL):

Need at least Fedora 25 for the appropriate dependencies:

  sudo dnf install swig gsl-devel python2-numpy python-libxml2 libxslt-python python-setuptools python-pip

See for instructions on containerizing the install on a Centos/RHEL release.

Linux (Ubuntu)

Install the following packages

  sudo apt install git libgsl-dev python-numpy python-libxml2 python-libxslt1 python-setuptools python-pip

The swig package in recent Ubuntu releases has bugs, you will need to compile the most recent from source, see also for details.

4. Build

./ build


These are examples of how to use PyPop. Specify the --help option to see an explanation of the options available.

Run a minimal dataset:

./bin/ -c  tests/data/minimal.ini tests/data/USAFEL-UchiTelle-small.pop

This will generate the following two files, an XML output file and a plain text version:


Running test suite

  ./ test

If you run into errors, file a bug (as per Support, below), include the output of py.test run in verbose mode and capturing the output

  py.test -s -v

(See for more details on installing or running py.test outside the context of setuptools.)


Please submit bug reports and feature requests

Bug reporting

When reporting bugs, especially during installation, please run the following and include the output:

echo $CPATH
echo $PATH
which python

If you are running on MacOS please also run and include the output of:

port installed


The code for PyPop is at

Copyright and License

PyPop is Copyright (C) 2003-2015. The Regents of the University of California (Regents)

PyPop is distributed under the terms of GPLv2