# SNPLINK -- Installation and User Guide

# 

# Emily Webb, February 2005

emily.webb@icr.ac.uk

## *SNPLINK: multipoint linkage analysis of densely distributed SNP data incorporating automated linkage disequilibrium removal*

SNPLINK is a Perl script that performs full genome linkage analysis of
high-density single nucleotide polymorphism (SNP) marker sets. It first
removes unlikely genotypes and performs parametric and non-parametric
linkage analysis in a fully automated fashion. The presence of linkage
disequilibrium (LD) between closely spaced SNP markers can falsely
inflate linkage statistics. SNPLINK removes LD from the marker sets in
an automated fashion and then carries out linkage analysis after LD has
been removed. SNPLINK can compute both parametric and non-parametric
statistics, utilising the freely available ALLEGRO and MERLIN software.
Graphical outputs of whole genome multipoint linkage statistics are
provided allowing comparison of results before and after the removal of
LD.

# Installation

SNPLINK is suitable for use on all Unix operating systems. It is not
currently compatible with Windows. Installation is straightforward.

SNPLINK requires that MERLIN (used for nonparametric analysis), ALLEGRO
(used for parametric analysis), R and PERL be installed on the system.
All are freely available (registration may be required) at the following
websites:

Merlin - <http://www.sph.umich.edu/csg/abecasis/Merlin>

Allegro - send email to <allegro@decode.is>

