View source: R/locator.haplo.q
locator.haplo | R Documentation |
Much like the R/Splus locator function is used to find x-y coordinates on a plot. Find all x-y coordinates that are chosen by the user's mouse clicks. Then print haplotype labels at the chosen positions.
locator.haplo(obj)
obj |
An object (of class haplo.score) that is returned from haplo.score. |
After plotting the results in obj, as from plot(obj), the function locator.haplo is used to place on the plot the text strings for haplotypes of interest. After the function call (e.g., locator.haplo(obj)), the user can click, with the left mouse button, on as many points in the plot as desired. Then, clicking with the middle mouse button will cause the haplotypes to be printed on the plot. The format of a haplotype is "a:b:c", where a, b, and c are alleles, and the separator ":" is used to separate alleles on a haplotype. The algorithm chooses the closest point that the user clicks on, and prints the haplotype either above the point (for points on the lower-half of the plot) or below the point (for points in the upper-half of the plot).
List with the following components:
x.coord |
Vector of x-coordinates. |
y.coord |
Vector of y-coordinates. |
hap.txt |
Vector of character strings for haplotypes. |
haplo.score
# follow the pseudo-code
# score.out <- haplo.score(y, geno, trait.type = "gaussian")
# plot(score.out)
# locator.haplo(score.out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.