# NOT RUN {
# True model
# True graph (V1 --> T1 --> T2 --> T3)
# Where V1 is a genetic variant (GV) and T1, T2, and T3 are phenotypes
tarmat_s1 <- matrix(0,
nrow = 4,
ncol = 4)
colnames(tarmat_s1) <- c("V1", "T1", "T2", "T3")
rownames(tarmat_s1) <- colnames(tarmat_s1)
# Create an adjacency matrix for the true graph
tarmat_s1[1, 2] <- 1
tarmat_s1[2, 3] <- 1
tarmat_s1[3, 4] <- 1
# Graph object of the true graph
Truth <- as(tarmat_s1,
"graphNEL")
# Inferred graph (V1 --> T1 <-- T2 --> T3)
# Where V1 is a genetic variant (GV) and T1, T2, and T3 are phenotypes
tarmat_s2 <- matrix(0,
nrow = 4,
ncol = 4)
colnames(tarmat_s2) <- c("V1", "T1", "T2", "T3")
rownames(tarmat_s2) <- colnames(tarmat_s2)
# Create an adjacency matrix for the inferred graph
tarmat_s2[1, 2] <- 1
tarmat_s2[3, 2] <- 1
tarmat_s2[3, 4] <- 1
# Graph objects for the inferred graph
Inferred <- as(tarmat_s2,
"graphNEL")
# Recall and Precision
Recall_Precision <- RecallPrecision(Truth,
Inferred,
GV = 1,
includeGV = TRUE,
edge.presence = 1.0,
edge.direction = 0.5)
# }
Run the code above in your browser using DataLab