Documentation

how to use TargetGen, and its API

Overview

TargetGen designs new drug-like molecules for a protein you choose. You give it a 3D structure, pick the binding site, and it generates molecules shaped to fit that site. You can then filter them by drug-likeness and download them.

  1. STEP 1
    Load a protein
    A PDB ID or your own file
  2. STEP 2
    Pick the site
    A detected pocket, a ligand, or coordinates
  3. STEP 3
    Generate
    New molecules built inside the site
  4. STEP 4
    Filter and download
    SDF, MOL2 or CSV
Generated molecules are computational suggestions. They are not tested compounds, so treat them as starting points to validate, not as results.

Quick start

  1. 1Go to the home page and sign in with Google. Loading a structure needs an account.
  2. 2Type a 4-character PDB ID such as 3POZ and press Fetch, or upload your own .pdb or .ent file (up to 25 MB).
  3. 3On the target page, TargetGen detects binding pockets automatically. Choose the one you want, or pick a ligand already in the structure, or enter coordinates by hand.
  4. 4Set drug-likeness constraints on the next page, or keep the defaults.
  5. 5On the generate page choose how many molecules you want and click Generate molecules. Confirm the popup to start. The run uses one credit per molecule.
  6. 6Watch the progress, or close the tab. You can leave the page and come back, and you can ask to be emailed when it finishes.
  7. 7Open the results, filter and sort them, view them in 3D, and download them.

Choosing a binding site

The site tells the model where in the protein to build molecules. There are three ways to set it.

OptionUse it whenWhat it does
Detected pocketYou don't know where the site isP2Rank scores the protein surface and lists likely pockets, best first. Pick one.
Native ligandThe structure already contains a bound ligandCentres the site on that ligand, so you design around a known binding mode.
Manual coordinatesYou know the exact locationEnter an x, y, z centre in ångströms.

Pocket detection takes around 15 seconds. The 3D viewer highlights the selected site so you can check it before spending credits.

Generation settings

SettingRangeEffect
Number of molecules5 to your plan's per-run limit (20 Free, 50 Pro, 100 Max)How many molecules to attempt. This is also what the run costs in credits.
Bounding box12 to 35 ÅThe size of the region around the site that the model can see and build in. Larger boxes include more surrounding protein.
Email me when it's doneOn or offSends a message when the run finishes or fails.

How long it takes. Roughly 15 seconds per molecule, so 20 molecules take about 5 minutes. If other runs are ahead of yours you wait in a queue first, and the page shows your position.

You may get fewer molecules than you asked for. Some generated molecules can't be turned into a valid structure and are discarded. The cost is based on the number you request.

Reading your results

Each molecule comes with properties calculated from its structure:

PropertyMeaning
MWMolecular weight (Da)
LogPLipophilicity estimate
HBD / HBAHydrogen-bond donors and acceptors
TPSATopological polar surface area (Ų)
Rotatable bondsA measure of flexibility
QEDDrug-likeness score from 0 to 1; higher is more drug-like
LipinskiPasses the rule of five with at most one violation

Use the constraint filters to keep molecules within ranges you care about, such as MW, LogP, HBD, HBA, TPSA, QED and rotatable bonds, and to exclude substructures. Sort by QED, MW, LogP, TPSA, HBA or HBD. Open any molecule to see it posed in the binding site in 3D.

Downloads. Get the molecules as SDF (3D structures),MOL2 or CSV (SMILES and properties). The download respects your current filters.

Finished runs are kept for 30 days and then deleted. Download what you need before then.

Credits, plans and limits

One credit pays for one requested molecule. Credits come from two places:

  • Monthly credits from your plan. They reset on the 1st of each month (UTC) and don't carry over.
  • Purchased top-ups. They never expire, and are used after your monthly credits.
FreeProMax
PriceFree$9 / month$29 / month
Monthly credits505002000
Molecules per run2050100
Runs at the same time1310

On the Free plan the Generate button is disabled while a run is in progress, and turns on again as soon as it finishes. See Pricing to upgrade. Paid plans are 30-day passes that you renew from that page.

Refunds.

  • A run that fails, times out or produces no molecules is refunded in full automatically.
  • You can cancel a run from the generate page. A run still waiting in the queue is refunded in full. A run that has started is refunded in proportion to the time not yet used, up to 80% of its cost.

API reference

Everything above is available over a REST API, so you can script runs. API access is included in the Max plan. Create a key in Settings, API keys (up to 5 active keys). The full key is shown once, so copy it then. API runs use the same credits and limits as the website. If your Max pass lapses, your keys stop working until you renew; they are not deleted.

ItemValue
Base URLhttps://targetgen-rjmtde.app.nearsite.cloud/v1
AuthenticationSend your key in the X-Api-Key header on every request
FormatJSON requests and responses (file upload is multipart)

