What is snp.plotter?

sp.download.png snp.plotter is an R package that creates publishable-quality plots of p-values using single SNP and/or haplotype data. Main features of the package include options to display a linkage disequilibrium (LD) plot and the ability to plot multiple sets of results simultaneously. Plots can be created using global and/or individual haplotype p-values along with single SNP p-values. Images are created as either Portable Document Format (PDF) or Encapsulated (EPS) files.

What do snp.plotter images look like?

Here is a sample image as both a PDF and a EPS image. PDF images can be viewed using the free Adobe Reader software. EPS (or PDF) images can be viewed using front-end software for Ghostscript, a Postscript and PDF interpreter: Ghostview and GV for Unix/X11 systems and GSView for Windows.

Who are the intended users of snp.plotter?

Researchers conducting gene association studies who need to create images showing results in the form of p-values of their work along with a linkage disequilibrium plot to show the underlying structure of the study population. Because snp.plotter is a visualization tool, the type of study design used either family-based, case-control, or a combination is irrelevant.

What are the main features of snp.plotter?


up_arrow.png

How do I install snp.plotter?

snp.plotter requires the installation of R, the statistical computing software, freely available here for Linux, Windows, or MacOS. snp.plotter uses three contributed packages: grid, lattice, and genetics available from the R Project website. snp.plotter can be downloaded here. Packages in the current working directory of R can be installed using the install.packages command.

In Windows, make sure that you have downloaded the .zip version of a package, which is a pre-compiled binary. Change the word PACKAGE_FILENAME to the name of the package being installed.

install.packages("PACKAGE_FILENAME.zip", repos=NULL)
In Unix/Linux, make sure that you have downloaded a source package, the .tar.gz version, of a package. Change the word PACKAGE_FILENAME to the name of the package being installed.
install.packages("PACKAGE_FILENAME.tar.gz", repos=NULL)

The following error indicates that additional packages need to be installed: PACKAGE_FILENAME can be grid or genetics. These packages can be downloaded from CRAN. and installed using the same process described above.
Error: package 'PACKAGE_FILENAME' could not be loaded

How is snp.plotter used?

Once snp.plotter and its dependencies are installed, snp.plotter can be loaded into R using this command:
library(snp.plotter)

snp.plotter is then run using the following command. Explanation of snp.plotter configuration files and input files is provided in the file formats section. The configuration file specifies all the characteristics for the plot to be produced and the names of the data files to be used as input. Example configuration and input files are also provided.

snp.plotter(config.file="config.txt")
Information about the configuration options is provided in the documentation, which can viewed from within R using this command.
?snp.plotter

How do I incorporate the snp.plotter figures into my publication?

The listing below shows the most common scenarios for inclusion of a figure into a publication; methods will vary based on the intended publication type:

  1. Inclusion of PDF into Word document: PDF images can be selected and copied using the Adobe Reader snapshot tool snapshot_tool.png. These images can then be pasted into a Word document.
  2. Inclusion of PDF/EPS into LaTeX document: Images included into DVI file using latex must be in the EPS format. PDF documents created by pdflatex cannot use files in the EPS format and requires the PDF format. The following is basic LaTeX code for including an image. FILENAME must be changed to the appropriate filename.
    \documentclass{article}
    
    \usepackage{graphicx}
    
    \begin{document}
    \begin{figure}
    \includegraphics{FILENAME}
    \end{figure}
    \end{document}
    
  3. Conversion of PDF/EPS file into other formats using Ghostscript: Ghostscript can be used to convert PDF and EPS files into a variety of raster formats such as JPG, BMP, PNG, etc. The following commandline converts an EPS image into a JPG image; the resulting image has a resolution of 300 DPI and pixel dimension of 1050x1050 pixels. Further information on the usage of Ghostscript can be found here. FILENAME must be changed to the appropriate filename.
    gs -q -dNOPAUSE -dSAFER -dBATCH -r300 -g1050x1050 -sOutputFile=FILENAME.jpg -sDEVICE=jpeg FILENAME.eps
    

up_arrow.png

Are there other ways to interact with snp.plotter?

There is an optional web interface for snp.plotter using Rpad available for download; (screenshot). Rpad allows the creation of web interfaces for R so that end users do not need to install anything on their computers. The web interface is best suited to intranet environments since users have complete access to any command in R and any system command. The instructions presented here are for local installation and usage; snp.plotter must be installed on the machine running Rpad. Instructions for server deployment are presented on the Rpad website.

Once installed Rpad is run using the following two commands:

library(Rpad)
Rpad()
In Windows, the web interface (snp_plotter.Rpad) is placed in C:\Program Files\R\R-2.3.1\library\Rpad\basehtml (location may vary depending on R version and where R was originally installed). If Rpad is running, snp.plotter can then be accessed at http://127.0.0.1:8079/snp_plotter.Rpad After setting the various options and clicking "Create Plot", users will see various output messages; the last message provides the location of where the created image can be found.

The interface includes the majority of features, but is limited to one dataset. The snp.plotter interface can be extended with basic knowledge of HTML and R to manipulate options presented or to perform additional analysis the researcher may require.


up_arrow.png

What file types are used by snp.plotter?

snp.plotter uses tab-delimited text files as input files. These files can be created in a basic text editor such as Notepad in Windows or Excel saved as tab-delimited files using the "Save As" option. A dataset is composed a configuration file, a SNP and haplotype file for each result set, one genotype file, and an optional palette file. More information about these files can be found in the documentation.


up_arrow.png

Where can I get the source code of snp.plotter for my own project?

up_arrow.png

Authors

Augustin Luna, B.S.
Postbaccalaureate Intramural Research Training Award Fellow
Clinical Brain Disorders Branch (CBDB)/Genes, Cognition, and Psychosis Program (GCAP), National Institute of Mental Health (NIMH), National Institutes of Health (NIH)

B.S., Biomedical Engineering, Georgia Institute of Technology

and

Kristin Nicodemus, Ph.D., M.P.H.
Statistical Geneticist/Genetic Epidemiologist
Genes, Cognition and Psychosis Program, IRP, NIMH, NIH

Acknowledgements

Anushka Aqil - For her feedback on the software
CBDB/GCAP, NIMH, NIH

Brandeis University


up_arrow.png