Last active
December 21, 2015 18:58
-
-
Save thomaskelder/6350586 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Test script to get NutriTech data from dbNP | |
| ## Crashes with: | |
| ## > source('~/projects/nutritech/code/dbnp.test.R') | |
| ## Clinical Chemistry | |
| ## Questionnaire Physical Activity | |
| ## Error in x$name : $ operator is invalid for atomic vectors | |
| require(GSCFClient) | |
| require(GSCFRUtils) | |
| ## Fill out your own dbNP user / pass here | |
| user = "XXXX" | |
| pass = "****" | |
| token = "YYYY" | |
| authenticate(user, pass, token) | |
| studies = getStudies() | |
| studyName = "NutriTechHIS" | |
| study = studies[[grep(studyName, sapply(studies, function(x) x$code))]] | |
| studyToken = study['token'] | |
| studyAssays = namedListToDataFrame(getAssaysForStudy(studyToken),"name") | |
| assayData = list() | |
| for(assayName in names(studyAssays)) { | |
| message(assayName) | |
| assayToken = studyAssays[[assayName]][2] | |
| assayData[[assayName]] = assayDataAsMatrix(assayToken)$data | |
| } | |
| subjects = getSubjectsForStudy(studyToken) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment