257 |
20 Apr 07 |
mattias |
1 |
####################################################### |
257 |
20 Apr 07 |
mattias |
2 |
# |
259 |
20 Apr 07 |
jari |
# $Id$ |
259 |
20 Apr 07 |
jari |
4 |
# |
257 |
20 Apr 07 |
mattias |
# This is a small test script to test the R/Perl to |
257 |
20 Apr 07 |
mattias |
# Base connection. |
257 |
20 Apr 07 |
mattias |
7 |
# |
257 |
20 Apr 07 |
mattias |
8 |
####################################################### |
257 |
20 Apr 07 |
mattias |
9 |
|
257 |
20 Apr 07 |
mattias |
library(RSPerl) |
257 |
20 Apr 07 |
mattias |
.PerlPackage("BaseWebService") |
257 |
20 Apr 07 |
mattias |
source("websFunc.R"); |
257 |
20 Apr 07 |
mattias |
13 |
|
257 |
20 Apr 07 |
mattias |
14 |
|
257 |
20 Apr 07 |
mattias |
# Login onto the BASE server |
261 |
20 Apr 07 |
jari |
#webobj <- login("http://base2.thep.lu.se:8080/demo", "login", "passwd"); |
261 |
20 Apr 07 |
jari |
webobj <- login("http://base2.thep.lu.se:8080/demo", "base2", "base2"); |
257 |
20 Apr 07 |
mattias |
18 |
|
257 |
20 Apr 07 |
mattias |
# The session ID |
257 |
20 Apr 07 |
mattias |
sessionID <- webobj$sessionID(); |
257 |
20 Apr 07 |
mattias |
21 |
|
257 |
20 Apr 07 |
mattias |
# Get the list of projects as a list of lists |
257 |
20 Apr 07 |
mattias |
projs <- getProjects(webobj); |
257 |
20 Apr 07 |
mattias |
24 |
|
257 |
20 Apr 07 |
mattias |
# get the ID of the first one |
257 |
20 Apr 07 |
mattias |
id <- projs[[1]]["id"]; |
257 |
20 Apr 07 |
mattias |
27 |
|
257 |
20 Apr 07 |
mattias |
# Set to be the active project |
257 |
20 Apr 07 |
mattias |
setActiveProject(webobj, id); |
257 |
20 Apr 07 |
mattias |
30 |
|
257 |
20 Apr 07 |
mattias |
# Get the list of experiments as a list of lists |
257 |
20 Apr 07 |
mattias |
exps <- getExperiments(webobj); |
257 |
20 Apr 07 |
mattias |
33 |
|
257 |
20 Apr 07 |
mattias |
# Select the first experiment |
257 |
20 Apr 07 |
mattias |
expId <- exps[[1]]["id"]; |
257 |
20 Apr 07 |
mattias |
36 |
|
257 |
20 Apr 07 |
mattias |
# Get all rawBioAssays for this experiment as a list of lists |
257 |
20 Apr 07 |
mattias |
raw <- getRawBioAssays_by_expID(webobj, expId); |
257 |
20 Apr 07 |
mattias |
39 |
|
257 |
20 Apr 07 |
mattias |
# Now download all files to a local directory |
257 |
20 Apr 07 |
mattias |
downloadRawBioAssays_by_expID(webobj, expId, "./tmp"); |
257 |
20 Apr 07 |
mattias |
42 |
|