sasudo2 commited on
Commit
f3da413
·
verified ·
1 Parent(s): 4e64478

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +83 -0
README.md ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - biology
5
+ - protein-function-prediction
6
+ - cafa5
7
+ - gene-ontology
8
+ - esm2
9
+ ---
10
+
11
+ # CAFA 5 Protein Function Prediction Models
12
+
13
+ This repository contains trained models, configurations, and inference scripts developed for multi-label Gene Ontology (GO) protein function prediction, aligned with the **CAFA 5** tournament guidelines.
14
+
15
+ ---
16
+
17
+ ## 📋 Table of Contents
18
+ 1. [Overview](#overview)
19
+ 2. [Model Artifacts & Architectures](#model-artifacts--architectures)
20
+ * [`esm2_ffn` (ESM-2 + Feed-Forward Network Head)](#esm2_ffn-esm-2--feed-forward-network-head)
21
+ * [`blast_knn` (BLAST & K-Nearest Neighbors Baseline)](#blast_knn-blast--k-nearest-neighbors-baseline)
22
+ * [`lr3mer` (Logistic Regression 3-mer Baseline)](#lr3mer-logistic-regression-3-mer-baseline)
23
+ 3. [Input & Output Schemas](#input--output-schemas)
24
+ 4. [Quick Usage Example](#quick-usage-example)
25
+
26
+ ---
27
+
28
+ ## 1. Overview
29
+ Predicting protein functions across Gene Ontology (GO) domains (Biological Process, Molecular Function, and Cellular Component) is crucial for functional annotation pipelines. This repository hosts multiple modeling approaches—ranging from deep learning embeddings (`esm2_ffn`) to sequence homology and baseline approaches (`blast_knn`, `lr3mer`)—to generate standardized functional predictions (`EntryID`, `term`, `score`).
30
+
31
+ ---
32
+
33
+ ## 2. Model Artifacts & Architectures
34
+
35
+ ### `esm2_ffn`
36
+ A hybrid model combining a frozen protein language model encoder with a custom feed-forward classification head.
37
+ * **Base Model Encoder:** [`facebook/esm2_t33_650M_UR50D`](https://huggingface.co/facebook/esm2_t33_650M_UR50D) (1,280 feature dimensions).
38
+ * **Training Hardware:** Tesla T4 GPU.
39
+ * **Training Stats:** Evaluated across 141,995 training proteins and 141,864 test proteins, generating over 200 million prediction rows.
40
+ * **Head Configuration:**
41
+ * Hidden Dimension: 512
42
+ * Dropout: 0.2
43
+ * Learning Rate: 0.001
44
+ * Weight Decay: 0.0001
45
+ * Positive Weight Cap: 50.0
46
+
47
+ ### `blast_knn`
48
+ A sequence-similarity and neighborhood-based baseline utilizing sequence alignment scores and k-nearest neighbors over annotation spaces.
49
+ * **Configuration:** Configured via `blast_knn/config.json` and tracked with `blast_knn/manifest.json`.
50
+
51
+ ### `lr3mer`
52
+ A lightweight sequence-based baseline utilizing 3-mer frequency representations coupled with multi-label logistic regression classifiers.
53
+ * **Configuration:** Backed by sequence k-mer tracking matrices and `lr3mer/go_terms.json`.
54
+
55
+ ---
56
+
57
+ ## 3. Input & Output Schemas
58
+
59
+ * **Required Input Fields:**
60
+ * `EntryID`: Unique identifier for the protein sequence.
61
+ * `sequence`: Amino acid sequence string.
62
+ * **Prediction Output Schema:**
63
+ * `EntryID`: Protein identifier.
64
+ * `term`: Gene Ontology term ID (e.g., `GO:0009987`).
65
+ * `score`: Confidence score ranging between $0.0$ and $1.0$.
66
+
67
+ ---
68
+
69
+ ## 4. Quick Usage Example
70
+
71
+ You can inspect, download, or execute inference for the `esm2_ffn` model bundle directly using the provided `inference.py` script:
72
+
73
+ ```python
74
+ import torch
75
+ from pathlib import Path
76
+ from esm2_ffn.inference import load_model, resolve_model_dir
77
+
78
+ # Load model bundle from the Hub
79
+ model_dir = resolve_model_dir("sasudo2/cafa5_models", subfolder="esm2_ffn")
80
+ print(f"Model bundle resolved at: {model_dir}")
81
+
82
+ # Example inference script execution
83
+ # python esm2_ffn/inference.py --model-dir {model_dir} --input proteins.fasta