TITLE: VCF2PCP
AUTHORS: Judith Ballesteros Villascan, Israel Aguilar Ordoñez, Fernando Pérez-Villatoro

[DESCRIPTION]
<div class = "text-blocks"><div class = "text-block">Nextflow pipeline that runs and plots admixture and smartpca from a compressed VCF.</div></div>

[STEPS]
?. [Pre-processing]
Split chromosomesSplit chromosomes from a compressed VCF file.Dependencies:
?. [Pre-processing]
Simplify and remove LDSimplifyVCCF to keep only INFO/AF and GT and removes LD variants with bcftools +prune. Please, consider window for LD pruning is given in bp.Dependencies:
a) Remove variants in LD.b) Simplify VCF to keep only INFO/AF and GT
?. [Pre-processing]
Rejoin VCFConcatenate multiple VCF of different chromosomes.Dependencies:
?. [Pre-processing]
VCF to PLINKConvert VCF to plink and filters MAF.Dependencies:
a) Convert VCF to PLINK file.Filter MAF with PLINK.
?. [Pre-processing]
Make pedindMake pedind file for running smartpca by using tagger.Rtagger.R is a tool that takes columns of fam file and the groups of samples and makes pedind file.Dependencies:tagger.RDependencies:
?. [Pre-processing]
Make pop infoMake popinfo file for plotting admixture results by using make_popinfo.Rmake_popinfo.R is a tool that takes columns of fam file and the groups of samples and makes popinfo file.Dependencies:make_popinfo.RDependencies:
?. [Core-processing]
Make par file for smartpcaMake par file to run smartpca, runs it and take best snps a-nd Tracy-Widom statistics from stdout.Dependencies:
a) Write par fileb) Run smartpcac) Get best snps
?. [Core-processing]
Keep autosomesKeep only autosomal chromosomes for running admixture, as it is said in its documentation.Dependencies:
?. [Core-processing]
Run admixtureRun admixture with K 2:9 by default and gathers all logs.Dependencies:
?. [Pos-processing]
Parallel coordinate plotGet number of snps for PCA, and the number of statistically significant PCs and plots it by using parallel_plotter.Rparallel_plotter.R is a tool for making parallel coordinates plots. Dependencies:parallel_plotter.RDependencies:Final Output:
a) Get the number of snps for PCA, and number of statisttically significnt PCs.b) Reformat the evec file to replace spaces.c) Run Rscript
?. [Pos-processing]
Regional PCAPlot PCA of PC1 vs all PCs and makes PCP by region by using plotter.Rplotter.R is a tool for making parallel coordinates plot by region.Dependencies:plotter.RDependencies:Final Output:
?. [Pos-processing]
Plot AdmixturePlot all admixture results by using admixture_plotter.Radmixture_plotter.R is a tool for plotting each admixture result.Dependencies:admixture_plotter.RDependencies:Final Output:
?. [Pos-processing]
Plot CVSPlot CVS from admixture by using plotter.Rplotter.R is a tool for plotting each CV from admixture results.Dependencies:plotter.RDependencies:Final Output:
?. [Pos-processing]
Gather admixture plotsPlot all admixture results in one file by using plotter.Rplotter.R is a tool for plotting k 2:9 from admixture results.Dependencies:plotter.RDependencies:Final Output:
?. [Pos-processing]
KmeansGet k means from significant PCs using kmean.RDependencies:kmean.RFinal Output:
a) Get the number of snps for PCA, and the number of statistically significant PCsb) Reformat the evec file to replace spacesc) Run Rscript
?. [Before Nextflow]
Format and select samplesRemoves unused contigs in the header and keeps given samples.Dependencies: