Mercurial > repos > tomnl > deconrank
annotate cameradims.R @ 14:5b0eceae2d6c draft
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 2864a500a25e87f292f185872b92ecfe5800dea1
| author | tomnl |
|---|---|
| date | Fri, 04 May 2018 12:49:30 -0400 |
| parents | fc1440a386f3 |
| children | aa7b5aac31d8 |
| 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 |
|
9
96b0439ff692
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit fe424320c0b41d5eb18ed36892750ee9ae41bc0b-dirty
tomnl
parents:
6
diff
changeset
|
82 if (nrow(df)==0){ |
|
96b0439ff692
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit fe424320c0b41d5eb18ed36892750ee9ae41bc0b-dirty
tomnl
parents:
6
diff
changeset
|
83 print('No peaks left after filtering') |
|
10
fc1440a386f3
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit fe424320c0b41d5eb18ed36892750ee9ae41bc0b-dirty
tomnl
parents:
9
diff
changeset
|
84 quit() |
|
9
96b0439ff692
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit fe424320c0b41d5eb18ed36892750ee9ae41bc0b-dirty
tomnl
parents:
6
diff
changeset
|
85 } |
|
96b0439ff692
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit fe424320c0b41d5eb18ed36892750ee9ae41bc0b-dirty
tomnl
parents:
6
diff
changeset
|
86 |
|
4
b37f97bda760
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit d4159f1962ef3fe37dd4f3047e4050afe013c15a-dirty
tomnl
parents:
1
diff
changeset
|
87 |
|
b37f97bda760
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit d4159f1962ef3fe37dd4f3047e4050afe013c15a-dirty
tomnl
parents:
1
diff
changeset
|
88 if (opt$rule_type=='extended_large'){ |
|
6
9c3d764b2e5b
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 578fd07833b93847193666c11744ba0bca1aaf57-dirty
tomnl
parents:
5
diff
changeset
|
89 |
|
9c3d764b2e5b
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 578fd07833b93847193666c11744ba0bca1aaf57-dirty
tomnl
parents:
5
diff
changeset
|
90 rule_sep=',' |
|
5
e91c400c6ca6
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 578fd07833b93847193666c11744ba0bca1aaf57-dirty
tomnl
parents:
4
diff
changeset
|
91 opt$rule_type <- 'user' |
|
4
b37f97bda760
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit d4159f1962ef3fe37dd4f3047e4050afe013c15a-dirty
tomnl
parents:
1
diff
changeset
|
92 if(opt$polarity=='pos'){ |
|
6
9c3d764b2e5b
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 578fd07833b93847193666c11744ba0bca1aaf57-dirty
tomnl
parents:
5
diff
changeset
|
93 opt$rule_path <- system.file("rules", "CAMERA_rules_PosFinal_PlusLi.csv", package = "cameraDIMS") |
|
4
b37f97bda760
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit d4159f1962ef3fe37dd4f3047e4050afe013c15a-dirty
tomnl
parents:
1
diff
changeset
|
94 }else{ |
|
6
9c3d764b2e5b
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 578fd07833b93847193666c11744ba0bca1aaf57-dirty
tomnl
parents:
5
diff
changeset
|
95 opt$rule_path <- system.file("rules", "CAMERA_rules_NegFinal_PlusLi.csv", package = "cameraDIMS") |
|
4
b37f97bda760
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit d4159f1962ef3fe37dd4f3047e4050afe013c15a-dirty
tomnl
parents:
1
diff
changeset
|
96 } |
|
6
9c3d764b2e5b
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 578fd07833b93847193666c11744ba0bca1aaf57-dirty
tomnl
parents:
5
diff
changeset
|
97 }else{ |
|
9c3d764b2e5b
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 578fd07833b93847193666c11744ba0bca1aaf57-dirty
tomnl
parents:
5
diff
changeset
|
98 rule_sep='\t' |
|
4
b37f97bda760
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit d4159f1962ef3fe37dd4f3047e4050afe013c15a-dirty
tomnl
parents:
1
diff
changeset
|
99 } |
|
b37f97bda760
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit d4159f1962ef3fe37dd4f3047e4050afe013c15a-dirty
tomnl
parents:
1
diff
changeset
|
100 |
|
1
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
101 cameraOut <- cameraDIMS(data=df, |
|
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
102 params_iso=paramiso, |
|
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
103 params_adduct=paramadduct, |
|
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
104 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
|
105 rule_pth=opt$rule_path, |
|
6
9c3d764b2e5b
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 578fd07833b93847193666c11744ba0bca1aaf57-dirty
tomnl
parents:
5
diff
changeset
|
106 rule_sep=rule_sep, |
|
1
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
107 rule_export=rule_export) |
|
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
108 |
|
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
109 |
|
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
110 print(head(cameraOut[[1]])) |
|
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
111 print(head(cameraOut[[2]])) |
|
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
112 |
|
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
113 |
|
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
114 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
|
115 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
|
116 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
|
117 |
|
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
118 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
|
119 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
|
120 |
|
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
121 if (rule_export){ |
|
defa57c7775e
planemo upload for repository https://github.com/computational-metabolomics/dma-tools-galaxy commit 6c48bd51987a28401de6cf5e49b1b30e5e73fe16-dirty
tomnl
parents:
diff
changeset
|
122 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
|
123 } |
