Learn R Programming

⚠️There's a newer version (0.7.7) of this package.Take me there.

DataSpaceR

DataSpaceR is an R interface to the CAVD DataSpace, a data sharing and discovery tool that facilitates exploration of HIV immunological data from pre-clinical and clinical HIV vaccine studies.

The package is intended for use by immunologists, bioinformaticians, and statisticians in HIV vaccine research, or anyone interested in the analysis of HIV immunological data across assays, studies, and time.

This package simplifies access to the database by taking advantage of the standardization of the database to hide all the Rlabkey specific code away from the user, and it allows the users to access the study-specific datasets via an object-oriented paradigm.

Examples & Documentation

For more detailed examples and detailed documentation, see the introductory vignette and the pkgdown site.

Installation

Install from CRAN:

install.packages("DataSpaceR")

You can install the latest development version from GitHub with devtools:

# install.packages("devtools")
devtools::install_github("ropensci/DataSpaceR")

Register and set DataSpace credential

The database is accessed with the user’s credentials. A netrc file storing login and password information is required.

  1. Create an account and read the terms of use
  2. On your R console, create a netrc file using a function from DataSpaceR:
library(DataSpaceR)
writeNetrc(
  login = "yourEmail@address.com", 
  password = "yourSecretPassword",
  netrcFile = "/your/home/directory/.netrc" # use getNetrcPath() to get the default path 
)

This will create a netrc file in your home directory.

Alternatively, you can manually create a netrc file in the computer running R.

  • On Windows, this file should be named _netrc
  • On UNIX, it should be named .netrc
  • The file should be located in the user’s home directory, and the permissions on the file should be unreadable for everybody except the owner
  • To determine home directory, run Sys.getenv("HOME") in R

The following three lines must be included in the .netrc or _netrc file either separated by white space (spaces, tabs, or newlines) or commas. Multiple such blocks can exist in one file.

machine dataspace.cavd.org
login myuser@domain.com
password supersecretpassword

See here for more information about netrc.

Usage

The general idea is that the user:

  1. creates an instance of DataSpaceConnection class via connectDS
  2. browses available studies and groups in the instance via availableStudies and availableGroups
  3. creates a connection to a specific study via getStudy or a group via getGroup
  4. retrieves datasets by name via getDataset

for example:

library(DataSpaceR)
#> By exporting data from the CAVD DataSpace, you agree to be bound by the Terms of Use available on the CAVD DataSpace sign-in page at https://dataspace.cavd.org

con <- connectDS()
con
#> <DataSpaceConnection>
#>   URL: https://dataspace.cavd.org
#>   User: jkim2345@scharp.org
#>   Available studies: 260
#>     - 76 studies with data
#>     - 4994 subjects
#>     - 423195 data points
#>   Available groups: 6
#>   Available publications: 1403
#>     - 1 publications with data

connectDS() will create a connection to DataSpace.

available studies can be listed by availableStudies field

knitr::kable(head(con$availableStudies))
study_nameshort_nametitletypestatusstagespeciesstart_datestrategynetworkdata_availability
cvd232Parks_RV_232Limiting Dose Vaginal SIVmac239 Challenge of RhCMV-SIV vaccinated Indian rhesus macaques.Pre-Clinical NHPInactiveAssays CompletedRhesus macaque2009-11-24Vector vaccines (viral or bacterial)CAVDNA
cvd234Zolla-Pazner_Mab_test1 StudyZolla-Pazner_Mab_Test1Antibody ScreeningInactiveAssays CompletedNon-Organism Study2009-02-03Prophylactic neutralizing AbCAVDNA
cvd235mAbs potencyWeiss mAbs potencyAntibody ScreeningInactiveAssays CompletedNon-Organism Study2008-08-21Prophylactic neutralizing AbCAVDNA
cvd236neutralization assaysneutralization assaysAntibody ScreeningActiveIn ProgressNon-Organism Study2009-02-03Prophylactic neutralizing AbCAVDNA
cvd238Gallo_PA_238HIV-1 neutralization responses in chronically infected individualsAntibody ScreeningInactiveAssays CompletedNon-Organism Study2009-01-08Prophylactic neutralizing AbCAVDNA
cvd239CAVIMC-015Lehner_Thorstensson_AllovacPre-Clinical NHPInactiveAssays CompletedRhesus macaque2009-01-08Protein & peptide vaccinesCAVDThis study has assay data (NAB) in the DataSpace.

