Learn R Programming

synbreed (version 0.9-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,file=NULL,n=NULL,...)

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.
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
file
character. path to a file where plot is saved as pdf (optional).
n
numeric. Number of observations used to estimate LD. Only required for type="nls".
...
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
# 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,col=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