5  Clusters analysis

load(file='metadag_work_space.RData')

In the Eukaryotes test, we aimed to analyze which factors caused some algae and plants to be distinguished from their respective kingdoms. To address this question, we revisited the core metabolism obtained with MetaDAG, focusing on each cluster.

reactions=names(Results)
reactions=reactions[grep("(^R\\d{5})",reactions)]
reactions=tibble(reactions)
reactions=reactions %>% separate(reactions, into=c("r_id","enzyme"),sep="\\(",remove=FALSE)
reactions=reactions %>% mutate(enzyme=gsub("\\(|\\)","",enzyme))
#reactions=reactions[,-3]
reactions$rev=stringr::str_detect(reactions$r_id,"v")

The results of the clusters are compared to the classification of Kingdoms for both similarity measures:

clust4_MSA2=tibble(mDAG_Id=names(clust4_MSA), clust4_MSA=clust4_MSA)
clust4_Mun2=tibble(mDAG_Id=names(clust4_Mun), clust4_Mun=clust4_Mun)
meta_taxo2=meta_taxo
meta_taxo2=meta_taxo2 %>% left_join(clust4_MSA2,by= "mDAG_Id") %>% 
  left_join(clust4_Mun2,by= "mDAG_Id")
meta_taxo2$combined_cluster_MSA_Kingdom=paste0(meta_taxo2$Kingdom,meta_taxo2$clust4_MSA)
meta_taxo2$combined_cluster_Mun_Kingdom=paste0(meta_taxo2$Kingdom,meta_taxo2$clust4_MSA)
write.csv(meta_taxo2,file="meta_taxo_4_clusters.csv")
knitr::kable(table(meta_taxo2$Kingdom,meta_taxo2$clust4_MSA))
1 2 3 4
Animals 331 197 7 0
Fungi 0 0 154 0
Plants 0 0 14 125
Protists 0 0 56 0
knitr::kable(table(meta_taxo2$Kingdom,meta_taxo2$clust4_Mun))
1 2 3 4
Animals 331 197 7 0
Fungi 0 0 154 0
Plants 0 0 14 125
Protists 0 0 56 0
knitr::kable(table(meta_taxo2$clust4_Mun,meta_taxo2$clust4_MSA))
1 2 3 4
331 0 0 0
0 197 0 0
0 0 231 0
0 0 0 125

The table below correlates the clusters with the Phylum information.

library(reshape2)
MSA_table=melt(table(meta_taxo2$Kingdom,meta_taxo2$Phylum,meta_taxo2$clust4_MSA))
names(MSA_table)=c("Kingdom","Phylum","cluster_MSA","N")
MSA_table=MSA_table %>% filter(N!=0)
knitr::kable(MSA_table)
Kingdom Phylum cluster_MSA N
Animals Vertebrates 1 331
Animals Annelids 2 1
Animals Arthropods 2 158
Animals Brachiopodas 2 1
Animals Cephalochordates 2 2
Animals Cnidarians 2 10
Animals Echinoderms 2 3
Animals Hemichordates 2 1
Animals Mollusks 2 14
Animals Nematodes 2 3
Animals Placozoans 2 1
Animals Poriferans 2 1
Animals Tunicates 2 2
Protists Alveolates 3 25
Protists Amoebozoa 3 7
Fungi Ascomycetes 3 113
Fungi Basidiomycetes 3 36
Protists Choanoflagellates 3 2
Protists Cryptomonads 3 1
Protists Euglenozoa 3 9
Animals Flatworms 3 4
Plants Green 3 11
Protists Haptophyta 3 1
Protists Heterolobosea 3 1
Protists Metamonada 3 2
Fungi Microsporidians 3 5
Animals Nematodes 3 3
Plants Red 3 3
Protists Stramenopiles 3 8
Plants Basal 4 2
Plants Eudicots 4 98
Plants Ferns 4 1
Plants Monocots 4 23
Plants Mosses 4 1