Variant Analysis Task List
Task 1: VCF to PLINK Format Conversion
-
Convert the filtered VCF to PLINK binary format using
plink --make-bed.
-
Edit the
.fam file to add region/population information
to the second column.
-
Edit the
.bim file and replace the chromosome name
E2 with 1.
Task 2: Principal Component Analysis (PCA)
-
Run PCA using
plink --pca 5.
-
Visualize the first two principal components in R using
ggplot2.
-
Label samples according to their population/region.
-
Save the PCA plot as both
.png and .pdf.
Task 3: File Transfer
-
Use
scp to copy output files from the server
to your local machine.
-
Example:
scp user@IP:path/to/Rplots.pdf .
Task 4: ADMIXTURE Analysis
-
Create a Conda environment and install ADMIXTURE.
-
Run ADMIXTURE for
K = 2 to K = 4.
-
Use a loop to run multiple K values.
-
Generate the corresponding
.K.P and
.K.Q output files.
Task 5: ADMIXTURE Plotting
-
Read the ADMIXTURE
.Q file and PLINK
.fam file into R.
-
Extract the population/region information from the sample IDs
or
.fam file.
-
Reshape the ADMIXTURE output for plotting.
-
Generate an ADMIXTURE barplot using
ggplot2.
-
Save the plot as
admixture_K3_grouped.png.
Task 6: Heterozygosity Estimation
-
Install
rtg-tools using Conda.
-
Run
rtg vcfstats on the final filtered VCF.
-
Save the output as a
.vcfstats file.
Task 7: Optional / Miscellaneous Tasks
-
Activate and deactivate Conda environments as required.
-
Keep track of intermediate and final output files.
-
Exit the server after completing the analysis using
exit.