-
Notifications
You must be signed in to change notification settings - Fork 45
/
.Rhistory
428 lines (428 loc) · 24 KB
/
.Rhistory
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
library(diagram)
openplotmat()
par(mar = c(2, 2, 2, 2))
openplotmat(main = paste("Sulfur Cycle:", name.of.genome)) # Add a title
elpos <- coordinates (c(1, 3, 3, 3, 1)) # Put the coordinate
elpos
straightarrow(from = elpos[1, ], to = elpos[4, ], lty = 1, lcol = input[23,2]) #S-S-01:Sulfide oxidation
read.csv("~/Desktop/Total.R_input.txt")
read.csv("~/Desktop/Total.R_input.txt", sep=)
read.csv("~/Desktop/Total.R_input.txt", sep="\t")
input <- read.table("~/Desktop/Total.R_input.txt", sep="\t")
library(diagram)
openplotmat()
par(mar = c(2, 2, 2, 2))
openplotmat(main = paste("Sulfur Cycle:", name.of.genome)) # Add a title
name.of.genome <- "test"
openplotmat(main = paste("Sulfur Cycle:", name.of.genome)) # Add a title
elpos <- coordinates (c(1, 3, 3, 3, 1)) # Put the coordinate
elpos
straightarrow(from = elpos[1, ], to = elpos[4, ], lty = 1, lcol = input[23,2]) #S-S-01:Sulfide oxidation
straightarrow(from = elpos[4, ], to = elpos[1, ], lty = 1, lcol = input[24,2]) #S-S-02:Sulfur reduction
straightarrow(from = elpos[4, ], to = elpos[10, ], lty = 1, lcol = input[25,2]) #S-S-03:Sulfur oxidation
straightarrow(from = elpos[10, ], to = elpos[11, ], lty = 1, lcol = input[26,2]) #S-S-04:Sulfite oxidation
straightarrow(from = elpos[11, ], to = elpos[5, ], lty = 1, lcol = input[27,2]) #S-S-05:Sulfate reduction
straightarrow(from = elpos[5, ], to = elpos[1, ], lty = 1, lcol = input[28,2]) #S-S-06:Sulfite reduction
straightarrow(from = elpos[6, ], to = elpos[11, ], lty = 1, lcol = input[29,2]) #S-S-07:Thiosulfate oxidation
splitarrow(from = elpos[6, ], to = elpos[c(1,10), ], lty = 1, lwd = 1, dd = 0.7, arr.side = 1:2, lcol = input[30,2]) #S-S-08:Thiosulfate disproportionation
splitarrow(from = elpos[6, ], to = elpos[c(4,11), ], lty = 1, lwd = 1, dd = 0.7, arr.side = 1:2, lcol = input[31,2]) #S-S-09:Thiosulfate disproportionation 2
View(input)
textrect (elpos[1, ], 0.07, 0.05, lab = expression(paste(H['2'],S,' ',(-2))), cex = 1.5)
textrect (elpos[4, ], 0.05, 0.05, lab = expression(paste(S,' ',(0))), cex = 1.5)
textrect (elpos[5, ], 0.07, 0.05, lab = expression(paste(SO['3'])^'2-'*' '(+4)), cex = 1.5)
textrect (elpos[6, ], 0.07, 0.05, lab = expression(paste(S['2']*O['3'])^'2-'* ' '(+2)), cex = 1.5)
textrect (elpos[10, ], 0.07, 0.05, lab = expression(paste(SO['3'])^'2-'*' '(+4)), cex = 1.5)
textrect (elpos[11, ], 0.07, 0.05, lab = expression(paste(SO['4'])^'2-'*' '(+6)), cex = 1.5)
straightarrow(from = elpos[1, ], to = elpos[4, ], lty = 1, lcol = input[23,2]) #S-S-01:Sulfide oxidation
textplain(mid = c(0.8, 0.85),
lab = c("Step1: Sulfide oxidation"))
textplain(mid = c(0.68, 0.69),
lab = c("Step2: Sulfur reduction"))
textplain(mid = c(0.93, 0.5),
lab = c("Step3: Sulfur oxidation"))
textplain(mid = c(0.75, 0.15),
lab = c("Step4: Sulfite oxidation"))
textplain(mid = c(0.25, 0.23),
lab = c("Step5: Sulfate reduction"))
textplain(mid = c(0.23, 0.75),
lab = c("Step6: Sulfite reduction"))
textplain(mid = c(0.605, 0.32),
lab = c("Step7: Thiosulfate oxidation"))
textplain(mid = c(0.45, 0.61),
lab = c("Step8: Thiosulfate disproportionation 1"))
textplain(mid = c(0.45, 0.61),
lab = c("Step8: Thiosulfate disproportionation 2"))
textplain(mid = c(0.68, 0.61),
lab = c("Step8: Thiosulfate disproportionation 2"))
textplain(mid = c(0.68, 0.40),
lab = c("Step8: Thiosulfate disproportionation 2"))
openplotmat()
par(mar = c(2, 2, 2, 2))
openplotmat(main = "Sulfur Cycle : Summary Figure") # Add a tiitle
elpos <- coordinates (c(1, 3, 3, 3, 1)) # Put the coordinate
straightarrow(from = elpos[1, ], to = elpos[4, ], lty = 1, lcol = 1) #S-S-01:Sulfide oxidation
straightarrow(from = elpos[4, ], to = elpos[1, ], lty = 1, lcol = 1) #S-S-02:Sulfur reduction
straightarrow(from = elpos[4, ], to = elpos[10, ], lty = 1, lcol = 1) #S-S-03:Sulfur oxidation
straightarrow(from = elpos[10, ], to = elpos[11, ], lty = 1, lcol = 1) #S-S-04:Sulfite oxidation
straightarrow(from = elpos[11, ], to = elpos[5, ], lty = 1, lcol = 1) #S-S-05:Sulfate reduction
straightarrow(from = elpos[5, ], to = elpos[1, ], lty = 1, lcol = 1) #S-S-06:Sulfite reduction
straightarrow(from = elpos[6, ], to = elpos[11, ], lty = 1, lcol = 1) #S-S-07:Thiosulfate oxidation
splitarrow(from = elpos[6, ], to = elpos[c(1,10), ], lty = 1, lwd = 1, dd = 0.7, arr.side = 1:2, lcol = 1) #S-S-08:Thiosulfate disproportionation 1
splitarrow(from = elpos[6, ], to = elpos[c(4,11), ], lty = 1, lwd = 1, dd = 0.7, arr.side = 1:2, lcol = 1) #S-S-09:Thiosulfate disproportionation 2
textrect (elpos[1, ], 0.07, 0.05, lab = expression(paste(H['2'],S,' ',(-2))), cex = 1.5)
textrect (elpos[4, ], 0.05, 0.05, lab = expression(paste(S,' ',(0))), cex = 1.5)
textrect (elpos[5, ], 0.07, 0.05, lab = expression(paste(SO['3'])^'2-'*' '(+4)), cex = 1.5)
textrect (elpos[6, ], 0.07, 0.05, lab = expression(paste(S['2']*O['3'])^'2-'* ' '(+2)), cex = 1.5)
textrect (elpos[10, ], 0.07, 0.05, lab = expression(paste(SO['3'])^'2-'*' '(+4)), cex = 1.5)
textrect (elpos[11, ], 0.07, 0.05, lab = expression(paste(SO['4'])^'2-'*' '(+6)), cex = 1.5)
par(lheight=0.01)
textplain(mid = c(0.8, 0.85),
lab = c("Step1: Sulfide oxidation",
paste("Genomes:",input.total$Nb.Genome[23]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[23],"%")))
input.total <- input.total
input.total <- input
textplain(mid = c(0.8, 0.85),
lab = c("Step1: Sulfide oxidation",
paste("Genomes:",input.total$Nb.Genome[23]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[23],"%")))
View(input.total)
colnames(input.total) <- c("Reaction","Nb.Genome","Genome.Coverage.Percentages.Round")
textplain(mid = c(0.8, 0.85),
lab = c("Step1: Sulfide oxidation",
paste("Genomes:",input.total$Nb.Genome[23]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[23],"%")))
openplotmat()
par(mar = c(2, 2, 2, 2))
openplotmat(main = "Sulfur Cycle : Summary Figure") # Add a tiitle
elpos <- coordinates (c(1, 3, 3, 3, 1)) # Put the coordinate
straightarrow(from = elpos[1, ], to = elpos[4, ], lty = 1, lcol = 1) #S-S-01:Sulfide oxidation
straightarrow(from = elpos[4, ], to = elpos[1, ], lty = 1, lcol = 1) #S-S-02:Sulfur reduction
straightarrow(from = elpos[4, ], to = elpos[10, ], lty = 1, lcol = 1) #S-S-03:Sulfur oxidation
straightarrow(from = elpos[10, ], to = elpos[11, ], lty = 1, lcol = 1) #S-S-04:Sulfite oxidation
straightarrow(from = elpos[11, ], to = elpos[5, ], lty = 1, lcol = 1) #S-S-05:Sulfate reduction
straightarrow(from = elpos[5, ], to = elpos[1, ], lty = 1, lcol = 1) #S-S-06:Sulfite reduction
straightarrow(from = elpos[6, ], to = elpos[11, ], lty = 1, lcol = 1) #S-S-07:Thiosulfate oxidation
splitarrow(from = elpos[6, ], to = elpos[c(1,10), ], lty = 1, lwd = 1, dd = 0.7, arr.side = 1:2, lcol = 1) #S-S-08:Thiosulfate disproportionation 1
splitarrow(from = elpos[6, ], to = elpos[c(4,11), ], lty = 1, lwd = 1, dd = 0.7, arr.side = 1:2, lcol = 1) #S-S-09:Thiosulfate disproportionation 2
textrect (elpos[1, ], 0.07, 0.05, lab = expression(paste(H['2'],S,' ',(-2))), cex = 1.5)
textrect (elpos[4, ], 0.05, 0.05, lab = expression(paste(S,' ',(0))), cex = 1.5)
textrect (elpos[5, ], 0.07, 0.05, lab = expression(paste(SO['3'])^'2-'*' '(+4)), cex = 1.5)
textrect (elpos[6, ], 0.07, 0.05, lab = expression(paste(S['2']*O['3'])^'2-'* ' '(+2)), cex = 1.5)
textrect (elpos[10, ], 0.07, 0.05, lab = expression(paste(SO['3'])^'2-'*' '(+4)), cex = 1.5)
textrect (elpos[11, ], 0.07, 0.05, lab = expression(paste(SO['4'])^'2-'*' '(+6)), cex = 1.5)
par(lheight=0.01)
textplain(mid = c(0.8, 0.85),
lab = c("Step1: Sulfide oxidation",
paste("Genomes:",input.total$Nb.Genome[23]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[23],"%")))
colnames(input.total) <- c("Reaction","Nb.Genome","Genome.Coverage.Percentages")
input.total$Genome.Coverage.Percentages.Round <- round(input.total$Genome.Coverage.Percentages, digits=2)
View(input.total)
textplain(mid = c(0.8, 0.85),
lab = c("Step1: Sulfide oxidation",
paste("Genomes:",input.total$Nb.Genome[23]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[23],"%")))
textplain(mid = c(0.68, 0.68),
lab = c("Step2: Sulfur reduction",
paste("Genomes:",input.total$Nb.Genome[24]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[24],"%")))
textplain(mid = c(0.93, 0.5),
lab = c("Step3: Sulfur",
"oxidation",
paste("Genomes:",input.total$Nb.Genome[25]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[25],"%")))
textplain(mid = c(0.75, 0.12),
lab = c("Step4: Sulfite oxidation",
paste("Genomes:",input.total$Nb.Genome[26]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[26],"%")))
textplain(mid = c(0.25, 0.20),
lab = c("Step5: Sulfate reduction",
paste("Genomes:",input.total$Nb.Genome[27]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[27],"%")))
textplain(mid = c(0.23, 0.75),
lab = c("Step6: Sulfite reduction",
paste("Genomes:",input.total$Nb.Genome[28]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[28],"%")))
textplain(mid = c(0.61, 0.32),
lab = c("Step7: Thiosulfate oxidation",
paste("Genomes:",input.total$Nb.Genome[29]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[29],"%")))
textplain(mid = c(0.45, 0.62),
lab = c("Step8: Thiosulfate disproportionation 1",
paste("Genomes:",input.total$Nb.Genome[30]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[30],"%")))
textplain(mid = c(0.68, 0.40),
lab = c("Step9: Thiosulfate disproportionation 2",
paste("Genomes:",input.total$Nb.Genome[31]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[31],"%")))
textplain(mid = c(0.51, 0.32),
lab = c("Step7: Thiosulfate oxidation",
paste("Genomes:",input.total$Nb.Genome[29]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[29],"%")))
textplain(mid = c(0.41, 0.32),
lab = c("Step7: Thiosulfate oxidation",
paste("Genomes:",input.total$Nb.Genome[29]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[29],"%")))
textplain(mid = c(0.41, 0.35),
lab = c("Step7: Thiosulfate oxidation",
paste("Genomes:",input.total$Nb.Genome[29]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[29],"%")))
elpos <- coordinates (c(1, 3, 3, 3, 1)) # Put the coordinate
straightarrow(from = elpos[1, ], to = elpos[4, ], lty = 1, lcol = 1) #S-S-01:Sulfide oxidation
straightarrow(from = elpos[4, ], to = elpos[1, ], lty = 1, lcol = 1) #S-S-02:Sulfur reduction
straightarrow(from = elpos[4, ], to = elpos[10, ], lty = 1, lcol = 1) #S-S-03:Sulfur oxidation
straightarrow(from = elpos[10, ], to = elpos[11, ], lty = 1, lcol = 1) #S-S-04:Sulfite oxidation
straightarrow(from = elpos[11, ], to = elpos[5, ], lty = 1, lcol = 1) #S-S-05:Sulfate reduction
openplotmat()
par(mar = c(2, 2, 2, 2))
openplotmat(main = "Sulfur Cycle : Summary Figure") # Add a tiitle
elpos <- coordinates (c(1, 3, 3, 3, 1)) # Put the coordinate
straightarrow(from = elpos[1, ], to = elpos[4, ], lty = 1, lcol = 1) #S-S-01:Sulfide oxidation
straightarrow(from = elpos[4, ], to = elpos[1, ], lty = 1, lcol = 1) #S-S-02:Sulfur reduction
straightarrow(from = elpos[4, ], to = elpos[10, ], lty = 1, lcol = 1) #S-S-03:Sulfur oxidation
straightarrow(from = elpos[10, ], to = elpos[11, ], lty = 1, lcol = 1) #S-S-04:Sulfite oxidation
straightarrow(from = elpos[11, ], to = elpos[5, ], lty = 1, lcol = 1) #S-S-05:Sulfate reduction
straightarrow(from = elpos[5, ], to = elpos[1, ], lty = 1, lcol = 1) #S-S-06:Sulfite reduction
straightarrow(from = elpos[6, ], to = elpos[11, ], lty = 1, lcol = 1) #S-S-07:Thiosulfate oxidation
splitarrow(from = elpos[6, ], to = elpos[c(1,10), ], lty = 1, lwd = 1, dd = 0.7, arr.side = 1:2, lcol = 1) #S-S-08:Thiosulfate disproportionation 1
splitarrow(from = elpos[6, ], to = elpos[c(4,11), ], lty = 1, lwd = 1, dd = 0.7, arr.side = 1:2, lcol = 1) #S-S-09:Thiosulfate disproportionation 2
textrect (elpos[1, ], 0.07, 0.05, lab = expression(paste(H['2'],S,' ',(-2))), cex = 1.5)
textrect (elpos[4, ], 0.05, 0.05, lab = expression(paste(S,' ',(0))), cex = 1.5)
textrect (elpos[5, ], 0.07, 0.05, lab = expression(paste(SO['3'])^'2-'*' '(+4)), cex = 1.5)
textrect (elpos[6, ], 0.07, 0.05, lab = expression(paste(S['2']*O['3'])^'2-'* ' '(+2)), cex = 1.5)
textrect (elpos[10, ], 0.07, 0.05, lab = expression(paste(SO['3'])^'2-'*' '(+4)), cex = 1.5)
textrect (elpos[11, ], 0.07, 0.05, lab = expression(paste(SO['4'])^'2-'*' '(+6)), cex = 1.5)
par(lheight=0.01)
textplain(mid = c(0.8, 0.85),
lab = c("Step1: Sulfide oxidation",
paste("Genomes:",input.total$Nb.Genome[23]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[23],"%")))
textplain(mid = c(0.68, 0.68),
lab = c("Step2: Sulfur reduction",
paste("Genomes:",input.total$Nb.Genome[24]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[24],"%")))
textplain(mid = c(0.93, 0.5),
lab = c("Step3: Sulfur",
"oxidation",
paste("Genomes:",input.total$Nb.Genome[25]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[25],"%")))
textplain(mid = c(0.75, 0.12),
lab = c("Step4: Sulfite oxidation",
paste("Genomes:",input.total$Nb.Genome[26]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[26],"%")))
textplain(mid = c(0.25, 0.20),
lab = c("Step5: Sulfate reduction",
paste("Genomes:",input.total$Nb.Genome[27]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[27],"%")))
textplain(mid = c(0.23, 0.75),
lab = c("Step6: Sulfite reduction",
paste("Genomes:",input.total$Nb.Genome[28]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[28],"%")))
textplain(mid = c(0.41, 0.35),
lab = c("Step7: Thiosulfate oxidation",
paste("Genomes:",input.total$Nb.Genome[29]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[29],"%")))
textplain(mid = c(0.45, 0.62),
lab = c("Step8: Thiosulfate disproportionation 1",
paste("Genomes:",input.total$Nb.Genome[30]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[30],"%")))
textplain(mid = c(0.68, 0.40),
lab = c("Step9: Thiosulfate disproportionation 2",
paste("Genomes:",input.total$Nb.Genome[31]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[31],"%")))
input <- read.table("~/Desktop/Sulfitobacter_sp_UWMA-0305.R_input.txt", sep="\t")
View(input)
openplotmat()
#par(mar = c(2, 2, 2, 2))
openplotmat(main = "Nitrogen Cycle: Summary Figure") # Add a tiitl
elpos <- coordinates (c(1, 2, 2, 2, 1)) # Put the coordinat
straightarrow(from = elpos[1, ], to = elpos[3, ], lty = 1, lcol = 1) #N-S-01:Nitrogen fixation
straightarrow(from = elpos[3, ], to = elpos[7, ], lty = 1, lcol = 1) #N-S-02:Ammonia oxidation
straightarrow(from = elpos[7, ], to = elpos[8, ], lty = 1, lcol = 1) #N-S-03:Nitrite oxidation
straightarrow(from = elpos[8, ], to = elpos[6, ], lty = 1, lcol = 1) #N-S-04:Nitrate reduction
straightarrow(from = elpos[6, ], to = elpos[4, ], lty = 1, lcol = 1) #N-S-05:Nitrite reduction
straightarrow(from = elpos[4, ], to = elpos[2, ], lty = 1, lcol = 1) #N-S-06:Nitric oxide reduction
straightarrow(from = elpos[2, ], to = elpos[1, ], lty = 1, lcol = 1) #N-S-07:Nitrous oxide reduction
splitarrow(from = elpos[c(3,6), ], to = elpos[1, ], lty = 1, lwd = 1, dd = 0.7, arr.side = 1:2, lcol = 1) #N-S-08:Nitrite ammonification
straightarrow(from = elpos[8, ], to = elpos[3, ], lty = 1, lcol = 1) #N-S-09:Anammox
textrect (elpos[1, ], 0.05, 0.05, lab = expression(paste(N['2'],' ',(0))), cex = 1.5)
textrect (elpos[2, ], 0.07, 0.05, lab = expression(paste(N['2'],O,' ',(+1))), cex = 1.5)
textrect (elpos[3, ], 0.07, 0.05, lab = expression(paste(NH['4'])^'+'* ' '(-3)), cex = 1.5)
textrect (elpos[4, ], 0.07, 0.05, lab = expression(paste(NO,' ',(+2))), cex = 1.5)
textrect (elpos[6, ], 0.07, 0.05, lab = expression(paste(NO['2'])^'-'* ' '(+3)), cex = 1.5)
textrect (elpos[7, ], 0.07, 0.05, lab = expression(paste(NO['2'])^'-'* ' '(+3)), cex = 1.5)
textrect (elpos[8, ], 0.07, 0.05, lab = expression(paste(NO['3'])^'-'* ' '(+5)), cex = 1.5)
# To know where to write the names (mid = c(X,Y), I ploted elpost (plot(elpos) to get approximate coordinates))
# Make spacing between lines smaller:
par(lheight=0.05)
textplain(mid = c(0.7, 0.85),
lab = c("Step1: Nitrogen fixation",
paste("Genomes:",input.total$Nb.Genome[10]),
paste("Coverage:",input.total$Genome.Coverage.Percentages.Round[10],"%")))
openplotmat()
par(mar = c(2, 2, 2, 2))
openplotmat(main = paste("Sulfur Cycle:", name.of.genome)) # Add a title
elpos <- coordinates (c(1, 3, 3, 3, 1)) # Put the coordinate
elpos
straightarrow(from = elpos[1, ], to = elpos[4, ], lty = 1, lcol = input[23,2]) #S-S-01:Sulfide oxidation
straightarrow(from = elpos[4, ], to = elpos[1, ], lty = 1, lcol = input[24,2]) #S-S-02:Sulfur reduction
openplotmat()
par(mar = c(2, 2, 2, 2))
openplotmat(main = paste("Sulfur Cycle:", name.of.genome)) # Add a title
elpos <- coordinates (c(1, 3, 3, 3, 1)) # Put the coordinate
elpos
straightarrow(from = elpos[1, ], to = elpos[4, ], lty = 1, lcol = input[23,2]) #S-S-01:Sulfide oxidation
input$V2 <- input$V2+1
straightarrow(from = elpos[1, ], to = elpos[4, ], lty = 1, lcol = input[23,2]) #S-S-01:Sulfide oxidation
straightarrow(from = elpos[4, ], to = elpos[1, ], lty = 1, lcol = input[24,2]) #S-S-02:Sulfur reduction
straightarrow(from = elpos[4, ], to = elpos[10, ], lty = 1, lcol = input[25,2]) #S-S-03:Sulfur oxidation
straightarrow(from = elpos[10, ], to = elpos[11, ], lty = 1, lcol = input[26,2]) #S-S-04:Sulfite oxidation
straightarrow(from = elpos[11, ], to = elpos[5, ], lty = 1, lcol = input[27,2]) #S-S-05:Sulfate reduction
straightarrow(from = elpos[5, ], to = elpos[1, ], lty = 1, lcol = input[28,2]) #S-S-06:Sulfite reduction
straightarrow(from = elpos[6, ], to = elpos[11, ], lty = 1, lcol = input[29,2]) #S-S-07:Thiosulfate oxidation
splitarrow(from = elpos[6, ], to = elpos[c(1,10), ], lty = 1, lwd = 1, dd = 0.7, arr.side = 1:2, lcol = input[30,2]) #S-S-08:Thiosulfate disproportionation
splitarrow(from = elpos[6, ], to = elpos[c(4,11), ], lty = 1, lwd = 1, dd = 0.7, arr.side = 1:2, lcol = input[31,2]) #S-S-09:Thiosulfate disproportionation 2
textrect (elpos[1, ], 0.07, 0.05, lab = expression(paste(H['2'],S,' ',(-2))), cex = 1.5)
textrect (elpos[4, ], 0.05, 0.05, lab = expression(paste(S,' ',(0))), cex = 1.5)
textrect (elpos[5, ], 0.07, 0.05, lab = expression(paste(SO['3'])^'2-'*' '(+4)), cex = 1.5)
textrect (elpos[6, ], 0.07, 0.05, lab = expression(paste(S['2']*O['3'])^'2-'* ' '(+2)), cex = 1.5)
textrect (elpos[10, ], 0.07, 0.05, lab = expression(paste(SO['3'])^'2-'*' '(+4)), cex = 1.5)
textrect (elpos[11, ], 0.07, 0.05, lab = expression(paste(SO['4'])^'2-'*' '(+6)), cex = 1.5)
par(lheight=0.08)
textplain(mid = c(0.8, 0.85),
lab = c("Step1: Sulfide oxidation"))
textplain(mid = c(0.68, 0.69),
lab = c("Step2: Sulfur reduction"))
textplain(mid = c(0.93, 0.5),
lab = c("Step3: Sulfur oxidation"))
textplain(mid = c(0.75, 0.15),
lab = c("Step4: Sulfite oxidation"))
textplain(mid = c(0.25, 0.23),
lab = c("Step5: Sulfate reduction"))
textplain(mid = c(0.23, 0.75),
lab = c("Step6: Sulfite reduction"))
textplain(mid = c(0.605, 0.32),
lab = c("Step7: Thiosulfate oxidation"))
textplain(mid = c(0.45, 0.61),
lab = c("Step8: Thiosulfate disproportionation 1"))
textplain(mid = c(0.68, 0.40),
lab = c("Step8: Thiosulfate disproportionation 2"))
textplain(mid = c(0.68, 0.40),
lab = c("Step9: Thiosulfate disproportionation 2"))
openplotmat()
par(mar = c(2, 2, 2, 2))
openplotmat(main = paste("Sulfur Cycle:", name.of.genome)) # Add a title
elpos <- coordinates (c(1, 3, 3, 3, 1)) # Put the coordinate
elpos
straightarrow(from = elpos[1, ], to = elpos[4, ], lty = 1, lcol = input[23,2]) #S-S-01:Sulfide oxidation
straightarrow(from = elpos[4, ], to = elpos[1, ], lty = 1, lcol = input[24,2]) #S-S-02:Sulfur reduction
straightarrow(from = elpos[4, ], to = elpos[10, ], lty = 1, lcol = input[25,2]) #S-S-03:Sulfur oxidation
straightarrow(from = elpos[10, ], to = elpos[11, ], lty = 1, lcol = input[26,2]) #S-S-04:Sulfite oxidation
straightarrow(from = elpos[11, ], to = elpos[5, ], lty = 1, lcol = input[27,2]) #S-S-05:Sulfate reduction
straightarrow(from = elpos[5, ], to = elpos[1, ], lty = 1, lcol = input[28,2]) #S-S-06:Sulfite reduction
straightarrow(from = elpos[6, ], to = elpos[11, ], lty = 1, lcol = input[29,2]) #S-S-07:Thiosulfate oxidation
splitarrow(from = elpos[6, ], to = elpos[c(1,10), ], lty = 1, lwd = 1, dd = 0.7, arr.side = 1:2, lcol = input[30,2]) #S-S-08:Thiosulfate disproportionation
splitarrow(from = elpos[6, ], to = elpos[c(4,11), ], lty = 1, lwd = 1, dd = 0.7, arr.side = 1:2, lcol = input[31,2]) #S-S-09:Thiosulfate disproportionation 2
textrect (elpos[1, ], 0.07, 0.05, lab = expression(paste(H['2'],S,' ',(-2))), cex = 1.5)
textrect (elpos[4, ], 0.05, 0.05, lab = expression(paste(S,' ',(0))), cex = 1.5)
textrect (elpos[5, ], 0.07, 0.05, lab = expression(paste(SO['3'])^'2-'*' '(+4)), cex = 1.5)
textrect (elpos[6, ], 0.07, 0.05, lab = expression(paste(S['2']*O['3'])^'2-'* ' '(+2)), cex = 1.5)
textrect (elpos[10, ], 0.07, 0.05, lab = expression(paste(SO['3'])^'2-'*' '(+4)), cex = 1.5)
textrect (elpos[11, ], 0.07, 0.05, lab = expression(paste(SO['4'])^'2-'*' '(+6)), cex = 1.5)
par(lheight=0.08)
textplain(mid = c(0.8, 0.85),
lab = c("Step1: Sulfide oxidation"))
textplain(mid = c(0.68, 0.69),
lab = c("Step2: Sulfur reduction"))
textplain(mid = c(0.93, 0.5),
lab = c("Step3: Sulfur oxidation"))
textplain(mid = c(0.75, 0.15),
lab = c("Step4: Sulfite oxidation"))
textplain(mid = c(0.25, 0.23),
lab = c("Step5: Sulfate reduction"))
textplain(mid = c(0.23, 0.75),
lab = c("Step6: Sulfite reduction"))
textplain(mid = c(0.605, 0.32),
lab = c("Step7: Thiosulfate oxidation"))
textplain(mid = c(0.45, 0.61),
lab = c("Step8: Thiosulfate disproportionation 1"))
textplain(mid = c(0.68, 0.40),
lab = c("Step9: Thiosulfate disproportionation 2"))
paste(R_input_table,"Metabolic_energy_flow_input.txt")
R_input_table<-"/path/"
paste(R_input_table,"Metabolic_energy_flow_input.txt")
paste(R_input_table,"Metabolic_energy_flow_input.txt",sep="")
library("tidygraph", lib.loc="/Library/Frameworks/R.framework/Versions/3.5/Resources/library")
library("igraph", lib.loc="/Library/Frameworks/R.framework/Versions/3.5/Resources/library")
library("ggraph", lib.loc="/Library/Frameworks/R.framework/Versions/3.5/Resources/library")
#R_input_table <- "/Users/patriciatran/Downloads/Metabolic_network_input.txt"
table <- read.csv(R_input_table, header=T, sep="\t")
R_input_table <- "/Users/patriciatran/Downloads/Metabolic_network_input.txt"
table <- read.csv(R_input_table, header=T, sep="\t")
View(table)
#install.packages("ggraph")
library(ggraph)
library(igraph)
library(tidyverse)
library(tidygraph)
my_graph <- table[,c(2,3,4,5)] %>%
graph_from_data_frame()
deg <- degree(my_graph, mode="all")
View(table)
View(my_graph)
View(table)
# this generates the whole community plot
community.plot <- table[,c(2,3,4,5)] %>%
graph_from_data_frame() %>%
ggraph(layout = "linear",circular = TRUE) +
geom_edge_arc(alpha = .25,
aes(width = Coverage.value.average., color=as.factor(Taxonomic.Group))) +
geom_node_point(color = "black", size = 0.02*deg, alpha=0.75) +
geom_node_text(aes(label = name), color="black", repel = TRUE)+
#theme_graph()+
labs(title = 'Metabolic connections within dataset',
subtitle = 'No scaling')
plot.name <- paste0(network.plots.folder,"/CommunityPlot.PDF")
print(plot.name)
# this generates the whole community plot
community.plot <- table[,c(2,3,4,5)] %>%
graph_from_data_frame() %>%
ggraph(layout = "linear",circular = TRUE) +
geom_edge_arc(alpha = .25,
aes(width = Coverage.value.average., color=as.factor(Taxonomic.Group))) +
geom_node_point(color = "black", size = 0.02*deg, alpha=0.75) +
geom_node_text(aes(label = name), color="black", repel = TRUE)+
#theme_graph()+
labs(title = 'Metabolic connections within dataset',
subtitle = 'No scaling')
community.plot
knitr::opts_chunk$set(echo = TRUE)
library(tidyverse)
library(lubridate)
library(RColorBrewer)
#Cys Individual plots of all sources
ggplot(Cys, aes(source)) +
geom_bar(aes(fill = query_name))
Cys <- read.csv("~/Downloads/Cys_Combined_Individual.csv")
ggplot(Cys, aes(source)) +
geom_bar(aes(fill = query_name))
Cys <- read.csv("~/Downloads/Cys_Combined_Individual.csv")
ggplot(Cys, aes(source)) +
geom_bar(aes(fill = query_name))
ggplot(Cys, aes(source)) +
geom_bar() +
facet_wrap(~query_name)
Cys %>%
filter(Evalue >= 1e-50) %>%
ggplot(aes(source)) +
geom_bar(aes(fill = query_name))
#Cys LM only
Cys_LM <- Cys %>%
filter(source == "LM_Time")
#Adding GaID column
Cys_LM$GaID <- Cys_LM$target_name
Cys_LM$GaID <- str_replace(Cys_LM$GaID, "_.*", "")
R_input_table <- "/Users/patriciatran/Downloads/Metabolic_network_input.txt"
table <- read.csv(R_input_table, header=T, sep="\t")
View(table)