kangar00 (version 1.0)

pathway: An S4 class to represent a gene-gene interaction network

Description

An S4 class to represent a gene-gene interaction network

'pathway' is the pathway object constructor.

show displays the pathway object briefly

summary generates a pathway object summary including basic network properties.

pathway2igraph converts a pathway object into an igraph object with edge attribute sign

analyze pathway network properties

get_genes is a helper function that extracts the gene names in a pathway and returns a vector containing character elements of gene names

plot plots pathway as igraph object

sample_genes function randomly selects effect genes in a pathway and returns a vector of length no with vertex id's of sampled genes

Usage

pathway(object, ...)

# S4 method for ANY pathway(id, adj, sign)

# S4 method for pathway show(object)

# S4 method for pathway summary(object)

# S4 method for pathway pathway2igraph(object)

# S4 method for pathway analyze(object, ...)

# S4 method for pathway get_genes(object)

# S4 method for pathway,missing plot(x, y = NA, highlight.genes = NULL, gene.names = c("legend", "nodes", NA), main = NULL, asp = 0.95, vertex.size = 11, vertex.color = "khaki1", vertex.label.cex = 0.8, edge.width = 2, edge.color = "olivedrab4", ...)

# S4 method for pathway sample_genes(object, no = 3)

Arguments

object

An object of class pathway-class

...

further arguments specifying plotting options in plot.igraph

id

A character repesenting the pathway id.

adj

A matrix respresenting the network adjacency matrix of dimension equaling the number of genes (1 interaction, 0 otherwise)

sign

A numeric vector indicating the interaction type for each link (1 activation, -1 inhibition) in the interaction network for the pathway.

x

pathway object

y

missing (placeholder)

highlight.genes

vector of gene names or node id's, which should be highlighted in a different color, default is NULL so that no genes are highlighted

gene.names

character indicating whether the genes names should appear in a legend ('legend'), as vertex label ('nodes'), or should be omitted (NA)

main

optional overall main title, default is NULL, which uses the pathway id

asp

a numeric constant, which gives the aspect ratio parameter for plot, default is 0.95

vertex.size

a numeric constant specifying the vertex size, default is 11

vertex.color

a character or numeric constant specifying the vertex color, default is 'khaki1'

vertex.label.cex

a numeric constant specifying the the vertex label size, default is 0.8,

edge.width

a numeric constant specifying the edge width, default is 2

edge.color

a character or numeric constant specifying the edge color, default is 'olivedrab4'

no

a numeric constant specifying the number of genes to be sampled, default is 3

Value

analyze returns a data.frame consisting of

id

pathway id,

vcount

number of genes,

ecount

number of links,

inh_ecount

number of inhibition links,

density

network density,

av_deg

average degree,

inh_deg

average degree of inhibition links,

diam

network diamter,

trans

transitivity, and

s_trans

signed transitivity (Kunegis et al., 2009).

Methods (by generic)

  • analyze:

  • get_genes:

  • sample_genes:

Slots

id

A character repesenting the pathway id, e.g. hsa00100 as used in the KEGG database.

adj

A matrix respresenting the network adjacency matrix of dimension equaling the number of genes (1 interaction, 0 otherwise)

sign

A numeric vector indicating the interaction type for each link (1 activation, -1 inhibition) in the interaction network for the pathway.

References

Details to the computation and interpretation can be found in:

  • Kolaczyk, E. D. (2009). Statistical analysis of network data: methods and models. Springer series in statistics. Springer.

  • Kunegis, J., A. Lommatzsch, and C. Bauckhage (2009). The slashdot zoo: Mining a social network with negative egdes. In Proceedings of the 18th international conference on World wide web, pp. 741-750. ACM Press.

Examples

Run this code
# NOT RUN {
pathway(id="hsa04022", adj=matrix(0), sign=as.vector(matrix(0)[matrix(0)!=0]))

#show method
data(hsa04020)
hsa04020
#summary method
data(hsa04020)
summary(hsa04020)
# convert to \code{\link[igraph]{igraph}} object
data(hsa04020)
str(hsa04020)
g <- pathway2igraph(hsa04020)
str(g)
# analyse \code{\link{pathway}} network properties
data(hsa04020)
summary(hsa04020)
analyze(hsa04020)
# extract gene names from \code{\link{pathway}}
get_genes(hsa04020)
# plot \code{\link{pathway}} as \code{\link[igraph]{igraph}} object
plot(hsa04020)
sample3 <- sample_genes(hsa04020, no = 3)
plot(hsa04020, highlight.genes = sample3)

# sample effect genes
sample3 <- sample_genes(hsa04020, no = 3)
plot(hsa04020, highlight.genes = sample3)
sample5 <- sample_genes(hsa04020, no = 5)
plot(hsa04020, highlight.genes = sample5)
# }

Run the code above in your browser using DataLab