-
Notifications
You must be signed in to change notification settings - Fork 0
/
glycan diversity for TMC.R
314 lines (247 loc) · 14.8 KB
/
glycan diversity for TMC.R
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
# Figure glycan diversity for TMC 05May2021
require(xcms)
require(dplyr)
rawdata<-readMSData("C:/Users/admin/ownCloud/Deep-water kelp/Presentations/Thesis committee meeting 11May2021/MS31_20210205_procA_Pos531_2_33b_11.mzML",
mode="onDisk")
rtrange=c(800,1400)
dp2<-chromatogram(rawdata, mz= c(562.2, 562.4), rt=rtrange)
dp3<-chromatogram(rawdata, mz= c(724.25, 724.45), rt=rtrange)
dp4<-chromatogram(rawdata, mz= c(886.3, 886.5), rt=rtrange)
dp5<-chromatogram(rawdata, mz=c(1048.35, 1048.55), rt=rtrange)
#ggplot(dp2, aes(x=))
png(filename="C:/Users/admin/ownCloud/Deep-water kelp/Presentations/Thesis committee meeting 11May2021/Fig2_oligosaccharides_POS531-2_Ex33b_procA_labels 06May2021.png",
height = 10, width=8.9, units = "cm", res = 200)
par(mfrow=c(4,1), mai=c(0.2,0.4,0,0.1), omi=c(0.3,0.3,0,0))
plot(dp5, main=NA, ylab='', xaxt='n', xlab='',
yaxt='n', ylim=c(0, 1.1e+4), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 5e+3, 1e+4),
labels=expression(0, 5%*%10^3, 1%*%10^4), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1)
mtext("DP5", side=3, line=-1.5, col="black", cex=0.8, adj = 0.98)
plot(dp4, xaxt='n', main=NA, las=2, ylab='', yaxt='n', ylim=c(0, 8e+4), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 4e+4, 8e+4),
labels=expression(0, 4%*%10^4, 8%*%10^4), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1)
mtext("DP4", side=3, line=-1.5, col="black", cex=0.8, adj = 0.98)
plot(dp3, xaxt='n', main=NA, las=2, ylab='', yaxt='n', ylim=c(0, 4e+5), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 2e+5, 4e+5),
labels=expression(0, 2%*%10^5, 4%*%10^5), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1, col="black")
mtext("DP3", side=3, line=-1.5, col="black", cex=0.8, adj = 0.98)
plot(dp2, xaxt='n', main=NA, las=2, ylab='', yaxt='n', col="black")
axis(1, at=seq(840,1380,60), labels = seq(840/60,1380/60,60/60), col="black")
axis(side=2, at=c(0, 5e+5, 1e+6),
labels=expression(0, 5%*%10^5, 1%*%10^6), las=2, col="black")
mtext("Intensity (a.u.)", side=2, outer=T, at=0.52, cex = 0.8, line = 0.8, col="black")
mtext("DP2", side=3, line=-1.5, col="black", cex=0.8, adj = 0.98)
mtext("Retention time (min)", side=1, outer=T, at=0.52, cex = 0.8, line = 0.8, col="black")
dev.off()
# with standard and blank -------------------------------------------------
setwd("D:/MS31_Sugars_20210205/mzML/")
raw_blank4<-readMSData("MS31_20210205_Blank_20.mzML", mode="onDisk")
# standard plotting -------------------------------------------------------
raw_std1<-readMSData("MS31_20210205_procA_col1_Std_17.mzML", mode="onDisk")
std1_dp2<-chromatogram(raw_std1, mz= c(562.2, 562.4), rt=rtrange)
std1_dp3<-chromatogram(raw_std1, mz= c(724.25, 724.45), rt=rtrange)
std1_dp4<-chromatogram(raw_std1, mz= c(886.3, 886.5), rt=rtrange)
std1_dp5<-chromatogram(raw_std1, mz=c(1048.35, 1048.55), rt=rtrange)
std1_dp6<-chromatogram(raw_std1, mz=c(1209.40, 1209.60), rt=rtrange)
par(mfrow=c(4,1), mai=c(0.2,0.4,0,0.1), omi=c(0.3,0.3,0,0))
#plot(std1_dp6, main=NA, ylab='', xaxt='n', xlab='',
# yaxt='n', ylim=c(0, 4.5e+4) , col="black")
#axis(1, seq(840,1380,60), labels = NA, col="black")
#axis(side=2, at=c(0,2e+4, 4e+4),
# labels=expression(0, 2%*%10^4, 4%*%10^4), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1)
#mtext("DP6", side=3, line=-1.5, col="black", cex=0.8, adj = 0.98)
plot(std1_dp5, main=NA, ylab='', xaxt='n', xlab='',
yaxt='n', ylim=c(0,1.1e+5), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 5e+4, 1e+5),
labels=expression(0, 5%*%10^4, 1%*%10^5), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1)
mtext("DP5", side=3, line=-1.5, col="black", cex=0.8, adj = 0.98)
plot(std1_dp4, xaxt='n', main=NA, las=2, ylab='', yaxt='n', ylim=c(0, 8e+4), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 4e+4, 8e+4),
labels=expression(0, 4%*%10^4, 8%*%10^4), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1)
mtext("DP4", side=3, line=-1.5, col="black", cex=0.8, adj = 0.98)
plot(std1_dp3, xaxt='n', main=NA, las=2, ylab='', yaxt='n', ylim=c(0, 4e+6), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 2e+6, 4e+6),
labels=expression(0, 2%*%10^6, 4%*%10^6), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1, col="black")
mtext("DP3", side=3, line=-1.5, col="black", cex=0.8, adj = 0.98)
plot(std1_dp2, xaxt='n', main=NA, las=2, ylab='', yaxt='n', col="black", ylim=c(0, 1.1e+7))
axis(1, at=seq(840,1380,60), labels = seq(840/60,1380/60,60/60), col="black")
axis(side=2, at=c(0, 5e+6, 1e+7),
labels=expression(0, 5%*%10^6, 1%*%10^7), las=2, col="black")
mtext("Intensity (a.u.)", side=2, outer=T, at=0.52, cex = 0.8, line = 0.8, col="black")
mtext("DP2", side=3, line=-1.5, col="black", cex=0.8, adj = 0.98)
mtext("Retention time (min)", side=1, outer=T, at=0.52, cex = 0.8, line = 0.8, col="black")
# blank plotting ----------------------------------------------------------
extrblk1_dp2<-chromatogram(raw_extrblk1, mz= c(562.2, 562.4), rt=rtrange)
extrblk1_dp3<-chromatogram(raw_extrblk1, mz= c(724.25, 724.45), rt=rtrange)
extrblk1_dp4<-chromatogram(raw_extrblk1, mz= c(886.3, 886.5), rt=rtrange)
extrblk1_dp5<-chromatogram(raw_extrblk1, mz=c(1048.35, 1048.55), rt=rtrange)
par(mfrow=c(4,1), mai=c(0.2,0.4,0,0.1), omi=c(0.3,0.3,0,0))
plot(extrblk1_dp5, main=NA, ylab='', xaxt='n', xlab='',
yaxt='n', ylim=c(0, 1.1e+4), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 5e+3, 1e+4),
labels=expression(0, 5%*%10^3, 1%*%10^4), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1)
mtext("DP5", side=3, line=-1.5, col="black", cex=0.8, adj = 0.98)
plot(extrblk1_dp4, xaxt='n', main=NA, las=2, ylab='', yaxt='n', ylim=c(0, 8e+4), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 4e+4, 8e+4),
labels=expression(0, 4%*%10^4, 8%*%10^4), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1)
mtext("DP4", side=3, line=-1.5, col="black", cex=0.8, adj = 0.98)
plot(extrblk1_dp3, xaxt='n', main=NA, las=2, ylab='', yaxt='n', ylim=c(0, 4e+5), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 2e+5, 4e+5),
labels=expression(0, 2%*%10^5, 4%*%10^5), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1, col="black")
mtext("DP3", side=3, line=-1.5, col="black", cex=0.8, adj = 0.98)
plot(extrblk1_dp2, xaxt='n', main=NA, las=2, ylab='', yaxt='n', col="black", ylim=c(0, 1e+6))
axis(1, at=seq(840,1380,60), labels = seq(840/60,1380/60,60/60), col="black")
axis(side=2, at=c(0, 5e+5, 1e+6),
labels=expression(0, 5%*%10^5, 1%*%10^6), las=2, col="black")
mtext("Intensity (a.u.)", side=2, outer=T, at=0.52, cex = 0.8, line = 0.8, col="black")
mtext("DP2", side=3, line=-1.5, col="black", cex=0.8, adj = 0.98)
mtext("Retention time (min)", side=1, outer=T, at=0.52, cex = 0.8, line = 0.8, col="black")
# sample plotting ----------------------------------------------------------
rawdata<-readMSData("C:/Users/admin/ownCloud/Deep-water kelp/Presentations/Thesis committee meeting 11May2021/MS31_20210205_procA_Pos531_2_33b_11.mzML",
mode="onDisk")
rtrange=c(800,1400)
dp2<-chromatogram(rawdata, mz= c(562.2, 562.4), rt=rtrange)
dp3<-chromatogram(rawdata, mz= c(724.25, 724.45), rt=rtrange)
dp4<-chromatogram(rawdata, mz= c(886.3, 886.5), rt=rtrange)
dp5<-chromatogram(rawdata, mz=c(1048.35, 1048.55), rt=rtrange)
dp6<-chromatogram(rawdata, mz=c(1209.40, 1209.60), rt=rtrange)
par(mfrow=c(4,1), mai=c(0.2,0.4,0,0.1), omi=c(0.3,0.3,0,0))
#plot(dp6, main=NA, ylab='', xaxt='n', xlab='',
# yaxt='n', ylim=c(0, 4.5e+4) , col="black")
#axis(1, seq(840,1380,60), labels = NA, col="black")
#axis(side=2, at=c(0,2e+4, 4e+4),
# labels=expression(0, 2%*%10^4, 4%*%10^4), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1)
#mtext("DP6", side=3, line=-1.5, col="black", cex=0.8, adj = 0.98)
plot(dp5, main=NA, ylab='', xaxt='n', xlab='',
yaxt='n', ylim=c(0, 1.1e+4), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 5e+3, 1e+4),
labels=expression(0, 5%*%10^3, 1%*%10^4), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1)
mtext("DP5", side=3, line=-1.5, col="black", cex=0.8, adj = 0.98)
plot(dp4, xaxt='n', main=NA, las=2, ylab='', yaxt='n', ylim=c(0, 8e+4), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 4e+4, 8e+4),
labels=expression(0, 4%*%10^4, 8%*%10^4), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1)
mtext("DP4", side=3, line=-1.5, col="black", cex=0.8, adj = 0.98)
plot(dp3, xaxt='n', main=NA, las=2, ylab='', yaxt='n', ylim=c(0, 4e+5), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 2e+5, 4e+5),
labels=expression(0, 2%*%10^5, 4%*%10^5), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1, col="black")
mtext("DP3", side=3, line=-1.5, col="black", cex=0.8, adj = 0.98)
plot(dp2, xaxt='n', main=NA, las=2, ylab='', yaxt='n', col="black")
axis(1, at=seq(840,1380,60), labels = seq(840/60,1380/60,60/60), col="black")
axis(side=2, at=c(0, 5e+5, 1e+6),
labels=expression(0, 5%*%10^5, 1%*%10^6), las=2, col="black")
mtext("Intensity (a.u.)", side=2, outer=T, at=0.52, cex = 0.8, line = 0.8, col="black")
mtext("DP2", side=3, line=-1.5, col="black", cex=0.8, adj = 0.98)
mtext("Retention time (min)", side=1, outer=T, at=0.52, cex = 0.8, line = 0.8, col="black")
# final figure ------------------------------------------------------------
png(filename="C:/Users/admin/ownCloud/Deep-water kelp/Presentations/Thesis committee meeting 11May2021/Fig3_oligosaccharides_extrblk extrstds POS531_procA_labels 06May2021.png",
height = 10, width=18.9, units = "cm", res = 200)
par(mfrow=c(4,3), mai=c(0.2,0.4,0,0.3), omi=c(0.3,0.3,0,0))
# dp5
plot(std1_dp5, main=NA, ylab='', xaxt='n', xlab='',
yaxt='n', ylim=c(0,1.1e+5), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 5e+4, 1e+5),
labels=expression(0, 5%*%10^4, 1%*%10^5), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1)
mtext("DP5", side=3, line=-1.5, col="black", cex=0.8, adj = 0.96)
plot(extrblk1_dp5, main=NA, ylab='', xaxt='n', xlab='',
yaxt='n', ylim=c(0, 1.1e+4), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 5e+3, 1e+4),
labels=expression(0, 5%*%10^3, 1%*%10^4), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1)
mtext("DP5", side=3, line=-1.5, col="black", cex=0.8, adj = 0.96)
plot(dp5, main=NA, ylab='', xaxt='n', xlab='',
yaxt='n', ylim=c(0, 1.1e+4), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 5e+3, 1e+4),
labels=expression(0, 5%*%10^3, 1%*%10^4), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1)
mtext("DP5", side=3, line=-1.5, col="black", cex=0.8, adj = 0.96)
#dp4
plot(std1_dp4, xaxt='n', main=NA, las=2, ylab='', yaxt='n', ylim=c(0, 8e+4), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 4e+4, 8e+4),
labels=expression(0, 4%*%10^4, 8%*%10^4), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1)
mtext("DP4", side=3, line=-1.5, col="black", cex=0.8, adj = 0.96)
plot(extrblk1_dp4, xaxt='n', main=NA, las=2, ylab='', yaxt='n', ylim=c(0, 8e+4), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 4e+4, 8e+4),
labels=expression(0, 4%*%10^4, 8%*%10^4), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1)
mtext("DP4", side=3, line=-1.5, col="black", cex=0.8, adj = 0.96)
plot(dp4, xaxt='n', main=NA, las=2, ylab='', yaxt='n', ylim=c(0, 8e+4), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 4e+4, 8e+4),
labels=expression(0, 4%*%10^4, 8%*%10^4), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1)
mtext("DP4", side=3, line=-1.5, col="black", cex=0.8, adj = 0.96)
#dp3
plot(std1_dp3, xaxt='n', main=NA, las=2, ylab='', yaxt='n', ylim=c(0, 4e+6), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 2e+6, 4e+6),
labels=expression(0, 2%*%10^6, 4%*%10^6), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1, col="black")
mtext("DP3", side=3, line=-1.5, col="black", cex=0.8, adj = 0.96)
plot(extrblk1_dp3, xaxt='n', main=NA, las=2, ylab='', yaxt='n', ylim=c(0, 4e+5), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 2e+5, 4e+5),
labels=expression(0, 2%*%10^5, 4%*%10^5), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1, col="black")
mtext("DP3", side=3, line=-1.5, col="black", cex=0.8, adj = 0.96)
plot(dp3, xaxt='n', main=NA, las=2, ylab='', yaxt='n', ylim=c(0, 4e+5), col="black")
axis(1, seq(840,1380,60), labels = NA, col="black")
axis(side=2, at=c(0, 2e+5, 4e+5),
labels=expression(0, 2%*%10^5, 4%*%10^5), las=2, col="black")
#title(ylab="Intensity (a.u.)", line=4, cex.lab=1, col="black")
mtext("DP3", side=3, line=-1.5, col="black", cex=0.8, adj = 0.96)
#dp2
plot(std1_dp2, xaxt='n', main=NA, las=2, ylab='', yaxt='n', col="black", ylim=c(0, 1.1e+7))
axis(1, at=seq(840,1380,60), labels = seq(840/60,1380/60,60/60), col="black")
axis(side=2, at=c(0, 5e+6, 1e+7),
labels=expression(0, 5%*%10^6, 1%*%10^7), las=2, col="black")
mtext("Intensity (a.u.)", side=2, outer=T, at=0.52, cex = 0.8, line = 0.8, col="black")
mtext("DP2", side=3, line=-1.5, col="black", cex=0.8, adj = 0.96)
mtext("Retention time (min)", side=1, outer=T, at=0.52, cex = 0.8, line = 0.8, col="black")
plot(extrblk1_dp2, xaxt='n', main=NA, las=2, ylab='', yaxt='n', col="black", ylim=c(0, 1e+6))
axis(1, at=seq(840,1380,60), labels = seq(840/60,1380/60,60/60), col="black")
axis(side=2, at=c(0, 5e+5, 1e+6),
labels=expression(0, 5%*%10^5, 1%*%10^6), las=2, col="black")
mtext("Intensity (a.u.)", side=2, outer=T, at=0.52, cex = 0.8, line = 0.8, col="black")
mtext("DP2", side=3, line=-1.5, col="black", cex=0.8, adj = 0.96)
mtext("Retention time (min)", side=1, outer=T, at=0.52, cex = 0.8, line = 0.8, col="black")
plot(dp2, xaxt='n', main=NA, las=2, ylab='', yaxt='n', col="black")
axis(1, at=seq(840,1380,60), labels = seq(840/60,1380/60,60/60), col="black")
axis(side=2, at=c(0, 5e+5, 1e+6),
labels=expression(0, 5%*%10^5, 1%*%10^6), las=2, col="black")
mtext("Intensity (a.u.)", side=2, outer=T, at=0.52, cex = 0.8, line = 0.8, col="black")
mtext("DP2", side=3, line=-1.5, col="black", cex=0.8, adj = 0.96)
mtext("Retention time (min)", side=1, outer=T, at=0.52, cex = 0.8, line = 0.8, col="black")
dev.off()