R - [http://www.r-project.org](http://www.r-project.org/)

Perl - <http://www.perl.com/download.csp>

SNPLINK has been fully tested on versions Merlin v0.10.1, Allegro v1.1,
R v1.8.1 and Perl v5.0.

The SNPLINK installation consists of eight files:

-   Perl modules -- snplinkfunctions.pm, snplinkfunctionspar.pm

-   Perl script -- snplink.pl

-   Manual -- Installation and user guide.doc

-   Example input files -- example1.in, example2.in

-   Example pedigree and marker information files -- example-chr1.pre,
    example-chr1.dat

To run SNPLINK, save these files into the folder where the analysis is
to be undertaken.

#  

# Instructions

## 

## Preparation of input files

SNPLINK undertakes linkage analysis and accepts pedigree and marker
information files in standard LINKAGE format, as generated by the
GeneChip^®^ DNA Analysis Software (GDAS v3.0.2) from Affymetrix or by
the pedigree database program ProgenyLab 6.0 (Progeny Software Inc, IN,
USA).

The expected format is shown in example-chr1.pre which contains the
pedigree and genotype information and example-chr1.dat which contains
the marker information.

SNPLINK expects one pedigree information file (.pre file) and one marker
information file (.dat file) for each chromosome to be analysed. The
linkage software used is capable of handling large numbers of markers
and has been tested up to a maximum of 1,000 markers per chromosome.

The pre and dat files must be named in the following way:

-   \<\<NAME\>\>-chr\<\<CHROMOSOME NUMBER\>\>.pre

-   \<\<NAME\>\>-chr\<\<CHROMOSOME NUMBER\>\>.dat

For example, if you wish to analyse the first three chromosomes in a
study entitled "example", the corresponding pre and dat files must be
named as follows:

-   example-chr1.pre

-   example-chr1.dat

-   example-chr2.pre

-   example-chr2.dat

-   example-chr3.pre

-   example-chr3.dat

Note that since the linkage programs used here do not support parametric
analysis with liability classes of the X chromosome, SNPLINK assumes
that the pre and dat files for the X chromosome have only one liability
class.

### The analysis option file 

All options for analysis are user-specified in an input file, with a
number of different fields. The input file takes the format:

field\|option

Example files are given in example1.in and example2.in.

In total, there are 12 fields for which values can be entered, 4 of
which are required. They are:

-   name -- the prefix for all pre and dat filenames. In the example
    above, name = 'example'.

-   analysis -- options are parametric or nonparametric. Parametric
    analysis uses the program ALLEGRO to produce LOD scores while
    nonparametric uses the program MERLIN to produce NPL statistics.
    Note that if parametric is specified, nonparametric analysis is also
    carried out in Allegro by default.

-   start -- the number of the first chromosome to be analysed.

-   chromosome -- the number of the last chromosome to be analysed.

Note that SNPLINK assumes that there are no 'gaps' in the numbered
chromosomes to be analysed, so it will attempt to analyse all
chromosomes between 'start' and 'chromosome' inclusive.

For example, to analyse the whole genome, set start=1 and chromosome=22;
to analyse chromosome 10, set start=10 and chromosome=10.

The following fields are not required, but if left unspecified default
values will be used.

-   mkstart1 -- mkstart22 -- the distance (Mb) from the start of each
    chromosome to the first marker. These are included so that the
    graphical output is produced with the correct chromosomal marker
    positions. The investigator need only specify mkstart values for the
    chromosomes to be analysed; however, if other mkstart values are
    given in the options file, they will be ignored. These fields take a
    default value of 0.

-   xinclude -- options are 'yes' or 'no'. Whether or not the X
    chromosome is to be analysed. The default for this field is 'no'.

-   mkstartx -- the distance from the start of the X chromosome to the
    first marker on the X chromosome. The default for this field is 0.

-   LDremoval -- options are 'yes' or 'no'. Whether or not markers in LD
    should be removed and linkage statistics re-calculated after LD
    removal. The default for this field is 'no'.

-   measure -- the measure used to calculate linkage disequilibrium. If
    Ldremoval = 'yes', then a measure must be specified. Options are
    'Dprime', 'rsq' or 'both'. If 'both' is selected, then

-   cutoffDprime -- the value of the$D^{'}$ measure at which LD is
    declared. Some authors have used a value of 0.7.

-   cutoffrsq -- the value of the r^2^ measure at which LD is declared.
    Some authors have used a value of 0.4.

**Example files**

Included in the installation package are two example input files,
example1.in and example2.in.

The file example1.in may be used to run a nonparametric linkage scan for
the chromosome 1 example files which are also included in the
installation: example-chr1.pre and example-chr1.dat. It carries out LD
removal using both the $D^{'}$ and r^2^ measures, with cut off values of
0.7 and 0.4 respectively. It starts and finishes with chromosome 1 and
does not calculate linkage statistics for the X chromosome. The distance
from the start of chromosome 1 to the first marker on chromosome 1 is
2.88Mb.

The file example2.in may be used for a hypothetical parametric linkage
scan for the whole genome including the X chromosome. It carries out LD
removal using the r^2^ statistic with a cut off value of 0.3.

**Output files**

Once SNPLINK has completed its run, a number of folders are produced,
depending on the analysis options specified.

For each SNPLINK run, the folder 'errors-removed-\<\<name\>\>' contains
the results of an initial linkage scan after unlikely genotypes have
been removed. The specific files depend on the type of analysis
specified by the user in the options file. If parametric analysis is
undertaken, separate files are produced for the LOD and NPL statistics;
if nonparametric analysis is undertaken, separate files are produced for
the NPL statistics. Graphical output is also produced for each
chromosome analysed.

If the option 'LDremoval' is set to 'yes', then depending on the field
for option 'measure', two or three folders are produced. Regardless of
the measure chosen, a folder 'LDresults' is produced contained 2 files
for each chromosome. The 'LDresults' files contain the pairwise LD
calculated for each consecutive pair of markers, while the 'LDmarkers'
files contain the markers chosen to be removed on the basis of LD.

If measure='Dprime', the folder 'DprimeLD-\<\<name\>\>' is produced and
contains linkage statistics for each chromosome analysed both before and
after LD is removed using the $D^{'}$ measure of LD. Plots of the
linkage statistics calculated before and after the removal of LD are
produced in Rplots.ps.

If measure='rsq', the folder 'rsqLD-\<\<name\>\>' is produced and
contains linkage statistics for each chromosome analysed both before and
after LD is removed using the r^2^ measure of LD. Plots of the linkage
statistics calculated before and after the removal of LD are produced in
Rplots.ps.

If measure='both', both folders 'DprimeLD-\<\<name\>\>' and
'rsqLD-\<\<name\>\>' are produced containing the files described above.

**How to run SNPLINK**

Once the input file has been prepared, to run SNPLINK, at the UNIX
prompt simply type snplink.pl followed by the name of the input file.

So, to run the example1.in file, type:

snplink.pl example1.in