TITLE: Genome-wide SNP data unveil admixture of Chinese indigenous chicken breeds with commercial breeds
AUTHORS: Changsheng Nie

[DESCRIPTION]
<div class = "text-blocks"><div class = "text-block">In this study, we aimed to evaluate the genetic diversity and population structure of eight chicken breeds (including conserved chicken breeds) from different geographic origin and to identify admixture within these breeds using a 600-K SNP (single nucleotide polymorphism) panel for genotyping. </div><div class = "text-block">Using the genotype of 580 961 single nucleotide polymorphism markers scored in 1 200 animals, we evaluated the genetic diversity (heterozygosity and proportion of polymorphic markers), linkage disequilibrium (LD) decay, population structure (principal component analysis and neighbor-joining tree), genetic differentiation (FST and genetic distance), and migration events (TreeMix and f-statistics) of the eight domesticated chicken breeds.</div></div>

[STEPS]
?. # Documentation#Pairwise LD measures for multiple SNPs (genome-wide)#source: http://zzz.bwh.harvard.edu/plink/ld.shtmlplink --file mydata --r2#running ADMIXTURE in multithreaded mode#source: http://software.genetics.ucla.edu/admixture/admixture-manual.pdfadmixture ~Data/dataset.bed 3 -j4for K in 1 2 3 4 5; \do admixture --cv dataset.bed $K | tee log${K}.out; done#quickly view the CV errorsgrep -h CV log*.out#TreeMix: Build the ML tree#source: https://bitbucket.org/nygcresearch/treemix/downloads/treemix_manual_10_1_2012.pdftreemix -i inputfile.gz -o outstem#Build the ML graph with migration (-m)treemix -i inputfile.gz -m 2 -o outstem#Graph visualization(R code)source("src/plottingfuncs.R")plot_tree("outstem")plot_resid("outstem", "poporder")#f-statistics#source: https://bitbucket.org/nygcresearch/treemix/downloads/treemix_manual_10_1_2012.pdf#threepopthreepop -i input.gz -k 500#fourpopfourpop -i input.gz -k 500#calulate Fst between two populations (R code).#Setting pathsetwd("F:\\summary_files")#Import data: two population summary filesaf1af2#summary file generated by AxAS software: contain SNP site information and genotype frequency.(https://assets.thermofisher.com/TFS-Assets/LSG/manuals/axiom_genotyping_solution_analysis_guide.pdf)#calculate Fst between two populationsaf1Fst_population1_vs_population2= ((1-(((2*af1$n_AA+af1$n_AB+2*af2$n_AA+af2$n_AB)/(2*(af1$n_AA+af1$n_AB+af1$n_BB)+2*(af2$n_AA+af2$n_AB+af2$n_BB)))**2+((2*af1$n_BB+af1$n_AB+2*af2$n_BB+af2$n_AB)/(2*(af1$n_AA+af1$n_AB+af1$n_BB)+2*(af2$n_AA+af2$n_AB+af2$n_BB)))**2))-(((1-(((af1$n_AA*2+af1$n_AB)/((af1$n_AA+af1$n_AB+af1$n_BB)*2))**2+((af1$n_BB*2+af1$n_AB)/((af1$n_AA+af1$n_AB+af1$n_BB)*2))**2))*(af1$n_AA+af1$n_AB+af1$n_BB)+(1-(((af2$n_AA*2+af2$n_AB)/((af2$n_AA+af2$n_AB+af2$n_BB)*2))**2+((af2$n_BB*2+af2$n_AB)/((af2$n_AA+af2$n_AB+af2$n_BB)*2))**2))*(af2$n_AA+af2$n_AB+af2$n_BB))/(af1$n_AA+af1$n_AB+af1$n_BB+af2$n_AA+af2$n_AB+af2$n_BB)))/(1-(((2*af1$n_AA+af1$n_AB+2*af2$n_AA+af2$n_AB)/(2*(af1$n_AA+af1$n_AB+af1$n_BB)+2*(af2$n_AA+af2$n_AB+af2$n_BB)))**2+((2*af1$n_BB+af1$n_AB+2*af2$n_BB+af2$n_AB)/(2*(af1$n_AA+af1$n_AB+af1$n_BB)+2*(af2$n_AA+af2$n_AB+af2$n_BB)))**2)))   #n_AA, n_AB, n_BB: three different genotypes frequency#Save resultswrite.csv(af1,"Fst_population1_vs_population2.csv",row.names = F, col.names = F, quote = F)