View source: R/compile_pedigree_sex_issues.R
compile_pedigree_sex_issues | R Documentation |
After a pedigree is inferred, some of the parents might both be of the same sex. This function looks through the pedigree and first warns the user if a pair is compatible (opposite sexes) but the pa is listed as Male or the ma is listed as Female. Then it finds all parent pairs whose members have the same reported sex and it finds the connected components of all of these, and it makes a plot of those as well. It does the same thing for fish with no reported sex.
compile_pedigree_sex_issues(
Ped,
strip_pattern = "_Coyote-Valley$|_Warm-Springs$",
scc_pointsize = 7,
suc_pointsize = 7
)
Ped |
A tibble that has the inferred pedigree in it.
This should already be filtered using whatever criteria you want to use (FDR, etc.)
This will typically be the output from |
strip_pattern |
A pattern that should be removed from IDs. This is used for the case where certain samples appear in multiple hatcheries and the occurrence in one of the hatcheries was denoted by adding a suffix to the ID. The default is set up for that as an example |
scc_pointsize |
The number passed into ggraph for the size of node points for the sex-clashing clusters plot. For the example data, this is set as 7 so that plot works well when printed at 30 inches by 30 inches as a PDF. |
suc_pointsize |
The number passed into ggraph for the size of node points for the sex-unknown clusters plot. For the example data, this is set as 7 so that plot works well when printed at 30 inches by 30 inches as a PDF. |
Returns a list with five components:
parent_pairs_graph
: a tidygraph object that holds the adjencies between parents and some of their meta data
sex_clash_clusters
: the portion of the tidygraph that has all the information about the connected
components that include at least one sex-clashing parent pair.
sex_unknown_clusters
: the portion of the tidygraph that has all the information about the connected
components that include at least one individual with sex unknown (i.e. not recorded in the data).
sex_clash_clusters_plot
: a faceted ggplot object. Each panel shows one of the connected components with a
sex-clashing pair.
sex_unknown_clusters_plot
: a faceted ggplot object. Each panel shows one of the connected components with a
sex-unknown member.
# the package comes with a pedigree for this example:
ped <- ped_with_sex_issues
issues <- compile_pedigree_sex_issues(ped)
# to look at the graph you would do like:
## Not run:
# sex clashing clusters
ggsave(
issues$sex_clash_clusters_plot,
filename = "clash.pdf",
width = 30,
height = 30
)
# sex unknown clusters
ggsave(
issues$sex_unknown_clusters_plot,
filename = "unknown.pdf",
width = 15,
height = 15
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.