select_substrates_or_products: Select substrates or products

View source: R/id_conversion.R

select_substrates_or_productsR Documentation

Select substrates or products

Description

The function select_substrates_or_products selects either substrates or products of (a) reaction(s) stored in a list object depending on the cols argument.

Depending on the type argument the function will either return a list of substrates (type = "substrates") or products (type = "products").

Usage

select_substrates_or_products(
  reaction,
  cols,
  type = c("substrates", "products")
)

Arguments

reaction

list, each entry contains a character vector of length 2

cols

numeric of length length(list)

type

character(1) either substrates or products

Details

Each list entry stores the substrates/products or products/substrates of a reaction. The direction of this reaction is codified in the cols argument. If cols = 1: first element is equal to substrates, if cols = 2: first entry is equal to substrates, if cols = 3: first entry is equal to products, if cols = 4: first entry is equal to substrates.

Value

list

Author(s)

Thomas Naake

Examples

## given a rection that describes the change of (3S)-3-Hydroxy-2-butanone
## to its stereoisomer (3R)-3-Hydroxy-2-butanone
reaction <- list(c("CC(=O)[C@H](C)O",  "CC(=O)[C@H](C)O"))

## cols = 2
cols <- 2
LipidNetworkPredictR:::select_substrates_or_products(reaction = reaction, 
    cols = cols, type = "substrates")
LipidNetworkPredictR:::select_substrates_or_products(reaction = reaction, 
    cols = cols, type = "products")

## cols = 3
cols <- 3
LipidNetworkPredictR:::select_substrates_or_products(reaction = reaction, 
    cols = cols, type = "substrates")
LipidNetworkPredictR:::select_substrates_or_products(reaction = reaction, 
    cols = cols, type = "products")

michaelwitting/wormLipidPredictR documentation built on Nov. 24, 2024, 5:39 p.m.