These 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 document
Setting up plink2, the directory structure, and tutorial files needed to run the tutorials.
Part 1: Setup the directory structure with tutorial files
We 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
Instructions for listing and downloading from FTP site using curl. Ensembl example.
List the files in the directory.
Use the following command to list the files from the FTP directory:
curl -l ftp://ftp.ensembl.org/pub/current_gff3/homo_sapiens/
Set a shell variable to one of the file names.
Once you have the list of files, set a shell variable to the desired file name.
For example, if the file you want to download is Homo_sapiens.GRCh38.113.chromosome.22.gff3.gz, set a variable like this:
FILE="Homo_sapiens.GRCh38.113.chromosome.22.gff3.gz"
Specify the target directory:
TARGET_DIR="./misc/"
Download the file using curl -o and save it in the target directory