comparison MsDb.R @ 4:1ba222315fd5 draft

planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit 947b8707b06176a4801de64a71c8771617311ffb
author prog
date Thu, 16 Mar 2017 05:05:55 -0400
parents 45e985cd8e9e
children b8f70d8216b3
comparison
equal deleted inserted replaced
3:abfba8eb1c8d 4:1ba222315fd5
7 7
8 ##################### 8 #####################
9 # CLASS DECLARATION # 9 # CLASS DECLARATION #
10 ##################### 10 #####################
11 11
12 MsDb <- setRefClass("MsDb", fields = list(.observers = "ANY", .prec = "list", .output.streams = "ANY", .input.stream = "ANY", .mz.tol.unit = "character")) 12 MsDb <- setRefClass("MsDb", fields = list(.observers = "ANY", .prec = "list", .output.streams = "ANY", .input.stream = "ANY", .mz.tol.unit = "character", .rt.unit = "character"))
13 13
14 ############### 14 ###############
15 # CONSTRUCTOR # 15 # CONSTRUCTOR #
16 ############### 16 ###############
17 17
18 MsDb$methods( initialize = function(...) { 18 MsDb$methods( initialize = function(...) {
19
20 callSuper(...)
19 21
20 .observers <<- NULL 22 .observers <<- NULL
21 .output.streams <<- NULL 23 .output.streams <<- NULL
22 .input.stream <<- NULL 24 .input.stream <<- NULL
23 .prec <<- MSDB.DFT.PREC 25 .prec <<- MSDB.DFT.PREC
24 .mz.tol.unit <<- MSDB.DFT.MZTOLUNIT 26 .mz.tol.unit <<- MSDB.DFT.MZTOLUNIT
25 27 .rt.unit <<- MSDB.RTUNIT.SEC
26 callSuper(...)
27 }) 28 })
28 29
29 #################### 30 ####################
30 # SET INPUT STREAM # 31 # SET INPUT STREAM #
31 #################### 32 ####################
124 125
125 MsDb$methods( setDbMsModes = function(modes) { 126 MsDb$methods( setDbMsModes = function(modes) {
126 stop("Method setDbMsModes() not implemented in concrete class.") 127 stop("Method setDbMsModes() not implemented in concrete class.")
127 }) 128 })
128 129
130 ###################
131 # SET MZ TOL UNIT #
132 ###################
133
129 MsDb$methods( setMzTolUnit = function(mztolunit) { 134 MsDb$methods( setMzTolUnit = function(mztolunit) {
130 135
131 if ( ! mztolunit %in% MSDB.MZTOLUNIT.VALS) 136 if ( ! mztolunit %in% MSDB.MZTOLUNIT.VALS)
132 stop(paste0("M/Z tolerance unit must be one of: ", paste(MSDB.MZTOLUNIT.VALS, collapse = ', '), ".")) 137 stop(paste0("M/Z tolerance unit must be one of: ", paste(MSDB.MZTOLUNIT.VALS, collapse = ', '), "."))
133 138
134 .mz.tol.unit <<- mztolunit 139 .mz.tol.unit <<- mztolunit
140 })
141
142 ###############
143 # SET RT UNIT #
144 ###############
145
146 MsDb$methods( setRtUnit = function(unit) {
147
148 if ( ! unit %in% MSDB.RTUNIT.VALS)
149 stop(paste0("RT unit must be one of: ", paste(MSDB.RTUNIT.VALS, collapse = ', '), "."))
150
151 .rt.unit <<- unit
135 }) 152 })
136 153
137 #################### 154 ####################
138 # HANDLE COMPOUNDS # 155 # HANDLE COMPOUNDS #
139 #################### 156 ####################