gdist: gdist

gdistR Documentation

gdist

Description

Compute "distance" between two gGraphs using node and edge features.

Distance computation involves (1) assigning a value to each node and edge via value / nvalue / evalue expression (default cn metadata field) (2) assigning a weight to each disjoint interval and edge in the union of the two graphs (log10(width) to intervals and 1 to edges) (3) for each disjoint interval computing a ndist = sum(weight*|value1-value2|)/sum(weight), where if the interval does not exist for one of the graphs we use the value "fill" in place (4) for each (ALT) edge present in one or both graphs compute edist = sum(weight*|value1-value2|)/sum(weight), filling in missing edges as above (5) combining node.coef*ndist + edge.coef*edist

Variations on these distances include defining alternate weight and value expressions for nodes and edges (based on their metadata), changing the padding to align ALT junctions that are not exactly identical.

If graphs are non-haploid (ie have two more intervals for a given reference region) then agg.fun (default min) is used to aggregate the several ndist that map to a that given reference region into a single ndist value for that coordinate.

Usage

gdist(
  gg1,
  gg2,
  weight = quote(log10(width)),
  value = quote(cn),
  nvalue = NULL,
  evalue = NULL,
  nweight = NULL,
  eweight = 1,
  fill = 0,
  normalize = TRUE,
  na.rm = TRUE,
  pad = 1000,
  agg.fun = min,
  node.coef = 1,
  edge.coef = 1,
  verbose = FALSE,
  L = 1
)

Arguments

gg1

first graph (or list of graphs)

gg2

second graph (or list of graphs)

weight

expression on node and edge metadata to compute node and edge weights

value

expression on node and edge metadata compute node and edge value

nvalue

expression on node metadata to compute node value

evalue

expression on edge metadata to compute edge value

nweight

expression on node metadata to compute node weight

eweight

expression on edge metadata to compute edge weight

fill

0 value to fill value for missing nodes and edges

normalize

logical flag specifying whether to divide distance by sum(weight) (if TRUE) or not

na.rm

logical flag specifying whether to remove NA when summing distance (should not be any NA's if value and weight are well specified


mskilab/gGnome documentation built on May 8, 2024, 4:25 p.m.