Giter Club home page Giter Club logo

balsamico's Introduction

BALSAMICO

BALSAMICO is an R package for BAyesian Latent Semantic Analysis of MIcrobial COmmunities

Authors:

Ko Abe and Teppei Shimamura

Contact: ko.abe[at]med.nagoya-u.ac.jp and shimamura[at]med.nagoya-u.ac.jp

Referrence

Abe, K., Hirayama, M., Ohno, K. et al. Hierarchical non-negative matrix factorization using clinical information for microbial communities. BMC Genomics 22, 104 (2021). https://doi.org/10.1186/s12864-021-07401-y

Installation

Install the latest version of this package from Github by pasting in the following.

devtools::install_github("abikoushi/BALSAMICO")

Example

library(BALSAMICO)
N <- 100
K <- 100
L <- 3
D <- 3
V <- matrix(c(1,1,1,-0.5,0,0.5,0.5,0,-0.5),D,L,byrow = TRUE)
x1 <- rnorm(N)
x2 <- rbinom(N,1,0.5)
X <- model.matrix(~x1+x2)
B <- exp(-X%*%V)
W <- matrix(rgamma(N*L,0.5,B),N,L)
unnormH <- matrix(rgamma(L*K,shape=1,rate=1),L,K)
H <- unnormH/rowSums(unnormH)
Y <- matrix(rpois(N*K,10000*W%*%H),N,K)
out <- VNMF(Y,X=X,L=L,tau=10000,maxit = 100000)

plot(10000*out$W%*%out$H,Y)
abline(0,1,lty=2)

#calculate standard error
se_VNMF(out)

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.