selectInstances: Returns all instances that conform to the selection criteria.

Description Usage Arguments Value Author(s) Examples

Description

Returns all instances that conform to the selection criteria. This function returns a subset of the internal data.table of the biopax object. Selection criteria are wether instances belong to a certain class or have the specified id, property or name. Setting a criteria to NULL ignores this criteria. If returnValues is set to FALSE only the selector (a logical vector with length of the internal data.table) is returned, otherwise the selected data is returned. If includeSubClasses is set to TRUE the class criteria is broadened to include all classes that inherit from the given class, e.g. if class="control" and includeSubClasses=TRUE the function will select catalyses and modulations too, since they are a subclass of class control. If includeReferencedInstances is set to TRUE all instances that are being referenced by the selected instances are being selected too. The parameter works recursively, this means for example that a selected pathway and all it's interactions, complexes, molecules and annotations are returned if this parameter is set to true. This parameter is especially helpful if you want to migrate or merge knowledge from different data bases.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
selectInstances(
  biopax,
  id = NULL,
  class = NULL,
  property = NULL,
  name = NULL,
  returnValues = TRUE,
  includeSubClasses = FALSE,
  includeReferencedInstances = FALSE,
  returnCopy = TRUE,
  biopaxlevel = 3
)

Arguments

biopax

A biopax model or a compatible internal data.table

id

string. ID of the instances to select

class

string. Class of the instances to select

property

string. Return only this property of the instances

name

string. Name of the instances to select

returnValues

logical. If returnValues is set to FALSE only the selector (a logical vector with length of the internal data.table) is returned, otherwise the selected data is returned

includeSubClasses

logical. If includeSubClasses is set to TRUE the class criteria is broadened to include all classes that inherit from the given class

includeReferencedInstances

logical. If includeReferencedInstances is set to TRUE all instances that are being referenced by the selected instances are being selected too

returnCopy

logical. Defaults to TRUE. If TRUE a copy of the internal data.table is returned. If FALSE data is returned by reference. Set to FALSE to increase speed when only ever reading data. Make sure you understand the implications of using this! See vignette of data.table package.

biopaxlevel

integer. Set the biopax level here if you supply a data.table directly.

Value

Returns a data.table containing all instances conforming to the given selection criteria if returnValues=TRUE, only the selector for the internal data.table otherwise.

Author(s)

Frank Kramer

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
 # load data
 data(biopaxexample)
 # select the subset of the internal data.table that belongs to class "protein"
 selectInstances(biopax, class="protein")
 # select the subset of the internal data.table that belongs to class "interaction"
 selectInstances(biopax, class="interaction")
 # select the subset of the internal data.table that belongs to class "interaction" or any of its sub classes, like control, catalysis etc.
 selectInstances(biopax, class="interaction", includeSubClasses=TRUE)
 # select the subset of the internal data.table that belongs to class "pathway" AND is a "NAME" property
 selectInstances(biopax, class="pathway", property="NAME")

frankkramer-lab/rBiopaxParser documentation built on July 19, 2020, 9:49 a.m.