Ich verwende dieses R-Paket namens "phyloseq", um die bioinformatischen Daten zu analysieren.Stapelbar erzeugt von Phyloseq
otumat = matrix(sample(1:100, 100, replace = TRUE), nrow = 10, ncol = 10)
otumat
rownames(otumat) <- paste0("OTU", 1:nrow(otumat))
colnames(otumat) <- paste0("Sample", 1:ncol(otumat))
otumat
taxmat = matrix(sample(letters, 70, replace = TRUE), nrow = nrow(otumat), ncol = 7)
rownames(taxmat) <- rownames(otumat)
colnames(taxmat) <- c("Domain", "Phylum", "Class", "Order", "Family", "Genus",
"Species")
taxmat
library("phyloseq")
OTU = otu_table(otumat, taxa_are_rows = TRUE)
TAX = tax_table(taxmat)
OTU
TAX
physeq = phyloseq(OTU, TAX)
physeq
plot_bar(physeq, fill = "Family")
Also das Balkendiagramm generiert nicht die gleiche Familie zusammen stapeln. Zum Beispiel gibt es zwei separate "I" -Blöcke in Probe 10. Ich kenne phyloseq plot graph mit ggplot2. Weiß jemand, welche ggplot2-assoziierten Codes ich der lot_bar (physeq, fill = "Family") hinzufügen kann, um die gleiche Familie im Balkendiagramm zusammen zu stapeln?