Giter VIP home page Giter VIP logo

mminp's Introduction

MMINP (Microbe-Metabolite INteractions-based metabolic profiles Predictor)

Introduction

MMINP is a computational framework to predict microbial community-based metabolic profiles with O2-PLS model. It provides procedures of model training and prediction. Paired microbiome and metabolome data are needed for modeling, and the trained model can be applied to predict metabolites of analogous environments using new microbial feature abundances.

Installation

Get the released version from CRAN (https://cran.r-project.org/package=MMINP):

install.packages("MMINP")

Or the development version from GitHub (https://github.com/YuLab-SMU/MMINP):

## install.packages("remotes")
remotes::install_github("YuLab-SMU/MMINP")

Example


library(MMINP)
library(dplyr)

## data:  train_metab, train_metag
set.seed(1234)
predS <- rownames(train_metab) %>% sample(nrow(train_metab)/3)
trainS <- setdiff(rownames(train_metab), predS)
tb <- train_metab[trainS, ]
tg <- train_metag[trainS, ]
pb <- train_metab[predS, ]
pg <- train_metag[predS, ]

## data preprocessing
a <- MMINP.preprocess(tg, normalized = FALSE, prev = 0.1, 
                    abund = 0.00001, transformed = 'boxcox', scaled = T)
b <- MMINP.preprocess(tb, normalized = FALSE, prev = 0.1, 
                    abund = 0.00001, transformed = 'boxcox', scaled = T)

## training model
mminpmodel <- MMINP.train(metag = a,
                          metab = b,
                          n = 3:5, nx = 0:3, ny = 0:3,
                          nr_folds = 2, nr_cores = 2)
mminpmodel
# under the development version:
# mminpmodel$WFM #well-fitted metabolites
# under the released version:
# mminpmodel$trainres$wellPredicted #well-fitted metabolites

## predicting
d <- MMINP.preprocess(pg, normalized = FALSE, transformed = 'boxcox', scaled = T)
pred <- MMINP.predict(mminpmodel, d, minGeneSize = 0.8)

## comparison between predicted and measured values
res <- compareFeatures(pred, pb)
res$wellPredicted %>% length() #number of well-predicted metabolites

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.