Code Monkey home page Code Monkey logo

pmcosm's Introduction

PMCosm: Probabilistic Models for Microbial-Cosmos

This PMCosm package implements statistical inferences for microbial ecology analysis. This package provides methods for

  • categorizing the admixed structure of microbial communities,
  • detecting influential microbes in both engineered and natural environments,
  • evaluating sub-communities' preferences of life strategies,
  • identifying causal relationship between microbes' metabolism functions and fluctuations of surrounding environments,
  • predicting the community composition and structure for a given local environment.

Installation and documentation

To install, open R and type:

install.packages("devtools")
devtools::install_github("YushiFT/PMCosm")

Package overview

Functions

  • calc_mle_trio: Calculate MLE estimates for universal parameter trio for inferences about the admixed community structure.
  • classify_taxa: Traditional relative-abundance-based methods to classify microbial taxa into rare or abundant biospheres.
  • classify_vag_lag: Define a model-driven testable boundary between dispersal vangguards and dispersal laggards.
  • is_dispersion: Hypothesis test for the existence of dispersion.
  • is_overdispersion: Hypothesis test for the existence of over-dispersion.
  • is_zero_infla: Check the existence of inflated zeros.
  • pca_simple: A simplified principle component analysis for microbial data.
  • plot_trio: Graphic display of trio estimates to observe the Two-Wing pattern.

Quick start guide

Deriving MLE estimates for the admixed structure of environmental microbial communities

library(PMCosm)
# import sample data from microbial communities in hangzhou bay
data(hzmicrobe)
param_trio_bay <- calc_mle_trio(mic_bay, n_sample=10, replicates=3)
param_trio_era <- calc_mle_trio(mic_era, n_sample=12, replicates=3)

Visualize the Two-Wing admixed structure by trio parameters estimates

library(ggplot2)
library(latex2exp)
# for bay
plot_trio(param_trio_bay, point_size=0.8, a=0.6)
# zoom in for the majority 
plot_trio(param_trio_bay, point_size=0.8, a=0.6, zoom_in=TRUE)
# for era 
plot_trio(param_trio_era, point_size=0.8, a=0.6)

Categorize dispersal vanguards and laggards by identifying the model-driven testable boundary

id_vag_lag_bay <- classify_vag_lag(mic_bay, param_trio_bay)
id_vag_lag_era <- classify_vag_lag(mic_era, param_trio_era)
# print ids of dispersal vanguards in bay
print(id_vag_lag_bay$vanguards)
# print ids of dispersal laggards in bay
print(id_vag_lag_bay$laggards)
# print ids of dispersal vanguards in era
print(id_vag_lag_era$vanguards)
# print ids of dispersal laggards in era
print(id_vag_lag_era$laggards)

Visualize community structure as an admixture of dispersal vanguards and laggards

plot_vag_lag(param_trio_bay, id_vag_lag_bay)
plot_vag_lag(param_trio_era, id_vag_lag_era)

pmcosm's People

Contributors

yushift 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.