tuneThreshold: Tunes adjacency matrix cutoff threshold

Description Usage Arguments Value Examples

View source: R/tuneThreshold.R

Description

Performs a search over possible cutoff thresholds ε. All edges with an importance score below ε are removed and the random forests are retrained without those connections.

Usage

1
tuneThreshold(data, ugene, cutoffs = NULL, showPareto = TRUE)

Arguments

data

Required. Same data as provided to inferNetwork().

ugene

Required. Output of the inferNetwork() function.

cutoffs

Optional. When not provided, edges are removed in two ways. Both cases start with a sparse network, one that has at least one connection/edge per column of the network matrix. This ensures that for each node, at least one node is used as input to the model.

  • Column-wise: The sparsest network is that with the maximum of each column as its only connections. Edges are incrementally added by including edges with the next highest importance score for each column. This continues until each column has exactly one missing edge.

  • Step-wise: Let n be the number of genes. Start with taking the maximum n elements as edges. Add more edges in descending order of the importance score until there is at least one connection per column. Edges are incrementally added by including edges with the next highest importance score over the entire matrix..

If provided, the cutoffs should be a vector of double numerics between 0 and 1 exclusive. For each cutoff, all connections in the learned network with values below the cutoff will be masked. If the result of the mask happens to remove an entire column of the network matrix, there will be an error.

showPareto

Optional. If TRUE (default), shows a plot of the mean squared residual error of the fitted random forests for all nodes, versus the complexity of the network. The ideal network complexity should be the smallest number of connections at which the error drops steeply (known as an Pareto front).

Value

An object of class "ugene.analysis" that contains the following:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
   # Automatic threshold tuning
   ugene <- inferNetwork(Repressilator, mtry = 3L)
   result <- tuneThreshold(Repressilator, ugene)

   # take a look at network corresponding to the third and seventh
   # step-wise mask (both has drops in mse)
   inferNetwork(Repressilator, mask = result$stepMasks[[3]], showPlot = TRUE)
   inferNetwork(Repressilator, mask = result$stepMasks[[7]], showPlot = TRUE)

   # Custom threshold tuning
   ugene <- inferNetwork(Repressilator, mtry = 3L)
   result <- tuneThreshold(Repressilator, ugene,
                           cutoffs=seq(from = 0.1, to = 0.5, by = 0.05))

## End(Not run)

tianyu-lu/dynUGENE documentation built on Jan. 7, 2021, 6:27 p.m.