{"id":15465792,"url":"https://github.com/thibaultlatrille/adaptapop","last_synced_at":"2026-01-07T10:10:53.648Z","repository":{"id":59978682,"uuid":"79432560","full_name":"ThibaultLatrille/AdaptaPop","owner":"ThibaultLatrille","description":"Genes and sites under adaptation at the phylogenetic scale also exhibit adaptation at the population-genetic scale","archived":false,"fork":false,"pushed_at":"2023-09-22T13:29:50.000Z","size":26058,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-02T12:26:54.939Z","etag":null,"topics":["phylogenetics","polymorphic-variants","population-genetics","scientific-publication"],"latest_commit_sha":null,"homepage":"https://doi.org/10.1073/pnas.2214977120","language":"TeX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ThibaultLatrille.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-19T08:31:36.000Z","updated_at":"2023-04-12T05:20:46.000Z","dependencies_parsed_at":"2025-02-02T12:26:55.845Z","dependency_job_id":"e50c15ad-d1c4-48b5-865f-adc136171186","html_url":"https://github.com/ThibaultLatrille/AdaptaPop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThibaultLatrille%2FAdaptaPop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThibaultLatrille%2FAdaptaPop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThibaultLatrille%2FAdaptaPop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ThibaultLatrille%2FAdaptaPop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ThibaultLatrille","download_url":"https://codeload.github.com/ThibaultLatrille/AdaptaPop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246025937,"owners_count":20711575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["phylogenetics","polymorphic-variants","population-genetics","scientific-publication"],"created_at":"2024-10-02T01:03:36.638Z","updated_at":"2026-01-07T10:10:53.566Z","avatar_url":"https://github.com/ThibaultLatrille.png","language":"TeX","funding_links":[],"categories":[],"sub_categories":[],"readme":"**Genes and sites under adaptation at the phylogenetic scale also exhibit adaptation at the population-genetic scale**\\\nThibault Latrille, Nicolas Rodrigue, Nicolas Lartillot,\\\n_Proceedings of the National Academy of Sciences_,\nVolume 120, Issue 11, March 2023, Pages e2214977120,\\\n[doi.org/10.1073/pnas.2214977120](https://doi.org/10.1073/pnas.2214977120)\n\n**Compiled binaries and instructions for BayesCode are available at [github.com/ThibaultLatrille/bayescode](https://github.com/ThibaultLatrille/bayescode)**\n\n# AdaptaPop\n\nThis repository is meant to provide the necessary scripts and instructions to reproduce the figures shown in the manuscript.\nThe experiments can either run on a local computer or in a cluster configuration (slurm).\nThe experiments are meant to run on Linux/Unix/MacOS operating systems.\n\nThe pipeline consist of three main steps, each with its own folder and Snakemake file:\n- [I. Polymorphism](https://github.com/ThibaultLatrille/AdaptaPop#i-polymorphism---download-and-filter-vcf-files)\n- [II. Divergence](https://github.com/ThibaultLatrille/AdaptaPop#ii-divergence---run-bayescode-on-orthomam)\n- [III. Contrast polymorphism and divergence](https://github.com/ThibaultLatrille/AdaptaPop#iii-run-global-analysis-contrasting-polymorphism-and-divergence)\n\nSection I and II are independent of each other and can be run in parallel, while section III depends on the results of I and II.\nAlternatively, the results of each section are available on Zenodo ([![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7543458.svg)](https://doi.org/10.5281/zenodo.7543458))\n\nIf problems and/or questions are encountered, feel free to [open issues](https://github.com/ThibaultLatrille/AdaptaPop/issues).\n\n## 0. Local copy\nClone the repository and `cd` to the dir.\n```\ngit clone https://github.com/ThibaultLatrille/AdaptaPop\ncd AdaptaPop\n```\n\n## 1. Installation\n\n### General dependencies\n\nInstall python3 (\u003e=3.9) and python3 packages\n```\nsudo apt install -qq -y python3-dev python3-pip\npip3 install --user snakemake numpy==1.23 scipy matplotlib pandas ete3 bio statsmodels seaborn rpy2 \n```\n\n### I. Polymorphism - Download and filter .vcf files \n\nInstall bedtools [bedtools.readthedocs.io/en/latest/content/installation.html](https://bedtools.readthedocs.io/en/latest/content/installation.html)\n```\nsudo apt install bedtools\n```\n\nIn folder `Polymorphism` run `snakemake` in each subfolder:\n```\ncd Polymorphism\nfor FOLDER in ./*/ do \n    cd $FOLDER\n    snakemake -j 8\n    cd ..\ndone\n```\n\nAlternatively, you can download the filtered .vcf files on Zenodo ([![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7543458.svg)](https://doi.org/10.5281/zenodo.7543458), file `Polymorphism.zip`) and unzip them in the folder `Polymorphism`.\n\n### II. Divergence - Run BayesCode on OrthoMam\nThis section is independent of the previous one ([I. Polymorphism](https://github.com/ThibaultLatrille/AdaptaPop#i-polymorphism---download-and-filter-vcf-files)).\n\nTo run on OrthoMam (mammalian orthologs), you must download the alignments and trees on Zenodo ([![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7543458.svg)](https://doi.org/10.5281/zenodo.7543458), file `OrthoMam.zip`) and unzip them in the folder `OrthoMam`. The input data will be already filtered and ready to be used in the folder `OrthoMam/Datasets`.\n\nInstall *BayesCode* from https://github.com/ThibaultLatrille/bayescode (see instructions there).\n\n```\ncd Orthomam\n```\n\nRun using snakemake, this requires access to large computation facilities:\n```\nsnakemake -j 128\n```\nOr use the script `snakeslurm.sh` if run on a cluster (slurm) to submit the jobs.\n\nAlternatively, you can download the OrthoMam results of BayesCode on Zenodo ([![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7543458.svg)](https://doi.org/10.5281/zenodo.7543458), file `OrthoMam.zip`) and unzip them in the folder `OrthoMam`. The results will be located in the folder `OrthoMam/Experiments`.\nMoreover, you can use this pipeline as a stand-alone to run `BayesCode` on your own set of alignments and trees by changing the `Snakefile` and/or the `config.yaml`.\n\n### III. Run global analysis contrasting polymorphism and divergence\n\nThis section depends on the results of [I. Polymorphism](https://github.com/ThibaultLatrille/AdaptaPop#i-polymorphism---download-and-filter-vcf-files) and [II. Divergence](https://github.com/ThibaultLatrille/AdaptaPop#ii-divergence---run-bayescode-on-orthomam).\n\nInstall PAML\n```\nsudo apt install paml\n```\n\nIn folder `Contrasts` run `snakemake`, this requires access to large computation facilities:\n```\ncd Contrasts\nsnakemake -j 128\n```\nOr use the script `snakeslurm.sh` if run on a cluster (slurm) to submit the jobs.\n\nAlternatively, at the gene level, the rate of adaptation at the phylogenetic scale and at the population scale (McDonald \u0026 Kreitman) can be downloaded on Zenodo ([![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7543458.svg)](https://doi.org/10.5281/zenodo.7543458), files `GeneTable.tsv` and `MK_statistics.gz`).\n\n## 3. Add features or debug in the python scripts\nYou made modifications to one of the python script, a notebook, this README.md, or you added new features.\nYou wish this work benefits to all (futur) users of this repository?\nPlease, feel free to open a [pull-request](https://github.com/ThibaultLatrille/AdaptaPop/pulls)\n\n## Licence\n\nThe MIT License (MIT)\n\nCopyright (c) 2019 Thibault Latrille\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthibaultlatrille%2Fadaptapop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthibaultlatrille%2Fadaptapop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthibaultlatrille%2Fadaptapop/lists"}