available groups can be listed by availableGroups field

knitr::kable(con$availableGroups)
idlabeloriginal_labeldescriptioncreated_bysharednstudies
216micemiceNAreadjkFALSE75cvd468, cvd483, cvd316, cvd331
217CAVD 242CAVD 242This is a fake group for CAVD 242readjkFALSE30cvd242
220NYVAC durability comparisonNYVAC_durabilityCompare durability in 4 NHP studies using NYVAC-C (vP2010) and NYVAC-KC-gp140 (ZM96) products.ehenrichTRUE78cvd281, cvd434, cvd259, cvd277
224cvd338cvd338NAreadjkFALSE36cvd338
228HVTN 505 case control subjectsHVTN 505 case control subjectsParticipants from HVTN 505 included in the case-control analysisdriennaTRUE189vtn505
230HVTN 505 polyfunctionality vs BAMAHVTN 505 polyfunctionality vs BAMACompares ICS polyfunctionality (CD8+, Any Env) to BAMA mfi-delta (single Env antigen) in the HVTN 505 case control cohortdriennaTRUE170vtn505

Note: A group is a curated collection of participants from filtering of treatments, products, studies, or species, and it is created in the DataSpace App.

Check out the reference page of DataSpaceConnection for all available fields and methods.

create an instance of cvd408

cvd408 <- con$getStudy("cvd408")
cvd408
#> <DataSpaceStudy>
#>   Study: cvd408
#>   URL: https://dataspace.cavd.org/CAVD/cvd408
#>   Available datasets:
#>     - BAMA
#>     - Demographics
#>     - ICS
#>     - NAb
#>   Available non-integrated datasets:
class(cvd408)
#> [1] "DataSpaceStudy" "R6"

available datasets can be listed by availableDatasets field

knitr::kable(cvd408$availableDatasets)
namelabelnintegrated
BAMABinding Ab multiplex assay1080TRUE
DemographicsDemographics20TRUE
ICSIntracellular Cytokine Staining3720TRUE
NAbNeutralizing antibody540TRUE

which will print names of available datasets.

Neutralizing Antibody dataset (NAb) can be retrieved by:

NAb <- cvd408$getDataset("NAb")
dim(NAb)
#> [1] 540  29
colnames(NAb)
#>  [1] "ParticipantId"          "ParticipantVisit/Visit" "visit_day"             
#>  [4] "assay_identifier"       "summary_level"          "specimen_type"         
#>  [7] "antigen"                "antigen_type"           "virus"                 
#> [10] "virus_type"             "virus_insert_name"      "clade"                 
#> [13] "neutralization_tier"    "tier_clade_virus"       "target_cell"           
#> [16] "initial_dilution"       "titer_ic50"             "titer_ic80"            
#> [19] "response_call"          "nab_lab_source_key"     "lab_code"              
#> [22] "exp_assayid"            "titer_ID50"             "titer_ID80"            
#> [25] "nab_response_ID50"      "nab_response_ID80"      "slope"                 
#> [28] "vaccine_matched"        "study_prot"

Check out the reference page of DataSpaceStudy for all available fields and methods.

Note: The package uses a R6 class to represent the connection to a study and get around some of R’s copy-on-change behavior.

Meta

  • Please report any issues or bugs.
  • License: GPL-3
  • Get citation information for DataSpaceR in R doing citation(package = 'DataSpaceR')
  • Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Copy Link

Version

Install

install.packages('DataSpaceR')

Monthly Downloads

308

Version

0.7.4

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Ju Yeong Kim

Last Published

August 26th, 2020

Functions in DataSpaceR (0.7.4)

DataSpaceStudy

The DataSpaceStudy class
checkNetrc

Check netrc file
writeNetrc

Write a netrc file
DataSpaceConnection

The DataSpaceConnection class
reexports

Objects exported from other packages
getNetrcPath

Get a default netrc file path
DataSpaceMab

The DataSpaceMab class
DataSpaceR-package

DataSpaceR
connectDS

Create a connection to DataSpace