visped | R Documentation |
visped
function draws a graph of a full or compact pedigree.
visped(ped, compact = FALSE, outline = FALSE, cex = NULL, showgraph = TRUE, file = NULL)
ped |
A data.table including the pedigree tidied by the |
compact |
A logical value indicating whether IDs of full-sib individuals in one generation will be deleted and replaced with the number of full-sib individuals. For example, if there are 100 full-sib individuals in one generation, they will be deleted from the pedigree and be replaced with one individual label of "100" when |
outline |
A logical value indicating whether shapes without label will be shown. A graph of the pedigree without individuals' label is shown when setting |
cex |
NULL or a numeric value changing the size of individual label shown in the graph. cex is an abbreviation of character expansion factor. |
showgraph |
A logical value indicating whether a plot will be shown in the defaulted graphic device, such as the Plots panel of Rstudio. It is useful for quick viewing of the pedigree graph without opening the pdf file. However, the graph on the defaulted graphic device may be not legible, such as overlapped labels, aliasing lines due to the restricted width and height. It's a good choice to set |
file |
NULL or a character value means whether the pedigree graph will be saved in a pdf file. The graph in the pdf file is a legible vector drawing, and labels isn't overlapped especially when the number of individuals is big and width of the individual label is long in one generation. It is recommended that saving a pedigree graph in the pdf file. The default value is NULL. |
This function takes a pedigree tidied by the tidyped
function, outputs a hierarchical graph for all individuals in the pedigree. The graph can be shown on the defaulted graphic device and be saved in a pdf file. The graph in the pdf file is a vector drawing, is legible and isn't overlapped. It is especially useful when the number of individuals is big and the width of individual label is long in one generation. This function can draw the graph of a very large pedigree (> 10,000 individuals per generation) by compacting the full-sib individuals. It is very effective for drawing the pedigree of aquatic animal, which usually including many full-sib families per generation in the nucleus breeding population. The outline of a pedigree without individuals' label is still shown if the width of a pedigree graph is longer than the maximum width (200 inches) of the pdf file.
In the graph, two shapes and three colors are used. Circle is for individual, square is for family. Dark sky blue means male, dark golden rod means female, dark olive green means unknown sex. For example, one circle with dark sky blue means a male individual; One square with dark golden rod means all female individuals in a full-sib family when compact = TRUE
.
No returned values. The graph will be plotted directly on graphic devices.
library(data.table) # Drawing a simple pedigree simple_ped simple_ped_tidy <- tidyped(simple_ped) visped(simple_ped_tidy) # Drawing a simple pedigree of a individual with id of J5X804 simple_ped_J5X804_tidy <- tidyped(simple_ped,cand=c("J5X804")) visped(simple_ped_J5X804_tidy) # Drawing the graph in the pdf file visped(simple_ped_J5X804_tidy,file="output.pdf") # Drawing a compact pedigree # The candidates' labels in 2007 cand_labels <- big_family_size_ped[(Year == 2007) & (substr(Ind,1,2) == "G8"),Ind] big_ped_tidy <- tidyped(big_family_size_ped,cand=cand_labels) visped(big_ped_tidy,compact=TRUE) visped(big_ped_tidy,compact=TRUE, file="output.pdf") # Individual labels are not shown visped(big_ped_tidy,compact=TRUE, outline=TRUE, file="output.pdf")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.