knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "README-" )
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.
For more detailed examples and detailed documentation, see the introductory vignette and the pkgdown site.
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")
The database is accessed with the user's credentials. A netrc file storing login and password information is required.
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.
_netrc
.netrc
Sys.getenv("HOME")
in RThe 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
.
The general idea is that the user:
DataSpaceConnection
class via connectDS
availableStudies
and availableGroups
getStudy
or a group via getGroup
getDataset
library(DataSpaceR) con <- connectDS() con
connectDS()
will create a connection to DataSpace.
availableStudies
fieldknitr::kable(head(con$availableStudies))
availableGroups
fieldknitr::kable(con$availableGroups)
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.
cvd408
cvd408 <- con$getStudy("cvd408") cvd408 class(cvd408)
availableDatasets
fieldknitr::kable(cvd408$availableDatasets)
which will print names of available datasets.
NAb
) can be retrieved by:NAb <- cvd408$getDataset("NAb") dim(NAb) colnames(NAb)
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.
DataSpaceR
in R doing citation(package = 'DataSpaceR')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.