Accessing Non-Integrated Datasets

Helen Miller

2020-08-20

Many studies include data from assays which have not been integrated into the DataSpace. Some of these are available as “Non-Integrated Datasets,” which can be downloaded from the app as a zip file. DataSpaceR provides an interface for accessing non-integrated data from studies where it is available.

Viewing available non-integrated data

Methods on the DataSpace Study object allow you to see what non-integrated data may be available before downloading it. We will be using HVTN 505 as an example.

library(DataSpaceR)
con <- connectDS()
vtn505 <- con$getStudy("vtn505")
vtn505
#> <DataSpaceStudy>
#>   Study: vtn505
#>   URL: https://dataspace.cavd.org/CAVD/vtn505
#>   Available datasets:
#>     - BAMA
#>     - Demographics
#>     - ICS
#>     - NAb
#>   Available non-integrated datasets:
#>     - ADCP
#>     - DEM SUPP
#>     - Fc Array

The print method on the study object will list available non-integrated datasets. The availableDatasets property shows some more info about available datasets, with the integrated field indicating whether the data is integrated. The value for n will be NA for non-integrated data until the dataset has been loaded.

knitr::kable(vtn505$availableDatasets)
name label n integrated
BAMA Binding Ab multiplex assay 10260 TRUE
Demographics Demographics 2504 TRUE
ICS Intracellular Cytokine Staining 22684 TRUE
NAb Neutralizing antibody 628 TRUE
ADCP ADCP NA FALSE
DEM SUPP Demographics (Supplemental) NA FALSE
Fc Array Fc Array NA FALSE

Loading non-integrated data

Non-Integrated datasets can be loaded with getDataset like integrated data. This will unzip the non-integrated data to a temp directory and load it into the environment.

adcp <- vtn505$getDataset("ADCP")
dim(adcp)
#> [1] 378  11
colnames(adcp)
#>  [1] "study_prot"             "ParticipantId"          "study_day"              "lab_code"               "specimen_type"         
#>  [6] "antigen"                "percent_cv"             "avg_phagocytosis_score" "positivity_threshold"   "response"              
#> [11] "assay_identifier"

You can also view the file format info using getDatasetDescription. For non-integrated data, this will open a pdf into your computer’s default pdf viewer.

vtn505$getDatasetDescription("ADCP")

Non-integrated data is downloaded to a temp directory by default. There are a couple of ways to override this if desired. One is to specify outputDir when calling getDataset or getDatasetDescription.

If you will be accessing the data at another time and don’t want to have to re-download it, you can change the default directory for the whole study object with setDataDir.

vtn505$dataDir
#> [1] "/var/folders/9m/vwxpkj1100z3gpsf27m21fx00000gn/T//RtmptzIOlk"
vtn505$setDataDir(".")
vtn505$dataDir
#> [1] "/Users/jkim/git/DataSpaceR/vignettes"

If the dataset already exists in the specified dataDir or outputDir, it will be not be downloaded. This can be overridden with reload=TRUE, which forces a re-download.

Session information

sessionInfo()
#> R version 4.0.2 (2020-06-22)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Catalina 10.15.6
#> 
#> Matrix products: default
#> BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] knitr_1.29        data.table_1.13.0 testthat_2.3.2    DataSpaceR_0.7.4 
#> 
#> loaded via a namespace (and not attached):
#>  [1] Rcpp_1.0.5        compiler_4.0.2    pryr_0.1.4        highr_0.8         tools_4.0.2       digest_0.6.25     jsonlite_1.7.0   
#>  [8] evaluate_0.14     rlang_0.4.7       cli_2.0.2         rstudioapi_0.11   crosstalk_1.1.0.1 curl_4.3          yaml_2.2.1       
#> [15] xfun_0.16         httr_1.4.2        stringr_1.4.0     htmlwidgets_1.5.1 DT_0.15           webshot_0.5.2     glue_1.4.1       
#> [22] R6_2.4.1          processx_3.4.3    fansi_0.4.1       Rlabkey_2.5.2     rmarkdown_2.3     callr_3.4.3       magrittr_1.5     
#> [29] codetools_0.2-16  ps_1.3.4          htmltools_0.5.0   assertthat_0.2.1  stringi_1.4.6     crayon_1.3.4