normalizeUPW: Up weights normalization

View source: R/weights.R

normalizeUPWR Documentation

Up weights normalization

Description

Normalizes up weights so that the sum of weights of edges entering in a node is 1

Usage

normalizeUPW(g, freqs, no.of.children, A, upWeights)

Arguments

g

graph (a Directed Acyclic Graph)

freqs

observed genotype frequencies

no.of.children

number of children for each node

A

adjacency matrix of G

upWeights

Up weights as computed by computeUPW

Value

a vector containing the normalized Up weights for each edge

Examples

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)
normalizeUPW(g, freqs, no.of.children, A, upWeights)


redsnic/CIMICE documentation built on March 30, 2022, 2:46 a.m.