library(visNetwork)
library(tibble)
library(dplyr)
library(htmlwidgets)
require(visPedigree)
library(dplyr)
library(readxl)
library(plyr)
library(ggenealogy)
A small example to visualize the Pedigree of a the lines involved in the thesis of Fanilo. As it can be seen, most of the parent are in the “100 parents list”. Some genotypes are not in that list (in red) because i) they are the product of two lines that are already on the list, or ii) they are not clearly identified, so we don’t have them in seed stock, such as the case of “PCT14”.
As a side note, the links represented are not direct, as the intermediate generations of selection are not represented in the plot.
Pedigree <- read.csv("C:/Users/CASTRO PACHECO/OneDrive - Cirad/Documents Selection Mada/Visual Pedigree/Pedigree for Fanilo/Liste Pedigree Fanilo.csv")
Nodes = Pedigree %>% select(id, label,group, level)
Crosses_Females = Pedigree %>% select(id, Number_Mother)
Crosses_Females$Gender = "Female"
names(Crosses_Females) =c("to", "from","Gender")
Crosses_Females = Crosses_Females[,c(2,1,3)]
Crosses_Males = Pedigree %>% select(id, Number_Father)
Crosses_Males$Gender = "Male"
names(Crosses_Males) =c("to", "from","Gender")
Crosses_Males = Crosses_Males[,c(2,1,3)]
Crosses = rbind(Crosses_Females, Crosses_Males)
visNetwork(Nodes, Crosses[,c(1,2)]) %>%
visNodes(font = list(size=10)) %>%
visHierarchicalLayout()%>%
visEdges(arrows= "to", col = "gray") %>%
visOptions( nodesIdSelection = TRUE, highlightNearest =
list(enabled = T, degree = 1, hover = T)) %>%
visGroups(groupname = "Fanilo's 50", color = "lightblue") %>%
visGroups(groupname = "Absent in lists", color = "red") %>%
visGroups(groupname = "100 parents list", color = "green") %>%
visLegend()