thehyve/GSCF-RClient

Name: GSCF-RClient

Owner: The Hyve

Description: R client to connect to GSCF

Created: 2012-08-02 08:34:01.0

Updated: 2013-01-11 13:35:49.0

Pushed: 2012-08-02 09:17:23.0

Homepage: null

Size: 107

Language: R

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

R2GSCF

An R client to connect to GSCF.

How to install

Download the package file from github: https://github.com/thomaskelder/R2GSCF/blob/master/GSCFClient_1.0.tar.gz

And install it in R:

all.packages('/path/to/GSCFClient_1.0.tar.gz', repo=NULL)
How to use

Below is a simple manual on how to use this R client. For a more complete example, please see this script.

Load the R client package:

ary(GSCFClient)

Or. if you prefer to load the library without installing, you can also run it directly from source:

ary(devtools)
ce_url("https://raw.github.com/PhenotypeFoundation/GSCF-RClient/master/dbnp.functions.R")

Specify to which instance of GSCF you wish to connect:

scfBaseUrl("http://old.studies.dbnp.org/api/")

Specify your authentication information and login to GSCF. You can lookup your shared key on the GSCF website, under user -> profile. Do not forget to ask an admin to give you ROLE_CLIENT privileges.

 = "yourUsername"
 = "yourPass"
 = "yourSharedKey"
enticate(user, pass, skey)

Now you can call the GSCF API functions in your R script, e.g.:

et available studies
ies = getStudies()

ook for the NuGO PPS2 study
y = studies[[grep("PPS2", sapply(studies, function(x) x$title))]]
yToken = study['token']

et the subject information for the study
ects = getSubjectsForStudy(studyToken)

et some assay data for the study
ys = getAssaysForStudy(studyToken)
yNames = sapply(assays, function(x) x$name)
ssay = names(assayNames[grep("chemistry", assayNames)])
ata = assayDataAsMatrix(samAssay)

t(samData$data[1:3,c("sampleToken", "measurement", "value")])
his will give:
                         sampleToken measurement value
 a9756533-108c-43d4-b1e0-d82d6a7d0781 adiponectin  8.64
 a9756533-108c-43d4-b1e0-d82d6a7d0781 Cholesterol 3.182
 8ac44d05-8203-4171-85f4-f81e78399d6a Cholesterol  4.49

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.