Learn R Programming

PathwaySpace (version 1.0.2)

circularProjection,PathwaySpace-method: Spatial 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,
  pdist = 0.15,
  rescale = TRUE,
  verbose = TRUE,
  decay.fun = signalDecay(),
  aggregate.fun = signalAggregation(),
  kns = deprecated()
)

Value

A preprocessed PathwaySpace class object.

Arguments

ps

A PathwaySpace class object.

k

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

pdist

A term (in [0, 1]) determining a distance unit for the signal decay function. When `pdist = 1` it will represent the diameter of the inscribed circle within the pathway space. This distance will affect the extent over which the convolution operation projects the signal between source- and destination points.

rescale

A single 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 single logical value specifying to display detailed messages (when verbose=TRUE) or not (when verbose=FALSE).

decay.fun

A signal decay function. Available options include 'Weibull', 'exponential', and 'linear' (see signalDecay). 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 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 single scalar value. Available options include 'mean', 'wmean', 'log.wmean', and 'exp.wmean' (See signalAggregation).

kns

Deprecated from PathwaySpace 1.0.1; use 'k' instead.

Author

Victor Apolonio, Vinicius Chagas, Mauro Castro, and TCGA Network.

See Also

buildPathwaySpace

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