-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rhistory
222 lines (222 loc) · 7.91 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
filename <- 'E:/dataset/deblank/Mspos_Leaf_MM48_20uM_1-A,6_01_14609.mzdata'
splitname <- strsplit(filename,"\\.")[[1]]
if(tolower(splitname[length(splitname)]) == "cdf"){
msobj <- openMSfile(filename,backend="netCDF")
}else if (tolower(splitname[length(splitname)]) == "mzml"){
msobj <- openMSfile(filename,backend="pwiz")
}else{
msobj <- openMSfile(filename,backend="Ramp")
}
library("mzR", lib.loc="F:/Program Files/R/R-3.4.3/library")
splitname <- strsplit(filename,"\\.")[[1]]
if(tolower(splitname[length(splitname)]) == "cdf"){
msobj <- openMSfile(filename,backend="netCDF")
}else if (tolower(splitname[length(splitname)]) == "mzml"){
msobj <- openMSfile(filename,backend="pwiz")
}else{
msobj <- openMSfile(filename,backend="Ramp")
}
tic(msobj)
head(peaks(msobj))
rm()
gc()
file <- 'E:/dataset/deblank/Mspos_Leaf_MM48_20uM_1-A,6_01_14609.mzdata'
blank <- 'E:/dataset/deblank/Mspos_Blank_1-A,1_01_14594.mzdata'
source('E:/R project/deblank/R/functions.R')
data_file <- load_data(file)
data_blank <- load_data(blank)
source('E:/R project/deblank/R/functions.R')
tic_file <- getTIC(data_file)
tic_blank <- getTIC(data_blank)
install.packages(c("devtools", "Rcpp", "RcppArmadillo", "mzR", "parallel", "shiny", "plotly", "data.table", "GA", "IRanges", "dbscan", "randomForest"))
source("https://bioconductor.org/biocLite.R")
biocLite(c("mzR","ropls"))
source('E:/R project/deblank/R/functions.R')
source('E:/R project/deblank/R/functions.R')
install.packages("RcppArmadillo")
library(deblank)
source('E:/R project/deblank/R/RcppExports.R')
file <- 'E:/dataset/deblank/Mspos_Leaf_MM48_20uM_1-A,6_01_14609.mzdata'
blank <- 'E:/dataset/deblank/Mspos_Blank_1-A,1_01_14594.mzdata'
data_file <- load_data(file)
data_blank <- load_data(blank)
tic_file <- getTIC(data_file)
tic_blank <- getTIC(data_blank)
pics_file <- getPIC(data_file)
pics_file <- getPIC(data_file, 200)
source('E:/R project/deblank/R/functions.R')
pics_file <- getPIC(data_file, 200)
mat <- do.call(rbind, data_file$peaks)
source('E:/R project/deblank/R/functions.R')
pics_file <- getPIC(data_file, 200)
source('E:/R project/deblank/R/functions.R')
pics_file <- getPIC(data_file, 200)
head(mat$mz)
rm(mat)
source('E:/R project/deblank/R/functions.R')
pics_file <- getPIC(data_file, 200)
source('E:/R project/deblank/R/RcppExports.R')
pics_file <- getPIC(data_file, 200)
library(deblank)
pics_file <- getPIC(data_file, 200)
source('E:/R project/deblank/R/RcppExports.R')
library(deblank)
pics_file <- getPIC(data_file, 200)
library(deblank)
pics_file <- getPIC(data_file, 200)
rm(getPIP)
pics_file <- getPIC(data_file, 200)
Rcpp::sourceCpp('src/getPIP.cpp')
library(devtools);
install_github("hcji/KPIC2")
library(devtools);
install_github("hcji/KPIC2")
library(devtools);
install_github("hcji/KPIC2")
library(devtools);
install_github("hcji/KPIC2")
install.packages("C:/Users/hcji/Downloads/KPIC2-2.4.0.tar.gz", repos = NULL, type = "source")
library(deblank)
library(deblank)
library(deblank)
library(devtools);
install_github("hcji/KPIC2")
library(devtools);
install_github("hcji/KPIC2")
install_github("hcji/KPIC2")
library(devtools);
install_github("hcji/KPIC2")
install.packages("E:/project/KPIC_2.4.0.tar.gz", repos = NULL, type = "source")
library(devtools);
install_github("hcji/KPIC2")
library(deblank)
install_github("hcji/KPIC2")
install.packages("E:/project/KPIC_2.4.0.tar.gz", repos = NULL, type = "source")
runApp('inst/app')
file <- 'E:/dataset/deblank/Mspos_Leaf_MM48_20uM_1-A,6_01_14609.mzdata'
blank <- 'E:/dataset/deblank/Mspos_Blank_1-A,1_01_14594.mzdata'
source('E:/project/deblank/R/functions.R')
raw_file <- LoadData(file)
source('E:/project/deblank/R/functions.R')
raw_file <- LoadData(file)
raw_blank <- LoadData(blank)
pic_file <- getPIC(raw_file)
pic_file <- getPIC(raw_file, 200)
library(deblank)
pic_file <- getPIC(raw_file)
pic_file <- getPIC(raw_file, 200)
gc()
blank <- 'E:/dataset/deblank/Mspos_Blank_1-A,1_01_14594.mzdata'
file <- 'E:/dataset/deblank/Mspos_Leaf_MM48_20uM_1-A,6_01_14609.mzdata'
raw_blank <- LoadData(blank)
library(deblank)
raw_blank <- LoadData(blank)
raw_file <- LoadData(file)
library(deblank)
pic_blank <- getPIC(raw_file)
pic_blank <- getPIC(raw_file, 200)
library(devtools);
install_github("hcji/KPIC2")
library("KPIC", lib.loc="F:/Program Files/R/R-3.4.3/library")
pic_blank <- getPIC(raw_blank, 200)
library(shiny)
library(plotly)
library(shiny)
library(plotly)
library(KPIC)
install.packages("C:/Users/hcji/Downloads/DeltaMS_1.0.0.tar.gz", repos = NULL, type = "source")
install.packages(c('rChoiceDialogs', 'rmarkdown', 'shinythemes', 'V8', 'DescTools', 'X13CMS'))
install.packages(c("Nozzle.R1","ggplot2","parallel","reshape2","plyr","BBmisc","mixOmics","missForest","doParallel","DiscriMiner","xcms","ape","scatterplot3d","pheatmap","bootstrap","boot","caret","dplyr","stringr","RColorBrewer","DiffCorr","RCurl","lattice","data.table","igraph","tidyr","scales","VennDiagram","pROC","readr","e1071","randomForest","coop","fpc","ROCR"))
biocLite(c("pcaMethods","vsn","pls","faahKO","mzR","preprocessCore","impute","CAMERA","ropls","sva","SSPA"))
install.packages("C:/Users/hcji/Downloads/metaX_1.4.16.tgz", repos = NULL, type = .Platform$pkgType)
shiny::runApp('inst/app')
runApp('inst/app')
runApp('inst/app')
runApp('inst/app')
runApp('inst/app')
library(deblank)
rm(pic_blank)
raw_blank <- LoadData(blank)
library(deblank)
raw_blank <- LoadData(blank)
raw_blank <- LoadData(blank)
raw_file <- LoadData(file)
window=5; threshold=100; digit=0.01
ws <- round(window/mean(diff(raw_file$times)))
ws
ps <- raw_file$peaks
pb <- raw_blank$peaks
quantile(unlist(lapply(pb, function(p) p$intensity)), 0.95)
quantile(unlist(lapply(pb, function(p) p$intensity)), 0.1)
s=1
this.rt <- raw_file$times[s]
rm(ws)
this.rt <- raw_file$times[s]
left.rt <- this.rt - window
right.rt <- this.rt + window
blank.win <- which(raw_blank$times>left.rt & raw_blank$times<right.rt)
blank.win
blank.ion <- do.call(rbind, pb[[blank.win]])
pb[[blank.win]]
blank.ion <- do.call(rbind, pb[blank.win])
View(blank.ion)
this.peak <- ps[[s]]
View(this.peak)
blank.ion <- blank.ion[blank.ion[,2]>threshold,]
View(blank.ion)
keep <- ! round(this.peak$mz, digit) %in% round(blank.ion$mz, digit)
round(1.12345, 0.01)
round(1.12345, 0.001)
round(1.12345, 2)
round(1.12345, 3)
pd <- lapply(seq_along(ps), function(s){
this.rt <- raw_file$times[s]
this.peak <- ps[[s]]
left.rt <- this.rt - window
right.rt <- this.rt + window
blank.win <- which(raw_blank$times>left.rt & raw_blank$times<right.rt)
blank.ion <- do.call(rbind, pb[blank.win])
blank.ion <- blank.ion[blank.ion[,2]>threshold,]
keep <- ! round(this.peak$mz, digit) %in% round(blank.ion$mz, digit)
this.peak[keep,]
})
}
source('E:/project/deblank/R/functions.R')
source('E:/project/deblank/R/functions.R')
tic_raw <- getTIC(raw_file)
source('E:/project/deblank/R/functions.R')
tic_blank <- getTIC(raw_blank)
raw_deblank <- deblank(raw_blank, raw_file, window=5, threshold=100, digit=2)
tic_deblank <- getTIC(raw_deblank)
source('E:/project/deblank/R/functions.R')
source('E:/project/deblank/R/functions.R')
tic_blank <- getTIC(raw_blank)
tic_deblank <- getTIC(raw_deblank)
tic_raw <- getTIC(raw_file)
source('E:/project/deblank/R/functions.R')
plotTIC(tic_raw, tic_blank, tic_deblank)
source('E:/project/deblank/R/functions.R')
tic_blank <- getTIC(raw_blank)
tic_deblank <- getTIC(raw_deblank)
tic_raw <- getTIC(raw_file)
plotTIC(tic_raw, tic_blank, tic_deblank)
source('E:/project/deblank/R/functions.R')
source('E:/project/deblank/R/functions.R')
ms <- getMS(raw_file, 100)
View(ms)
View(ms)
View(ms)
source('E:/project/deblank/R/functions.R')
source('E:/project/deblank/R/functions.R')
p <- plot_ly() %>%
layout(xaxis = list(tick0 = 0, title = 'mass-to-charge'),
yaxis = list(tick0 = 0, title = 'Intensity'),
showlegend = FALSE)
p <- add_markers(p, x=0, y=0, color=I('black'))
p <- add_markers(p, x=max(ms[,'mz'] + 20), y=0, color=I('black'))
for (i in 1:nrow(ms)){
p <- add_lines(p, x=rep(ms[i,'mz'],2), y=c(0,ms[i,'intensity']), color=I('blue'))
}
p
source('E:/project/deblank/R/functions.R')
library("plotly", lib.loc="F:/Program Files/R/R-3.4.3/library")