GithubHelp home page GithubHelp logo

q2-karenina's Introduction

q2-karenina

Build Status

Approach

q2-karenina in a QIIME2 plug-in for the karenina python package, which provides simulation and model-fitting tools for studying stochastic variability in microbial communities. The package is named for Anna Karenina Principle effects, in which certain diseases and environmental stressors can cause increased stochastic variability in animal microbiomes. A recent review of this phenomenon can be found in Zaneveld et al.,Nature Microbiology, 2017. This pattern is in contrast to stressors that shift the mean position of microbial communities in PCoA space.

The approach of the q2-karenina package to modeling microbiome dynamics is top down: microbial communities in PCoA space are modeled as if they were physical particle in Euclidean space. For example, a microbiome that shifts in composition by a small amount at each time-step can be modeled like the random walk of a particle undergoing Brownian Motion. Most healthy animal microbiomes do not appear to wander randomly like this. Instead, they tend to revert over time to a composition that is average for a particular individual. q2-karenina models this phenomenon using Ornstein-Uhlenbeck models, which include both Brownian motion and reversion to a particular home position.

Model

This model is fairly simple, having only 3 tunable parameters per PC axes. (A separate model is fit to the motion of a microbial community on each PC axis separately, as many papers observe increased variance along some axes but not others).

Mathematically, the model is as follows:

dx/dt = dW * sigma + (x - theta)* lambda

Where:

dx/dt = change in the position of a microbial community on a particular axis of the PCoA plot

dW = the Weiner process which generates Brownian motion (effectively drawing the extent of displacement from a normal distribution)

sigma = a constant that scales the Brownian motion component

theta = the 'home position' or attractor for the community. Over time (in the absence of disturbance or e.g. seasonal effects that alter the mean composition) it is expected that this position will be the mean composition of microbiome samples from an individual. It is also expected that in a stable community this will be the centroid of samples taken from an individual longitudinally.

Release

The initial q2-karenina release allows for fitting of Ornstein-Uhlenbeck models to QIIME2 ordination results using the fit_spatial_ornstein_uhlenbeck visualizer, and returns the parameters for the model fit. Future development will wrap other functionality in karenina such as simulation of QIIME2-compatible OrdinationResult and Metadata files based on Ornstein-Uhlenbeck model parameters, benchmarks of the model fitting procedure, and visualization.

Tutorial

Other links

Models can either be fit to timeseries from each subject separately (individual fit), or can be fit to all individuals within a treatment collectively (cohort fit) using the spatial_ornstein_uhlenbeck.py script

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.