This project focuses on using transformer models and data science techniques to perform predictive curation of the well-established database Minimal Information about Biosynthetic Gene Clusters (MiBIG). The MiBIG Database contains information about gene clusters in prokaryotes, including literature explaining the gene cluster, protein sequences of genes in the cluster, organism, product/secondary metabolite of the gene cluster, SMILES, activity, and more. The information in the MiBIG Database will be used as both training and test data for different models to accomplish various objectives.
This repository contains a collection of Python scripts that serve two main purposes:
playing_ground.py: Retrieves data from the MiBIG Databaseget_protein_seqs_ncbi.py: Retrieves protein sequences from the NCBI given an accession numberdownload_pubmed_abstracts.py: Retrieves abstracts or full texts from the literature referred to in the MiBIG Databasevalidating_MiBIG_data.py: Validates that literature references in the MiBIG Database are correct and linked to relevant informationshorten_words.py: Takes a dataset with gene names in a cluster and attempts to create meaningful abbreviations to reduce memory consumption for later models.CV_file_creation.py: Shuffles data and creates n-fold partitions of a dataset for performing cross-validation later.understand_text_dataset.py: A large collection of functions for producing various plots and visualizations, such as histograms, PCA, Wordclouds, and othersjournal_distribution_of_pos_data.py: Produces a plot of journal distributionBERT_abstract.py: BERT pre-trained on PubMed articles. Used to predict if new literature is relevant for inclusion in the MiBIG DB.bioGPT.py: GPT-2 pre-trained on PubMed articles. Used to predict if new literature is relevant for inclusion in the MiBIG DB.simple_models_for_pos_neg_classifier.py: Three simple models, majority voting, a novel model based on word frequencies in abstract, and Support Vector Machine. All three models are used to predict if new literature is relevant for inclusion in the MiBIG DB.T5.py: T5 encoder-decoder model. Can be used to predict either SMILES based on the gene names or activity of secondary metabolite based on SMILES or whether literature should be included in MiBIG.ESM2_to_T5.py: A novel approach to predicting SMILES molecule representations from all the protein sequences in the gene cluster. It uses the ESM-2 encoder embeddings passed directly to a Flan T5 decoder (or specifically pre-trained T5 decoder).Attention_made_simply.py: A script that explains the self-attention mechanism in transformer models with simple base Python and NumPy implementations.All datasets can be found in code/datasets.
Already maded figures can be found in code/figures
To get started with this project, you will need to have Python installed on your system. We recommend using a virtual environment to manage dependencies.
pip install -r requirements.txt.We welcome contributions to this project! If you would like to contribute, please follow these steps:
This project is released under the MIT License. Please see the LICENSE file for more information.
This project focuses on using transformer models and data science techniques to perform predictive curation of the well-established database Minimal Information about Biosynthetic Gene Clusters (MiBIG). The MiBIG Database contains information about gene clusters in prokaryotes, including literature explaining the gene cluster, protein sequences of genes in the cluster, organism, product/secondary metabolite of the gene cluster, SMILES, activity, and more. The information in the MiBIG Database will be used as both training and test data for different models to accomplish various objectives.
This repository contains a collection of Python scripts that serve two main purposes:
playing_ground.py: Retrieves data from the MiBIG Databaseget_protein_seqs_ncbi.py: Retrieves protein sequences from the NCBI given an accession numberdownload_pubmed_abstracts.py: Retrieves abstracts or full texts from the literature referred to in the MiBIG Databasevalidating_MiBIG_data.py: Validates that literature references in the MiBIG Database are correct and linked to relevant informationshorten_words.py: Takes a dataset with gene names in a cluster and attempts to create meaningful abbreviations to reduce memory consumption for later models.CV_file_creation.py: Shuffles data and creates n-fold partitions of a dataset for performing cross-validation later.understand_text_dataset.py: A large collection of functions for producing various plots and visualizations, such as histograms, PCA, Wordclouds, and othersjournal_distribution_of_pos_data.py: Produces a plot of journal distributionBERT_abstract.py: BERT pre-trained on PubMed articles. Used to predict if new literature is relevant for inclusion in the MiBIG DB.bioGPT.py: GPT-2 pre-trained on PubMed articles. Used to predict if new literature is relevant for inclusion in the MiBIG DB.simple_models_for_pos_neg_classifier.py: Three simple models, majority voting, a novel model based on word frequencies in abstract, and Support Vector Machine. All three models are used to predict if new literature is relevant for inclusion in the MiBIG DB.T5.py: T5 encoder-decoder model. Can be used to predict either SMILES based on the gene names or activity of secondary metabolite based on SMILES or whether literature should be included in MiBIG.ESM2_to_T5.py: A novel approach to predicting SMILES molecule representations from all the protein sequences in the gene cluster. It uses the ESM-2 encoder embeddings passed directly to a Flan T5 decoder (or specifically pre-trained T5 decoder).Attention_made_simply.py: A script that explains the self-attention mechanism in transformer models with simple base Python and NumPy implementations.All datasets can be found in code/datasets.
Already maded figures can be found in code/figures
To get started with this project, you will need to have Python installed on your system. We recommend using a virtual environment to manage dependencies.
pip install -r requirements.txt.We welcome contributions to this project! If you would like to contribute, please follow these steps:
This project is released under the MIT License. Please see the LICENSE file for more information.