getPlottingData: Get plotting data from an OmicNavigator study

View source: R/plots.R

getPlottingDataR Documentation

Get plotting data from an OmicNavigator study

Description

Returns assay, sample, feature, and result data that may be used for plotting. This function is called by plotStudy() and the output is passed to custom plotting functions. It should be used directly when interactively creating custom plotting functions.

Usage

getPlottingData(study, modelID, featureID, testID = NULL, libraries = NULL)

Arguments

study

An OmicNavigator study. Either an object of class onStudy, or the name of an installed study package.

modelID

Filter by modelID

featureID

Filter by featureID

testID

Filter by testID

libraries

The directories to search for installed study packages. If left as NULL (the default), then installed.packages will use the result of .libPaths.

Details

The end-user should call this function and populate the first argument of their custom plotting function with the output. When building functions, the end-user should understand the category of plotting function they are creating (e.g. singleFeature or multiFeature, see addPlots()) and call getPlottingData() accordingly.

Custom plots that accept data from multiple models and a single test (⁠plotType = c(‘multiModel’, ‘singleTest’)⁠; see addPlots()) should be built to accept output from getPlottingData() where modelID is vector of length n and testID is a vector of length n, where n is the number of models. Custom plots that accept data from multiple models and multiple tests (⁠plotType = c(‘multiModel’, ‘multiTest’)⁠) should be built to accept output from getPlottingData() where modelID and testID vectors are length m, where m is the total number of tests considered across all models (note that testIDs must be repeated across models for the plotting function to work in the app). The index positions of these two vectors should correspond. That is, testID position 1 should be found in the model specified by modelID position 1, etc. See addPlots() for information about the assignment of plotTypes for your custom plots.

Value

Returns a list of at least 4 objects:

assays

A data frame that contains the assay measurements, filtered to only include the row(s) corresponding to the input featureID(s) (see getAssays). If multiple featureIDs are requested, the rows are reordered to match the order of this input. The column order is unchanged.

samples

A data frame that contains the sample metadata for the given modelID (see getSamples). The rows are reordered to match the columns of the assays data frame.

features

A data frame that contains the feature metadata, filtered to only include the row(s) corresponding to the input featureID(s) (see getFeatures). If multiple featureIDs are requested, the rows are reordered to match the order of this input (and thus match the order of the assays data frame).

results

A data frame that contains the test results, filtered to only include the row(s) corresponding to the input featureID(s). If multiple featureIDs are requested, the rows are reordered to match the order of this input. The column order is unchanged. If multiple testIDs are provided, they are stored in a list object.

mapping

A data frame that contains the featureID(s) from each model. This is the filtered mapping object. This data frame is returned when multiple models are passed as arguments

The data frame results is only returned if you pass a testID. By default the app will always pass the currently selected testID.

See Also

addPlots, plotStudy


abbvie-external/OmicNavigator documentation built on April 12, 2025, 12:07 a.m.