Package: mDeepFRI
🍳 Metagenomic-DeepFRIA pipeline for annotation of genes withDeepFRI, a deep learning model for functional protein annotation withGene Ontology (GO) terms. It incorporatesFoldCompdatabases of predicted protein structures for fast annotation of metagenomic gene catalogues.🔍 OverviewProteins perform most of the work of living cells. Amino acid sequence and structural features of proteins determine a wide range of functions: from binding specificity and conferring mechanical stability, to catalysis of biochemical reactions, transport, and signal transduction.
DeepFRI is a neural network designed to predict protein function within the framework of the Gene Ontology (GO). The exponential growth in the number of available protein sequences, driven by advancements in low-cost sequencing technologies and computational methods (e.g., gene prediction), has resulted in a pressing need for efficient software to facilitate the annotation of protein databases.
Metagenomic-DeepFRI addresses such need, building upon efficient libraries. It incorporates novel databases of predicted structures (AlphaFold, ESMFold, MIP, etc.) and improves runtimes of DeepFRI by2-12 times!📋 Pipeline stagesSearch proteins similar to query in PDB and suppliedFoldCompdatabases withMMSeqs2.Find the best alignment amongMMSeqs2hits usingPyOpal.Align target protein contact map to query protein with unknown structure.RunDeepFRIwith structure if it was found in database, otherwise runDeepFRIwith sequence only.🛠️ Built WithMMseqs2pyOpalDeepFRIFoldCompONNX🔧 InstallationClone repo locallygit clone https://github.com/bioinf-mcb/Metagenomic-DeepFRI
cd Metagenomic-DeepFRISetup conda environmentconda env create --name deepfri --file environment.yml
conda activate deepfriShow help messagemDeepFRI --help💡 Usage1. Prepare structural databaseThe PDB database will be automatically downloaded and installed during first run ofmDeepFRI. You can download additional databases fromwebsite. The app was tested withafdb_swissprot_v4. You can use different databases, but be mindful that computation time might increase exponentially with the size of the database.2. Download modelsTwo versions of models available:v1.0- is the original version from DeepFRI publication.v1.1- is a version finetuned on AlphaFold models and Gene Ontology Uniprot annotations.
To download models run command:mDeepFRI get-models --output path/to/weights/folder -v {1.0 or 1.1}3. Predict protein function & capture logmDeepFRI predict-function -i /path/to/protein/sequences -d /path/to/foldcomp/database/ -w /path/to/deepfri/weights/folder -o /output_path 2> log.txtTheloggingmodule writes output intostderr, so use2>to redirect it to the file.
Other available parameters can be found upon commandmDeepFRI --help.✅ ResultsThe output folder will contain:{database_name}.search_results.tsvmetadata_skipped_ids_due_to_length.json- too long or too short queries (DeepFRI is designed to predict the function of proteins in the range of 60-1000 aa).query.mmseqsDB+ index from MMSeqs2 search.results.tsv- a final output from the DeepFRI model.Example output (results.tsv)ProteinGO_term/EC_numerScoreAnnotationNeural_netDeepFRI_modeDB_hitDB_nameIdentityMIP_00215364GO:00167980.218hydrolase activity, acting on glycosyl bondsgcnmfMIP_00215364mip_rosetta_hq0.9331GVH_1GO:00090550.217electron transfer activitygnnmfAF-P24232-F1-model_v4afdb_swissprot_v41.0unaligned3.2.1.-0.2153.2.1.-cnnecnannannanThis is an example of protein annotation with the AlphaFold database.Protein - the name of the protein from the FASTA file.GO_term/EC_numer - predicted GO term or EC number (dependent on mode)Score - DeepFRI score, translates to model confidence in prediction. Details inpublication.Annotation - annotation from ontologyNeural_net - type of neural network used for prediction (gcn = Graph Convolutional Network; cnn = Convolutional Neural Network). GCN (Graph Convolutional Network) is employed when structural information is available in the database, allowing for generally more confident predictions.DeepFRI_mode:mf = molecular_function
bp = biological_process
cc = cellular_component
ec = enzyme_commission⚙️Features1. Prediction modesThe GO ontology contains three subontologies, defined by their root nodes:Molecular Function (MF)Biological Process (BP)Cellular Component (CC)Additionally, Metagenomic-DeepFRI v1.0 is able to predict Enzyme Comission number (EC).
By default, the tool makes predictions in all 4 categories. To select only a few pass the parameter-por--processing-modesfew times, i.e.:mDeepFRI predict-function -i /path/to/protein/sequences -d /path/to/foldcomp/database/ -w /path/to/deepfri/weights/folder -o /output_path -p mf -p bp2. Hierarchical database searchDifferent databases have a different level of evidence. For example, PDB structures are real experimental structures, thus they are considered to be the data of highest quality. Therefore new proteins are first queried against PDB. Computational predictions differ by quality, i.e. AlphaFold predictions are often more accurate than ESMFold predictions. We provide an opporunity to search multiple databases in a hierarchical manner. For example, if you want to search AlphaFold database first, and then ESMFold, you can pass the parameter-dor--databasesfew times, i.e.:mDeepFRI predict-function -i /path/to/protein/sequences -d /path/to/alphafold/database/ -d /path/to/another/esmcomp/database/ -w /path/to/deepfri/weights/folder -o /output_path3. Temporary filesThe first run ofmDeepFRIwith the database will create temporary files, needed for the pipeline. If you don't want to keep them for the next run add
flag--remove-intermediate.4. CPU / GPU utilizationIf argumentthreadsis provided, the app will parallelize certain steps (alignment, contact map alignment, functional annotation).
GPU is often used to speed up neural networks. Metagenomic-DeepFRI takes care of this and, if CUDA is installed on your machine,mDeepFRIwill automatically use it for prediction. If not, the model will use CPUs.Technical tip:Single instance of DeepFRI on GPU requires 2GB VRAM. Every currently available GPU with CUDA support should be able to run the model.🔖 CitationsMetagenomic-DeepFRI is a scientific software. If you use it in an academic work, please cite the papers behind it:Gligorijević et al. "Structure-based protein function prediction using graph convolutional networks" Nat. Comms. (2021).https://doi.org/10.1038/s41467-021-23303-9Steinegger & Söding "MMseqs2 enables sensitive protein sequence searching for the analysis of massive data sets" Nat. Biotechnol. (2017)https://doi.org/10.1038/nbt.3988Kim, Midrita & Steinegger "Foldcomp: a library and format for compressing and indexing large protein structure sets" Bioinformatics (2023)https://doi.org/10.1093/bioinformatics/btad153Maranga et al. "Comprehensive Functional Annotation of Metagenomes and Microbial Genomes Using a Deep Learning-Based Method" mSystems (2023)https://doi.org/10.1128/msystems.01178-22💭 Feedback⚠️ Issue TrackerFound a bug ? Have an enhancement request ? Head over to theGitHub issue
trackerif you need to report
or ask something. If you are filing in on a bug, please include as much
information as you can about the issue, and try to recreate the same bug
in a simple, easily reproducible situation.🏗️ ContributingContributions are more than welcome! SeeCONTRIBUTING.mdfor more details.📋 ChangelogThis project adheres toSemantic Versioningand provides achangelogin theKeep a Changelogformat.⚖️ LicenseThis library is provided under theThe 3-Clause BSD License.