normalizeDWNW | R Documentation |
Normalizes Down weights so that the sum of weights of edges exiting a node is 1
normalizeDWNW(g, freqs, no.of.children, A, downWeights)
g |
graph (a Directed Acyclic Graph) |
freqs |
observed genotype frequencies |
no.of.children |
number of children for each node |
A |
adjacency matrix of G |
downWeights |
Down weights as computed by computeDWNW |
a vector containing the normalized Down weights for each edge
require(dplyr) require(igraph) preproc <- example_dataset() %>% dataset_preprocessing samples <- preproc[["samples"]] freqs <- preproc[["freqs"]] labels <- preproc[["labels"]] genes <- preproc[["genes"]] g <- graph_non_transitive_subset_topology(samples, labels) # prepare adj matrix A <- as.matrix(as_adj(g)) # pre-compute exiting edges from each node no.of.children <- get_no_of_children(A,g) upWeights <- computeUPW(g, freqs, no.of.children, A) normUpWeights <- normalizeUPW(g, freqs, no.of.children, A, upWeights) downWeights <- computeDWNW(g, freqs, no.of.children, A, normUpWeights) normalizeUPW(g, freqs, no.of.children, A, downWeights)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.