/ctvt_paper

Source code from the paper: "The evolutionary history of dogs in the Americas" (2018) Science

Primary LanguagePythonMIT LicenseMIT

CTVT

This repository contains Python and R code for the ancestry analyses of the ancient nuclear DNA from the paper The evolutionary history of dogs in the Americas.

Figure qpGraph

Citation

If you reuse any of this code then please cite the paper:

Leathlobhair, M.N., Perri, A.R., Irving-Pease, E.K., Witt, K.E., Linderholm, A., Haile, J., Lebrasseur, O., Ameen, C., Blick, J., Boyko, A.R., Brace, S., Cortes, Y.N., Crockford, S.J., Devault, A., Dimopoulos, E.A., Eldridge, M., Enk, J., Gopalakrishnan, S., Gori, K., Grimes, V., Guiry, E., Hansen, A.J., Hulme-Beaman, A., Johnson, J., Kitchen, A., Kasparov, A.K., Kwon, Y.-M., Nikolskiy, P.A., Lope, C.P., Manin, A., Martin, T., Meyer, M., Myers, K.N., Omura, M., Rouillard, J.-M., Pavlova, E.Y., Sciulli, P., Sinding, M.-H.S., Strakova, A., Ivanova, V.V., Widga, C., Willerslev, E., Pitulko, V.V., Barnes, I., Gilbert, M.T.P., Dobney, K.M., Malhi, R.S., Murchison, E.P., Larson, G., Frantz, L.A.F., 2018. The evolutionary history of dogs in the Americas. Science 361, 81–85. https://doi.org/10.1126/science.aao4776

Installation

To reproduce the analyses from the paper you will need to install the following dependencies.

Python

Python ≥ 2.7 with the following modules:

pip install dendropy graphviz luigi matplotlib numpy pathos psutil pyparsing scipy 

The full list of Python modules installed in the project environment can be found in the requirements file.

R

R ≥ 3.4 with the following modules:

install.packages(c("ape", "combinat", "doParallel", "foreach", "ggplot2", "gridExtra", "RColorBrewer", "reshape2", 
                   "scales", "stringr"))

Other

Running the pipeline

The pipeline is broken into three luigi wrapper tasks.

Stats pipeline

  • run qpDstat
  • run qpF4ratio
  • run qp3Pop
luigi --module pipeline_ctvt CTVTStatsPipeline

qpGraph pipeline

  • fit qpGraph models
luigi --module pipeline_ctvt CTVTqpGraphPipeline

Supplementary figures pipeline

  • run SmartPCA
  • plot NJ trees
  • run Treemix
luigi --module pipeline_ctvt CTVTFiguresPipeline

Author

Evan K. Irving-Pease, PalaeoBARN, University of Oxford

License

This project is licensed under the MIT License - see the LICENSE.md file for details