SubsetPathwayCollection {pathwayPCA} | R Documentation

## Subset a `pathwayCollection`-class Object by Pathway.

### Description

The subset method for pathways lists as returned by the `read_gmt` function.

### Usage

    ## S3 method for class 'pathwayCollection'
    x[[name_char]]

### Arguments

`x` | An object of class `pathwayCollection`.
`name_char` | The name of a pathway in the collection or its unique ID.

### Details

This function finds the index matching the `name_char` argument to the `TERMS` field of the `pathwayCollection`-class Object, then subsets the `pathways` list, `TERMS` vector, `description` vector, and `setsize` vector by this index. If you subset a trimmed `pathwayCollection` object, and the function errors with "Pathway not found.", then the pathway specified has been trimmed from the pathway collection.

Also, this function does not allow for users to overwrite any portion of a pathway collection. These objects should rarely, if ever, be changed. If you absolutely must change the components of a `pathwayCollection` object, then create a new one with the codeCreatePathwayCollection function.

### Value

A list of the pathway name (`Term`), unique ID (`pathID`), contents (`IDs`), description (`description`), and number of features (`Size`).

### Examples

      data("colon_pathwayCollection")
      colon_pathwayCollection[["KEGG_RETINOL_METABOLISM"]]

[Package pathwayPCA version 1.10.0 Index]