|
@ -1,32 +1,32 @@ |
|
|
library("nontarget") |
|
|
library("nontarget") |
|
|
library("purrr") |
|
|
library("purrr") |
|
|
library("funprog") |
|
|
|
|
|
|
|
|
#library("funprog") |
|
|
library("enviPat") |
|
|
library("enviPat") |
|
|
library("stringr") |
|
|
library("stringr") |
|
|
library("parallel") |
|
|
library("parallel") |
|
|
|
|
|
|
|
|
# Configurations ############################################################# |
|
|
# Configurations ############################################################# |
|
|
# file : decides which file to read in data from ############################# |
|
|
# file : decides which file to read in data from ############################# |
|
|
file <- "/path/to/file" |
|
|
|
|
|
|
|
|
file <- "path/to/file" |
|
|
|
|
|
|
|
|
|
|
|
# check cluster 2846 |
|
|
|
|
|
|
|
|
search_isos <- c("13C", "37Cl") |
|
|
search_isos <- c("13C", "37Cl") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Minimum size of a cluster |
|
|
# Minimum size of a cluster |
|
|
|
|
|
|
|
|
min_cluster_size <- 3 |
|
|
min_cluster_size <- 3 |
|
|
|
|
|
|
|
|
# Number of cores to be used (will be adjusted if not possible) |
|
|
# Number of cores to be used (will be adjusted if not possible) |
|
|
used_cores <- 3 |
|
|
|
|
|
|
|
|
|
|
|
############################################################################## |
|
|
|
|
|
|
|
|
use_cores <- 6 ############################################################################## |
|
|
# Read in the Table ########################################################## |
|
|
# Read in the Table ########################################################## |
|
|
table <- read.table(file, header=TRUE, sep=",") |
|
|
|
|
|
|
|
|
table <- read.table(file, header=TRUE, sep="\t") |
|
|
|
|
|
|
|
|
# Organize the tables by number ############################################## |
|
|
# Organize the tables by number ############################################## |
|
|
fragments <- max(table[,"Spectra_Number"]) |
|
|
fragments <- max(table[,"Spectra_Number"]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# The algorithm below guarantees linear complexity of looking up data points.# |
|
|
# The algorithm below guarantees linear complexity of looking up data points.# |
|
|
|
|
|
|
|
|
# set use_cores to safe amount |
|
|
# set use_cores to safe amount |
|
@ -80,7 +80,20 @@ isos <- make.isos(isotopes,use_isotopes=search_isos, |
|
|
|
|
|
|
|
|
diagnostics <- function(fragment) { |
|
|
diagnostics <- function(fragment) { |
|
|
points <- getdataframe(fragment) |
|
|
points <- getdataframe(fragment) |
|
|
ptrn <- pattern.search(points, isos) |
|
|
|
|
|
|
|
|
ptrn <- pattern.search( |
|
|
|
|
|
points, |
|
|
|
|
|
isos, |
|
|
|
|
|
cutint=100000, |
|
|
|
|
|
rttol=c(-0.2,0.2), |
|
|
|
|
|
mztol=1000, |
|
|
|
|
|
mzfrac=1.0, |
|
|
|
|
|
ppm=TRUE, |
|
|
|
|
|
inttol=0.2, |
|
|
|
|
|
# Do not modify anything below. |
|
|
|
|
|
rules=rep(FALSE, 11), |
|
|
|
|
|
deter=FALSE, |
|
|
|
|
|
entry=50 |
|
|
|
|
|
); |
|
|
return(ptrn) |
|
|
return(ptrn) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -88,7 +101,7 @@ use <- Filter(function(x) usable[x], 1:fragments) |
|
|
|
|
|
|
|
|
results <- mclapply(use, diagnostics, mc.cores=use_cores) |
|
|
results <- mclapply(use, diagnostics, mc.cores=use_cores) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Incomplete: Make the analysis more resiliant to different sorting. |
|
|
# Incomplete: Make the analysis more resiliant to different sorting. |
|
|
# Incomplete: How to process results. (is it actually supposed to be all negatives?) |
|
|
|
|
|
|
|
|
|
|
|
############################################################################## |
|
|
############################################################################## |