agentleFS
PharMolixPharMolix/OpenBioMed/skills/functional-protein-design/SKILL.md

functional-protein-design

Skill1.1k starsChanged 8 months agoMITView on GitHub

Generate functional protein sequences. Use this skill when: (1) Generating de novo protein sequences guided by specific Gene Ontology (GO) tags. (2) Exploring sequence space with prior functional constraints.

Trending

Quiet this year.thin dataabout the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the PharMolix/OpenBioMed repository that our weekly crawl found: only 1 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about PharMolix/OpenBioMed

The biggest 1 of 1 mention linking to the repository that our crawl found. Each line is their own headline.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before getting started, ensure that your environment is fully configured.

    line 46
  2. Distinctive:

    Run the following command in your Terminal (replace your@email.com and paste the actual sequence generated in Phase 1):

    line 89
  3. Distinctive:

    Check the generated JSON annotation file:

    line 100
  4. Distinctive:

    Every successful run must yield a report containing:

    line 232

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Functional Protein Design

Prerequisites

RequirementDetails
EnvironmentConfigured via OpenBioMed: README.md
HardwareCUDA-compatible GPU (≥ 10GB VRAM) required for both generation and folding
CheckpointsDownload CodeFP weights & mappings from Google Drive.

Data Preparation & Configuration

Directory Structure Organize your downloaded checkpoints and mapping files as follows:

checkpoints/
├── codefp/
│   ├── model/
│   │   └── checkpoints/
│   │       └── model.ckpt
│   └── mappings/
│       ├── go_mapping.pkl
│       ├── go_id_mapping.pkl
│       ├── desc2map_dict_statics.pkl
│       └── train_go_terms_cls_emb.pkl

How to Run

Phase 0: Environment & Prerequisites

Before getting started, ensure that your environment is fully configured. This includes a successful installation of OpenBioMed and the completion of all required model weight downloads.

Next, search the Gene Ontology website to identify 1–3 Molecular Function (MF) GO terms (e.g., ['GO:0004930', 'GO:0004984']) that best align with your functional target.

Note: Please ensure that the selected GO terms are included in go_mapping.pkl, a dictionary whose keys enumerate all supported GO terms (e.g., “GO:0004930”, “GO:0004984”), to ensure compatibility with the model.

Phase 1: GO-Guided Sequence Generation (Python)

First, we generate the protein sequence using the model. Run the following code:

from open_biomed.core.pipeline import InferencePipeline
from open_biomed.data import Protein

# 1. GO-guided sequence generation
generator = InferencePipeline(
    task="go_guided_protein_generation",
    model="codefp",
    model_ckpt="./checkpoints/codefp/model/checkpoints/model.ckpt",
    device="cuda:0"
)

# Replace with 1–3 target Molecular Function (MF) GO terms
go_terms = [['GO:0004930', 'GO:0004984']]

designed_seqs = generator.run(go_terms=go_terms)
seq_only = designed_seqs[0][0]  # Protein object

seq_str = seq_only.sequence
print(f"Generated Sequence: {seq_str}")

Phase 2: Functional Evaluation & Quality Check via InterProScan (Terminal Execution)

Critical Checkpoint: Before proceeding to structure prediction, you must use InterProScan to verify whether the generated sequence (seq_str) possesses the expected function.

Steps:

  1. Download the InterProScan client script:
curl -L -o iprscan5.py https://raw.githubusercontent.com/ebi-jdispatcher/webservice-clients/master/python/iprscan5.py
  1. Run the following command in your Terminal (replace your@email.com and paste the actual sequence generated in Phase 1):
python iprscan5.py --email your@email.com \
  --stype p \
  --sequence "PASTE_THE_SEQ_STR_GENERATED_IN_PHASE_1_HERE" \
  --outformat json

Workflow Decision Tree:

Check the generated JSON annotation file:

✅ Target GO terms appear: Validation successful! Proceed to Phase 3.

❌ Target GO terms DO NOT appear: Validation failed. Return to Phase 1 to regenerate sequences.

🔄 If unsuccessful after 3 attempts: Select the generated sequence whose functional annotations most closely match your target function, then proceed.

Phase 3: Structure Prediction & pLDDT Writing (Python)

Once validated, input the sequence into ESMFold for 3D structure prediction, and write the pLDDT confidence scores into the B-factor field of the resulting PDB file.


folder = InferencePipeline(
    task="protein_folding",
    model="esmfold",
    model_ckpt="./checkpoints/server/esmfold.ckpt", # ESMFold will be downloaded automatically.
    device="cuda:0"
)

seq_only = Protein.from_fasta(seq_str)

