From a6ea1d117f59791e3b7948d462cb6ee7b4999f72 Mon Sep 17 00:00:00 2001 From: junikimm717 Date: Wed, 30 Jun 2021 14:03:40 -0400 Subject: [PATCH] began testing --- .gitignore | 2 ++ specification.md | 3 +++ src/script.def.R | 31 ++++++++++++++++++++++--------- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 3da05d0..2c5219a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ .DS_Store /data +/.RData +/.Rhistory diff --git a/specification.md b/specification.md index 23cc09c..ddc03f7 100644 --- a/specification.md +++ b/specification.md @@ -48,6 +48,8 @@ isotopes. - No statistical testing required (check if it is chlorine or bromine) - Isotopes to check (Carbon, Sulfur, Chlorine, Bromine all have n+2) (check make.isos object) + +- Tweak parameters (but also put them into a slideshow/record, see how good the results are). - **set all rules to false** ## Isotopes @@ -56,3 +58,4 @@ isotopes. - Part of the reasoning can be attributed to differences. - Forseeable future, adapt to different isotopes. - Capture multiple outputs of different isotopes. + diff --git a/src/script.def.R b/src/script.def.R index 5c96dd0..93bf9dd 100644 --- a/src/script.def.R +++ b/src/script.def.R @@ -1,32 +1,32 @@ library("nontarget") library("purrr") -library("funprog") +#library("funprog") library("enviPat") library("stringr") library("parallel") # Configurations ############################################################# # 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") + # Minimum size of a cluster min_cluster_size <- 3 # Number of cores to be used (will be adjusted if not possible) -used_cores <- 3 - -############################################################################## +use_cores <- 6 ############################################################################## # Read in the Table ########################################################## -table <- read.table(file, header=TRUE, sep=",") +table <- read.table(file, header=TRUE, sep="\t") # Organize the tables by number ############################################## fragments <- max(table[,"Spectra_Number"]) - # The algorithm below guarantees linear complexity of looking up data points.# # set use_cores to safe amount @@ -80,7 +80,20 @@ isos <- make.isos(isotopes,use_isotopes=search_isos, diagnostics <- function(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) } @@ -88,7 +101,7 @@ use <- Filter(function(x) usable[x], 1:fragments) results <- mclapply(use, diagnostics, mc.cores=use_cores) + # Incomplete: Make the analysis more resiliant to different sorting. -# Incomplete: How to process results. (is it actually supposed to be all negatives?) ##############################################################################