plot.snp.dprime {chopsticks} | R Documentation

## Function to draw the pairwise D' in a eps file

### Description

`plot.snp.dprime` takes a `snp.dprime` object and draw an eps file to visualize the pairwise D', $r^2$ and LOD.

### Usage

    ## S3 method for class 'snp.dprime'
    plot(x, filename, scheme = "standard", do.notes = FALSE,
    metric=NULL, ...)

### Arguments

`x` | An object of class `snp.dprime`
`filename` | The output file name, preferably ending with ".eps" (not enforced)
`scheme` | The colour scheme used. Valid values are "standard" for the Haploview default, and "rsq" for grayscale $r^2$. More may come later
`do.notes` | Boolean for whether to generate pdf annotation-related code
`metric` | An integer vector, detailing the chromosome position of the SNP, to drawa scaled metric of the location of the SNP. If NULL, no metric would be drawn
`...` | place holder

### Details

Annotation is a little used pdf features where certain part of a pdf file are hot spots where one can get pop-up balloons containing extra information, which doesn't appear in print. This is written to imitate the extra information one can get from right-clicking in Haploview's GUI.

### Value

return nothing. Write a file as a result. And if `do.notes` is specified, Will also suggest user to execute `ps2pdf -dEPSCrop <filename>` to get a suitable pdf.

### Note

Unfortunately, there are two problems with annotations: only Acrobat Reader (out of all the pdf viewers, e.g. xpdf, kpdf, evince, various ghostscript based viewers) implements the feature, and a few thousand annotations can really make Acrobat Reader crawl.

Also, Acrobat Reader has an implementation limit of 200 inches of the widest dimension of a document. This translates to 1200 snps in the current implementation of the drawing code, hence a warning is emitted that pdf written this way is not viewable by Acrobat Reader.(but viewable by xpdf, etc). A work around is possible based on LaTeX pdfpage, or eps can be included with scaling in another document, to stay inside 200 inches.

In the future, one might want to put some additional scaling code to fit the whole drawing within an A4, for example.

There is a Google Summer of code http://code.google.com/soc/ 2006 project to improve kpdf's annotation support. http://wiki.kde.org/tiki-index.php?page=KDE%20Google%20SoC%202006%20ideas#id60851 I am involved.

### Author(s)

Hin-Tak Leung htl10@users.sourceforge.net

### References

Clayton, D.G. and Leung, Hin-Tak (2007) An R package for analysis of whole-genome association studies. Human Heredity 64:45-51.
GSL (GNU Scientific Library) http://www.gnu.org/software/gsl/
The postscript language reference manual: http://www.adobe.com/products/postscript/pdfs/PLRM.pdf
The pdf specification: http://partners.adobe.com/public/developer/en/pdf/PDFReference16.pdf

### See Also

`snp.dprime-class`

### Examples

    data(testdata)
    # As for ld.snp example ...
    data(testdata)
    ldinfo <- ld.snp(Autosomes, start=1, end=500, depth=50)
    # Now plot to an eps file
    plot.snp.dprime(ldinfo, filename="test.eps")

[Package chopsticks version 1.52.0 Index]