D: 6 Dec 2024 Main functions (--make-grm-bin...) Quick index search |
Plink 2 Tutorial SetupAbout the tutorialsThese exercises are intended to introduce concepts in genomic analyses and provide some examples for exploring/implementing them using Plink 2. They are not exhaustive How-To's. However, they are a good start for learning the functionalities of Plink 2.About this documentSetting up plink2, the directory structure, and tutorial files needed to run the tutorials.Part 1: Setup the directory structure with tutorial filesDownload the Plink 2 Tutorial package to a directory that you want to run your analyses from. Decompress the downloaded plink2tut.tar.gz file in this directory. You should see this folder structure./GWAS/
|-- bin/ # Top-level executables like plink2.
|-- R/ # R code used for the tutorials.
|-- docs/ # High-level reference documents.
|-- project1/ # The tutorials project run-folder.
|-- data/
|-- raw/
|-- processed/ # Filtered data, such as after quality control.
|-- export/ # Data files that are exported for other platforms.
|-- misc/ # Miscellaneous files used for analyses (e.g., subject ID lists for filtering).
|-- results/
|-- qc/ # Results of quality control steps.
|-- qc1/
|-- qc2/
|-- qc3/
|-- projections/ # Projections, such as PCA projection or linear scoring.
|-- gwas/ # Association analysis and post-hoc results.
Part 2: Analysis environment: Plink 2 + RThis tutorial is intended such that Plink 2 is run in a terminal alongside R commands for visualization. Shown below is an example using R Studio where we navigate between the R Studio (command-line, shell) Terminal and the R Console panes. It will look like this.setwd("<path to project1>")
source("../R/install_packages.R")
Part 3: Command-linePlink is intended to run using a shell terminal. If you are not familiar with shell programming and command lines, then we suggest going through The Missing Semester of Your CS Education, particularly the first 5 lessons.Part 4: Add Plink to PATHWe have included tutorial-compatible Plink 2 (PLINK v2.00a6) and 1.9 (PLINK v1.90b7.4) executables for macOS M1 in the /GWAS/bin/ folder. If you are not using macOS M1, then you need to download the corresponding Plink 2 and 1.9 executables (minimum versions as above) for your system and rename them as plink2 and plink19 respectfully. In addition, if these are not part of your global path (which is unlikely due to renaming), then add these to the global shell path. Get the absolute path by navigating to the /GWAS/bin folder in a Terminal and run the command: pwd. Use the returned path with the name of executable below. Identify the type of terminal shell your are using by running this in the command line.ps -p $$
Then add the path to plink 2 or 1.x that you copied above by adding this to the profile file.
export PATH="<path-to-plink><name of executable>:$PATH"
For example, if zsh then open and add using.
nano ~/.zshrc
If bash, then
nano ~/.bash_profile
or
nano ~/.bashrc
Part 5: MiscellanycurlInstructions for listing and downloading from FTP site using curl. Ensembl example.
|