load(file='metadag_work_space.RData')
6 Appendix
Some tables and graphs for the supplementary material.
Table MBB sizes
=write_delim(table_MBB_size,
write_delimfile="data_appendix/table_MBB_size.csv",
delim=",")
=tibble(mDAG_Id=names(clust4_MSA),
clust4_MSA2clust4_MSA=as.integer(clust4_MSA))
=tibble(mDAG_Id=names(clust4_Mun),
clust4_Mun2clust4_Mun=as.integer(clust4_Mun))
= meta_taxo %>% filter(!is.na(Kingdom))%>%
clust4_MSA_Eukaryotes_taxoselect(-c(Freq_Kingdom,Freq_Phylum,Freq_Class)) %>%
left_join(clust4_MSA2,by="mDAG_Id")
= meta_taxo %>% filter(!is.na(Kingdom))%>%
clust4_Mun_Eukaryotes_taxoselect(-c(Freq_Kingdom,Freq_Phylum,Freq_Class)) %>%
left_join(clust4_Mun2,by="mDAG_Id")
write_delim(clust4_MSA_Eukaryotes_taxo,
file="data_appendix/clust4_MSA_Eukaryotes_taxo.csv",
delim=",")
write_delim(clust4_Mun_Eukaryotes_taxo,
file="data_appendix/clust4_Mun_Eukaryotes_taxo.csv",
delim=",")
Heatmaps by Kingdom MSA y Mun: Animals, Fungi, Plants ans Protists.
Animals
## Animals by phylum
= meta_taxo %>% filter(Kingdom=="Animals")
meta_animals=names(rev(sort(table(meta_animals$Phylum))))
namesP namesP
[1] "Vertebrates" "Arthropods" "Mollusks" "Cnidarians"
[5] "Nematodes" "Flatworms" "Echinoderms" "Tunicates"
[9] "Cephalochordates" "Poriferans" "Placozoans" "Hemichordates"
[13] "Brachiopodas" "Annelids"
=data.frame(Phylum=meta_animals$Phylum)
dff=ordered(meta_animals$Phylum,levels=namesP)
Phylum=paste(c(paste0(0,1:9),10:14),namesP,sep="-")
numbersPlevels(Phylum)=numbersP
$Phylum=Phylum
dff=rainbow(length(namesP))
col
=list(Phylum=col)
colorsPnames(colorsP$Phylum)=numbersP
<- HeatmapAnnotation(df = dff,
annot col = colorsP,
annotation_name_side = "left",
show_annotation_name=TRUE )
<- Heatmap(
MSA_heat_2 matrix = Sim_MSA_mDAG[meta_animals$mDAG_Id,
$mDAG_Id],
meta_animalsname = "MSA similarity",
column_title = "m-DAGs MSA-similarity Animals by Phyla",
col = rev(viridis(256)),
cluster_rows = FALSE,
show_heatmap_legend = FALSE,
cluster_columns = FALSE,
top_annotation = annot,
show_column_names = FALSE,
show_row_names = FALSE,
left_annotation =
rowAnnotation(
df = dff,
col = colorsP,
show_annotation_name = FALSE
)
)
<- Heatmap(
Mun_heat_2 matrix = Sim_Mun_mDAG[meta_animals$mDAG_Id,
$mDAG_Id],
meta_animalscolumn_title = "m-DAGs Munkres-similarity Animals by Phyla",
col = rev(viridis(256)),
cluster_rows = FALSE,
show_heatmap_legend = FALSE,
cluster_columns = FALSE,
top_annotation = annot,
show_column_names = FALSE,
show_row_names = FALSE,
left_annotation =
rowAnnotation(
df = dff,
col = colorsP,
show_annotation_name = FALSE
) )
Save graphics
png
2
png
2
Plants
= meta_taxo[1:884,] %>% filter(Kingdom=="Plants")
meta_plants=names(rev(sort(table(meta_plants$Phylum))))
namesP namesP
[1] "Eudicots" "Monocots" "Green" "Red" "Basal" "Mosses" "Ferns"
=data.frame(Phylum=meta_plants$Phylum)
dff=ordered(meta_plants$Phylum,levels=namesP)
Phylum=paste(c(paste0(0,1:7)),namesP,sep="-")
numbersPlevels(Phylum)=numbersP
$Phylum=Phylum
dff=rainbow(length(namesP))
col
=list(Phylum=col)
colorsPnames(colorsP$Phylum)=numbersP
<- HeatmapAnnotation(df = dff,
annot col = colorsP,
annotation_name_side = "left",
show_annotation_name=TRUE )
<- Heatmap(
MSA_heat_2 matrix = Sim_MSA_mDAG[meta_plants$mDAG_Id,
$mDAG_Id],
meta_plantsname = "MSA similarity",
column_title = "m-DAGs MSA-similarity Plants by Phyla",
col = rev(viridis(256)),
cluster_rows = FALSE,
show_heatmap_legend = FALSE,
cluster_columns = FALSE,
top_annotation = annot,
show_column_names = FALSE,
show_row_names = FALSE,
left_annotation =
rowAnnotation(
df = dff,
col = colorsP,
show_annotation_name = FALSE
)
)
<- Heatmap(
Mun_heat_2 matrix = Sim_Mun_mDAG[meta_plants$mDAG_Id,
$mDAG_Id],
meta_plantsname = "Mun similarity",
column_title = "m-DAGs Munkres-similarity Plants by Phyla",
col = rev(viridis(256)),
cluster_rows = FALSE,
show_heatmap_legend = FALSE,
cluster_columns = FALSE,
top_annotation = annot,
show_column_names = FALSE,
show_row_names = FALSE,
left_annotation =
rowAnnotation(
df = dff,
col = colorsP,
show_annotation_name = FALSE
) )
Save graphics
png
2
png
2
Fungi
= meta_taxo%>% filter(Kingdom=="Fungi")
meta_fungi=names(rev(sort(table(meta_fungi$Phylum))))
namesP namesP
[1] "Ascomycetes" "Basidiomycetes" "Microsporidians"
=data.frame(Phylum=meta_fungi$Phylum)
dff=ordered(meta_fungi$Phylum,levels=namesP)
Phylum=length(namesP)
n
=paste(c(paste0(0,1:n)),namesP,sep="-")
numbersPlevels(Phylum)=numbersP
$Phylum=Phylum
dff=rainbow(length(namesP))
col
=list(Phylum=col)
colorsPnames(colorsP$Phylum)=numbersP
<- HeatmapAnnotation(df = dff,
annot col = colorsP,
annotation_name_side = "left",
show_annotation_name=TRUE )
<- Heatmap(
MSA_heat_2 matrix = Sim_MSA_mDAG[meta_fungi$mDAG_Id,
$mDAG_Id],
meta_funginame = "MSA similarity",
column_title = "m-DAGs MSA-similarity Fungi by Phyla",
col = rev(viridis(256)),
cluster_rows = FALSE,
show_heatmap_legend = FALSE,
cluster_columns = FALSE,
top_annotation = annot,
show_column_names = FALSE,
show_row_names = FALSE,
left_annotation =
rowAnnotation(
df = dff,
col = colorsP,
show_annotation_name = FALSE
)
)
<- Heatmap(
Mun_heat_2 matrix = Sim_Mun_mDAG[meta_fungi$mDAG_Id,
$mDAG_Id],
meta_funginame = "Mun similarity",
column_title = "m-DAGs Munkres-similarity Fungi by Phyla",
col = rev(viridis(256)),
cluster_rows = FALSE,
show_heatmap_legend = FALSE,
cluster_columns = FALSE,
top_annotation = annot,
show_column_names = FALSE,
show_row_names = FALSE,
left_annotation =
rowAnnotation(
df = dff,
col = colorsP,
show_annotation_name = FALSE
) )
Save graphics
png
2
png
2
Protists
= meta_taxo %>% filter(Kingdom=="Protists")
meta_protists
=names(rev(sort(table(meta_protists$Phylum))))
namesP namesP
[1] "Alveolates" "Euglenozoa" "Stramenopiles"
[4] "Amoebozoa" "Metamonada" "Choanoflagellates"
[7] "Heterolobosea" "Haptophyta" "Cryptomonads"
=data.frame(Phylum=meta_protists$Phylum)
dff=ordered(meta_protists$Phylum,levels=namesP)
Phylum=length(namesP)
n=paste(c(paste0(0,1:n)),namesP,sep="-")
numbersPlevels(Phylum)=numbersP
$Phylum=Phylum
dff=rainbow(length(namesP))
col
=list(Phylum=col)
colorsPnames(colorsP$Phylum)=numbersP
<- HeatmapAnnotation(df = dff,
annot col = colorsP,
annotation_name_side = "left",
show_annotation_name=TRUE )
<- Heatmap(
MSA_heat_2 matrix = Sim_MSA_mDAG[meta_protists$mDAG_Id,
$mDAG_Id],
meta_protistsname = "MSA similarity",
column_title = "m-DAGs MSA-similarity Protist by Phyla",
col = rev(viridis(256)),
cluster_rows = FALSE,
show_heatmap_legend = FALSE,
cluster_columns = FALSE,
top_annotation = annot,
show_column_names = FALSE,
show_row_names = FALSE,
left_annotation =
rowAnnotation(
df = dff,
col = colorsP,
show_annotation_name = FALSE
)
)
<- Heatmap(
Mun_heat_2 matrix = Sim_Mun_mDAG[meta_protists$mDAG_Id,
$mDAG_Id],
meta_protistsname = "Mun similarity",
column_title = "m-DAGs Munkres-similarity Protist by Phyla",
col = rev(viridis(256)),
cluster_rows = FALSE,
show_heatmap_legend = FALSE,
cluster_columns = FALSE,
top_annotation = annot,
show_column_names = FALSE,
show_row_names = FALSE,
left_annotation =
rowAnnotation(
df = dff,
col = colorsP,
show_annotation_name = FALSE
) )
Save graphics
draw(MSA_heat_2,merge_legend=TRUE)
draw(Mun_heat_2,merge_legend=TRUE)