Using the DataSpace app, the workflow of using the mAb grid is the following:
DataSpaceR
offers a similar interface:
con$mabGridSummary
con$mabGrid
using con$filterMabGrid()
con$getMab()
to retrieve the mAb dataYou can browse the mAb Grid by calling the mabGridSummary
field in the connection object:
library(DataSpaceR)
con <- connectDS()
DT::datatable(con$mabGridSummary, options = list(autoWidth = TRUE, scrollX = TRUE))
This table is designed to mimic the mAb grid found in the app.
One can also access the unsummarized data from the mAb grid by calling con$mabGrid
.
You can filter rows in the grid by specifying the values to keep in the columns found in the field con$mabGrid
: mab_mixture
, donor_species
, isotype
, hxb2_location
, tiers
, clades
, viruses
, and studies
. filterMabGrid
takes the column and the values and filters the underlying tables (private fields), and when you call the mabGridSummary
or (which is actually an active binding), it returns the filtered grid with updated n_
columns and geometric_mean_curve_ic50
.
# filter the grid by viruses
con$filterMabGrid(using = "virus", value = c("242-14", "Q23.17", "6535.3", "BaL.26", "DJ263.8"))
# filter the grid by donor species (llama)
con$filterMabGrid(using = "donor_species", value = "llama")
# check the updated grid
DT::datatable(con$mabGridSummary, options = list(autoWidth = TRUE, scrollX = TRUE))
Or we can use method chaining to call multiple filter methods and browse the grid. Method chaining is unique to R6 objects and related to the pipe. See Hadley Wickham’s Advanced R for more info
You can retrieve values from the grid by mab_mixture
, donor_species
, isotype
, hxb2_location
, tier
, clade
, virus
, and studies
, or any variables found in the mabGrid
field in the connection object via data.table
operations.
After filtering the grid, you can create a DataSpaceMab object that contains the filtered mAb data.
mab <- con$getMab()
mab
#> <DataSpaceMab>
#> URL: https://dataspace.cavd.org
#> User: jkim2345@scharp.org
#> Summary:
#> - 3 studies
#> - 14 mAb mixtures
#> - 1 neutralization tiers
#> - 4 clades
#> Filters:
#> - virus: 242-14, Q23.17, 6535.3, BaL.26, DJ263.8
#> - mab_donor_species: llama
There are 6 public fields available in the DataSpaceMab
object: studyAndMabs
, mabs
, nabMab
, studies
, assays
, and variableDefinitions
, and they are equivalent to the sheets in the excel file or the csv files you would download from the app via “Export Excel”/“Export CSV”.
There are several metadata fields that can be exported in the mAb object.
sessionInfo()
#> R version 3.6.2 (2019-12-12)
#> Platform: x86_64-apple-darwin15.6.0 (64-bit)
#> Running under: macOS Catalina 10.15.2
#>
#> Matrix products: default
#> BLAS: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
#>
#> locale:
#> [1] C/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] DataSpaceR_0.7.3
#>
#> loaded via a namespace (and not attached):
#> [1] Rcpp_1.0.3 Rlabkey_2.3.3 knitr_1.26 magrittr_1.5
#> [5] xtable_1.8-4 R6_2.4.1 rlang_0.4.2 fastmap_1.0.1
#> [9] stringr_1.4.0 httr_1.4.1 highr_0.8 tools_3.6.2
#> [13] DT_0.10 data.table_1.12.8 xfun_0.11 htmltools_0.4.0
#> [17] crosstalk_1.0.0 yaml_2.2.0 digest_0.6.23 assertthat_0.2.1
#> [21] shiny_1.4.0 later_1.0.0 promises_1.1.0 htmlwidgets_1.5.1
#> [25] curl_4.3 mime_0.7 evaluate_0.14 rmarkdown_2.0
#> [29] stringi_1.4.3 compiler_3.6.2 jsonlite_1.6 httpuv_1.5.2