phsc.get.most.likely.transmission.chains.greedy: Reconstruct most likely transmission chains, greedy algorithm

View source: R/phyloscan.fun.private.R

phsc.get.most.likely.transmission.chains.greedyR Documentation

Reconstruct most likely transmission chains, greedy algorithm

Description

This function reconstructs a maximum probility transmission network from the scores associated with directed and undirected edges. The algorithm starts by keeping the edge with highest score. It then removes the competitor in the opposite direction, and any conflicting edges that would result in indegrees larger than one. By construction, all removed edges have lower probability. The algorithm proceeds until all edges have been processed.

Usage

phsc.get.most.likely.transmission.chains.greedy(rtnn, verbose = 0)

Arguments

rtn

data.table with network scores for all individuals that could form a network. Must contain columns 'ID1','ID2','IDCLU','GROUP','TYPE','POSTERIOR_SCORE','KEFF'.

Value

new data.table with added columns LINK_12 LINK_21 (either 1 or 0), and MX_PROB_12 MX_PROB_21 (associated posterior probabilities)


olli0601/Phyloscanner.R.utilities documentation built on April 21, 2024, 1:59 p.m.