summaryW: Summarize infector probability (W) for phylogenetic trees

View source: R/W_utils.R

summaryWR Documentation

Summarize infector probability (W) for phylogenetic trees

Description

This function will summarize results for W calculated for a phylogenetic tree.

Usage

summaryW(sim, tm, W1, tree, code, prefix = NULL, labels = TRUE)

Arguments

sim

Simulation number to know the parameter values that network was simulated.

tm

Transmission matrix.

W1

Infector probability calculated on true trees (all region tips)

code

string to identify if W was calculated on true or simulated trees.

prefix

prefix to save results. If prefix = NULL, results will be saved as W.csv.

labels

if labels = TRUE, labels of 0 or 1 will be created for ROC curves.

Value

a data frame of 1 row with the following values:

all_data <- data.frame(sim, 1. Sim = simulation number (to get parameter values).

2. Total tips = total number of tips in the phylogenetic tree.

3. n_tips_region = total number of tips from region in the phylogenetic tree.

4. n_tips_global = total number of tips from global in the phylogenetic tree.

5. n_trans_W_all = total number of transmission pairs in which W was calculated. Here we consider all infector probability values.Here W was calculated for the combination of tips in the phylogenetic tree.

6. n_trans_tm = total number of true transmissions based on the transmission matrix (tm). Note that the tm will be subset to include only IDs that are also observed in the phylogenetic tree.

7. n_true_trans_W = total number of true transmission independent of infector probability (W) values. Here is the true transmission when compared to the transmission matrix.

8. n_W80_all = number of transmission pairs in which W >= 80

9. n_W80_correctDonorRecipt = number of transmission pairs in point 8 that is a true transmission (when comparing to the transmission matrix).

10. n_W80_swapDonorRecipt = number of transmission pairs in point 8 that is a true transmission (when comparing to the transmission matrix), but there was a swap between donor and recipient.

11. expected_n_trans = expected number of transmission defined as the sum of all infector probability (W) values.


thednainus/HIVepisimAnalysis documentation built on Sept. 21, 2023, 7:32 a.m.