agentleFS
ssinderssinder/bioinformatics-agent-skills/skills/protein-docking-hdock/SKILL.md

protein-docking-hdock

Skill67 starsChanged 19 days agoMITView on GitHub

Submits protein-protein docking jobs to the HDOCK server and retrieves the resulting Docking Score, Confidence Score, ligand RMSD and ranked complex models. Uses plain HTTP form submission against the HDOCK server rather than browser automation, supports PDB files, PDB ID:ChainID references and FASTA sequences for both receptor and ligand, records submitted jobs to a CSV so results can be collected later, and can poll for completion. This skill should be used when running protein-protein complex structure prediction on the HDOCK server, checking the docking score of a submitted complex, or downloading top-ranked docked models is requested.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When the page does not include the column, the skill computes it from the Docking Score.

    line 141

≈ “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

HDOCK Protein Docking

Overview

This skill submits protein-protein docking jobs to the HDOCK server (http://hdock.phys.hust.edu.cn/) and collects the results: Docking Score, Confidence Score, ligand RMSD, and the ranked complex models.

It uses HTTP, not a browser

HDOCK publishes no REST API — only a web interface. The natural assumption is that this therefore requires Selenium. It does not.

The submission page is a standard HTML form POST. There is no CSRF token, no hidden field, no JavaScript-computed signature, and no session cookie. The form posts to runhdock.php, and the results page is an ordinary HTML table. Everything the old Selenium scripts did is reachable with requests.

The one thing worth knowing is that the form's action attribute is empty, and the real target is set by JavaScript at submit time:

if( ! sym.value ){
    document.form1.action = "runhdock.php";     // ordinary docking
}else{
    document.form1.action = "runhsymdock.php";  // symmetric multimer
}

Posting to the homepage instead of runhdock.php returns a byte-identical copy of the homepage — HTTP 200, no error, no result. This is the single most likely way to waste an hour of debugging.

Submission and retrieval are separate steps

HDOCK's own documentation says a job "can normally complete within 30 min". Baking the wait into the submission command means the user stares at a blank terminal for half an hour. This skill therefore splits the workflow:

submit_docking.py     →  returns a job URL in ~2 seconds
        ↓ (minutes to tens of minutes, server-side)
fetch_docking_results.py →  reads the score

Submitted jobs are appended to jobs.csv, so a batch can be collected later in one pass.

When to Use This Skill

  • Predicting a protein-protein complex structure with HDOCK
  • Getting the Docking Score / Confidence Score for a candidate complex
  • Screening many receptor-ligand pairs through the HDOCK server
  • Downloading the top-ranked docked models for further analysis

Quick Start

export PYTHONPATH="$PWD/packages"

# 用 PDB ID:ChainID 提交(最快,不用准备文件)
python scripts/submit_docking.py \
    --receptor-pdb-id 1CGI:E --ligand-pdb-id 1CGI:I \
    --job-name my_docking --output-dir results/

# 用 FASTA 序列提交
python scripts/submit_docking.py \
    --receptor-seq receptor.fasta --ligand-seq ligand.fasta \
    --output-dir results/

# 稍后取结果(查一次)
python scripts/fetch_docking_results.py \
    --url http://hdock.phys.hust.edu.cn/data/xxxxxxxxxxxx/ \
    --output-dir results/

# 批量收集所有已提交作业
python scripts/fetch_docking_results.py \
    --jobs-file results/jobs.csv --output-dir results/ --download-models

Workflow

Submission

  1. Provide one input per molecule. Each of the receptor and the ligand accepts exactly one of four input forms: a PDB file, a PDBID:ChainID string, a FASTA sequence, or a FASTA file. The --*-seq arguments accept either inline sequence text or a path to a FASTA file — the skill detects which.
  2. Submit. The skill GETs the homepage first (matching browser behaviour), then POSTs the multipart form to runhdock.php — or runhsymdock.php when --symmetry is given.
  3. Record. The job name, ID and URL are appended to jobs.csv and jobs.json in the output directory. The command returns immediately.

Retrieval

  1. Read the page. The result page has three possible states, which the skill distinguishes explicitly:

    StateMarker on the pageReported status
    Queuedis QUEUEDqueued
    FinishedDocking Score table presentdone
    FailedERROR: messagefailed

    This distinction matters. The old script treated "not ready yet" as "failed" and aborted the whole batch on the first unfinished job.

  2. Parse the ranking matrix. The results page is a matrix: rows are metrics (Docking Score, Ligand rmsd), columns are ranks 1–10. The skill extracts the full row, so the top-10 scores are all available, not just the best one.
  3. Compute Confidence Score if needed. HDOCK's documentation gives the closed form:

    Confidence_score = 1.0 / [1.0 + e^(0.02 * (Docking_Score + 150))]

    When the page does not include the column, the skill computes it from the Docking Score. The formula is public and exact — there is no reason to wait for an element that may never appear.

  4. Optionally download models. --download-models fetches the top-ranked complex models.

Parameters

submit_docking.py

ParameterDefaultDescription
--receptor-pdb-id—Receptor as PDBID:ChainID (e.g. 1CGI:E)
--receptor-seq—Receptor FASTA sequence, inline text or file path
--receptor-pdb—Receptor PDB file path
--ligand-pdb-id—Ligand as PDBID:ChainID
--ligand-seq—Ligand FASTA sequence, inline text or file path
--ligand-pdb—Ligand PDB file path
--job-nametimestampJob label
--emailnoneNotification address; the server emails you when the job finishes
--ligand-typeproteinprotein, rna, dna, rna.d, ssdna
--symmetrynoneSymmetry such as C2 or D3; switches to the symmetric endpoint
--receptor-sitenoneReceptor binding-site residues, comma separated
--ligand-sitenoneLigand binding-site residues, comma separated
--restraintnoneResidue distance restraints
--output-dirhdock_resultsOutput directory for the job records
--timeout180Per-request timeout in seconds

fetch_docking_results.py

ParameterDefaultDescription
--url—Single job result URL
--jobs-file—Job record CSV to process in batch
--output-dirhdock_resultsOutput directory for the results
--waitoffPoll until the job finishes instead of checking once
--poll-interval20Polling interval in seconds
--max-wait3600Maximum wait in seconds
--download-modelsoffDownload the top-ranked complex models
--top-n5How many models to download
--timeout60Per-request timeout in seconds

Outputs

FileContent
jobs.csv / jobs.jsonSubmitted jobs: name, ID, URL, status
results.csv / results.jsonResults: status, Docking Score, Confidence Score, error

Validation

  • A Docking Score is not a binding affinity. HDOCK's documentation is explicit: the score comes from a knowledge-based iterative scoring function and "should not be treated as the true binding affinity of two molecules because it has not been calibrated to the experimental data." It is useful for ranking candidate poses, not for predicting a Kd.
  • A more negative score is better. For comparison, complexes in the PDB normally score around −200 or better.
  • Confidence Score above 0.7 means "likely to interact". The score is a monotone function of the Docking Score, so it adds no information beyond the score itself — it just puts the result on an interpretable scale.
  • A queued job is not a failed job. status=queued means the server is still computing. HDOCK jobs commonly take 5–30 minutes; re-run the retrieval command later rather than resubmitting.
  • "No structure found" means the input was unusable, not that the interaction is impossible. Common causes: a chain ID that does not exist in that PDB entry, a sequence containing characters other than the 20 standard amino acids, or a PDB file that the server cannot parse. Check the chain ID format (1CGI:E — four-character PDB ID, colon, chain).
  • Results are stored for two weeks by the server. Retrieve them within that window or resubmit.
  • Sequence input is modelled, not docked as-is. HDOCK builds a structure from the sequence first (via homology modelling), then docks it. Upload PDB structures when you have them — the accuracy is better and the job is faster.
  • Bind the score to the job, not to the URL alone. Job names are normalised by the server (spaces become underscores); the job_id in the URL is the stable identifier.

References

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.