barycentre: Computation of the barycentre-coordinate of a node connected...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/barycentre.R

Description

barycentre provides an updated coordinate value for a node that is connected to nodes in a different layer of a bigraph. It is computed as the average of coordinates of the adjacent nodes, where weighted edges are considered as multi-edges collapsed into one.

Usage

1
barycentre(edge.weight, coordinates = NULL)

Arguments

edge.weight

a vector containing the intersection sizes (edge weights) between a given node (from one of the partitionings) and all nodes in the other.

coordinates

a vector indicating the coordinates of the adjacent nodes. If it is not provided, then they are evenly spaced assuming a layout from top downwards.

Details

The node under consideration, from a given partitioning, is assigned a new position using the barycentre algorithm. The coordinates of the incident nodes are considered as many times as the corresponding edge weights indicate, and the new position for the node is given by the average over this set of coordinates.

Value

position

a nsumber indicating the barycentre-coordinate of the node under consideration.

Author(s)

Aurora Torrente aurora@ebi.ac.uk and Alvis Brazma brazma@ebi.ac.uk

References

Torrente, A. et al. (2005). A new algorithm for comparing and visualizing relationships between hierarchical and flat gene expression data clusterings. Bioinformatics, 21 (21), 3993-3999.

See Also

flatVSflat, flatVShier

Examples

1
2
3
4
5
6
7
8
    # simulated data
    clustering1 <- c(rep(1, 5), rep(2, 10), rep(3, 10))
    clustering2 <- c(rep(1, 6), rep(2, 6), rep(3, 4), rep(4, 9))
    weights <- table(clustering1, clustering2)
    barycentre(weights[1, ], 1:4)
    barycentre(weights[1, ])
    barycentre(weights[2, ], 1:4)
    apply(weights, 1, barycentre, 1:4)

Example output

Warning message:
no DISPLAY variable so Tk is not available 
[1] 1
[1] 4
[1] 2.2
  1   2   3 
1.0 2.2 3.9 

clustComp documentation built on Nov. 8, 2020, 5:54 p.m.