1 | ####################################################### |
---|
2 | # |
---|
3 | # $Id: webs-test.R 261 2007-04-20 16:36:47Z jari $ |
---|
4 | # |
---|
5 | # This is a small test script to test the R/Perl to |
---|
6 | # Base connection. |
---|
7 | # |
---|
8 | ####################################################### |
---|
9 | |
---|
10 | library(RSPerl) |
---|
11 | .PerlPackage("BaseWebService") |
---|
12 | source("websFunc.R"); |
---|
13 | |
---|
14 | |
---|
15 | # Login onto the BASE server |
---|
16 | #webobj <- login("http://base2.thep.lu.se:8080/demo", "login", "passwd"); |
---|
17 | webobj <- login("http://base2.thep.lu.se:8080/demo", "base2", "base2"); |
---|
18 | |
---|
19 | # The session ID |
---|
20 | sessionID <- webobj$sessionID(); |
---|
21 | |
---|
22 | # Get the list of projects as a list of lists |
---|
23 | projs <- getProjects(webobj); |
---|
24 | |
---|
25 | # get the ID of the first one |
---|
26 | id <- projs[[1]]["id"]; |
---|
27 | |
---|
28 | # Set to be the active project |
---|
29 | setActiveProject(webobj, id); |
---|
30 | |
---|
31 | # Get the list of experiments as a list of lists |
---|
32 | exps <- getExperiments(webobj); |
---|
33 | |
---|
34 | # Select the first experiment |
---|
35 | expId <- exps[[1]]["id"]; |
---|
36 | |
---|
37 | # Get all rawBioAssays for this experiment as a list of lists |
---|
38 | raw <- getRawBioAssays_by_expID(webobj, expId); |
---|
39 | |
---|
40 | # Now download all files to a local directory |
---|
41 | downloadRawBioAssays_by_expID(webobj, expId, "./tmp"); |
---|
42 | |
---|