Learn R Programming

PathwaySpace (version 1.1.0)

circularProjection,PathwaySpace-method: Circular Projection of Graph-Associated Signals

Description

circularProjection implements a convolution algorithm to project signals onto a 2D-coordinate system.

Usage

# S4 method for PathwaySpace
circularProjection(
  ps,
  k = 8,
  decay.fun = weibullDecay(),
  aggregate.fun = signalAggregation(),
  rescale = TRUE,
  verbose = TRUE,
  pdist = deprecated()
)

Value

A preprocessed PathwaySpace class object.

Arguments

ps

A PathwaySpace class object.

k

A single positive integer determining the k-top signals for the convolution operation.

decay.fun

A signal decay function. Available options include 'Weibull', 'exponential', and 'linear' (see weibullDecay). Users may also define a custom decay model with at least two arguments, e.g., function(x, signal) { ... }, which should returns a vector of projected signals of the same length as x. Additional arguments may include any variable available as a graph vertex attribute.

aggregate.fun

A function used to aggregate the projected signals. It must be provided as a unary function, e.g., function(x) { ... }, which should aggregate a vector of signals to a scalar value. Available options include 'mean', 'wmean', 'log.wmean', and 'exp.wmean' (See signalAggregation).

rescale

A logical value indicating whether to rescale the signal. If the signal >=0, then it will be rescaled to [0, 1]; if the signal <=0, then it will be rescaled to [-1, 0]; and if the signal in (-Inf, +Inf), then it will be rescaled to [-1, 1].

verbose

A logical value specifying to display detailed messages (when verbose=TRUE) or not (when verbose=FALSE).

pdist

Deprecated as of PathwaySpace 1.0.2; this parameter is now passed internally through decay.fun.

Author

Sysbiolab Team

See Also

buildPathwaySpace, weibullDecay, expDecay, linearDecay

Examples

Run this code
# Load a demo igraph
data('gtoy1', package = 'RGraphSpace')

# Create a new PathwaySpace object
ps <- buildPathwaySpace(gtoy1, nrc = 100)
# note: adjust 'nrc' to increase image resolution

# Set '1s' as vertex signal
vertexSignal(ps) <- 1

# Create a 2D-landscape image
ps <- circularProjection(ps)

Run the code above in your browser using DataLab