Coder Social home page Coder Social logo

admixturemapper's Introduction

AdmixtureMapper

Stochastic model for admixture in a geographically structured population Default mode is all-or nothing: The only thing that is recorded is whether a person has any ancestors from a given region, or none (for display purposes: whether all, some, or no persons in a village have ancestors from region x). The alternative rel_mode is meant to store the fractions of ancestry from different regions, but its currently not fully implemented.

Region() class defined in Region.py, constructs a two-dimensional (rectangular) arrangement of villages as a list, calculates their distances up to a given limit and stores the resulting distance matrices in the village objects. Can be joined at the four corners and four cardinal directions with another region, with parametrized degree of permeability properties: width and height (lon_size, lat_size) in villages, integer village size (integer or range of two integers) name (sanitized string) distance_limit x_offset, y_offset determine position on map, relevant for displaying results

Village() class, defined in Village.py, usually called from Region distance matrices are stored here taboos against exogamy, if used, are stored here contains two lists of Person()s: adults and children. At the end of each generation, the caller needs to call the .generation_change method

Person() class, usually called from Village Contains a method for spawning offspring with a partner selected from the homevillage´s distance matrix, with a biased random distribution favouring the closest villages (current implementation: about 50% from the same village, and less than 5% from more than 6 steps away) attribute: ancestry_identifier identifies all the regions where this person´s ancestors lived at the beginning of the simulation through an integer, where every position in the integer´s binary representation corresponds to a region. The order is determined counting backward from the ones in the order the regions were created (e. g. the first region created and thus with identifier 0 will be represented as a 0 or 1 in a person´s ancestry_identifier)

admixturePlotter maps the results

See blog post demonstrating and discussing an exemplary run: https://panloquens.wordpress.com/2017/11/14/were-all-siberians/

admixturemapper's People

Contributors

jmsteixner avatar

Watchers

 avatar

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.