Giter Site home page Giter Site logo

momi's Introduction

momi

This repository implements the algorithm in this paper (preprint here).

In particular, this repository computes the expected joint site frequency spectrum (SFS) for a tree-shaped demography without migration, via a multipopulation Moran model.

It also computes the "truncated site frequency spectrum" for a single population, i.e. the frequency spectrum for mutations arising after a certain point in time. This can be used in both Moran and coalescent approaches to computing the multipopulation SFS.

Installation

First, make sure you have Python 2.7, pip, and numpy installed. Then type

pip install .

from the root directory.

Getting started

See tutorial.py to get started.

See this repository to reproduce the results in the paper.

momi2

This package is now superceded by momi2, which is the recommended version to use. New features include pulse migration and maximum likelihood inference.

momi's People

Contributors

jackkamm avatar thomas-a-neil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

momi's Issues

'OutDegreeView' object has no attribute 'items'

Dear popgenmethods,

I have the following issue. Thanks in advance for your reply.
Best regards,
Cesar

$ git clone https://github.com/popgenmethods/momi.git
$ cd momi
$ python tutorial.py
Printing SFS entries for three epoch history
[3.46922568239798, 0.6905041803193086, 0.28925918566082426, 0.18382307646826954, 0.14630222131940324, 0.12951430246441245, 0.12025482991358812, 0.11413280441137114, 0.10950608451603584, 0.10569664740756339, 0.10239483376447593, 0.09944275368450997, 0.0967502566421602, 0.09426034418677022, 0.09193397689474075, 0.08974285562158904, 0.08766566223553252, 0.08568590655924462, 0.0837905841160356]

Printing truncated SFS for middle epoch
[0.1874478923928087, 0.08769197071896163, 0.05459923171604704, 0.038169703103527165, 0.028403412493141773, 0.021967054055764115, 0.017432083759685326, 0.014084243180327256, 0.011526734103605961, 0.009521488367390292, 0.007917017789540414, 0.0066123391320212456, 0.005537549081665744, 0.004642724239263062, 0.0038912611130865783, 0.003255713614919281, 0.00271509967519516, 0.0022531056531559686, 0.0018568577754385516]
Traceback (most recent call last):
File "tutorial.py", line 46, in
demo3 = Demography.from_newick(newick_str)
File "/media/cesarpc/momi/demography.py", line 13, in from_newick
t = cls(_newick_to_nx(newick, default_lineages))
File "/media/cesarpc/momi/demography.py", line 25, in init
if not all('lineages' in nd[k] for k in self.leaves):
File "/media/cesarpc/momi/util.py", line 44, in get
value = obj.dict[self.func.name] = self.func(obj)
File "/media/cesarpc/momi/demography.py", line 66, in leaves
return set([k for k, v in self.out_degree().items() if v == 0])
AttributeError: 'OutDegreeView' object has no attribute 'items'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.