grimon: grimon

View source: R/grimon.R

grimonR Documentation

grimon

Description

grimon

Grimon (Graphical interface to visualize multi-omics networks) visualizes high-dimensional multi-layered data sets in three-dimensional parallel coordinates. It enables users to intuitively and interactively explore their data, helping their understanding of multiple inter-layer connections embedded in high-dimensional complex data.

Usage

grimon(x, format = "wide", segment_mat = NULL, col = "black",
  label = NULL, optimize_coordinates = FALSE, maxiter = 1000, initT = 1,
  alpha = NULL, score_function = "angle", progress = FALSE,
  optimized_point_mat = NULL, return_coordinates = FALSE, norm = TRUE,
  norm_scale = NULL, norm_shift = NULL, z_interval = 1, point_size = 2,
  plane_col = "black", plane_alpha = 0.1, border_col = "black",
  border_alpha = 1, border_lwd = 1, segment_col = NULL,
  segment_alpha = 0.3, segment_lwd = 1, new_device = FALSE,
  reset_view = TRUE, userMatrix = rotationMatrix(pi/2, 0, 1, 0),
  windowRect = c(0, 0, 800, 600), plot_2d_panels = FALSE)

Arguments

x

an input matrix, data.frame, or list. It should be in "wide" or "long" format. The "wide" format is n x 2m matrix, where n represents a number of points (samples) and m represents a number of planes (layers).

The "long" format is basically nm x 2 matrix, but accepts different number of samples across planes (layers).

format

format of an input x, "wide" or "long".

segment_mat

a 2-column matrix to specify segment (edge) connections by the indexes of connecting points. The index is calculated based on the "long" format. It is required particularly when format is "long". If NULL and format is "wide", all points in the same row are connected.

col

colors of points.

label

labels of planes (layers).

optimize_coordinates

a logical value indicating whether to optimize points coordinates across layers.

maxiter

a maximum number of iterations for optimization by simulated annealing.

initT

a initial value of the temperature parameter T for simulated annealing.

alpha

a numerical value of the cooling rate alpha for simulated annealing. If NULL, alpha will be set as 1 - 5 / maxiter.

score_function

an objective score function to minimize, "angle" or "length". If "angle", the sum of angles of segments (edges) from the flat ground (the horizontal line) will be minimized. If "length", the sum of length of segments will be minimized.

progress

a logical value indicating whether to show optimization progress.

optimized_point_mat

a matrix of pre-optimized point coordinates that was returned in a previous run.

return_coordinates

a logical value indicating whether to return points coordinates across layers.

norm

a logical value indicating whether to normalize point scales. Point coordinates for x axis, px, will be normalized as: (px - min(px)) / (max(px) - min(px)) * scale - shift. Ditto for y axis.

norm_scale

a numerical value of the scaling parameter for normalization. If NULL, the default value is 2.

norm_shift

a numerical value of the shifting parameter for normalization. if NULL, the default value is 1.

z_interval

a numerical value of the interval length between planes (layers).

point_size

a point size.

plane_col

colors of planes.

plane_alpha

alpha transparency of planes.

border_col

a color of borders surrounding a plane.

border_alpha

alpha transparency of borders.

border_lwd

line width of borders.

segment_col

colors of segments (edges). If NULL, the same color for connecting points is used.

segment_alpha

alpha transparency of segments (edges).

segment_lwd

line width of segments (edges).

new_device

a logical value indicating whether to open a new rgl device.

reset_view

a logical value indicating whether to reset viewpoint perspective.

userMatrix

userMatrix parameter to be passed to rgl::par3d.

windowRect

windowRect parameter to be passed to rgl::par3d.

plot_2d_panels

a logical value indicating whether to additionally plot two-dimensional panels of each layer.

Author(s)

Masahiro Kanai

Examples

data("grimon.example")
grimon(x = example, col = example_col, label = 1:6,
       optimize_coordinates = TRUE, maxiter = 1e3,
       score_function = "angle",
       segment_alpha = 0.5)

mkanai/grimon documentation built on March 17, 2022, 6:33 p.m.