https://github.com/brianhie/evolocity

Evolutionary velocity with protein language models

https://github.com/brianhie/evolocity

Science Score: 20.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: nature.com, zenodo.org
  • Committers with academic emails
    1 of 7 committers (14.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.9%) to scientific vocabulary

Keywords from Contributors

transformers interactive archival projection generic sequences observability autograding hacking shellcodes
Last synced: 11 months ago · JSON representation

Repository

Evolutionary velocity with protein language models

Basic Info
Statistics
  • Stars: 94
  • Watchers: 5
  • Forks: 23
  • Open Issues: 4
  • Releases: 4
Created over 5 years ago · Last pushed almost 3 years ago
Metadata Files
Readme License

README.md

Evolocity

Evolocity

Evolocity is a Python package that implements evolutionary velocity, which constructs landscapes of protein evolution by using the local evolutionary predictions enabled by language models to predict the directionality of evolution and is described in the paper "Evolutionary velocity with protein language models predicts evolutionary dynamics of diverse proteins" by Brian Hie, Kevin Yang, and Peter Kim. This repository also contains the analysis code and links to the data for reproducing the results in the paper.

Evolocity is a fork of the scVelo tool for RNA velocity by Bergen et al. and relies on many aspects of the Scanpy library for high-dimensional biological data analysis. Like Scanpy and scVelo, evolocity makes use of anndata, a convenient way to store and organize biological data. Our main implementation is based on the ESM-1b language model by Rives et al.

Documentation

For in-depth API documentation, go to https://evolocity.readthedocs.io.

Installation

You should be able to install evolocity using pip: bash python -m pip install evolocity

API example and tutorials

Below is a quick Python example of using evolocity to load and analyze sequences in a FASTA file. ```python import evolocity as evo import scanpy as sc

Load sequences and compute language model embeddings.

fastafname = 'data.fasta' adata = evo.pp.featurizefasta(fasta_fname)

Construct sequence similarity network.

evo.pp.neighbors(adata)

Run evolocity analysis.

evo.tl.velocity_graph(adata)

Embed network and velocities in two-dimensions and plot.

sc.tl.umap(adata) evo.tl.velocityembedding(adata) evo.pl.velocityembeddinggrid(adata) evo.pl.velocityembedding_stream(adata) ```

More detailed documentation is provided here.

Tutorials are also available in the documentation and also on Google Colab for influenza A nucleoprotein and cytochrome c.

Testing

Unit tests require using pytest and can be run with the command python -m pytest tests/ from the top-level directory.

Experiments

Below are scripts for reproducing the experiments in our paper. To apply evolocity to your own sequence data, we also encourage you to check out the tutorials in the documentation. Our experiments were run with Python version 3.7 on Ubuntu 20.04.

Data

You can download the relevant datasets using the commands bash wget https://zenodo.org/record/5590361/files/data.tar.gz tar xvf data.tar.gz ln -s data/target/ target within the same directory as this repository. Be sure to move the target/ directory one level up or create a symlink to it (as done above).

Dependencies

Before running the scripts below, we encourage you to use the conda environment in environment-epi.yml using bash conda env create --file environment-epi.yml To run the TAPE baseline, TAPE needs to be installed separately as described in https://github.com/songlab-cal/tape. PyTorch will need to be reupdated after TAPE installation.

Evolocity analysis

Our main evolocity analyses can be reproduced using the command bash bash bin/main.sh which will create new log files and figures in a new figures/ directory. Analyses should fit within 100 GB of CPU RAM and 8 GB of GPU RAM, and should finish within a few hours.

Benchmark results are generated by the commands bash python bin/benchmark.py python bin/benchmark_downsample.py

Benchmarking results can be reproduced with the commands below, but can take several days to complete if run in serial. bash bash bin/benchmark.sh bash bin/benchmark_downsample.sh

Scripts for other analyses

