annotate cameradims.R @ 0:aa55ff1d76d4 draft

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