First, make sure you have Python installed on your system and that your genotyping data is in EIGENSTRAT format. A brief tutorial to convert to EIGENSTRAT format using the convertf tool is here.
Next, download the SNPWEIGHTS package here and a reference panel. I usually use the European, West African and East Asian ancestral populations, but there are other options on the SNPWEIGHTS webpage as well.
Then, create a parameter file with directories of input files, your input population (designated "AA", "CO", and "EA"), and a output file. An example of one is below:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input_geno: data.geno | |
input_snp: data.snp | |
input_ind: data.ind | |
input_pop: CO | |
output: data.txt |
Finally, run the program using the command inferancestry.py --par par.SNPWEIGHTS. For the program to run correctly, make sure the inferancestry.info and snpwt.co files are in the same directory as your inferancestry.py file.
For more details, see the SNPWEIGHTS paper or the README file included in the SNPWEIGHTS zip folder. For code on generating eigenvector plots with overlaid ancestry percentages and triangle plots according to percent ancestry, see this post.
No comments:
Post a Comment