Coder Social home page Coder Social logo

binfnstats / imagene Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mfumagalli/imagene

0.0 1.0 0.0 3.65 MB

Estimation of population genetic parameters using deep learning

License: GNU General Public License v3.0

Python 14.73% Shell 1.69% Jupyter Notebook 83.59%

imagene's Introduction

ImaGene

ImaGene is a supervised machine learning algorithm to predict natural selection and estimate selection coefficients from population genomic data. It can be used to estimate any parameter of interest from an evolutionary population genetics model.

ImaGene implements a convolutional neural network (CNN) which takes as input haplotypes of a locus of interest for a population. It outputs confusion matrices as well as point estimates of the selection coefficient (or any parameter of interest) along with its posterior distribution and various metrics of confidence.

Citation

The original manuscript can be found here and it is open access. You should cite it as:

Torada, L., Lorenzon, L., Beddis, A. et al. ImaGene: a convolutional neural network to quantify natural selection from genomic data. BMC Bioinformatics 20, 337 (2019)

doi:10.1186/s12859-019-2927-x

and you can download the citation file in .ris or .json format.

Related studies from the group are on balancing selection and adaptive introgression.

Download and installation

We provide examples on how to run ImaGene on your local machine, on Google Colab or Google Cloud in the Tutorials folder. Below are instructions to download and install ImaGene on your local machine or server.

Download the repository using git.

git clone https://github.com/mfumagalli/ImaGene

ImaGene runs under Python3 and it is interfaced with tensorflow and keras. We recommend using conda to set the environment and take care of all dependencies. There are detailed instructions on how to download conda for linux and macOS. A suitable environment can be created with

conda create -n ImaGene python=3.6 tensorflow=2 keras numpy scipy scikit-image scikit-learn matplotlib pydot pymc3 ipython jupyter

which can be activated with

conda activate ImaGene

and deactivated with

conda deactivate.

ImaGene is currently interfaced with msms but you are required to download it separately following the instructions here. Follow the link, download the .zip folder and extract it. The .jar file of interest will be in the lib folder. There are no requirements for msms to be installed in a specific folder. However, msms requires java to be installed. On unix Debian systems just type sudo apt-get update && apt-get upgrade; sudo apt-get install default-jdk Otherwise follow the link here if you need to install java on other systems. Remember that java must be in your /usr/bin folder. In unix systems you can create a symbolic link with ln -s ~/Downloads/java-XXX/jre/bin/java /usr/bin/java, as an example.

Usage

Please look at the jupyter notebook 01_binary.ipynb (or the corresponding Colab version) for a tutorial on how to use ImaGene for predicting natural selection with a simple binary classification. We also provide examples on how ImaGene can be used for multiclass classification in 02_multiclass.ipynb and 03_multiclass_for_continuous.ipynb and for regression in 04_regression.ipynb (or the corresponding Colab versions).

Finally, we provide an utility generate_dataset.sh to quickly generate simulations with msms to be used for training. This script takes an input file with all parameters needed for the simulations. An example of this file is params.txt and tutorials show how to run such simulations in practice. More information can be found in the tutorials.

The folder Reproduce contains all scripts used for the analyses shown in the manuscript.

Contributors (in alphabetical order)

  • main: Matteo Fumagalli (m.fumagalli [at] imperial [dot] ac [dot] uk)
  • others (in alphabetical order): Alice Beddis, Ulas Isildak, Sirimar (Nook) Laosinwattana, Lucrezia Lorenzon, Luis Torada

imagene's People

Contributors

mfumagalli avatar nook14s avatar

Watchers

 avatar

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.