Results format¶
A run with output_format="atlas" writes one results folder. This is the default of pocketvina dock. The folder
has Parquet tables with the scores and one compressed pose file per protein, as in the PocketVina Atlas.
Results directory¶
A run writes this folder:
results/
MANIFEST.json the run: PocketVina version, settings, checksum of the ligand list
manifest/<protein_id>.json written last for each protein: the protein is done
poses/<protein_id>.poses highest-affinity pose per ligand as SDF, every engine output as PDBQT
structures/<protein_id>.pdb.gz the input structure, gzipped
sas/<protein_id>.json.gz P2Rank's solvent accessible surface points, when the run ran P2Rank
tables/
ligands.parquet one table for the whole run
proteins/<protein_id>.parquet the other tables have one part per protein
pockets/<protein_id>.parquet
pocket_runs/<protein_id>.parquet
modes/<protein_id>.parquet
pairs/<protein_id>.parquet
posebusters/<protein_id>.parquet after PoseBusters checks
A protein is done when its manifest/<protein_id>.json exists. A new run skips the done proteins.
A folder holds one run. MANIFEST.json keeps the settings that change the results, such as box, seed, pockets and
P2Rank model. Docking into the folder with other settings or ligands is refused. Use a new folder, or --force to
replace the run. You can change the GPUs, the temp folder and the timeouts.
Reading results¶
pandas¶
Results gives you the tables as pandas DataFrames. Open a results folder:
from pocketvina.io.results import Results
res = Results("results")
The protein ids, sorted:
res.proteins()
The highest-affinity pose of each protein and ligand:
pairs = res.pairs()
The 10 of them with the lowest Vina score:
pairs.sort_values("vina").head(10)
The P2Rank pockets of one protein, with their score, probability and centre:
res.pockets("1fbl")[["pocket", "score", "probability", "center_x", "center_y", "center_z"]]
Every pose of one protein with its Vina score (affinity). columns reads only these columns:
res.modes("1fbl", columns=["ligand_idx", "pocket", "mode", "affinity"])
The ligands, with the SMILES docked and whether their preparation worked (status):
res.ligands(columns=["ligand_idx", "ligand_id", "smiles_docked", "status"])
The SDF text of the highest-affinity pose of a protein and ligand:
res.top_sdf("1fbl", "molecule1")
The input structure of a protein, as bytes:
res.structure("1fbl")
P2Rank's solvent accessible surface (SAS) points of a protein (SAS points), or None:
res.sas("1fbl")
Results reads only the proteins that are done.
DuckDB¶
Results.duckdb() gives you a DuckDB connection with one view per table:
con = res.duckdb()
Run SQL over these views. .df() gives the rows as a pandas DataFrame, here the 10 protein x ligand pairs with the
lowest Vina score:
con.sql("""
SELECT p.protein_id, p.ligand_id, p.vina, round(p.ligand_efficiency, 3) AS le, l.smiles_docked
FROM pairs p JOIN ligands l USING (ligand_idx)
ORDER BY p.vina LIMIT 10
""").df()
You can run SQL from the command line too, here the lowest Vina score of each ligand over all proteins, lowest first:
pocketvina query --results results "SELECT ligand_id, min(vina) AS best FROM pairs GROUP BY ligand_id ORDER BY best"
With --csv, the rows are saved as a CSV file, here every pose with a Vina score below -9:
pocketvina query --results results --csv strong.csv "SELECT * FROM modes WHERE affinity < -9"
Exports¶
pocketvina export writes poses and tables as plain files. With --what best --format sdf, it writes the
highest-affinity pose of each protein and ligand, one SDF file per protein x ligand:
pocketvina export --results results --what best --format sdf --out best_poses
With --what all --format pdbqt, it writes every engine output:
pocketvina export --results results --what all --format pdbqt --out outputs
With --what best --format csv, it writes the highest-affinity pose of each protein and ligand as a table,
best_poses.csv:
pocketvina export --results results --what best --format csv --out tables
With --what all --format csv, it writes combined_results.csv, as in v0.1:
pocketvina export --results results --what all --format csv --out tables
In Python, use res.export(out_dir, what=..., fmt=...) and res.to_combined_csv(path).
Tables¶
All tables are Parquet files. "null" marks columns that can be empty. Vina scores are in kcal/mol, distances in Å.
Ids¶
protein_id: the structure file name without extension. Characters other thanA-Za-z0-9._-become_.ligand_id: themolecule_nameof the input.ligand_idxis its row intables/ligands.parquet, from 0.pocket: the P2Rank rank of the pocket, where 1 is the best.mode: the rank of a pose within one pocket, where 1 is the highest-affinity pose.
The highest-affinity pose of a ligand has the lowest Vina score over all docked pockets. Ties go to the lower pocket, then the lower mode.
ligands¶
The prepared ligands.
Column |
Type |
Meaning |
|---|---|---|
|
int32, string |
|
|
string |
the SMILES as given |
|
string, null |
the SMILES docked: the largest fragment of a salt or mixture |
|
string null, int16 null |
InChIKey and heavy atoms of the docked molecule |
|
string, int64 null |
|
|
string, string null |
|
|
string, null |
the input of the engine |
proteins¶
One row per protein.
Column |
Type |
Meaning |
|---|---|---|
|
string, string null |
|
|
string |
the input file, and its copy in the results folder |
|
binary(32) |
checksum of the receptor given to the engine |
|
int16 |
pockets found by P2Rank, and pockets docked |
|
string, string null |
|
pockets¶
Every P2Rank pocket, docked or not.
Column |
Type |
Meaning |
|---|---|---|
|
string, int16, string |
the P2Rank rank and name, such as |
|
float32, float32 null |
P2Rank score and probability |
|
float32 |
pocket centre, the centre of the docking box |
|
float32 |
size of the docking box |
|
string, null |
residues lining the pocket, such as |
pocket_runs¶
One row per ligand and docked pocket.
Column |
Type |
Meaning |
|---|---|---|
|
string, int32, string, int8 |
|
|
string |
|
|
int8, float32 null |
poses found, and the lowest Vina score in this pocket |
|
where the engine output is in the pose file |
|
|
int64 null, float32 null, string null |
engine seed, seconds per ligand, error message |
modes¶
One row per pose.
Column |
Type |
Meaning |
|---|---|---|
|
||
|
float32 |
Vina score |
|
float32 |
RMSD lower and upper bound to mode 1, as Vina reports them |
|
where the pose is in the pose file |
pairs¶
The highest-affinity pose of each ligand in each protein.
Column |
Type |
Meaning |
|---|---|---|
|
||
|
float32 |
lowest Vina score. NaN without a pose |
|
int8 |
where the highest-affinity pose is. -1 without a pose |
|
float32 |
of that mode |
|
string, null |
PoseBusters status of the highest-affinity pose |
|
where its SDF is in the pose file |
|
|
string |
|
Results.pairs() and the DuckDB view pairs add ligand_efficiency, which is -vina / n_heavy. With PoseBusters
results they also add pb_valid.
posebusters¶
Written by pocketvina bust or posebusters=True. See PoseBusters checks.
Column |
Type |
Meaning |
|---|---|---|
|
the pose checked. -1: no pose |
|
|
string |
PoseBusters configuration and version |
|
string, bool null |
|
|
int32 |
bit b set: check b passed, or gave no result |
|
string, null |
names of the failed checks, comma-separated |
|
int16 null, float32 null, string null |
Pose files¶
poses/<protein_id>.poses holds all poses of one protein, in the PVATLAS1 format. Part A has the highest-affinity
pose of every ligand as SDF, highest-affinity first. Part B has every engine output as PDBQT, with all modes. The
offset columns of the tables point into this file. Results reads the poses for you with top_sdf(), pose_block()
and pose_model().
SAS points¶
sas/<protein_id>.json.gz holds P2Rank's solvent accessible surface (SAS) points of one protein: the points around
the protein that P2Rank scores to find the pockets. The file is gzipped JSON:
{"protein": "1fbl",
"pockets": {"1": [[x, y, z, score], ...], "2": [...]},
"other_pockets": {"3": [...], "4": [...]},
"rest": [[x, y, z, score], ...]}
pockets: the points of each docked pocket, by P2Rank rank. The coordinates have 2 decimals, the score 3.other_pockets: the points of P2Rank's other pockets, andrestthe points in no pocket. Their coordinates have 1 decimal, the score 2.
The coordinates are in Å, in the frame of the input structure. The score is P2Rank's score of the point, from 0 to 1.
A run writes the file when it runs P2Rank. A protein docked into the pockets of a CSV file has none, nor do the
proteins of older results. The PocketVina Atlas has the same files, sas/<UniProt>.json.gz, with uniprot instead
of protein. The SAS button of the 3D page draws the points (3D views).
The "files" format¶
pocketvina dock --format files writes the output folder of PocketVina 0.1. It is also the default of
PocketVinaConfig, for scripts written for 0.1. The folder has one PDBQT and JSON file per ligand and pocket, and
combined_results.csv. This format does not resume and has no PoseBusters step. pocketvina import-legacy
converts it into a results folder (Migrating from PocketVina 0.1).