Beginning multipartite

This commit is contained in:
Louis 2025-10-17 16:47:54 +02:00
parent bf571317f4
commit 5c955a8478

23
multipartite-lbm.R Normal file
View file

@ -0,0 +1,23 @@
library("sbm")
library("phyloseq")
library("microbiome")
source("load-europe.R")
# Define the taxonomy structure as a multipartite network
type <- "bipartite"
model <- "poisson"
## Define all adjacency matrices
kingdom_sample_mat <- otu_table(aggregate_taxa(cpd_phyloseq_europe, level = "kingdom"))
phylum_sample_mat <- otu_table(aggregate_taxa(cpd_phyloseq_europe, level = "phylum"))
class_sample_mat <- otu_table(aggregate_taxa(cpd_phyloseq_europe, level = "class"))
order_sample_mat <- otu_table(aggregate_taxa(cpd_phyloseq_europe, level = "order"))
family_sample_mat <- otu_table(aggregate_taxa(cpd_phyloseq_europe, level = "family"))
genus_sample_mat <- otu_table(aggregate_taxa(cpd_phyloseq_europe, level = "genus"))
## Define taxonomic relations
## Define the SBMs
KingdomSample <- defineSBM(otu_table())