OrthoEvolution is an easy to use and comprehensive Python package which aids in the analysis and visualization of comparative evolutionary genetics related projects such as the inference of orthologs.
Current Version: 1.0.0b2
This package focuses on inferring orthologs using NCBI's blast, various sequence alignment strategies, and phylogenetics analyses including PAML, PhyML, ete3, and more tools.
Ultimately, the goal of this project is to create a reusable pipeline for the inference of orthologs in order to ensure reproducibility of data as well as improve the management and analysis of (what can be) large datasets. The Cookies, Manager, Pipeline, and Tools modules act as a framework for our workflow, while the Orthologs module provides access to specific functions for our various ortholog inference projects.
View our read the docs and feel free to also read this related paper to gain more insight into this project/python package.
View the below methods for installing this package. Python 3.9 or higher is required.
pip install --upgrade pip
pip install OrthoEvolgit clone https://github.com/datasnakes/OrthoEvolution.git
cd OrthoEvolution
pip install --upgrade pip
pip install .WARNING : This code is actively under development and may not be reliable. Please create an issue for questions about development.
git clone -b dev https://github.com/datasnakes/OrthoEvolution.git
cd OrthoEvolution
pip install --upgrade pip
pip install .Please view the examples directory for working examples and scripts demonstrating how to utilize this package.
The examples include:
- Standalone scripts for common workflows
- Example data files
- GUI implementations (Tkinter and PyWebView)
- Pipeline demonstrations
from OrthoEvol.Orthologs.Blast import OrthoBlastN
# Use an existing list of gpcr genes
gpcr_blastn = OrthoBlastN(project="orthology-gpcr", method=1,
save_data=True, acc_file="gpcr.csv",
copy_from_package=True)
# Run blast
gpcr_blastn.run()from OrthoEvol.Manager.management import ProjectManagement
ProjectManagement(repo="test-repo", user=None,
project="test-project",
research=None,
research_type='comparative_genetics',
new_repo=False, new_user=False, new_project=True,
new_research=False)from OrthoEvol.Tools.ftp import NcbiFTPClient
ncbiftp = NcbiFTPClient(email='somebody@gmail.com')
ncbiftp.getblastdb(database_name='refseq_rna', v5=True)from OrthoEvol.Manager.management import ProjectManagement
from OrthoEvol.Manager.database_dispatcher import DatabaseDispatcher
from OrthoEvol.Manager.config import yml
from pkg_resources import resource_filename
from pathlib import Path
import yaml
import getpass
from datetime import datetime as d
import os
# Define job name
job_name = "jobname"
# Function to load configuration from YAML file
def load_config(file_name):
file_path = resource_filename(yml.__name__, file_name)
with open(file_path, 'r') as file:
return yaml.load(file, Loader=yaml.FullLoader)
# Load project management configuration
pm_config = load_config("initialize_new.yml")
project_manager = ProjectManagement(**pm_config["Management_config"])
# Load and update database management configuration
db_config = load_config("databases.yml")
db_config.update(pm_config)
# Configure NCBI RefSeq release settings
ncbi_config = db_config['Database_config']['Full']['NCBI']['NCBI_refseq_release']
ncbi_config['upload_number'] = 12
ncbi_config['pbs_dict'] = {
'author': getpass.getuser(),
'description': 'This is a default pbs job.',
'date': d.now().strftime('%a %b %d %I:%M:%S %p %Y'),
'proj_name': 'OrthoEvol',
'select': '1',
'memgb': '6gb',
'cput': '72:00:00',
'wt': '2000:00:00',
'job_name': job_name,
'outfile': job_name + '.o',
'errfile': job_name + '.e',
'script': job_name,
'log_name': job_name,
'pbsworkdir': os.getcwd(),
'cmd': f'python3 {os.path.join(os.getcwd(), job_name + ".py")}',
'email': 'n/a'
}
# Save the updated configuration to a YAML file
config_file_path = project_manager.user_log / Path("upload_config.yml")
with open(str(config_file_path), 'w') as config_file:
yaml.dump(db_config, config_file, default_flow_style=False)
# Initialize database dispatcher and execute dispatch functions
db_dispatcher = DatabaseDispatcher(config_file_path, project_manager)
db_dispatcher.dispatch(db_dispatcher.strategies, db_dispatcher.dispatcher, db_dispatcher.configuration)To run tests, first install the test dependencies:
pip install pytest pytest-covThen run the test suite:
pytest testsThis package was created by the Datasnakes.
- Rob Gilmore | Github: @grabear | β
- Shaurita D. Hutchins | Github: @sdhutchins | β
If you would like to contribute to this package, install the package in development mode:
pip install -e .Check out our contributing guidelines for more information.
This project is licensed under the MIT License. See the LICENSE file for details.
We're thankful to have a resource such as Biopython, which inspired this package.
Cock, P.J.A. et al. Biopython: freely available Python tools for computational molecular biology and bioinformatics. Bioinformatics 2009 Jun 1; 25(11) 1422-3 http://dx.doi.org/10.1093/bioinformatics/btp163 pmid:19304878