Coder Social home page Coder Social logo

thibaultlatrille / adaptapop Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 25.45 MB

Genes and sites under adaptation at the phylogenetic scale also exhibit adaptation at the population-genetic scale

Home Page: https://doi.org/10.1073/pnas.2214977120

Shell 0.38% Python 17.42% TeX 75.74% R 5.24% Visual Basic 6.0 1.22%
phylogenetics polymorphic-variants scientific-publication population-genetics

adaptapop's Introduction

Genes and sites under adaptation at the phylogenetic scale also exhibit adaptation at the population-genetic scale
Thibault Latrille, Nicolas Rodrigue, Nicolas Lartillot,
Proceedings of the National Academy of Sciences, Volume 120, Issue 11, March 2023, Pages e2214977120,
doi.org/10.1073/pnas.2214977120

Compiled binaries and instructions for BayesCode are available at github.com/ThibaultLatrille/bayescode

AdaptaPop

This repository is meant to provide the necessary scripts and instructions to reproduce the figures shown in the manuscript. The experiments can either run on a local computer or in a cluster configuration (slurm). The experiments are meant to run on Linux/Unix/MacOS operating systems.

The pipeline consist of three main steps, each with its own folder and Snakemake file:

Section 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. Alternatively, the results of each section are available on Zenodo (DOI)

If problems and/or questions are encountered, feel free to open issues.

0. Local copy

Clone the repository and cd to the dir.

git clone https://github.com/ThibaultLatrille/AdaptaPop
cd AdaptaPop

1. Installation

General dependencies

Install python3 (>=3.9) and python3 packages

sudo apt install -qq -y python3-dev python3-pip
pip3 install --user snakemake numpy==1.23 scipy matplotlib pandas ete3 bio statsmodels seaborn rpy2 

I. Polymorphism - Download and filter .vcf files

Install bedtools bedtools.readthedocs.io/en/latest/content/installation.html

sudo apt install bedtools

In folder Polymorphism run snakemake in each subfolder:

cd Polymorphism
for FOLDER in ./*/ do 
    cd $FOLDER
    snakemake -j 8
    cd ..
done

Alternatively, you can download the filtered .vcf files on Zenodo (DOI, file Polymorphism.zip) and unzip them in the folder Polymorphism.

II. Divergence - Run BayesCode on OrthoMam

This section is independent of the previous one (I. Polymorphism).

To run on OrthoMam (mammalian orthologs), you must download the alignments and trees on Zenodo (DOI, 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.

Install BayesCode from https://github.com/ThibaultLatrille/bayescode (see instructions there).

cd Orthomam

Run using snakemake, this requires access to large computation facilities:

snakemake -j 128

Or use the script snakeslurm.sh if run on a cluster (slurm) to submit the jobs.

Alternatively, you can download the OrthoMam results of BayesCode on Zenodo (DOI, file OrthoMam.zip) and unzip them in the folder OrthoMam. The results will be located in the folder OrthoMam/Experiments. Moreover, 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.

III. Run global analysis contrasting polymorphism and divergence

This section depends on the results of I. Polymorphism and II. Divergence.

Install PAML

sudo apt install paml

In folder Contrasts run snakemake, this requires access to large computation facilities:

cd Contrasts
snakemake -j 128

Or use the script snakeslurm.sh if run on a cluster (slurm) to submit the jobs.

Alternatively, at the gene level, the rate of adaptation at the phylogenetic scale and at the population scale (McDonald & Kreitman) can be downloaded on Zenodo (DOI, files GeneTable.tsv and MK_statistics.gz).

3. Add features or debug in the python scripts

You made modifications to one of the python script, a notebook, this README.md, or you added new features. You wish this work benefits to all (futur) users of this repository? Please, feel free to open a pull-request

Licence

The MIT License (MIT)

Copyright (c) 2019 Thibault Latrille

Permission 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:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE 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.

adaptapop's People

Contributors

thibaultlatrille avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

adaptapop's Issues

.

ModuleNotFoundError: No module named 'libraries'

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.