{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.12.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":116062,"databundleVersionId":14875579,"sourceType":"competition"},{"sourceId":14805820,"sourceType":"datasetVersion","datasetId":9467210}],"dockerImageVersionId":31259,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# SPROF-GO full training Pipeline\n\nI have used **SPROF-GO** for protein function prediction on the CAFA6.\n\nCitation for SPROF-GO:\n\n```bibtex\n@article{10.1093/bib/bbad117,\n    author = {Yuan, Qianmu and Xie, Junjie and Xie, Jiancong and Zhao, Huiying and Yang, Yuedong},\n    title = \"{Fast and accurate protein function prediction from sequence through pretrained language model and homology-based label diffusion}\",\n    journal = {Briefings in Bioinformatics},\n    year = {2023},\n    month = {03},\n    issn = {1477-4054},\n    doi = {10.1093/bib/bbad117},\n    url = {https://doi.org/10.1093/bib/bbad117}\n}\n```\n\n#### SPROF-GO uses the following:\n\nFull ProtT5 embeddings (unpooled, frozen) → MLP-based multi-head self-attention pooling → hierarchical max-constraint learning for GO consistency → homology-based label diffusion\n\n#### The full training pipeline and generated models and submission.tsv are available here \n\n[![GitLab Repo](https://img.shields.io/badge/GitLab-Repository-orange?logo=gitlab)](https://gitlab.com/nn_projects/cafa6_project)\n\n## The Training Pipeline Steps\n\n1. **Generate embeddings**\n\n   Run `cafa6-save-embeddings-no-average.ipynb` to convert protein sequences to embeddings.\n\n2. **Convert embeddings to numpy**\n\n   Run `cafa6-hfd5-to-numpy.ipynb` to convert HDF5 embeddings to `.npy` format.\n\n3. **Train SPROF-GO with Cross Validation**\n\n   Run `cafa6-nfold-sprof.ipynb`.\n\n4. **Perform homology-based label diffusion**\n\n   Run `cafa6-diamond.ipynb`.\n\n\n## You can try the ensemble models here:\n\n[![Hugging Face Spaces](https://img.shields.io/badge/🤗%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces/eloise54/cafa6_project)\n\nNo label diffusion on hf for fast inference ","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19"}},{"cell_type":"code","source":"import shutil\n\nshutil.copy(\n    \"/kaggle/input/datasets/eloisedai/cafa6-sprof-go-diamond/submission.tsv\",\n    \"/kaggle/working/submission.tsv\"\n)\n","metadata":{"trusted":true,"execution":{"iopub.status.busy":"2026-02-11T10:00:59.296627Z","iopub.execute_input":"2026-02-11T10:00:59.296962Z","iopub.status.idle":"2026-02-11T10:01:03.604168Z","shell.execute_reply.started":"2026-02-11T10:00:59.296936Z","shell.execute_reply":"2026-02-11T10:01:03.603203Z"}},"outputs":[],"execution_count":null},{"cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null}]}