KeggPathwayConn: The connector class to KEGG Pathway database.

KeggPathwayConnR Documentation

The connector class to KEGG Pathway database.

Description

The connector class to KEGG Pathway database.

The connector class to KEGG Pathway database.

Details

This is a concrete connector class. It must never be instantiated directly, but instead be instantiated through the factory BiodbFactory. Only specific methods are described here. See super classes for the description of inherited methods.

Super classes

biodb::BiodbConnBase -> biodb::BiodbConn -> biodbKegg::KeggConn -> KeggPathwayConn

Methods

Public methods

Inherited methods

Method new()

New instance initializer. Connector classes must not be instantiated directly. Instead, you must use the createConn() method of the factory class.

Usage
KeggPathwayConn$new(...)
Arguments
...

All parameters are passed to the super class initializer.

Returns

Nothing.


Method getReactions()

Retrieves all reactions part of a KEGG pathway. Connects to KEGG databases, and walk through all pathways submitted, and their modules, to find all reactions they are composed of.

Usage
KeggPathwayConn$getReactions(id, drop = TRUE)
Arguments
id

A character vector of entry IDs.

drop

If set to TRUE, returns a single KEGG reaction object instead of a list, if the list contains only one element.

Returns

A list of KEGG reaction objects.


Method convertToOrgPathways()

Takes a list of pathways IDs and converts them to the specified organism, filtering out the ones that do not exist in KEGG.

Usage
KeggPathwayConn$convertToOrgPathways(id, org)
Arguments
id

A character vector of entry IDs.

org

The organism in which to search for pathways, as a KEGG organism code (3-4 letters code, like 'hsa', 'mmu', ...). See https //www.genome.jp/kegg/catalog/org_list.html for a complete list of KEGG organism codes.

Returns

A character vector, the same length as 'id', containing the converted IDs.


Method buildPathwayGraph()

Builds a pathway graph in the form of two tables of vertices and edges, using KEGG database.

Usage
KeggPathwayConn$buildPathwayGraph(id, directed = FALSE, drop = TRUE)
Arguments
id

A character vector of KEGG pathway entry IDs.

directed

If set to TRUE, use available direction information to create directed edges, duplicating if necessary the vertices.

drop

If set to TRUE and the output list contains only one element, then the returned value is a single list of two data frames.

Returns

A named list whose names are the pathway IDs, and values are lists containing two data frames named vertices and edges.


Method getPathwayIgraph()

Builds a pathway graph, as an igraph object, using KEGG database.

Usage
KeggPathwayConn$getPathwayIgraph(id, directed = FALSE, drop = TRUE)
Arguments
id

A character vector of KEGG pathway entry IDs.

directed

If set to TRUE, use available direction information to create directed edges, duplicating if necessary the vertices.

drop

If set to TRUE and the output list contains only one element, then the returned value is a single igraph object.

Returns

A list of igraph objects, or an empty list if the igraph library is not available.


Method getDecoratedGraphPicture()

Create a pathway graph picture, with some of its elements colorized.

Usage
KeggPathwayConn$getDecoratedGraphPicture(id, color2ids)
Arguments
id

A KEGG pathway ID.

color2ids

A named list defining colors for entry IDs that are present on the graph. The names of the list are standard color names. The values are character vector of entry IDs.

Returns

An image object or NULL if the package magick is not available.


Method extractPathwayMapShapes()

Extracts shapes from a pathway map image.

Usage
KeggPathwayConn$extractPathwayMapShapes(id, color2ids)
Arguments
id

A KEGG pathway ID.

color2ids

A named list defining colors for entry IDs that are present on the graph. The names of the list are standard color names. The values are character vector of entry IDs.

Returns

A list of BiodbShape objects.


Method clone()

The objects of this class are cloneable with this method.

Usage
KeggPathwayConn$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

KeggConn.

Examples

# Create an instance with default settings:
mybiodb <- biodb::newInst()

# Get connector
conn=mybiodb$getFactory()$createConn('kegg.pathway')

# Retrieve all reactions related to a mouse pathway:
reactions=conn$getReactions('mmu00260')

# Get a pathway graph
graph=conn$buildPathwayGraph('mmu00260')

# Terminate instance.
mybiodb$terminate()


pkrog/biodbKegg documentation built on Oct. 1, 2022, 6:27 p.m.