Using the DataSpace app, the workflow of using the mAb grid is the following:
DataSpaceR offers a similar interface:
con$getMab()to retrieve the mAb data
You 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)) #> dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib #> Referenced from: /usr/local/bin/phantomjs #> Reason: image not found #> Error in (function (url = NULL, file = "webshot.png", vwidth = 992, vheight = 744, : webshot.js returned failure value: -6
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
You can filter rows in the grid by specifying the values to keep in the columns found in the field
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
# 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)) #> dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib #> Referenced from: /usr/local/bin/phantomjs #> Reason: image not found #> Error in (function (url = NULL, file = "webshot.png", vwidth = 992, vheight = 744, : webshot.js returned failure value: -6
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
studies, or any variables found in the
mabGrid field in the connection object via
After filtering the grid, you can create a DataSpaceMab object that contains the filtered mAb data.
There are 6 public fields available in the
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 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: #>  en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 #> #> attached base packages: #>  stats graphics grDevices utils datasets methods base #> #> other attached packages: #>  knitr_1.29 data.table_1.13.0 testthat_2.3.2 DataSpaceR_0.7.4 #> #> loaded via a namespace (and not attached): #>  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 #>  evaluate_0.14 rlang_0.4.7 cli_2.0.2 rstudioapi_0.11 crosstalk_126.96.36.199 curl_4.3 yaml_2.2.1 #>  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 #>  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 #>  codetools_0.2-16 ps_1.3.4 htmltools_0.5.0 assertthat_0.2.1 stringi_1.4.6 crayon_1.3.4