Endpoints

Method and pathPurpose
GET /meYour email, plan, credit balance and when it resets
POST /pdb/fetchLoad a structure by PDB ID. Body: {"pdb_id": "3POZ"}. Returns a session_id
POST /pdb/uploadUpload a .pdb or .ent file (multipart field "file"). Returns a session_id
GET /pdb/{session_id}/pocketsDetect binding pockets for a session
POST /jobsStart a generation run (see body below)
GET /jobsList your runs
GET /jobs/{job_id}Status and progress. When done, the molecules are included
GET /jobs/{job_id}/resultsThe molecules and their properties (run must be done)
GET /jobs/{job_id}/sdfDownload all molecules as one SDF file (run must be done)

Start a run

FieldTypeNotes
session_idstringFrom /pdb/fetch or /pdb/upload. Required
center[x, y, z]Site centre in ångströms, for example from a pocket. Required
num_samplesintegerMolecules to generate. Default 20; capped by your plan (20 / 50 / 100)
bbox_sizenumberBox size in Å, 10 to 40. Default 23

Example

bash
# 1. Load a structure
curl -X POST https://targetgen-rjmtde.app.nearsite.cloud/v1/pdb/fetch \
  -H "X-Api-Key: tg_..." -H "Content-Type: application/json" \
  -d '{"pdb_id": "3POZ"}'

# 2. Find pockets (use the session_id from step 1)
curl https://targetgen-rjmtde.app.nearsite.cloud/v1/pdb/<session_id>/pockets -H "X-Api-Key: tg_..."

# 3. Start a run at a pocket centre
curl -X POST https://targetgen-rjmtde.app.nearsite.cloud/v1/jobs \
  -H "X-Api-Key: tg_..." -H "Content-Type: application/json" \
  -d '{"session_id": "<session_id>", "center": [12.4, 8.1, 22.7], "num_samples": 20}'

# 4. Poll until status is "done", then download
curl https://targetgen-rjmtde.app.nearsite.cloud/v1/jobs/<job_id> -H "X-Api-Key: tg_..."
curl https://targetgen-rjmtde.app.nearsite.cloud/v1/jobs/<job_id>/sdf -H "X-Api-Key: tg_..." -o molecules.sdf
python
import time, requests

BASE = "https://targetgen-rjmtde.app.nearsite.cloud/v1"
H = {"X-Api-Key": "tg_..."}

s = requests.post(f"{BASE}/pdb/fetch", headers=H, json={"pdb_id": "3POZ"}).json()["session_id"]
job = requests.post(f"{BASE}/jobs", headers=H, json={
    "session_id": s, "center": [12.4, 8.1, 22.7], "num_samples": 20,
}).json()["job_id"]

while True:
    r = requests.get(f"{BASE}/jobs/{job}", headers=H).json()
    if r["status"] in ("done", "failed"):
        break
    time.sleep(10)

print(r["status"], len(r.get("results", [])), "molecules")

Statuses and errors

A run's status is queued, running, done or failed. Errors use standard HTTP codes:

CodeMeaning
401Missing, invalid or revoked API key
402Not enough credits, over your per-run limit, or you already have the maximum number of runs going. The body says which
403Your plan doesn't include API access, or your account is blocked. The body says which
404Unknown session or run, or it belongs to someone else
409The run isn't finished yet
413Uploaded file is larger than 25 MB
422A field is missing or invalid, such as a PDB ID that isn't 4 letters or digits

How it works

TargetGen chains four well-known tools. Knowing what each does helps you read the results.

StageToolWhat happens
StructureRCSB PDBYour structure is fetched by ID, or read from your upload.
Pocket detectionP2Rank 2.5A machine-learning model scores points on the protein surface for how ligand-friendly they look and groups the best ones into pockets.
GenerationPocketXMolA 3D diffusion model. Starting from random noise inside the site, it refines atom positions and types over 100 steps until valid molecules emerge. The protein stays fixed.
Properties and filteringRDKitEach molecule is checked and its drug-likeness properties are calculated, so you can filter and rank.

Troubleshooting

My run failed. Did I lose my credits?

No. Failed and timed-out runs are refunded in full automatically.

The Generate button is greyed out.

Either a run is already in progress on a plan that allows one at a time (it enables again when that run finishes), you don't have enough credits for the number of molecules chosen, or no binding site is selected yet.

I asked for 20 molecules and got fewer.

Some generated molecules can't be rebuilt into a valid structure and are dropped. This is normal. The credits charged are based on the number requested.

My upload was rejected.

Files must end in .pdb or .ent, be under 25 MB, and contain ATOM records. PDB IDs must be exactly four letters or digits.

Where did my old results go?

Runs are deleted after 30 days. Download results you want to keep.

Still stuck?
Send us a message and include your run ID if it's about a run.
Contact support