Bayes ALLELE

Full Download

Bayes Allele segments the output of the program STRUCTURE so that the clusters can be further investigated allowing the user to asses the alleles that contribute to clustering. This can be particularly helpful when investigating the potential existence of a second species. 

For a more complete description of this analysis please read our full article:

Wham DC, LaJeunesse TC (2016) Symbiodinium population genetics: Testing for species boundaries and analyzing samples with mixed genotypes. Molecular Ecology.

Structure Figure.jpg

The above figure shows the partitioning and reanalysis of microsatellite data from Wirshing et al. (2013). (a)  STRUCTURE plot similar to results published previously by Wirshing et al. (2013) of microsatellite data for Symbiodinium obtained from the west tropical Atlantic gorgonian, Eunicea flexuosa. (b) shows these results at k=2. (c) shows the results at k=2 with identical clones removes and mixed genotypes recovered using the methods discussed in Wham and LaJeunesse (2016). Finally (d) shows the results previously shown in (c) after being partitioned by Bayes Allele.r and then reanalyzed by the program STRUCTURE showing that the existence of two distinct species was obscured in the original analysis.

- script for calculating the probability of assignment to clusters given the input and output of the program STRUCTURE. The script will partition samples into their structure assigned species then provide histograms for each locus showing the allele frequencies of samples that have been assigned to those species. Finally, it will provide conditional probability tables useful for recovering mixed MLGs. The script requires 2 infiles, the infile provided to the program STRUCTURE and the outfile provided by the program STRUCTURE. An example of working infiles are provided below. 

To use this script: Download the above script and the two infiles below and place them into your R working directory. Open R and enter the command: 

source("Bayes Allele.r")

install any dependencies then run the Bayes_Allele function on the below files by entering the command:

Bayes_Allele.Hap("strinfile.txt","stroutfile.txt",0.5)

where the 0.5 is the cut-off for membership of a cluster. 

This script also contains the function Bayes_Allele.Dip which will work with diploid data with similarly structured input. 

 

strinfile.txt

- example infile 1 of 2 for BAYES ALLELE.R. This infile is in the same format as an infile for the program STRUCTURE. BAYES ALLELE.R will not allow sample names with characters like "." or "-", if you experience problems reading in your own data please contact the Author at FCWham (at) gmail (dot) com Data from Wirshing et al. (2013).

 

STRoutFILE.TXT

- example infile 2 of 2 for BAYES ALLELE.R. This infile is in the same format as an outfile for the program STRUCTURE.