folded_protein = folder.run(protein=seq_only)
plddt = folder.model.model.temp_plddt_res[0]
mean_plddt = plddt.mean()
print(f"Global pLDDT: {mean_plddt:.2f}")


folded_protein[0][0].save_pdb("designed.pdb", overwrite=True)


from Bio import PDB

def update_plddt_with_biopython(input_pdb, output_pdb, plddt_array):
    parser = PDB.PDBParser(QUIET=True)
    structure = parser.get_structure("protein", input_pdb)
    
    print(f"Global pLDDT: {plddt_array.mean():.4f}")
    
    residues = list(structure.get_residues())
    
    if len(residues) != len(plddt_array):
        print(f"Warning: PDB residue count ({len(residues)}) does not match pLDDT array length ({len(plddt_array)}).")

    for i, res in enumerate(residues):
        if i < len(plddt_array):
            score = plddt_array[i]  
            for atom in res:
                atom.set_bfactor(score)
                
    io = PDB.PDBIO()
    io.set_structure(structure)
    io.save(output_pdb)
    print(f"Successfully saved updated PDB to: {output_pdb}")

update_plddt_with_biopython("designed.pdb", "designed.pdb", plddt * 100)

Phase 4: (Optional) PyMOL Structure Visualization (Python)

import os
import shutil
from datetime import datetime
from pymol import cmd

def visualize_protein_plddt(pdb_file, output_gif, num_frames=36):
    try:
        cmd.reinitialize()
        
       
        cmd.load(pdb_file, "prot_obj")
        
        
        cmd.hide("everything", "prot_obj") 
        cmd.show_as("cartoon", "prot_obj")
        
        
        cmd.set_color("db_blue",   [0.00, 0.33, 0.71])
        cmd.set_color("db_cyan",   [0.39, 0.74, 0.93])
        cmd.set_color("db_yellow", [1.00, 0.78, 0.16])
        cmd.set_color("db_orange", [1.00, 0.48, 0.30])
        
        cmd.color("db_blue",   "prot_obj and b > 90")
        cmd.color("db_cyan",   "prot_obj and b < 90")
        cmd.color("db_yellow", "prot_obj and b < 70")
        cmd.color("db_orange", "prot_obj and b < 50")

   
        cmd.bg_color("white")
        cmd.set("ray_opaque_background", 1)
        cmd.orient("prot_obj") 
        cmd.zoom("prot_obj", buffer=2.0)

       
        temp_dir = f"temp_pngs_{datetime.now().strftime('%Y%m%d_%H%M%S')}"
        os.makedirs(temp_dir, exist_ok=True)
        print(f"Generating frames in {temp_dir}...")


        for i in range(num_frames):

            cmd.rotate("y", 360.0 / num_frames, "prot_obj")
            
            frame_path = os.path.join(temp_dir, f"frame{i:03d}.png")

            cmd.png(frame_path, width=800, height=600, dpi=150, ray=0)


        from open_biomed.tools.visualization_tools import convert_png2gif
        
        if len(os.listdir(temp_dir)) > 0:
            convert_png2gif(temp_dir, output_gif, fps=12)
            print(f"Success! Saved to {output_gif}")
        else:
            print("Error: No PNG frames were generated.")

        if os.path.exists(temp_dir):
            shutil.rmtree(temp_dir)

    except ImportError as ie:
        print(f"Import Error: Please make sure PyMOL and open_biomed are installed. Details: {ie}")
    except Exception as e:
        print(f"An error occurred: {e}")
visualize_protein_plddt("designed.pdb", "designed_rotated.gif")

Expected Deliverables

Every successful run must yield a report containing:

  1. The generated PDB file (designed.pdb).
  2. The PNG image (designed.png) rendered from the PDB file.
  3. The GIF image (designed_rotated.gif) rendered from the PDB file.
  4. The exact GO tags used for generation.
  5. Brief descriptions of each GO tag.

Sample Deliverable Report:

  • Used GO Terms: ['GO:0004930', 'GO:0004984']
  • Descriptions: * GO:0004930 — G protein-coupled receptor activity
  • GO:0004984 — Olfactory receptor activity

Troubleshooting

Error / WarningCauseFix
Warning: "GO ID {go_id} not found in mapping, using hash instead."Target GO ID is not supported in go_mapping.pkl.1. Find the closest alternative GO combination in go_mapping.pkl.<br>2. Rerun with the alternative.<br>3. Explicitly report the substituted GO combination to the user.
FileNotFoundError or Checkpoint fails to loadIncorrect paths in codefp.yaml.Verify file paths match the actual directory structure.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.