GBS filtering in TASSEL Standalone v3.0
Run_pipeline.bat –fork1 –UcreatWorkingDirPlugin –w workingdirectory\ -endPlugin –runfork1
Run_pipeline.bat –fork1 –UfastqToTagCountPlugin –w workingdirectory\ -e PstI –endPlugin –runfork1
Run_pipeline.bat –fork1 –MergeMultipleTagCountPlugin –i workingdirectory\tagCounts –o workingdirectory\mergedTagCounts\mergedAll.cnt –c 10 –endPlugin –runfork1
Run_pipeline.bat –fork1 –UTagCountToTagPairPlugin –w workingdirectory\ -e 0.03 –endPlugin –runfork1
Run_pipeline.bat –fork1 –UTagPairToTBTPlugin –w workingdirectory\ -endPlugin –runfork1
Run_pipeline.bat –fork1 UTBTToMapInfoPlugin –w workingdirectory\ -endPlugin –runfork1
Run_pipeline.bat –fork1 -UMapInfoToHapMapPlugin –w workingdirectory\ -mnMAF 0.05 –mxMAF 0.5 –mnC 0.8 –endPlugin –runfork1
Run_pipeline.bat –fork1 –GBSHapMapFiltersPlugin –hmp workingdirectory\hapMap\HapMap.hmp.txt -o workingdirectory\hapMap\filteredhapMap.hmp.txt –mnTCov 0.125 –mnSCov 0.8 –endPlugin –runfork1

Make bed file in Plink v1.07
plink --file ~/scratch/tassel_cornell/filtered40pinds_80psnps.plk --out ~/scratch/tassel_cornell/filtered40pinds_80psnps --make-bed

Run Admixture v1.3.0
for i in {2..5}
do
 admixture --cv filtered40pinds_80psnps.bed $i > log${i}.out
done

Run Introgress package v1.22 in R
## set working directory for CAB hybrid zone
setwd("C:/path/")
## change to introgress library for introgress command line commands
library(introgress)
## read in data for individuals from admixed population (within the CAB hybrid zone)
CAB.admix.data <- read.table(file="alladmixInds.txt", header=FALSE)
## read in marker information
CABhz.locidata <- read.table(file="locidata.txt", header=TRUE)
## read in parental datasets, 2 separate data sets, one for each "pure" population of individuals (allopatric pure RNSA and YBSA)
RNSA.data <- read.table(file="RNSAparent.txt", header=FALSE)
YBSA.data <- read.table(file="YBSAparent.txt", header=FALSE)
## estimate hybrid index values and save the results to the data.frame data object hi.index.CAB
hi.index.CAB <- est.h(introgress.data = allelecount.matrix, fixed = FALSE,
                      loci.data = CABhz.locidata)
## write the hi.index.CAB data frame into a text file
write.table(hi.index.CAB, file="hindextable.txt", 
            quote=FALSE, sep="\t")
# calculate interspecific heterozygosity
CAB.intersphet <- calc.intersp.het(introgress.data=allelecount.matrix)
# write CAB.intersphet as a text file
write.table(CAB.intersphet, file="intersphet.txt", quote=FALSE, sep="\t")