Phylogenetic tree reconstruction of NP and ancient proteins can be done with the commands below (you will first need to install PhyML and FastTree): bash bash bin/phylo_np.sh > phylo_np.log 2>&1 bash bin/phylo_eno.sh > phylo_eno.log 2>&1 bash bin/phylo_pgk.sh > phylo_pgk.log 2>&1 bash bin/phylo_ser.sh > phylo_ser.log 2>&1

Deep mutational scan benchmarking can be done with the command bash python bin/dms.py esm1b > dms_esm1b.log 2>&1 python bin/dms.py tape > dms_tape.log 2>&1

Owner

  • Name: Brian Hie
  • Login: brianhie
  • Kind: user
  • Location: San Francisco

GitHub Events

Total
  • Issues event: 1
  • Watch event: 10
  • Issue comment event: 1
  • Fork event: 4
Last Year
  • Issues event: 1
  • Watch event: 10
  • Issue comment event: 1
  • Fork event: 4

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 354
  • Total Committers: 7
  • Avg Commits per committer: 50.571
  • Development Distribution Score (DDS): 0.305
Past Year
  • Commits: 7
  • Committers: 3
  • Avg Commits per committer: 2.333
  • Development Distribution Score (DDS): 0.286
Top Committers
Name Email Commits
Brian Hie b****e@m****u 246
Brian Hie b****1@g****m 101
Andy Tso a****o@i****m 3
Samuel Sledzieski s****e@g****m 1
dependabot[bot] 4****] 1
Seyone Chithrananda 4****a 1
dongspy 3****y 1
Committer Domains (Top 20 + Academic)
mit.edu: 1

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 13
  • Total pull requests: 5
  • Average time to close issues: 5 days
  • Average time to close pull requests: about 14 hours
  • Total issue authors: 10
  • Total pull request authors: 5
  • Average comments per issue: 1.92
  • Average comments per pull request: 0.6
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 2
  • Pull requests: 0
  • Average time to close issues: 4 days
  • Average time to close pull requests: N/A
  • Issue authors: 2
  • Pull request authors: 0
  • Average comments per issue: 1.5
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • jadolfbr (4)
  • mattmorts-sci (1)
  • wangleiofficial (1)
  • salvatoreloguercio (1)
  • Jiacheng06 (1)
  • DrewBarratt (1)
  • seyonechithrananda (1)
  • dongspy (1)
  • brianhie (1)
  • UronicAcid (1)
Pull Request Authors
  • seyonechithrananda (1)
  • dongspy (1)
  • samsledje (1)
  • gianhiltbrunner (1)
  • brianhie (1)
Top Labels
Issue Labels
bug (4) enhancement (3)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 80 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 7
  • Total maintainers: 1
pypi.org: evolocity

Evolutionary velocity with protein language models

  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 80 Last month
Rankings
Dependent packages count: 7.3%
Stargazers count: 8.2%
Forks count: 10.6%
Average: 14.1%
Dependent repos count: 22.1%
Downloads: 22.2%
Maintainers (1)
Last synced: 11 months ago

Dependencies

docs/requirements.txt pypi
  • biopython ==1.76
  • louvain ==0.7.0
  • matplotlib ==3.1.1
  • nbconvert ==6.1.0
  • nbsphinx ==0.8.6
  • numpy ==1.17.2
  • pandas ==0.25.1
  • python-igraph ==0.8.3
  • scanpy ==1.4.5.1
  • scikit-learn ==0.21.3
  • scipy ==1.3.1
  • seaborn ==0.9.0
  • sphinx ==3.5.4
  • sphinx-theme ==1.0
  • sphinx_autodoc_typehints ==1.12.0
  • torch ==1.7.1
requirements.txt pypi
  • biopython >=1.76
  • louvain >=0.6.1
  • matplotlib >=3.1.1
  • numpy >=1.17.2
  • pandas >=0.25.1
  • python-igraph >=0.8.3
  • scanpy >=1.4.5.1
  • scikit-learn >=0.21.3
  • scipy >=1.3.1
  • seaborn >=0.9.0
  • torch >=1.7.1
setup.py pypi
  • l.strip *