Skip to main content
    Protein Science

    17 min read

    P2Rank vs fpocket: Machine-Learning vs Geometric Binding-Site Detection

    One method learns what a ligand-binding surface looks like, the other finds the cavities in the coordinates — and the benchmarks reward each for a different thing

    Ivy Biosciences

    how this was written

    an AI agent, from a research brief and primary literature. reviewed and edited by the ivy biosciences team before publishing.

    P2Rank ranks the true binding site higher; fpocket finds more sites somewhere in a longer list. P2Rank (Krivák & Hoksza, J. Cheminform. 2018) is a machine-learning method: a random forest scores points on the protein's solvent-accessible surface by how much their chemical neighbourhood resembles known ligand-binding sites, and the high-scoring points are clustered into ranked pockets. fpocket (Le Guilloux, Schmidtke & Tufféry, BMC Bioinformatics 2009) is a geometric method: it finds cavity-shaped empty space with alpha spheres from a Voronoi tessellation and ranks the resulting pockets with a small scoring function. On the two held-out sets in the P2Rank paper, P2Rank put a true site in its top-n predictions 72.0% and 68.6% of the time against 56.4% and 52.4% for fpocket. In the largest independent benchmark, fpocket's full output contained 91.3% of observed sites at some rank against P2Rank's 57.0% (Utgés & Barton, J. Cheminform. 2024). Use P2Rank when you want a short, well-ordered list. Use fpocket when you want every candidate cavity, with a volume, and you will rank them yourself.

    On .bloom*, P2Rank runs as a job and fpocket is not offered on .bloom*. Everything below about fpocket describes it as an external package you run yourself. It is free, MIT-licensed and a one-line install, and for some of the jobs in this article it is the right tool.

    This article is about the method. What changes when the input is an AlphaFold or ESMFold model rather than a crystal structure is a separate question, covered in Binding Pocket Prediction on AlphaFold Models vs Experimental Structures.

    At a Glance#

    AspectP2Rankfpocket
    Method classMachine learning (random forest)Geometric (alpha spheres, Voronoi tessellation)
    What it scoresPoints on the solvent-accessible surface, by local chemical neighbourhoodClusters of alpha spheres, by a 5-descriptor scoring function
    Trained onKnown protein–ligand complexes (CHEN11)Scoring function fitted on 307 hand-checked complexes
    Pocket representationA cloud of surface points plus lining residues; no volumeAlpha-sphere cluster with a volume and per-pocket descriptors
    Pockets per protein (COACH420 / HOLO4K)6.3 / 12.614.6 / 27
    Top-n success, COACH420 / HOLO4K72.0% / 68.6%56.4% / 52.4%
    Max recall, any rank (LIGYSIS)57.0%91.3%
    Time per protein (~2,500 atoms, one core)6.8 s cold, 0.9 s amortised0.2 s
    ExtrasPRANK re-scoring of other tools' pockets; conservation modelsDruggability score; mdpocket for MD trajectories
    Language / licenceJava; MITC; MIT
    Runs on .bloom*Yes, as p2rank_predictNo — not offered on .bloom*

    Success rates are the authors' figures from the P2Rank paper (Table 3), where a hit is a pocket centre within 4 Å of any ligand atom and n is the number of ligands in the structure. Pocket counts and timings are from the same paper's Tables 4 and 2. Max recall is from LIGYSIS, which uses a different criterion (below), so do not read it against the top-n row.

    How Each Method Works#

    fpocket: find the empty space, then rank it#

    fpocket is built on alpha spheres: a sphere that touches four atoms on its boundary and contains none inside. Their radii read the local curvature of the protein. Very small spheres sit inside the protein, very large ones out in the solvent, and clefts and cavities fill with spheres of intermediate size. fpocket submits the heavy atoms to Qhull for a Voronoi tessellation, keeps the alpha spheres between a minimum and maximum radius (3.0 and 6.0 Å by default in the original release), labels each sphere polar or apolar by the atoms it touches, and merges nearby spheres into pockets in three clustering passes (Le Guilloux et al., 2009).

    Each pocket is then ranked by a scoring function fitted with partial least squares on five descriptors: the number of alpha spheres, local hydrophobic density, the proportion of apolar spheres, a polarity score and alpha-sphere density. The paper is explicit about what that score is: it "does not reflect drugability. It simply reflects the putative capacity of the pocket to bind a small molecule". A separate druggability score came later, trained on a curated set of druggable and non-druggable cavities (Schmidtke & Barril, J. Med. Chem. 2010), and the current README notes it has since been re-optimised (Discngine/fpocket).

    Because the pocket is the set of alpha spheres, fpocket gives you a shape: a volume, the atoms and residues that line it, and the sphere centres, written out as PDB and PQR files with PyMOL and VMD scripts. Nothing in this pipeline was learned from ligand-bound examples except the five weights of the ranking function.

    P2Rank: score the surface, then cluster the hits#

    P2Rank starts from the opposite end. It places regularly spaced points on the protein's solvent-accessible surface, computes a feature vector for each point by projecting distance-weighted properties of protein atoms within 6 Å onto it, and asks a random forest how "ligandable" that neighbourhood is. The points that score high are clustered into pockets, and each pocket is ranked by the scores of its points (Krivák & Hoksza, 2018). The default model is 200 trees trained on CHEN11, 251 proteins whose binding sites were filled out by superimposing ligands from close homologues so that unlabelled true sites would not be counted as negatives.

    The output is a ranked list of pockets, each with a centre, a raw score, and the residues and surface atoms that form it. Later releases add a 0–1 probability: a transformation of the raw score, calibrated on HOLO4K so that it approximates the fraction of true sites among predictions with a similar score (Jakubec et al., Nucleic Acids Res. 2022). What P2Rank does not give you is a shape. Its authors state the limitation directly: "it does not produce exact shapes and volumes of predicted binding sites. For each predicted pocket, P2Rank can produce a set of its SAS points that somewhat define its shape, but they are not regularly spaced in 3D."

    The point of contact: geometry is most of the signal#

    The P2Rank paper contains a result that makes the "ML vs geometry" framing less clean than it sounds. A reduced P2Rank using a single geometric feature — protrusion, essentially how many protein atoms surround a surface point — scored 64.2% top-n on COACH420, already above fpocket's 56.4%. The full model's other features took it to 72.0%. Much of what the classifier knows is shape. The difference is that P2Rank reads shape at each surface point and learns which shapes bind ligands, where fpocket's shape is the pocket itself and its ranking was fitted on five summary descriptors.

    The two also meet in software. P2Rank ships with PRANK, the authors' earlier method, which takes pockets found by another tool and re-scores them with the same kind of learned surface model (Krivák & Hoksza, J. Cheminform. 2015). It was released with support for fpocket and ConCavity output out of the box. Keep that in mind for the benchmarks, because the best configuration in the largest one is exactly this hybrid.

    What the Benchmarks Actually Measured#

    A pocket-prediction percentage means nothing without three things: the

    distance criterion, the rank cutoff, and the dataset. The three studies below use different combinations, so compare numbers within a table, never across them.

    The P2Rank paper: ranking on held-out holo structures#

    The authors trained on CHEN11, tuned on a separate development set, and state that "only results on [COACH420] and HOLO4K datasets represent an unbiased estimate of P2Rank's performance". A prediction counts as a hit when the pocket centre lies within 4 Å of any ligand atom, among the top n (or n+2) pockets, where n is the number of ligands in the structure (Krivák & Hoksza, 2018, Table 3). The paper labels this criterion "DCC" while defining it as the distance to the closest ligand atom, which most later papers call DCA.

    MethodCOACH420 top-ntop-(n+2)HOLO4K top-ntop-(n+2)
    fpocket56.468.952.463.1
    fpocket re-scored by PRANK63.676.562.071.0
    P2Rank, protrusion feature only64.273.059.367.7
    P2Rank72.078.368.674.0

    Two things in this table matter more than the headline gap. First, the jump from fpocket to fpocket + PRANK uses the same pockets; only the order changed. That is a measurement of how much of fpocket's deficit is ranking rather than detection. Second, fpocket returned 14.6 pockets per protein on COACH420 and 27 on HOLO4K, against P2Rank's 6.3 and 12.6, where the true number was 1.2 and 2.4 (Table 4). fpocket's authors anticipated this in 2009: in their own benchmark it found the site in its top three 92% of the time on ligand-bound structures, and they wrote that "further filtering on pocket drugability (for instance) could be used to re-rank the top 3 pockets" (Le Guilloux et al., 2009).

    Both test sets are holo structures — solved with the ligand bound, so the pocket is already open in the coordinates.

    LIGYSIS: an independent benchmark that rewards coverage#

    The largest independent comparison to date ran 13 methods and 15 variants on 2,775 human protein chains, using biological assemblies rather than asymmetric units, P2Rank v2.4.2 and fpocket v4.0 (Utgés & Barton, 2024). It counts a site as found when the pocket centre is within 12 Å of the site's centre (a centre-to-centre criterion the authors argue is the fair equivalent of 4 Å to the nearest atom), and it reports recall at several rank cutoffs plus precision over the 1,000 highest-scoring predictions.

    MethodRecall, top-NRecall, top-N+2Recall, any rankPrecision, top 1,000
    fpocket38.8%46.5%91.3%47.3%
    P2Rank46.7%51.9%57.0%79.2%
    fpocket re-scored by PRANK48.8%60.4%91.3%81.7%

    Read the columns, not the winner. P2Rank is the better ranker: higher recall at a tight cutoff and far higher precision among confident predictions. fpocket is the better detector: 91.3% of observed sites are somewhere in its output, while 43% of sites never appear in P2Rank's output at any rank, so no cutoff recovers them. The cost is volume: fpocket produced 57,859 pockets on this set, a median of 17 per protein against P2Rank's median of 3.

    The hybrid takes both. fpocket re-scored by PRANK had the highest top-N+2 recall of every method tested, which is the study's main methodological point: "performance can be boosted with a solid scoring scheme." The geometry finds the cavities; the learned scorer puts the right one near the top.

    On shape, the picture flips again. Among sites each method located correctly, the predicted pocket volume overlapped the observed site by 58.2% on average for P2Rank and 38.2% for fpocket. At the residue level, P2Rank's mean F1 was 0.31 against fpocket's 0.23.

    Sensitivity to the input structure#

    Geometry is only as good as the coordinates it reads, and the two methods degrade differently.

    • Predicted structures. On 688 proteins with both a PDB structure and an AlphaFold2 model, top-1 success (pocket centre within 4 Å of a ligand heavy atom) was 0.81 on both for P2Rank, while fpocket fell from 0.75 to 0.50 (Carbery et al., J. Cheminform. 2024). Those AlphaFold2 models were unusually accurate — only 1.6% exceeded 2 Å backbone RMSD — so treat this as a statement about the method's sensitivity, not about predicted structures in general. The input side of this is covered in the AlphaFold vs experimental pockets article.
    • Apo versus holo. Across 304 protein families with both ligand-bound and ligand-free crystal structures, fpocket was the only one of seven methods tested with a statistically significant preference for holo structures (median F score 0.42 apo vs 0.53 holo, p = 0.04) (Clark, Orban & Carlson, Sci. Rep. 2020). P2Rank was not among the seven. Most families in that set barely move at the site, so the penalty is small; it grows where the pocket changes shape.
    • Cryptic sites. Where the pocket opens only on binding, P2Rank suffers too. On apo structures of cryptic sites, its residue-level AUPRC was 0.21, against 0.34 on the matched holo structures (Škrhák et al., Bioinformatics 2025). Neither method can see a pocket that is not in the coordinates.

    When to Use Each#

    Use P2Rank when#

    • You want a short list you can act on. You need a docking box, or a target triage across many structures, and you will look at the top three pockets rather than thirty. P2Rank's precision among confident predictions is what you are paying for.
    • Your input may be a predicted model. P2Rank held its top-1 success on accurate AlphaFold2 models where fpocket lost a third of it. Use the alphafold model, which ignores the B-factor column where predicted structures store pLDDT.
    • You want a probability, not just an order. The 0–1 pocket probability is calibrated against the fraction of true sites at a given score, so it reads the same way from one protein to the next.

    Use fpocket when#

    • Missing a site is worse than reading a long list. fpocket's full output contained 91% of observed sites in LIGYSIS. For allosteric or secondary-site hunting, start from the exhaustive list and filter it.
    • You need a cavity's shape and volume. fpocket's pockets are alpha-sphere clusters with volumes and descriptors you can compute on, filter on and compare across structures. P2Rank does not report volume.
    • You are analysing an ensemble or a trajectory. mdpocket tracks pockets across molecular-dynamics frames and conformational ensembles (Schmidtke et al., Nucleic Acids Res. 2010), which is how transient pockets are found in practice.
    • You are building your own scoring. fpocket was designed as a platform for new scoring functions and descriptor extraction, and it is the faster of the two: 0.2 seconds per protein against P2Rank's 0.9 seconds once loaded.

    Use both when#

    The site matters and you have a few minutes. Run fpocket for coverage and P2Rank (or PRANK over fpocket's pockets) for ranking, then look hardest at the pockets both methods place in the same spot. The best configuration in the largest independent benchmark was exactly that combination.

    Limitations of Both#

    • Neither predicts binding. A pocket score says a surface region looks like the binding sites a method was fitted to, or that there is a cavity of the right size. It does not say any molecule binds there, or how tightly.
    • Druggability is a second model, not a measurement. fpocket's druggability score is a logistic model on pocket descriptors; the druggability class .bloom* attaches to P2Rank pockets is a heuristic over the pocket score and residue composition. Fragments, covalent binders and protein–protein interaction inhibitors can bind pockets that such scores call difficult.
    • Almost every success rate is on holo structures. The pocket was held open by a ligand when the crystal was solved. Expect lower numbers on apo structures, and much lower on cryptic sites.
    • Benchmarks disagree because they define success differently. Nearest ligand atom versus site centre, 4 Å versus 12 Å, top-n versus top-n+2, recall versus precision: each choice moves a number by ten points or more. Never quote a percentage without its criterion.
    • Rank orderings between methods are fragile; the structural deltas are not. P2Rank's ranking lead over plain fpocket holds in every study here. The size of the lead depends on the dataset.

    How to Run It on .bloom*#

    The platform runs P2Rank as the p2rank_predict job. fpocket is not offered on .bloom*, and neither is PRANK re-scoring or P2Rank's conservation models, so if you need fpocket's coverage or volumes, run it locally (conda install -c conda-forge fpocket, then fpocket -f protein.pdb) and compare its pockets against the P2Rank result by residue.

    Input. One structure, given either as a 4-character PDB ID or a UniProt accession in the same field (the job detects which), or as PDB content from an upload or an earlier job (P2Rank inputs). The options are the scoring model (default for experimental structures, alphafold for predicted ones), max_pockets (1–50, default 10) and whether to write a PyMOL script. When you give a UniProt accession, the job resolves a structure experimental-first and falls back to the AlphaFold Database model, and it sets the scoring model to match the structure it resolved. There is no chain filter: the whole structure you submit is analysed, so trim it to the chain or domain you care about first.

    Output. A ranked pocket table with the 0–1 pocket probability, the lining residues, the pocket centre, hydrophobic and polar residue fractions and a druggability class, plus pocket and residue CSVs and the PyMOL script (P2Rank outputs). Volume and surface area come back empty, because P2Rank does not compute them — that is the method's point-cloud representation, not a missing feature. When the known site ranks second or third, or nothing is found, the troubleshooting page covers the usual causes.

    Access. The job runs on CPU, takes a few minutes at most, and runs without an account. Start from the P2Rank quickstart, or ask Ivy for the whole arc in one request: fetch or fold the structure (ESMFold), predict the pockets, and dock a ligand into the top one with DiffDock. Which tool? matches other goals to the job that answers them.

    Key Takeaways#

    • The methods answer different questions. fpocket asks where the coordinates contain a cavity; P2Rank asks where the surface resembles known binding sites.
    • P2Rank ranks better; fpocket covers more. 72.0% vs 56.4% top-n on COACH420, but 57.0% vs 91.3% of LIGYSIS sites found at any rank.
    • Most of fpocket's gap is ranking. Re-scoring fpocket's own pockets with PRANK closed much of it in the P2Rank paper and topped the independent benchmark.
    • Geometry is most of P2Rank's signal too. A one-feature, protrusion-only P2Rank already beat fpocket on COACH420.
    • fpocket gives shapes; P2Rank gives points. Use fpocket when you need a volume or a trajectory; use P2Rank when you need a short list and a calibrated probability.
    • Both read the coordinates you give them. Apo structures, cryptic sites and inaccurate models cost both methods; fpocket is the more sensitive of the two.

    Pick the method by the question — ranked shortlist or exhaustive cavity map — then run P2Rank on your structure, with the model matched to where the structure came from, on the .bloom* platform.

    References#

    1. Krivák, R. & Hoksza, D. "P2Rank: machine learning based tool for rapid and accurate prediction of ligand binding sites from protein structure." Journal of Cheminformatics 10, 39 (2018). doi:10.1186/s13321-018-0285-8 · code: rdk/p2rank
    2. Le Guilloux, V., Schmidtke, P. & Tufféry, P. "Fpocket: an open source platform for ligand pocket detection." BMC Bioinformatics 10, 168 (2009). doi:10.1186/1471-2105-10-168 · code: Discngine/fpocket
    3. Krivák, R. & Hoksza, D. "Improving protein-ligand binding site prediction accuracy by classification of inner pocket points using local features." Journal of Cheminformatics 7, 12 (2015). doi:10.1186/s13321-015-0059-5
    4. Jakubec, D., Škoda, P., Krivák, R., Novotný, M. & Hoksza, D. "PrankWeb 3: accelerated ligand-binding site predictions for experimental and modelled protein structures." Nucleic Acids Research 50, W593–W597 (2022). doi:10.1093/nar/gkac389
    5. Utgés, J.S. & Barton, G.J. "Comparative evaluation of methods for the prediction of protein–ligand binding sites." Journal of Cheminformatics 16, 126 (2024). doi:10.1186/s13321-024-00923-z
    6. Carbery, A., Buttenschoen, M., Skyner, R., von Delft, F. & Deane, C.M. "Learnt representations of proteins can be used for accurate prediction of small molecule binding sites on experimentally determined and predicted protein structures." Journal of Cheminformatics 16, 32 (2024). doi:10.1186/s13321-024-00821-4
    7. Clark, J.J., Orban, Z.J. & Carlson, H.A. "Predicting binding sites from unbound versus bound protein structures." Scientific Reports 10, 15856 (2020). doi:10.1038/s41598-020-72906-7
    8. Škrhák, V., Novotný, M., Feidakis, C.P., Krivák, R. & Hoksza, D. "CryptoBench: cryptic protein–ligand binding sites dataset and benchmark." Bioinformatics 41, btae745 (2025). doi:10.1093/bioinformatics/btae745
    9. Schmidtke, P. & Barril, X. "Understanding and Predicting Druggability. A High-Throughput Method for Detection of Drug Binding Sites." Journal of Medicinal Chemistry 53, 5858–5867 (2010). doi:10.1021/jm100574m
    10. Schmidtke, P., Le Guilloux, V., Maupetit, J. & Tufféry, P. "fpocket: online tools for protein ensemble pocket detection and tracking." Nucleic Acids Research 38, W582–W589 (2010). doi:10.1093/nar/gkq383

    Frequently asked

    Is P2Rank more accurate than fpocket?

    At putting the true binding site near the top of the list, yes. On the two held-out sets in the P2Rank paper, a site was found in the top-n predictions (n = number of ligands) 72.0% of the time on COACH420 and 68.6% on HOLO4K, against 56.4% and 52.4% for fpocket, where a hit means the pocket centre lies within 4 Å of a ligand atom. An independent benchmark on 2,775 human protein chains (LIGYSIS) agrees on ranking but shows the other side: fpocket's full output contains 91.3% of observed sites at some rank, against 57.0% for P2Rank. P2Rank ranks better; fpocket covers more.

    What is the difference between machine-learning and geometric pocket detection?

    A geometric method such as fpocket finds empty, enclosed space in the coordinates — fpocket fills the protein with alpha spheres from a Voronoi tessellation, keeps the ones of cavity-like size, clusters them into pockets, and ranks the pockets with a five-descriptor scoring function. A machine-learning method such as P2Rank places points on the solvent-accessible surface, describes each point's local chemical neighbourhood, and uses a random forest trained on known protein–ligand complexes to score how ligand-like that neighbourhood is, then clusters the high-scoring points. The first answers 'where is there a cavity?', the second 'where does this look like the binding sites in the training data?'.

    Can P2Rank re-rank fpocket pockets?

    Yes. The P2Rank package includes PRANK, the authors' earlier method, which re-scores pockets produced by another tool. In the P2Rank paper, fpocket re-scored by PRANK reached 63.6% top-n on COACH420 against 56.4% for fpocket alone. In the independent LIGYSIS benchmark, fpocket re-scored by PRANK had the highest top-N+2 recall of every method tested, 60.4% against 51.9% for P2Rank and 46.5% for fpocket, because it keeps fpocket's coverage and replaces its ranking.

    Which pocket finder is faster, P2Rank or fpocket?

    fpocket. The P2Rank paper timed both on a single 3.7 GHz core on proteins of about 2,500 atoms: fpocket took 0.2 seconds per protein, P2Rank 6.8 seconds from a cold start and 0.9 seconds per protein once the Java virtual machine and model were loaded across a dataset. Both are fast enough for proteome-scale runs; the gap matters only when you run millions of structures or many molecular-dynamics frames.

    Does .bloom* run fpocket?

    No. fpocket is not offered on .bloom*. The platform runs P2Rank as the p2rank_predict job, with the default model for experimental structures and the alphafold model for predicted ones, and it does not expose PRANK re-scoring or P2Rank's conservation models. fpocket is MIT-licensed and installs from conda-forge, so run it locally when you need cavity volumes, molecular-dynamics pocket tracking or maximum coverage.


    tags

    • binding site prediction
    • P2Rank
    • fpocket
    • pocket detection
    • structure-based drug design
    • machine learning

    about the author

    Ivy Biosciences

    The Ivy Biosciences team builds AI tools for computational drug discovery.

    Loading...