Rodam (version 0.1.2)

odamws-class: API layer for the ODAM web services

Description

the class that implements the API layer for the ODAM (Open Data for Access and Mining) web services.

Provides functions to allow you to retrieve online data using ODAM Web Services. This obviously requires that data are implemented according the ODAM approach (Open Data for Access and Mining), 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.

Arguments

Fields

wsURL

defines the URL of the webservice - Must be specify when creating a new instance of the odamws object.

dsname

specifies the name of the Dataset to query - Must be specify when creating a new instance of the odamws object.

auth

specifies the authentication code to access to the Dataset by this webservice (if required)

subsets

a data.frame object containing metadata related to the data subsets - Initialized during the instantiation step

subsetNames

a list of the data subset names - Initialized during the instantiation step

connectList

a matrix of the connection graph between data subsets (i.e. the links between each subset with the subset at its origin, so that links can be interpreted as 'obtained from'). The data subsets are referred by their subset number. (corresponding to the 'SetID' column in the 'subsets' field) - Initialized during the instantiation step.

Methods

getCommonID(refID, setName1, setName2)

Returns the list of identifiers (defined by refID as an identifier attribute label) that are in common between two subsets (defined by the attribute label of the setName1 and setName2 subsets) i.e. resulting in the intersection of the two identifier sets.

getDataByName(setName, condition = "")

Returns the data of the 'setName' subset as a data.frame

getDataTree()

Returns a data.tree object filled up according to the data subset metadata

getMerged(refID, setName1, setName2)

Returns a data.frame containing data obtained by merging two subsets (defined by the attribute label of the setName1 and setName2 subsets) that have the same identifiers in common (defined by refID as an identifier attribute label) i.e. resulting in the intersection of the two identifier sets.

getSubsetByName(setName, condition = "")

Returns both data and metadate of the 'setName' subset as an object list:

data - a data.frame object containing the data. The column names of this data.frame are gathered according their categories and avaivalble in embedded lists, and described below.

varnames, facnames, qualnames, - Return lists containing the 'quantitative' variables, the 'factor' variables, the 'qualitative ' variables respectively.

samplename - a data.frame containing the metadata about the data subset, namely its name (Subset), its identifier (Attribute), its description (Description), its type (Type), and its CVTerm (CV_Term_ID, CV_Term_Name)

LABELS - a data.frame containing the metadata about all attributes - its format is the same as the 'samplename' data.frame.

WSEntry - a data.frame containing the correspondance between some attributes and their alias name, these latter serving within a query to put a constraint a or selection on this attribute. Note: 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'.

getWS(query = "")

Low level routine allowing to retrieve data or metadata from a query formatted according the ODAM framework specifications - Returns a data.frame object. By default, i.e. with an empty query, a data.frame object containing metadata related to the data subsets is returned.

Examples

Run this code
# NOT RUN {
dh <- new("odamws", "http://www.bordeaux.inra.fr/pmb/getdata/", "frim1")
dn <- show(dh)
# Get data from 'samples' subset with a constraint
data <- dh$getDataByName('samples','sample/365')
 # Get 'activome' data subset
ds <- dh$getSubsetByName('activome')
# Get the merged data of both data subsets based on their common identifier
refID <- "SampleID"
setName1 <- "activome"
setName2 <- "qNMR_metabo"
dsMerged <- dh$getMerged(refID, setName1, setName2)
# }

Run the code above in your browser using DataLab