retrieve_SpecialCases {magmaR} | R Documentation |
Helper functions that utilize special cases of magma /retrieve
Description
Helper functions that utilize special cases of magma /retrieve
Usage
retrieveTemplate(target, projectName, ...)
retrieveModels(target, projectName, ...)
retrieveIds(target, projectName, modelName, ...)
retrieveAttributes(target, projectName, modelName, ...)
Arguments
target |
A list, which can be created using |
projectName |
Single string. The name of the project you would like to interact with. For options, see |
... |
Additional parameters passed along to the internal '.retrieve()', '.query()', or '.update()' functions, for troubleshooting or advanced-user purposes only:
|
modelName |
Single string. The name of the subset data structure within the project, which are referred to as 'model's in magma, to interact with.
For options, see |
Details
These functions aim to help users determine acceptable inputs to other magmaR functions without needing to leave R.
They make properly crafted calls to retrieve
which target either the "template" or "identifier" special cases outlined in https://mountetna.github.io/magma.html#retrieve,
followed by directly returning the output (retrieveTemplate
and retrieveIds
),
by returning just a targeted portion of that output (retrieveModels
),
or by returning a targeted portion of a subsequent single-record call to retrieve
(retrieveAttributes
).
Value
retrieveTemplate = a list conversion of the project's template json.
retrieveModels = a string vector of model names
retrieveIds = a string vector of record names/identifiers.
retrieveAttributes = a string vector of attribute names.
Functions
-
retrieveTemplate()
: Retrieve the template for a given project -
retrieveModels()
: Retrieve the modelNames for a given project -
retrieveIds()
: Retrieve all the identifiers/recordNames for a given project-model pair. -
retrieveAttributes()
: Retrieve all the attribute options for a given project-model pair.
Examples
if (interactive()) {
# First, we use magmaRset to create an object which will tell other magmaR
# functions our authentication token (as well as some other optional bits).
# When run in this way, it will ask you to give your token.
magma <- magmaRset()
template <- retrieveTemplate(
target = magma,
projectName = "example")
str(template, max.level = 4)
models <- retrieveModels(
target = magma,
projectName = "example")
print(models)
ids <- retrieveIds(
target = magma,
projectName = "example",
modelName = "rna_seq")
print(ids)
atts <- retrieveAttributes(
target = magma,
projectName = "example",
modelName = "subject")
print(atts)
}