Mercurial > repos > tomnl > deconrank
annotate cameradims.R @ 4:b37f97bda760 draft
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit d4159f1962ef3fe37dd4f3047e4050afe013c15a-dirty
author | tomnl |
---|---|
date | Thu, 03 May 2018 05:20:17 -0400 |
parents | defa57c7775e |
children | e91c400c6ca6 |
rev | line source |
---|---|
1
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
1 library(optparse) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
2 library(cameraDIMS) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
3 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
4 option_list <- list( |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
5 make_option(c("-i", "--in_file"), type="character"), |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
6 make_option(c("-o", "--out_dir"), type="character"), |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
7 make_option("--ppm_iso", default=5), |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
8 make_option("--ppm_adduct", default=5), |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
9 make_option("--maxiso", default=4), |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
10 make_option("--mzabs_iso", default=0.015), |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
11 make_option("--mzabs_adduct", default=0.015), |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
12 make_option("--maxcharge", default=3), |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
13 make_option("--maxmol", default=3), |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
14 make_option("--polarity", default='pos'), |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
15 make_option("--rule_path"), |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
16 make_option("--rule_type"), |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
17 make_option("--export_ruleset", action="store_true"), |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
18 make_option("--intensity_filter", default=0) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
19 ) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
20 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
21 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
22 # store options |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
23 opt<- parse_args(OptionParser(option_list=option_list)) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
24 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
25 print(sessionInfo()) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
26 print(opt) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
27 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
28 df <- read.table(opt$in_file, header = TRUE, sep='\t', stringsAsFactors=FALSE) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
29 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
30 print('IN DATA') |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
31 print(nrow(df)) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
32 print(head(df)) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
33 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
34 devppm_adduct <- opt$ppm_adduct / 1000000 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
35 devppm_iso <- opt$ppm_iso / 1000000 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
36 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
37 paramiso <- list("ppm"=opt$ppm_iso, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
38 "filter"=TRUE, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
39 "maxcharge"=opt$maxcharge, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
40 "maxiso"=opt$maxiso, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
41 "mzabs"=opt$mzabs_iso, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
42 "intval"='maxo', |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
43 "minfrac"=0.5, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
44 'IM'=NULL, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
45 'devppm'=devppm_iso) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
46 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
47 paramadduct <- list("maxCharge"= opt$maxcharge, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
48 "maxMol"= opt$maxmol, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
49 'devppm'=devppm_adduct, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
50 "mzabs"=opt$mzabs_adduct, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
51 'IM'=NULL, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
52 "filter"=TRUE, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
53 'ppm'=opt$ppm_adduct, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
54 "quasimolion"= c(1, 6, 8), |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
55 'polarity'=opt$polarity) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
56 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
57 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
58 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
59 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
60 if(is.null(opt$export_ruleset)){ |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
61 rule_export <- FALSE |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
62 }else{ |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
63 rule_export <- TRUE |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
64 } |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
65 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
66 df$mz <- as.numeric(df$mz) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
67 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
68 print(head(df$mz)) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
69 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
70 if ('intensity' %in% colnames(df)){ |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
71 colnames(df)[colnames(df)=='intensity'] = 'i' |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
72 } |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
73 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
74 if (!'peakID' %in% colnames(df)){ |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
75 df <- cbind('peakID'=1:nrow(df), df) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
76 } |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
77 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
78 df$i <- as.numeric(df$i) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
79 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
80 df <- df[df$i>opt$intensity_filter,] |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
81 |
4
b37f97bda760
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit d4159f1962ef3fe37dd4f3047e4050afe013c15a-dirty
tomnl
parents:
1
diff
changeset
|
82 |
b37f97bda760
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit d4159f1962ef3fe37dd4f3047e4050afe013c15a-dirty
tomnl
parents:
1
diff
changeset
|
83 if (opt$rule_type=='extended_large'){ |
b37f97bda760
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit d4159f1962ef3fe37dd4f3047e4050afe013c15a-dirty
tomnl
parents:
1
diff
changeset
|
84 if(opt$polarity=='pos'){ |
b37f97bda760
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit d4159f1962ef3fe37dd4f3047e4050afe013c15a-dirty
tomnl
parents:
1
diff
changeset
|
85 opt$rule_path <- read.csv(system.file("rules", "CAMERA_rules_PosFinal_PlusLi.csv", package = "cameraDIMS"), header=TRUE) |
b37f97bda760
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit d4159f1962ef3fe37dd4f3047e4050afe013c15a-dirty
tomnl
parents:
1
diff
changeset
|
86 }else{ |
b37f97bda760
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit d4159f1962ef3fe37dd4f3047e4050afe013c15a-dirty
tomnl
parents:
1
diff
changeset
|
87 opt$rule_path <- read.csv(system.file("rules", "CAMERA_rules_NegFinal_PlusLi.csv", package = "cameraDIMS"), header=TRUE) |
b37f97bda760
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit d4159f1962ef3fe37dd4f3047e4050afe013c15a-dirty
tomnl
parents:
1
diff
changeset
|
88 } |
b37f97bda760
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit d4159f1962ef3fe37dd4f3047e4050afe013c15a-dirty
tomnl
parents:
1
diff
changeset
|
89 } |
b37f97bda760
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit d4159f1962ef3fe37dd4f3047e4050afe013c15a-dirty
tomnl
parents:
1
diff
changeset
|
90 |
1
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
91 cameraOut <- cameraDIMS(data=df, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
92 params_iso=paramiso, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
93 params_adduct=paramadduct, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
94 rule_type=opt$rule_type, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
95 rule_pth=opt$rule_path, |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
96 rule_sep='\t', |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
97 rule_export=rule_export) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
98 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
99 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
100 print(head(cameraOut[[1]])) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
101 print(head(cameraOut[[2]])) |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
102 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
103 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
104 out_file1 <- file.path(opt$out_dir, 'camera_annotated_peaklist.txt') |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
105 out_file2 <- file.path(opt$out_dir, 'camera_annotated_map.txt') |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
106 out_file3 <- file.path(opt$out_dir, 'ruleset.txt') |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
107 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
108 write.table(cameraOut[[1]], out_file1, row.names=FALSE, sep='\t') |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
109 write.table(cameraOut[[2]], out_file2, row.names=FALSE, sep='\t') |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
110 |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
111 if (rule_export){ |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
112 write.table(cameraOut[[3]], out_file3, row.names=FALSE, sep='\t') |
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
113 } |