Learn R Programming

synbreed (version 0.11-2)

LDDist: LD versus distance Plot

Description

Visualization of pairwise Linkage Disequilibrium (LD) estimates generated by function pairwiseLD versus marker distance. A single plot is generated for every chromosome.

Usage

LDDist(LDdf,chr=NULL,type="p",breaks=NULL,n=NULL,file=NULL,fileFormat="pdf",
       onefile=TRUE,colL=2,colD=1,...)

Arguments

LDdf
object of class LDdf which is the output of function pairwiseLD and argument type="data.frame"
chr
numeric scalar or vector. Return value is a plot for each chromosome in chr. Note: Remember to add in a batch-script one empty line for each chromosome, if you use more than one chromosome!
type
Character string to specify the type of plot. Use "p" for a scatterplot, "bars" for stacked bars or "nls" for scatterplot together with nonlinear regression curve according to Hill and Weir (1988).
breaks
list containing breaks for stacked bars (optional, only for type="bars"). Components are dist with breaks for distance on x-axis and r2 for breaks on for r2 on y-axis. By default, 5 equal spaced categori
n
numeric. Number of observations used to estimate LD. Only required for type="nls".
file
character. path to a file where plot is saved to (optional).
fileFormat
character. At the moment two file formats are supported: pdf and png. Default is "pdf".
onefile
logical. If fileFormat = "pdf" you can decide, if you like to have all graphics in one file or in multiple files.
colL
The color for the line if type="nls" is used. In other cases without a meaning.
colD
The color for the dots in the plot of type="nls" and type="p"
...
Further arguments for plot

References

For nonlinear regression curve: Hill WG, Weir BS (1988) Variances and covariances of squared linkage disequilibria in finite populations. Theor Popul Biol 33:54-78.

See Also

pairwiseLD, LDMap

Examples

Run this code
library(synbreedData)
# maize data example
data(maize)
maizeC <- codeGeno(maize)

# LD for chr 1
maizeLD <- pairwiseLD(maizeC,chr=1,type="data.frame")
# scatterplot
LDDist(maizeLD,type="p",pch=19,colD=hsv(alpha=0.1,v=0))

# stacked bars  with default categories
LDDist(maizeLD,type="bars")

# stacked bars  with user-defined categories
LDDist(maizeLD,type="bars",breaks=list(dist=c(0,10,20,40,60,180),
r2=c(1,0.6,0.4,0.3,0.1,0)))

Run the code above in your browser using DataLab