A pipeline for QC'ing and preparing genotyping data for imputation, combining genotyping data with a reference panel to determine ancestry with EIGENSTRAT, and QC'ing genotype vcf files post-imputation.
GenomeStudio is an Illumina software that is only made for Windows. If using a Mac, install a Windows mirror with the following steps:
- Download the Windows 10 Disc Image (ISO File)
- Open Applications > Utilities > Boot Camp Assistant
- Follow the onscreen instructions to set up Boot Camp Assistant. When prompted, add downloaded Windows 10 ISO image.
- Switch between Mac and Windows by restarting and holding option.
Installing GenomeStudio:
-
Download both GenomeStudio and PLINK Input Report Plug-in from Illumina here.
-
Follow onscreen instructions to download and setup GenomeStudio.
Do not open the included sample sheet before loading into Genome Studio because it will mess up the barcode formatting.
- Start a new Genotyping Project. Select "Use sample sheet to load sample intensities."
- On the next page of the Project Wizard, load the given sample sheet (.csv) under "Sample Sheet." Load the given images directory under "Data Repository." Load the given Manifest directory under "Manifest Repository."
- On the final page of the Project Wizard, click the box to "Import cluster positions from a cluster file." Load the given /Manifest > .egt file as the cluster file. Click Finish.
- To export a PLINK report, click Analysis > Reports > Custom Report > PLINK. A map and ped file should be generated.
-
Clone this entire repo into working directory:
git clone https://github.com/nekramer/Genopipe.git
-
Edit the comma-separated
geno.csvwith the project name, batch name, PLINK map/ped file prefix, and the path to these files under theGenotyping_Directorycolumn. The names in theProjandBatchcolumns will be used to create a group name for output files. -
Edit
config/config.yamlfor parameters specific to your analysis. The parameters are described below:## Path to genotyping data samplesheet geno: 'geno.csv' ## Thresholds for variant inclusion in PLINK miss_call: 0.1 # PLINK --geno: Missing rate per SNP; A value of 0.1 will include only SNPs with a 90% genotyping rate (10% missing). maf: 0.01 # PLINK --maf: Minor allele frequency; A value of 0.01 will only include SNPs with a minor allele frequencey >= 0.01. hwe: .000001 # PLINK --hwe: Hardy-Weinberg equilibrium; Exclude markers that fail the Hardy-Weinberg test at a specified significance. remove: 'remove.txt' # Text file listing which, if any, samples to remove from data and which batch they should be removed from. ## Genome-specific reference parameters ref: '/proj/phanstiel_lab/References/genomes/1000G/GRCh37/1000G_phase3_chrALL_biallelic' # Path to population reference data in PLINK binary format (.bed, .bim, .fam files), all autosomes merged. panel: '/proj/phanstiel_lab/References/genomes/1000G/GRCh37/1000G_phase3.panel' # Path to panel file of above population reference data. Must have the columns `sample`, `pop`, `super_pop`, and `gender`. sequence: '/proj/phanstiel_lab/References/genomes/hg19/Sequence/hg19.fa' # Path to reference sequence fasta file. ## Eigensoft software path eigensoft: '/proj/phanstiel_lab/software/EIGENSOFT/EIG-6.1.4/bin' # Path to EIGENSOFT software directory. ## Additional options pop_name: 'CQTL' # Name of data 'population' to use as the label in ancestry PCA plot.
To check the genome build of raw genotyping data obtained via a GenomeStudio project, check the GenomeBuild column of the .csv file
found under the Manifest directory.
Note: This pipeline requires an installation of Eigensoft. This software can be downloaded from https://github.com/DReichLab/EIG. To build the software on UNC Longleaf follow these steps:
```
unzip v8.0.0.zip
cd EIG-8.0.0/src
make clobber
module add openblas
make all OPENBLAS=/nas/longleaf/apps/openblas/0.2.19
make install
```
Then, update the path to the smartpca command on line 58 of EIG-8.0.0/bin/smartpca.perl.
-
Submit the first workflow with
sbatch:sbatch runGenopipe
After running these steps the pipeline will produce the following key files:
output/ancestry/ancestry.pdf: A plot of PC1 vs. PC2 of data merged with reference, colored by population.output/imputation/{group}_chr{chr}.recode.vcf.gz: Gzipped vcf files, separated by chromosome, which are prepared for imputation.
-
Impute data with imputation method of choice (i.e. Michigan Imputation Server) using an appropriate reference file.
-
Edit the comma-separated
vcf.csvwith the chromosome and the full path/filename to the imputed vcf of that chromosome in thevcf_pathfield. -
Submit the second workflow to combine and QC these vcfs with
sbatch:sbatch runGenopipeImputation
After running this workflow the pipeline will produce one qc'd, gzipped vcf file:
output/vcf/{group}_ALL_qc.vcf.gz
If an error occurs by misspecification of resources, a job's resources can be adjusted
by editing config/cluster.yaml. To relaunch a workflow, unlock the directory with:
module load python/3.6.6
snakemake -j 1 -s snakefiles/genoProc --unlock #or
snakemake -j 1 -s snakefiles/postImputation --unlockand relaunch with sbatch.