Mercurial > repos > prog > lcmsmatching
annotate LipidmapsConn.R @ 1:45e985cd8e9e draft
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
| author | prog |
|---|---|
| date | Tue, 31 Jan 2017 05:27:24 -0500 |
| parents | 3afe41d3e9e7 |
| children |
| rev | line source |
|---|---|
|
1
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
1 ##################### |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
2 # CLASS DECLARATION # |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
3 ##################### |
|
0
3afe41d3e9e7
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit bb4d3e23d99828bfee16d31d794c49a17313ec2f
prog
parents:
diff
changeset
|
4 |
|
1
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
5 LipidmapsConn <- methods::setRefClass("LipidmapsConn", contains = "RemotedbConn") |
|
0
3afe41d3e9e7
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit bb4d3e23d99828bfee16d31d794c49a17313ec2f
prog
parents:
diff
changeset
|
6 |
|
1
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
7 ############### |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
8 # CONSTRUCTOR # |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
9 ############### |
|
0
3afe41d3e9e7
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit bb4d3e23d99828bfee16d31d794c49a17313ec2f
prog
parents:
diff
changeset
|
10 |
|
1
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
11 LipidmapsConn$methods( initialize = function(...) { |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
12 # From http://www.lipidmaps.org/data/structure/programmaticaccess.html: |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
13 # If you write a script to automate calls to LMSD, please be kind and do not hit our server more often than once per 20 seconds. We may have to kill scripts that hit our server more frequently. |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
14 callSuper(scheduler = UrlRequestScheduler$new(t = 20), ...) |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
15 }) |
|
0
3afe41d3e9e7
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit bb4d3e23d99828bfee16d31d794c49a17313ec2f
prog
parents:
diff
changeset
|
16 |
|
1
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
17 ########################## |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
18 # GET ENTRY CONTENT TYPE # |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
19 ########################## |
|
0
3afe41d3e9e7
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit bb4d3e23d99828bfee16d31d794c49a17313ec2f
prog
parents:
diff
changeset
|
20 |
|
1
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
21 LipidmapsConn$methods( getEntryContentType = function() { |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
22 return(BIODB.CSV) |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
23 }) |
|
0
3afe41d3e9e7
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit bb4d3e23d99828bfee16d31d794c49a17313ec2f
prog
parents:
diff
changeset
|
24 |
|
1
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
25 ##################### |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
26 # GET ENTRY CONTENT # |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
27 ##################### |
|
0
3afe41d3e9e7
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit bb4d3e23d99828bfee16d31d794c49a17313ec2f
prog
parents:
diff
changeset
|
28 |
|
1
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
29 LipidmapsConn$methods( getEntryContent = function(id) { |
|
0
3afe41d3e9e7
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit bb4d3e23d99828bfee16d31d794c49a17313ec2f
prog
parents:
diff
changeset
|
30 |
|
1
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
31 # Initialize return values |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
32 content <- rep(NA_character_, length(id)) |
|
0
3afe41d3e9e7
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit bb4d3e23d99828bfee16d31d794c49a17313ec2f
prog
parents:
diff
changeset
|
33 |
|
1
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
34 # Request |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
35 content <- vapply(id, function(x) .self$.get.url(get.entry.url(BIODB.LIPIDMAPS, x, content.type = BIODB.CSV)), FUN.VALUE = '') |
|
0
3afe41d3e9e7
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit bb4d3e23d99828bfee16d31d794c49a17313ec2f
prog
parents:
diff
changeset
|
36 |
|
1
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
37 return(content) |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
38 }) |
|
0
3afe41d3e9e7
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit bb4d3e23d99828bfee16d31d794c49a17313ec2f
prog
parents:
diff
changeset
|
39 |
|
1
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
40 ################ |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
41 # CREATE ENTRY # |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
42 ################ |
|
0
3afe41d3e9e7
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit bb4d3e23d99828bfee16d31d794c49a17313ec2f
prog
parents:
diff
changeset
|
43 |
|
1
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
44 LipidmapsConn$methods( createEntry = function(content, drop = TRUE) { |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
45 return(createLipidmapsEntryFromCsv(content, drop = drop)) |
|
45e985cd8e9e
planemo upload for repository https://github.com/workflow4metabolomics/lcmsmatching.git commit d4048accde6bdfd5b3e14f5394902d38991854f8-dirty
prog
parents:
0
diff
changeset
|
46 }) |
