-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbarplot.R
More file actions
56 lines (53 loc) · 1.6 KB
/
barplot.R
File metadata and controls
56 lines (53 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
library(ggplot2)
library(scales)
library(magrittr)
library(dplyr)
#setwd("~/your/path")
df<-read.table('barplot.tab',sep='\t',header=TRUE)
df$Phylum<-
factor(df$Phylum,
levels=
c("Odinarchaeota",
"Helarchaeota",
"Thorarchaeota",
"Unclassified_Asgard",
"Lokiarchaeota ",
"Heimdallarchaeota",
"Parvarchaeota",
"Diapherotrites",
"Nanohaloarchaeota",
"Altiarchaeota",
"Nanoarchaeota",
"Aenigmarchaeota",
"Micrarchaeota",
"Pacearchaeota",
"Woesearchaeota",
"Methanohalarchaeia",
"Theionarchaea",
"Hydrotermarchaeota",
"Pontarchaea (MG-III)",
"Hadasarchaeota",
"Methanobacteria",
"Archaeoglobi",
"Thermococci",
"Thalassoarchaea (MG-II)",
"Unclassified_Euryarchaeota",
"Halobacteria",
"Thermoplasmata",
"Methanomicrobia",
"Aigarchaeota",
"Geothermarchaeota",
"Geoarchaeota",
"Brockarchaeota",
"Marsarchaeota",
"Verstraetarchaoeta",
"Unclassified_Crenarchaeota",
"Korarchaeota",
"Bathyarchaeota ",
"Thaumarchaeota",
"Crenarchaeota",
"Unclassified"))
df%>%
ggplot(data = df, mapping= aes(y=Number.of.genomes, x=Phylum, fill = factor(Superphylum))) +
geom_bar(position = "dodge", stat = "identity") +
coord_flip()