Description Usage Arguments Details Value Author(s) See Also Examples
This function removes non-informative pairwise relatedness values from simulated data sets.
1 | cleanuprvals(simdata, ninds)
|
simdata |
A data frame containing pairwise relatedness values for a simulated data set (generated by the |
ninds |
A single value representing the number of simulated pairs that were generated for each degree of relatedness. For example, this value would be 100 if you similated 100 parent-offspring pairs, 100 full-sib pairs, 100 half-sib pairs, and 100 unrelated pairs. |
The familysim
function will generate the defined number of pairs of individuals of known relatedness. However, the coancestry
function calculates relatedness for all pairwise comparisons. We are not interested in most of these. For example, for parent-offspring we are only interested in the relatedness of individuals 1 and 2, 3 and 4, 5 and 6, and so on. We don't care about the relatedness of 1 and 3, 1 and 4, etc. To deal with this, the cleanuprvals
function will remove the unwanted relatedness values, resulting in a data frame containing only the relatedness values of interest (those for the simulated number of pairs for each relatedness value).
A data frame containing pairwise relatedness values for simulated pairs of known relatedness.
Tim Frasier <timothy.frasier@smu.ca>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
#---Load Genotype Data---#
data(GenotypeData)
input <- readgenotypedata(GenotypeData)
#---Create a data set of simulated individuals based on observed allele frequencies---#
sim <- familysim(input$freqs, 100)
#---Calculate pairwise relatedness---#
output <- coancestry(sim, wang = 1)
#---Clean up results to contain only desired relatedness values---#
simrel <- cleanuprvals(output$relatedness, 100)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.