|
1 | 1 | # Name: example.R
|
2 | 2 | # Purpose: Example set of function calls to query and retrieve data from BMS in use case scenario
|
3 | 3 | # Author: Khaled Al-Shamaa <[email protected]>
|
4 |
| -# Version: 0.1 |
| 4 | +# Version: 0.2 |
5 | 5 | # Revision: v0.1 - 24 Jul 2019 - initial version
|
| 6 | +# v0.2 - 20 Aug 2019 - update function calls to reflect the new names |
6 | 7 | # License: GPLv3
|
7 | 8 |
|
8 | 9 | # include and load required libraries
|
9 | 10 | source("qbms.R")
|
10 | 11 |
|
11 | 12 | # config your BMS connection
|
12 |
| -qbmsConfig$server <- "bms.icarda.org" |
| 13 | +qbms_config$server <- "bms.icarda.org" |
13 | 14 |
|
14 | 15 | # if you are not connecting BMS server using SSL layer,
|
15 | 16 | # then comment the following two lines
|
16 |
| -qbmsConfig$protocol <- "https://" |
17 |
| -qbmsConfig$port <- 18443 |
| 17 | +qbms_config$protocol <- "https://" |
| 18 | +qbms_config$port <- 18443 |
18 | 19 |
|
19 |
| -# login using your BMS account |
20 |
| -qbmsLogin() |
| 20 | +# login using your BMS account (interactive mode) |
| 21 | +# You can pass BMS username and password as parameters (batch mode) |
| 22 | +login_bms() |
21 | 23 |
|
22 | 24 | # list supported crops in the bms server
|
23 |
| -listCrops() |
24 |
| -setCrop("Tutorial1") |
| 25 | +list_crops() |
| 26 | + |
| 27 | +set_crop("Tutorial1") |
25 | 28 |
|
26 | 29 | # list existing breeding programs
|
27 |
| -listPrograms() |
| 30 | +list_programs() |
| 31 | + |
28 | 32 | # select a breeding program by name
|
29 |
| -setProgram("Training Breeding Program") |
| 33 | +set_program("Training Breeding Program") |
30 | 34 |
|
31 | 35 | # list all studies/trials in the selected program
|
32 |
| -listTrials() |
33 |
| -listTrials(2017) |
| 36 | +list_trials() |
| 37 | +list_trials(2017) |
| 38 | + |
34 | 39 | # select a specific study/trial by name
|
35 |
| -setTrial("CIDTN-2016") |
| 40 | +set_trial("CIDTN-2016") |
| 41 | + |
| 42 | +# get observation variable ontology |
| 43 | +ontology <- get_trial_obs_ontology() |
36 | 44 |
|
37 | 45 | # list all environments/locations in the selected study/trial
|
38 |
| -listStudies() |
| 46 | +list_studies() |
| 47 | + |
39 | 48 | # select a specific environment/location dataset
|
40 |
| -setStudy("FLRP") |
| 49 | +set_study("FLRP") |
41 | 50 |
|
42 |
| -# retrive general information, data, and germplasm list of the selected environment/location |
43 |
| -info <- getStudyInfo() |
44 |
| -data <- getStudyData() |
45 |
| -germplasm <- getGermplasmList() |
| 51 | +# retrieve general information, data, and germplasm list of the selected environment/location |
| 52 | +info <- get_study_info() |
| 53 | +data <- get_study_data() |
| 54 | +germplasm <- get_germplasm_list() |
46 | 55 |
|
47 | 56 | # retrive multi-environment trial data
|
48 |
| -MET <- getTrialData() |
| 57 | +MET <- get_trial_data() |
0 commit comments