Skip to main content

PhageAI is an AI-driven software platform using advanced Machine Learning and Natural Language Processing techniques for deeper understanding of the bacteriophages genomics.

Project description

PhageAI is an application that simultaneously represents a repository of knowledge of bacteriophages and a bioinformatics pipeline to analyse genomes with Artificial Intelligence support. This package supports the most critical programmable features from our platform.

Machine Learning algorithms can process enormous amounts of data in relatively short time in order to find connections and dependencies that are obvious for human beings. Correctly designed applications based on AI are able to vastly improve and speed up the work of the domain experts.

Models based on DNA or proteins contextual vectorization and Deep Neural Networks are particularly effective when it comes to analysis of genomic data. The system that we propose aims to use the phages sequences uploaded to the database to build a model which is able to predict if a bacteriophage is chronic, temperate or virulent with a high probability. Furthermore, our system shares more prediction methods for phage taxonomy, phage similarity and annotation extended by proteins structural classes classification.

One of the key system modules is the bacteriophages repository with a clean web interface that allows to browse, upload and share data with other users. The gathered knowledge about the bacteriophages is not only valuable on its own but also because of the ability to train the ever-improving Machine Learning models.

Detection of virulent or temperate features is only one of the first tasks that can be solved with Artificial Intelligence. The combination of Biology, Natural Language Processing and Machine Learning allows us to create algorithms for genomic data processing that could eventually turn out to be effective in a wide range of problems with focus on classification and information extraced from DNA.

PyPI version PyPI license PyPI pyversions Code style Downloads Twitter Follow LinkedIn Follow

Table of Contents

Available methods | Installation | Benchmark | Community and Contributions | Have a question? | Found a bug? | Team | Change log | License | Cite

Available methods

  • upload(fasta_path, access) - upload FASTA file with phage genome as "public", "private" or "" (temporary) sample in the PhageAI repository. Upload stage is starting the bioinformatics pipeline execution for phage characteristic.
  • processing_status(job_id) - get current processing status for your phage sample related with Job ID;
  • get_lifecycle_classification(job_id) - get phage lifecycle classification result;
  • get_taxonomy_classification(job_id) - get phage taxonomy classification results for order, family and genus;
  • get_proteins_classification(job_id) - get phage proteins structural classes classification results;
  • get_top10_similarities(job_id) - get TOP-10 similar phages to your sample from the repository;
  • get_full_report(job_id) - get full phage characteristics report (all meta-data and predictions);
  • get_phage_characteristic(accession_number) - get meta-data about publicly available phage with specific accession number (with version);

Installation and usage

PhageAI user account (1/3)

Create a free user account in the PhageAI web platform or use an existing one. If you had to create new one, activate your account by activation link which was sent on your mail inbox. After that, log into the platform successfully and click "My profile" in the top-right menu. In the "API access" section create a new access token (string) and copy it for the steps below.

PhageAI package (2/3)

PhageAI requires Python 3.8.0+ to run and can be installed by running:

pip install phageai

If you can't wait for the latest hotness from the develop branch, then install it directly from the repository:

pip install git+https://github.com/phageaisa/phageai.git@develop

PhageAI execution (3/3)

PASTE_YOUR_ACCESS_TOKEN_HERE - PhageAI web user's access token; PASTE_YOUR_FASTA_PATH_HERE - FASTA filename with *.fasta or *.fa extension;

Example - how to upload phage to repository with private access

from phageai.platform import PhageAIAccounts

phageai_api = PhageAIAccounts(access_token='PASTE_YOUR_ACCESS_TOKEN_HERE')

phage_example_jobid = phageai_api.upload(fasta_path="PASTE_YOUR_FASTA_PATH_HERE", access="private")

Expected output should be the job ID value:

{
  'job_id': '0a71e61a-ec58-447b-859e-d9ba15e103a9'
}

or, if you reach out daily API requests limit (100 by default), you can expect:

{
    "author": ["Your daily API limit (100 requests) has been exceeded"]
}

If you reach out your daily requests limit, and you still need more, feel free to contact us by contact@phageai.

Example - how to track the processing progress

Tracking progress of phage processing is super useful if you upload more samples in the same time or when you integrate your service or pipeline with PhageAI.

(...)

phage_example_jobid = phageai_api.upload(fasta_path="PASTE_YOUR_FASTA_PATH_HERE", access="private")

job_id = phage_example_jobid["job_id"]

phageai_api.processing_status(job_id=job_id)

Depends on what is the current stage of your sample processing ("Not Started", "In progress", "Done", "Failed"), expected output should be like:

{
  'taxonomy_stage': 'Done',
  'proteins_stage': 'Not Started',
  'top10_stage': 'Not Started',
  'lifecycle_stage': 'Done',
  'final_report': 'In Progress'
}

Each of the above stage is work separately in PhageAI so you can expect different statuses for each of them.

Example - get lifecycle classification

(...)

phageai_api.get_lifecycle_classification(job_id=job_id)

Expected output should be like:

{'value': 'Chronic', 'probability': 99.85}

In the same way you can execute other available methods from the package.

Benchmark

PhageAI lifecycle classifier was benchmarked with DeePhage, bacphlip, VIBRANT and PHACTS tools using 104 Virulent and Temperate bacteriophages from our paper (testing set). Correct predictions results:

Tool Version Chronic support Phage sequences used in research Test set accuracy (%) DOI
PhageAI 0.4.1 Yes 15,235 93.27 This research
DeePhage 1.0 No 1,640 84.62 10.1093/gigascience/giab056
bacphlip 0.9.6 No 1,057 100 10.7717/peerj.11396
VIBRANT 1.2.1 No 350,626 85.58 10.1186/s40168-020-00867-0
PHACTS 1.8 No 227 75.00 10.1093/bioinformatics/bts014

Community and Contributions

Happy to see you willing to make the PhageAI better. Development on the latest stable version of Python 3+ is preferred. As of this writing it's 3.8. You can use any operating system.

If you're fixing a bug or adding a new feature, add a test with pytest and check the code with Black and mypy. Before adding any large feature, first open an issue for us to discuss the idea with the core devs and community.

Have a question?

Obviously if you have a private question or want to cooperate with us, you can always reach out to us directly by mail.

Found a bug?

Feel free to add a new issue with a respective title and description on the the PhageAI repository. If you already found a solution to your problem, we would be happy to review your pull request.

Team

Core Developers and Domain Experts who contributing to PhageAI:

  • Piotr Tynecki
  • Łukasz Wałejko
  • Krzysztof Owsieniuk
  • Joanna Kazimierczak
  • Arkadiusz Guziński
  • Bogumił Zimoń
  • Żaneta Szulc
  • Maria Urbanowicz

Change log

The log's will become rather long. It moved to its own file.

See CHANGELOG.md.

License

The PhageAI package is released under the under terms of the MIT License.

Cite

PhageAI - Bacteriophage Life Cycle Recognition with Machine Learning and Natural Language Processing

Tynecki, P.; Guziński, A.; Kazimierczak J.; Zimoń B.; Szulc Ż.; Jadczuk, M.; Dastych, J.; Onisko, A.

Viruses, Special Issue "Bacteriophage Bioinformatics" (ISSN 1999-4915), DOI: 10.1101/2020.07.11.198606

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

phageai-1.0.0.tar.gz (13.4 kB view hashes)

Uploaded Source

Built Distribution

phageai-1.0.0-py3-none-any.whl (9.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page