Using the DataSpace app, the workflow of using the mAb grid is the following:
DataSpaceR offers a similar interface:
con$mabGridSummarycon$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()
knitr::kable(head(con$mabGridSummary))| mab_mixture | donor_species | isotype | hxb2_location | n_viruses | n_clades | n_tiers | geometric_mean_curve_ic50 | n_studies |
|---|---|---|---|---|---|---|---|---|
| 10-1074 | human | IgG | Env | 7 | 3 | 2 | 0.0213723 | 1 |
| 10E8 | human | IgG3 | gp160 | 227 | 11 | 7 | 0.4843333 | 2 |
| 10E8 V2.0 | human | 28 | 3 | 1 | 0.0031350 | 1 | ||
| 10E8 V2.0/iMab | human | gp160 | 13 | 8 | 2 | 0.0462897 | 1 | |
| 10E8 V4.0 | human | 28 | 3 | 1 | 0.0024094 | 1 | ||
| 10E8 V4.0/iMab | human | 119 | 12 | 6 | 0.0015396 | 1 |
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
knitr::kable(con$mabGridSummary)| mab_mixture | donor_species | isotype | hxb2_location | n_viruses | n_clades | n_tiers | geometric_mean_curve_ic50 | n_studies |
|---|---|---|---|---|---|---|---|---|
| 11F1B | llama | 4 | 2 | 1 | NA | 1 | ||
| 11F1F | llama | 4 | 2 | 1 | 26.2961178 | 1 | ||
| 1H9 | llama | Env | 4 | 2 | 1 | 5.0898322 | 1 | |
| 2B4F | llama | 4 | 2 | 1 | 1.5242288 | 1 | ||
| 2H10 | llama | 2 | 2 | 1 | NA | 1 | ||
| 2H10/W100A | llama | 2 | 2 | 1 | NA | 1 | ||
| 3E3 | llama | gp160 | 3 | 3 | 1 | 0.9944945 | 1 | |
| 4H73 | llama | 4 | 2 | 1 | NA | 1 | ||
| 5B10D | llama | 4 | 2 | 1 | NA | 1 | ||
| 9B6B | llama | 4 | 2 | 1 | 24.3643637 | 1 | ||
| A14 | llama | gp160 | 3 | 3 | 1 | 1.8444582 | 1 | |
| B21 | llama | gp160 | 3 | 3 | 1 | 0.0936399 | 1 | |
| B9 | llama | gp160 | 3 | 3 | 1 | 0.0386986 | 1 | |
| LAB5 | llama | 4 | 2 | 1 | NA | 1 |
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
con$
filterMabGrid(using = "hxb2_location", value = c("Env", "gp160"))$
filterMabGrid(using = "donor_species", value = "llama")$
mabGridSummaryYou 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.
# retrieve available viruses in the filtered grid
con$mabGrid[, unique(virus)]
#> [1] "6535.3" "Q23.17" "242-14" "BaL.26" "DJ263.8"
# retrieve available clades for 1H9 mAb mixture in the filtered grid
con$mabGrid[mab_mixture == "1H9", unique(clade)]
#> [1] "B" "CRF02_AG"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:
#> Summary:
#> - 3 studies
#> - 14 mAb mixtures
#> - 1 neutralization tiers
#> - 3 clades
#> Filters:
#> - virus: 242-14, Q23.17, 6535.3, BaL.26, DJ263.8
#> - mab_donor_species: llamaThere 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”.
knitr::kable(con$mabGridSummary)| mab_mixture | donor_species | isotype | hxb2_location | n_viruses | n_clades | n_tiers | geometric_mean_curve_ic50 | n_studies |
|---|---|---|---|---|---|---|---|---|
| 11F1B | llama | 4 | 2 | 1 | NA | 1 | ||
| 11F1F | llama | 4 | 2 | 1 | 26.2961178 | 1 | ||
| 1H9 | llama | Env | 4 | 2 | 1 | 5.0898322 | 1 | |
| 2B4F | llama | 4 | 2 | 1 | 1.5242288 | 1 | ||
| 2H10 | llama | 2 | 2 | 1 | NA | 1 | ||
| 2H10/W100A | llama | 2 | 2 | 1 | NA | 1 | ||
| 3E3 | llama | gp160 | 3 | 3 | 1 | 0.9944945 | 1 | |
| 4H73 | llama | 4 | 2 | 1 | NA | 1 | ||
| 5B10D | llama | 4 | 2 | 1 | NA | 1 | ||
| 9B6B | llama | 4 | 2 | 1 | 24.3643637 | 1 | ||
| A14 | llama | gp160 | 3 | 3 | 1 | 1.8444582 | 1 | |
| B21 | llama | gp160 | 3 | 3 | 1 | 0.0936399 | 1 | |
| B9 | llama | gp160 | 3 | 3 | 1 | 0.0386986 | 1 | |
| LAB5 | llama | 4 | 2 | 1 | NA | 1 |
There are several metadata fields that can be exported in the mAb object.
names(mab)
#> [1] ".__enclos_env__" "variableDefinitions" "assays"
#> [4] "studies" "nabMab" "mabs"
#> [7] "studyAndMabs" "config" "clone"
#> [10] "refresh" "print" "initialize"sessionInfo()
#> R version 4.1.0 (2021-05-18)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 20.04.2 LTS
#>
#> Matrix products: default
#> BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
#> LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
#>
#> locale:
#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
#> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
#> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
#> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
#> [9] LC_ADDRESS=C LC_TELEPHONE=C
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] data.table_1.14.0 DataSpaceR_0.7.5 knitr_1.33
#>
#> loaded via a namespace (and not attached):
#> [1] Rcpp_1.0.7 digest_0.6.27 assertthat_0.2.1 R6_2.5.0
#> [5] jsonlite_1.7.2 magrittr_2.0.1 evaluate_0.14 highr_0.9
#> [9] httr_1.4.2 stringi_1.7.3 curl_4.3.2 tools_4.1.0
#> [13] stringr_1.4.0 Rlabkey_2.8.0 xfun_0.25 compiler_4.1.0