From 5c955a8478f45d7f20105546cc55869965de1468 Mon Sep 17 00:00:00 2001 From: Louis Date: Fri, 17 Oct 2025 16:47:54 +0200 Subject: [PATCH] Beginning multipartite --- multipartite-lbm.R | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 multipartite-lbm.R diff --git a/multipartite-lbm.R b/multipartite-lbm.R new file mode 100644 index 0000000..264dd22 --- /dev/null +++ b/multipartite-lbm.R @@ -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())