minPath: Minimal path

View source: R/gelPaths.R

minPathR Documentation

Minimal path

Description

Obtain the path of links through the feature space that links two traits together such that the probability of obtaining any link from the null distribution is minimized. For the nodeNames vector, note that trait names come before feature names.

Usage

minPath(s, t, gm, clusters, r = 1, plotpath = TRUE, nodeNames = NULL)

Arguments

s

a string (if nodeNames is supplied) or an index (otherwise) corresponding to the starting node of the path

t

a string (if nodeNames is supplied) or an index (otherwise) corresponding to the ending node of the path

gm

the output of gelMatrix.

clusters

a numeric vector of cluster labels, usually obtained from the labels attribute of gammaCluster

r

a regularization term. More info in the details section.

plotpath

whether to plot the minimal path.

nodeNames

a character vector of names for the nodes in the network. Trait names come before feature names

Details

For regularization, consider the following three options, where N is the total number of nodes:

1. r = 1 (no regularization)

2. r = 1 - 2 / (N*(N-1)) (the smallest meaningful p-value is the probability of drawing the single greatest association out of the entire network)

3. r = 1 - 1/(N-1) (the smallest meaningful p-value is the probability of drawing a given feature's closest neighbor out of the entire network)

Value

pvals

the individual p-values of each link from the first node to the last node. The sum of these p-values is the total distance

clusters

cluster labels for each feature in the path

names

the names of the nodes in the path

Author(s)

Anooj Arkatkar

See Also

distBoot, pBoot

Examples

# Load data
data(foldChange)
data(traitData)

# Obtain clusters
c.gm <- gelMatrix(foldChange)
clust <- gammaCluster(c.gm, 7)

# Set up the path data
path.gm <- gelMatrix(foldChange, phen=traitData, squared=TRUE, output="orig")
nodeNames <- c(rownames(traitData), rownames(foldChange))

# Find the minimal path
mp <- minPath("TCDD", "Fat", path.gm, clust$labels, nodeNames=nodeNames)

aarkatkar/gelClust documentation built on May 6, 2022, 12:24 a.m.