Giter Site home page Giter Site logo

btmartin721 / phylip2eigenstrat Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 244 KB

Python script to generate .snp and .ind Eigenstrat files from a PHYLIP infile

License: MIT License

Python 100.00%
admixtools eigenstrat rad ddrad hybridization introgression f-statistics d-statistic admixture population-genetics population-genomics rad-sequencing ddrad-sequencing pyrad geno phylip snps ind

phylip2eigenstrat's Introduction

Script to generate Eigenstrat input files used in AdmixTools (and other) software packages: .snp and .ind
The script was intended for RAD or ddRAD data, which do not usually have cM or physical distance information.


Usage:

phylip2eigenstrat.py -p [--phylip] *.phy -i [--ind <ind outfile>] *.ind -s [--snp <snp outfile>] *.snp [options]...

Mandatory arguments:

[-p, --phylip - Input PHYLIP file from the same pyRAD run as the .geno file]

Optional arguments:

[-i, --ind - Specifies .ind output file; default = out.ind]
[-n, --snp - Specifies .snp output file; default = out.snp]
[-s, --start - Starting character for popID search pattern; default = 1]
[-e, --end - Last character for popID search pattern; default = 4]

The only required command-line flag is -p. If -i and -n are not specified, default = out.ind, out.snp

This script requires a phylip file as input to obtain the sample names and number of loci
The Phylip file should be from the same pyRAD run as the .geno file to ensure the same number of loci

The Phylip file also uses a REGEX pattern to determine population IDs in the .ind file
The characters used for the REGEX can be changed with the -s and -e options (default = 1-4)

AdmixTools and Eigensoft require a third input file that is produced in pyRAD: .geno
Please note that AdmixTools requires the three input files to have .geno, .snp, and .ind extensions.

Citations

Example PHYLIP and .geno datasets were downloaded from the Dryad repository. The citations are listed below:

Prates I, Xue AT, Brown JL, Alvarado-Serrano DF, Rodrigues MT, Hickerson MJ, Carnaval AC. (2016). Inferring responses to climate > dynamics from historical demography in neotropical forest lizards. Proceedings of the National Academy of Sciences of the United > States of America 113(129): 7978โ€“7985. https://doi.org/10.1073/pnas.1601063113

Dryad data package:

Prates I, Xue AT, Brown JL, Alvarado-Serrano DF, Rodrigues MT, Hickerson MJ, Carnaval AC. (2016). Data from: Inferring responses to climate dynamics from historical demography in neotropical forest lizards. Dryad Digital Repository. https://doi.org/10.5061/dryad.2v1p6

phylip2eigenstrat's People

Contributors

btmartin721 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

hejian151004

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.