Description Usage Arguments Details Value Author(s) Examples
A heuristic to prune spurious edges in a pehnotypic hierarchy
1 | prune.graph(g,cutIN=NULL,cutOUT=NULL,quant=.95,verbose=TRUE)
|
g |
an adjacency matrix or a 'graphNEL' object |
cutIN |
minimum number of missing in-edges required to cut all in-edges. Default |
cutOUT |
minimum number of missing out-edges required to cut all out-edges |
quant |
if 'cutIN' or 'cutOUT' are not assigned, a quantile 'quant' of the distribution of missing in- or out-edges for all nodes is used |
verbose |
Default: TRUE |
prune.graph
provides a heuristic approach to prune surious edges.
prune.graph
compares the input graph to its transitive closure, and counts for each node how many incoming and outgoing edges are missing.
If the number is bigger than a user-defined cutoff, all incoming (outgoing) edges are removed.
graph |
the pruned phenotypic hierarchy (a 'graphNEL' object) |
removed |
number of removed edges |
missing.in |
number of missing in-edges for each node |
missing.out |
number of missing out-edges for each node |
Florian Markowetz
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # a transitively closed core with two spurious edges
g <- matrix(0,5,5)
g[1,2] <- 1
g[2,c(3,4)] <- 1
g[3,4] <- 1
g[4,5] <- 1
dimnames(g) <- list(LETTERS[1:5],LETTERS[1:5])
g <- as(g,"graphNEL")
# prune graph
gP <- prune.graph(g)
# plot
if(require(Rgraphviz)){
par(mfrow=c(1,2))
plot(g,main="two spurious edges")
plot(gP$graph,main="pruned")
}
|
cutIN: 3 - cutOUT: 3
Removed 1 edge
Loading required package: Rgraphviz
Loading required package: graph
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: 'BiocGenerics'
The following objects are masked from 'package:parallel':
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from 'package:stats':
IQR, mad, sd, var, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, basename, cbind, colMeans, colSums, colnames,
dirname, do.call, duplicated, eval, evalq, get, grep, grepl,
intersect, is.unsorted, lapply, lengths, mapply, match, mget,
order, paste, pmax, pmax.int, pmin, pmin.int, rank, rbind,
rowMeans, rowSums, rownames, sapply, setdiff, sort, table, tapply,
union, unique, unsplit, which, which.max, which.min
Loading required package: grid
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.