Package: ercs
Simulates the coalescent for populations evolving in a spatial
continuum under the extinction/recolonisation model. The simulations
support:A sample ofnindividuals withmloci at arbitrary locations on a
torus of diameterL.Arbitrary recombination rates between adjacent loci.An arbitrary number of classes of event occuring at fixed
rates.Ercs supports both Python 2 and 3.DocumentationHere’s a quick example for the impatient:import ercs
sim = ercs.Simulator(10)
sim.sample = [None, (3, 2), (6, 4), (7, 0)]
sim.event_classes = [ercs.DiscEventClass(u=0.5, r=1)]
pi, tau = sim.run(1)Full documentation forercsis available athttp://jeromekelleher.github.com/ercs.InstallationErcs depends on theGNU Scientific Library,
which must be installed before theercsmodule can be built.
Fortunately, this is straightforward on most platforms. For example,
on Debian or Ubuntu use:$ sudo apt-get install libgsl0-devor on Fedora:$ sudo yum install gsl-develGSL is available on most packaging systems; if it is not available on your
platform, it can be installed from source.Once GSL has been installed we can build theercsmodule using the
standard Pythonmethods. For
example, using pip we have$ sudo pip install ercsOr, we can manually download the package, unpack it and then run:$ python setup.py build
$ sudo python setup.py installMost of the time this will compile and install the module without difficulty.It is also possible to download the latest development version ofercsfromgithub.Potential problemsOn platforms that GSL is not available as part of the native packaging
system (or GSL was installed locally because of non-root access)
there can be issues with finding the correct headers and libraries
when compilingercs. For example, on FreeBSD we get something
like this:$ python setup.py build
... [Messages cut for brevity] ...
In file included from _ercsmodule.c:27:
lib/ercs.h:26:25: error: gsl/gsl_rng.h: No such file or directory
In file included from _ercsmodule.c:27:
lib/ercs.h:73: error: expected declaration specifiers or '...' before 'gsl_rng'
lib/ercs.h:94: error: expected specifier-qualifier-list before 'gsl_rng'
_ercsmodule.c: In function 'pyercs_simulate':
_ercsmodule.c:351: error: 'ercs_t' has no member named 'pi'
_ercsmodule.c:356: error: 'ercs_t' has no member named 'tau'
error: command 'cc' failed with exit status 1This can be remedied by using thegsl-configprogram to set the
theLDFLAGSandCFLAGSenvironment variables to
their correct values:$ CFLAGS=`gsl-config --cflags` LDFLAGS=`gsl-config --libs` python setup.py buildTestsErcs provides some test cases to ensure that the installation has gone smoothly.
It is a good idea to run these immediately after installation:$ python tests.pyIt is also possible to run some tests on the low-level C library.
To do this,cdto thelibdirectory and run:$ make checkThis will build the C library test cases and run them. If compilation fails, it
may be necessary setLDFLAGSandCFLAGSas before:$ make CFLAGS="`gsl-config --cflags`" LDFLAGS="`gsl-config --libs`" checkTested platformsErcs has been successfully built and tested on the following platforms:Operating systemPlatformPythonCompilerUbuntu 8.04i3862.5.2gcc 4.2.3NetBSD 5.0i3862.7.3gcc 4.1.3Fedora 17i3862.7.3gcc 4.7.2Fedora 17i3863.2.3gcc 4.7.2Cygwini3862.6.8gcc 4.5.3Ubuntu 12.04x86-642.7.3gcc 4.6.3Ubuntu 12.04x86-643.2.3gcc 4.6.3FreeBSD 9.0i3863.2.2gcc 4.2.2FreeBSD 9.0i3862.7.2gcc 4.2.2FreeBSD 9.0i3863.1.4clang 3.0Solaris 11x86-642.6.4Sun C 5.12Mac OSX 10.6.8x86-642.6.1gcc 4.2.1Mac OSX 10.6.8x86-643.2.3gcc 4.2.1Mac OS X 10.4.11ppc3.2.3gcc 4.0.1Mac OS X 10.4.11ppc2.7.3gcc 4.0.1Debian wheezyarmv6l2.7.3gcc 4.6.3Debian squeezeppc642.6.6gcc 4.4.5Debian squeezeppc643.1.3gcc 4.4.5The C library has additionally been compiled and tested with the
following processors and compilers:PlatformCompilerLinux 2.6.18-164.15.1.el5 x86_64 GNU/LinuxIntel(R) C 11.0Linux 2.6.32-5-amd64 x86_64 GNU/Linuxgcc 4.4.5Linux 2.6.32-5-amd64 x86_64 GNU/Linuxclang 1.1Linux 3.2.0-32-generic x86_64 GNU/Linuxgcc 4.6.3Linux 3.2.0-32-generic x86_64 GNU/Linuxclang 3.0Linux 3.2.27+ armv6l GNU/Linuxgcc 4.6.3Linux 2.6.32-5-powerpc64 ppc64 GNU/Linuxgcc 4.4.5Linux 2.6.32-5-powerpc64 ppc64 GNU/Linuxclang 1.1SunOS 5.11 11.0 i86pc i386 i86pcSun C 5.12SunOS 5.10 sun4u sparc SUNW,Ultra-4Sun C 5.8