Title: | Metabolomics Workbench in R |
---|---|
Description: | This package provides functions for interfacing with the Metabolomics Workbench RESTful API. Study, compound, protein and gene information can be searched for using the API. Methods to obtain study data in common Bioconductor formats such as SummarizedExperiment and MultiAssayExperiment are also included. |
Authors: | Gavin Rhys Lloyd [aut, cre], Ralf Johannes Maria Weber [aut] |
Maintainer: | Gavin Rhys Lloyd <[email protected]> |
License: | GPL-3 |
Version: | 1.17.0 |
Built: | 2024-11-08 06:00:52 UTC |
Source: | https://github.com/bioc/metabolomicsWorkbenchR |
Gets the value of a slot from mw_base objects, provided they are not listed as 'private'.
## S4 method for signature 'mw_base' x$name
## S4 method for signature 'mw_base' x$name
x |
An object derived from mw_base. |
name |
The name of the slot to access. |
The assigned to the slot.
# an object derived from mw_base object C = context$study # access the name slot C$name
# an object derived from mw_base object C = context$study # access the name slot C$name
Checks an input_value against a regex pattern to determine if the input_value is valid. This method is used internally and not for intended for general use.
check_pattern(I, input_value, match) ## S4 method for signature 'mw_input_item' check_pattern(I, input_value, match)
check_pattern(I, input_value, match) ## S4 method for signature 'mw_input_item' check_pattern(I, input_value, match)
I |
An mw_input_item. |
input_value |
The value for the input item (character). |
match |
The type of match. One of "exact" or "partial". |
TRUE if input matches the pattern, or throws an error.
check_pattern(input_item$study_id,'ST000001','exact')
check_pattern(input_item$study_id,'ST000001','exact')
Checks that the provided inputs and output are compatible. This method is used internally and not for intended for general use.
check_puts(input_item, output_item) ## S4 method for signature 'mw_input_item' check_puts(input_item, output_item)
check_puts(input_item, output_item) ## S4 method for signature 'mw_input_item' check_puts(input_item, output_item)
input_item |
An mw_input_item. |
output_item |
An mw_output_item. |
TRUE if the items are compatible or throws an error if not.
check_puts(input_item$study_id,output_item$summary)
check_puts(input_item$study_id,output_item$summary)
A predefined list of mw_context objects. The context have been created to mirror the metabolomics workbench API documentation contexts as closely as possible.
context
context
An object of class list
of length 7.
# list available contexts names(context) # get the context 'study' context$study
# list available contexts names(context) # get the context 'study' context$study
Get a list of valid input_items for a context.
context_inputs(context)
context_inputs(context)
context |
The name of a valid context (character) |
A list of input item names for a context
# list of input items for the "study" context context_inputs("study")
# list of input items for the "study" context context_inputs("study")
Get a list of valid output_items for a context.
context_outputs(context)
context_outputs(context)
context |
The name of a valid context (character) |
A list of output item names for a context
# list of output items for the "study" context context_outputs("study")
# list of output items for the "study" context context_outputs("study")
Sends a query to the metabolomics database and returns the result. Note that while objects derived from mw_base can be used the recommended approach is to use character inputs.
do_query(context, input_item, input_value, output_item) ## S4 method for signature 'character,character,character,character' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_moverz_context,list,character,mw_output_item' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_moverz_context,list,character,character' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_moverz_context,list,character,missing' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_moverz_context,character,character,missing' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'character,character,character,missing' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_exactmass_context,list,character,mw_output_item' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_exactmass_context,list,character,character' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_exactmass_context,list,character,missing' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_exactmass_context,character,character,missing' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'character,character,character,missing' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_context,mw_input_item,character,mw_output_item' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_context,mw_input_item,character,mw_SE_item' do_query(context, input_item, input_value, output_item) ## S4 method for signature ## 'mw_context,mw_input_item,character,mw_untarg_SE_item' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_context,mw_input_item,character,mw_DE_item' do_query(context, input_item, input_value, output_item) ## S4 method for signature ## 'mw_context,mw_input_item,character,mw_untarg_DE_item' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_context,mw_input_item,character,mw_MAE_item' do_query(context, input_item, input_value, output_item)
do_query(context, input_item, input_value, output_item) ## S4 method for signature 'character,character,character,character' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_moverz_context,list,character,mw_output_item' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_moverz_context,list,character,character' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_moverz_context,list,character,missing' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_moverz_context,character,character,missing' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'character,character,character,missing' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_exactmass_context,list,character,mw_output_item' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_exactmass_context,list,character,character' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_exactmass_context,list,character,missing' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_exactmass_context,character,character,missing' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'character,character,character,missing' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_context,mw_input_item,character,mw_output_item' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_context,mw_input_item,character,mw_SE_item' do_query(context, input_item, input_value, output_item) ## S4 method for signature ## 'mw_context,mw_input_item,character,mw_untarg_SE_item' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_context,mw_input_item,character,mw_DE_item' do_query(context, input_item, input_value, output_item) ## S4 method for signature ## 'mw_context,mw_input_item,character,mw_untarg_DE_item' do_query(context, input_item, input_value, output_item) ## S4 method for signature 'mw_context,mw_input_item,character,mw_MAE_item' do_query(context, input_item, input_value, output_item)
context |
A valid context name (character) |
input_item |
A valid input_item name (character) |
input_value |
The value for the input item (character). |
output_item |
A valid output_item (character). |
A data.frame, or other output appropriate to the output_item.
# Get a summary of all studies with "diabetes" in the title df = do_query( context = 'study', input_item = 'study_title', input_value = 'diabetes', output_item = 'summary' )
# Get a summary of all studies with "diabetes" in the title df = do_query( context = 'study', input_item = 'study_title', input_value = 'diabetes', output_item = 'summary' )
Displays a valid input_value for an input_item and returns an example that matches the required input pattern.
input_example(input_item)
input_example(input_item)
input_item |
The name of a valid input_item (character) |
An example input value matching the pattern required for the chosen input item.
# example input_value for input item "study_id" input_example('study_id')
# example input_value for input item "study_id" input_example('study_id')
A predefined list of mw_input_item objects. The items have been created to mirror the Metabolomics Workbench API documentation input items as closely as possible.
input_item
input_item
An object of class list
of length 41.
# list available input_items names(input_item) # get the input item 'study_id' input_item$study_id
# list available input_items names(input_item) # get the input item 'study_id' input_item$study_id
Compares the input and output items to the expected values for a context and returns TRUE if the inputs/puts are valid for the provided context or an error if not. This method is used internally and not for intended for general use.
is_valid(context, input_item, input_value, output_item) ## S4 method for signature 'mw_context,character,character,character' is_valid(context, input_item, input_value, output_item) ## S4 method for signature 'mw_moverz_context,character,character,missing' is_valid(context, input_item, input_value) ## S4 method for signature 'mw_exactmass_context,character,character,missing' is_valid(context, input_item, input_value)
is_valid(context, input_item, input_value, output_item) ## S4 method for signature 'mw_context,character,character,character' is_valid(context, input_item, input_value, output_item) ## S4 method for signature 'mw_moverz_context,character,character,missing' is_valid(context, input_item, input_value) ## S4 method for signature 'mw_exactmass_context,character,character,missing' is_valid(context, input_item, input_value)
context |
An mw_context object. |
input_item |
An mw_input_item object, or the name of one. |
input_value |
The value for the input item (character). |
output_item |
An mw_output_item, or the name of one. |
TRUE or an error.
is_valid(context$study, input_item$study_id$name, 'ST000001', output_item$summary$name )
is_valid(context$study, input_item$study_id$name, 'ST000001', output_item$summary$name )
A predefined list of mw_output_item objects. The items have been created to mirror the Metabolomics Workbench API documentation output items as closely as possible.
output_item
output_item
An object of class list
of length 31.
# list available output_items names(output_item) # get the output item 'summary' output_item$summary
# list available output_items names(output_item) # get the output item 'summary' output_item$summary