SD Plots
Synergy Disequilibrium Computation and Plotting for MATLAB
SD Plots
This package supports the computation and plotting of Synergy Disequilibrium plots in MATLAB.

Download
Click the link below to download (approximate download size is 1 MB):

    sdplots.zip

Advanced users can compute SD and construct plots directly in Java. The source code is available below, see the file readme.txt for guidance:

    sdplots-src.zip

System Requirements

  • Requires a computer running Windows 2000 or later, Mac OS X 10.5 or later, or a version of Linux that can run Java SE 5 or later.
  • At least 256 MB of memory required, possibly more for large genotype data sets.
  • Java SE 5 or later is required, available here.
  • Matlab 2007b or later is required.

Installation
Included are two MATLAB .m files, a Java .jar file, and a MATLAB .mat workspace. The MATLAB files and workspace can be placed in your MATLAB working directory. The .jar file is only necessary for creating high-quality PDF SD plots. Follow the instructions below to install this file:

  1. Find your MATLAB installation directory, such as C:\Program Files\MATLAB\2008b, call this $MATLAB_HOME$.
  2. Copy sdplot-1.0.jar to $MATLAB_HOME$/java/jarext.
  3. In MATLAB, run:
        edit classpath.txt
    
  4. Add this line to the bottom of the file:
        $matlabroot/java/jarext/sdplot-1.0.jar
    
  5. Save the file, then restart MATLAB.

Instructions and Parameter Choices
Genotype data should be stored in a two-dimensional array, with the samples along the rows, and the SNPs along the columns. The valid genotype values are:

    0 - Homozygous major allele.
    1 - Homozygous minor allele.
    2 - Heterozygous.
    3 - Missing value.
Phenotype data should be in a one-dimensional array, with length matching the number of rows in the genotype data. The valid phenotype values are:
    1 - Control.
    2 - Case.
To compute the SD, run:
    sd = computeSD(genotypes, phenotypes);
The value at sd(i,j) is the synergy between SNPs i and j with respect to the phenotype. The value at sd(i,i) is the self-synergy of SNP i with respect to the phenotype. This is equal to the negative of the mutual information between SNP i and the phenotype.

To create a PDF SD plot, ensure that the above installation instructions have been followed. A one-dimensional cell array of SNP names is required. Then run:

    sdplot(sd, snps, highlights, gaps)
The variables are:
  • sd - The sd result from computeSD.
  • snps - The cell array of snp names.
  • highlights - The indices of SNPs to highlight in the plot. This can be left empty ([]).
  • gaps - The indices of SNPs after which to place a gap. This is useful when plotting sets of SNPs from two different distant regions or from two different chromosomes. This can also be empty.
Once completed, a PDF file named SDPlot.pdf is placed in the current MATLAB's working directory.

Example
A simulated "toy example" is found in the workspace example.mat. You can generate the SD plot, as explained above, by typing:

    sd = computeSD(genotypes, phenotypes);
    sdplot(sd, snps, [], [])