knitr::opts_chunk$set(echo = TRUE, warning=FALSE, fig.align=TRUE)
'ODAM' (Open Data for Access and Mining) is an experimental data table management software to make research data accessible and available for reuse with minimal effort on the part of the data provider. Designed to manage experimental data tables in an easy way for users, ODAM provides a model for structuring both data and metadata that facilitates data handling and analysis. It also encourages data dissemination according to FAIR principles by making the data interoperable and reusable by both humans and machines, allowing the dataset to be explored and then extracted in whole or in part as needed.
The Rodam package has only one class, odamws that provides methods to allow you to retrieve online data using 'ODAM' Web Services. This obviously requires that data are implemented according the 'ODAM' approach , namely that the data subsets were deposited in the suitable data repository in the form of TSV files associated with their metadata also described in TSV files.
The R ODAM package offers a set of functions for retrieve data and their metadata of datasets that are implemented help with the "Experimental Data Table Management System" (EDTMS) called ODAM, which stands for "Open Data for Access and Mining".
See https://inrae.github.io/ODAM/ for further information.
library(Rodam)
Initialize the 'ODAM' object with the wanted dataset along with its corresponding URL of webservice
dh <- new('odamws', wsURL='https://pmb-bordeaux.fr/getdata/', dsname='frim1')
options(width=256) options(warn=-1) options(stringsAsFactors=FALSE) show(dh)
Get all WebService entries defined in the data subset 'samples'
dh$getWSEntryByName("samples")
a 'WSEntry' is an alias name associated with an attribute that allows user to query the data subset by putting a filter condition (i.e. a selection constraint) on the corresponding attribute. Not all attributes have a WSEntry but only few ones, especially the attributes within the identifier and factor categories. For instance, the WSEntry of the 'SampleID' attribute is 'sample'. Thus, if you want to select only samples with their ID equal to 365, you have to specify the filter condition as 'sample/365'.
data <- dh$getDataByName('samples','sample/365') data
But if this WSEntry concept is not clear for you, you can retrieve the full data subset, then performe a local selection as shown below :
data <- dh$getDataByName('samples') data[data$SampleID==365, ]
data$HarvestDate <- dh$dateToStr(data$HarvestDate) data$HarvestHour <- dh$timeToStr(data$HarvestHour) data[data$SampleID==365, ]
Get 'activome' data subset along with its metadata
ds <- dh$getSubsetByName('activome') ds$samples # Show the identifier defined in the data subset ds$facnames # Show all factors defined in the data subset
options(width=150)
ds$varnames # Show all quantitative variables defined in the data subset ds$qualnames # Show all qualitative variables defined in the data subset ds$WSEntry # Show all WS entries defined in the data subset
Rank <- simplify2array(lapply(ds$varnames, function(x) { round(mean(log10(ds$data[ , x]), na.rm=T)) })) cols <- c('red', 'orange', 'darkgreen', 'blue', 'purple') boxplot(log10(ds$data[, ds$varnames]), outline=F, horizontal=T, border=cols[Rank], las=2, cex.axis=0.8)
Based on the subset network, the common ID to be considered is the "SampleID" identifier
refID <- "SampleID" subsetList <- c( "samples", "activome", "qNMR_metabo", "cellwall_metabo" ) n <- length(subsetList) Mintersubsets <- matrix(data=0, nrow=n, ncol=n) for (i in 1:(n-1)) for (j in (i+1):n) Mintersubsets[i,j] <- length(dh$getCommonID(refID,subsetList[i],subsetList[j])) rownames(Mintersubsets) <- subsetList colnames(Mintersubsets) <- subsetList Mintersubsets[ -n, -1 ]
setNameList <- c("activome", "qNMR_metabo" ) dsMerged <- dh$getSubsetByName(setNameList)
cols <- c( rep('red', length(dsMerged$varsBySubset[[setNameList[1]]])), rep('darkgreen', length(dsMerged$varsBySubset[[setNameList[2]]])) ) boxplot(log10(dsMerged$data[, dsMerged$varnames]), outline=F, horizontal=T, border=cols, las=2, cex.axis=0.8)
options(width=128) sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.