Main navigation

How to Run PLINK

Input

You can use any text editor to make the appropriate input files for PLINK, for example test.ped and test.map files.

Example of test.ped file:

1 1 0 0 1 1 A A G T
2 1 0 0 1 1 A C T G
3 1 0 0 1 1 C C G G
4 1 0 0 1 2 A C T T
5 1 0 0 1 2 C C G T
6 1 0 0 1 2 C C T T

Example of test.map file:

1 snp1 0 1
1 snp2 0 2

Setting PLINK in your environment

To set up your environment to use PLINK, use the module command:

module load plink

See How to use the module command for further information.

How to Run PLINK in Batch

To run PLINK in batch create a script containing the needed plink commands. For example:

#!/bin/bash
. /u/local/Modules/default/init/modules.sh
module load
cd mydir
plink --ped test.ped --map test.map --maf 0.05 --assoc

where mydir is the directory where your data are located.

Use the chmod command to mark your script executable. For example:

chmod +x myscript

where myscript is the name of the script containing the plink commands.

Use the queue script job.q to create a UGE command file. For example:

job.q

Alternatively see Build a UGE command file for your job and use UGE commands directly for a discussion on how to write your own submission script.

See: Running a Batch Job for further information.

How to Run PLINK Interactively

To run PLINK interactively on the cluster please request an interactive node with qrsh (see: How to Get and Interactive Session through UGE for further information), load PLINK into your environment, and invoke PLINK at the command line as needed. For example:

qrsh -li

when you get the command prompt on the interactive node enter:

module load plink
cd mydir

to change into the directory to where your data to be analyzed are located.

Enter the plink command with any arguments. For example:

plink -ped test.ped --map test.map --maf 0.05 --assoc

where test.ped and test.map are your ped and map files.

How to Run gPLINK Interactively from a Cluster Interactive Node

To run PLINK interactively you must first connect to the cluster login node with X11 forwarding enabled. Use qrsh to obtain an interactive compute node. Then enter:

java -jar /u/local/apps/plink/1.06/gPLINK2.jar

How to Run PLINK Interactively with R and Rserve

Click “R-plugins” link (Chapter 27 in version 1.07 documentation) at http://pngu.mgh.harvard.edu/~purcell/plink/pdf.shtml for details and examples.

If you need to use the functionalities of the statistical package R with PLINK, first use qrsh to obtain an interactive compute node, and load PLINK into your environment.

  1. Start Rserve

    module load R
    R CMD Rserve

    Rserve will run daemonized as a server. Verify it is running with ps aux | grep Rserve

    Please remember to kill the Rserve process when is no longer needed. Get the process ID from the command ps aux | grep Rserve and then enter kill pid where pid is the process ID.

  2. Change directory to where your data to be analyzed are located.

    cd mydir

  3. Enter the plink command with any arguments.

    plink arguments

  4. After you finish, kill the Rserve daemon on the same node where you started it before you exit your qrsh session.

    ps aux | grep Rserve
    kill pid

    where pid is the process ID of your Rserve process.

Report Typos and Errors
UCLA OIT

© 2016 UC REGENTS TERMS OF USE & PRIVACY POLICY