Mercurial > repos > prog > lcmsmatching
comparison LipidmapsConn.R @ 1:253d531a0193 draft
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit 36c9d8099c20a1ae848f1337c16564335dd8fb2b
author | prog |
---|---|
date | Sat, 03 Sep 2016 17:02:01 -0400 |
parents | e66bb061af06 |
children | 20d69a062da3 |
comparison
equal
deleted
inserted
replaced
0:e66bb061af06 | 1:253d531a0193 |
---|---|
1 if ( ! exists('LipdmapsConn')) { # Do not load again if already loaded | 1 if ( ! exists('LipdmapsConn')) { # Do not load again if already loaded |
2 | 2 |
3 source('BiodbConn.R') | 3 source('RemotedbConn.R') |
4 source('LipidmapsCompound.R') | 4 source('LipidmapsCompound.R') |
5 | 5 |
6 ##################### | 6 ##################### |
7 # CLASS DECLARATION # | 7 # CLASS DECLARATION # |
8 ##################### | 8 ##################### |
9 | 9 |
10 LipidmapsConn <- setRefClass("LipidmapsConn", contains = "BiodbConn") | 10 LipidmapsConn <- setRefClass("LipidmapsConn", contains = "RemotedbConn") |
11 | 11 |
12 ############### | 12 ############### |
13 # CONSTRUCTOR # | 13 # CONSTRUCTOR # |
14 ############### | 14 ############### |
15 | 15 |
22 ########################## | 22 ########################## |
23 # GET ENTRY CONTENT TYPE # | 23 # GET ENTRY CONTENT TYPE # |
24 ########################## | 24 ########################## |
25 | 25 |
26 LipidmapsConn$methods( getEntryContentType = function(type) { | 26 LipidmapsConn$methods( getEntryContentType = function(type) { |
27 return(RBIODB.CSV) | 27 return(BIODB.CSV) |
28 }) | 28 }) |
29 | 29 |
30 ##################### | 30 ##################### |
31 # GET ENTRY CONTENT # | 31 # GET ENTRY CONTENT # |
32 ##################### | 32 ##################### |
33 | 33 |
34 LipidmapsConn$methods( getEntryContent = function(type, id) { | 34 LipidmapsConn$methods( getEntryContent = function(type, id) { |
35 | 35 |
36 if (type == RBIODB.COMPOUND) { | 36 if (type == BIODB.COMPOUND) { |
37 | 37 |
38 # Initialize return values | 38 # Initialize return values |
39 content <- rep(NA_character_, length(id)) | 39 content <- rep(NA_character_, length(id)) |
40 | 40 |
41 # Request | 41 # Request |
42 content <- vapply(id, function(x) .self$.scheduler$getUrl(get.entry.url(RBIODB.LIPIDMAPS, x, content.type = RBIODB.CSV)), FUN.VALUE = '') | 42 content <- vapply(id, function(x) .self$.scheduler$getUrl(get.entry.url(BIODB.LIPIDMAPS, x, content.type = BIODB.CSV)), FUN.VALUE = '') |
43 | 43 |
44 return(content) | 44 return(content) |
45 } | 45 } |
46 | 46 |
47 return(NULL) | 47 return(NULL) |
50 ################ | 50 ################ |
51 # CREATE ENTRY # | 51 # CREATE ENTRY # |
52 ################ | 52 ################ |
53 | 53 |
54 LipidmapsConn$methods( createEntry = function(type, content, drop = TRUE) { | 54 LipidmapsConn$methods( createEntry = function(type, content, drop = TRUE) { |
55 return(if (type == RBIODB.COMPOUND) createLipidmapsCompoundFromCsv(content, drop = drop) else NULL) | 55 return(if (type == BIODB.COMPOUND) createLipidmapsCompoundFromCsv(content, drop = drop) else NULL) |
56 }) | 56 }) |
57 } | 57 } |