Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/.pages
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
nav:
- Home: index.md
- Methodology: method
- Pocket detection: detect.md
- Monolith docs: mono-docs.md
- Pocket volume: volume.md
- API: api
9 changes: 9 additions & 0 deletions docs/css/mol.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.mol-container {
width: 100%;
height: 700px;
position: relative;
margin: auto;
display: flex;
justify-content: center;
align-items: center;
}
281 changes: 80 additions & 201 deletions docs/detect.md
Original file line number Diff line number Diff line change
@@ -1,136 +1,11 @@
# Pocket detection

Pocket detection is an essential process in computational biology and drug design, enabling researchers to identify and characterize binding sites on protein surfaces.
These pockets or cavities are critical for understanding molecular interactions, particularly in the context of ligand binding, drug discovery, and protein functionality.
By accurately detecting pockets, researchers can explore their shapes, volumes, and properties, facilitating the design of effective inhibitors or activators.
`POVME` simplifies pocket detection through its `povme detect` CLI, which provides an intuitive and efficient way to run the detection process.

This guide focuses on using `POVME` for pocket detection, detailing its purpose, the methodology behind the detection process, and how to use the `povme detect` command-line interface (CLI) for real-world scenarios.
## Preparing the Configuration File

## Purpose of Pocket Detection

Proteins interact with small molecules, ions, and other macromolecules through specific regions called pockets.
These pockets are often formed by the three-dimensional arrangement of amino acid residues and are highly significant for biological function.
Identifying pockets is the first step toward analyzing potential druggable sites and understanding how ligands interact with proteins.

Pocket detection involves identifying regions on the protein surface that:

- Have sufficient depth and volume to accommodate a ligand.
- Are spatially enclosed by surrounding residues.
- Could serve as potential binding sites for drugs or other molecules.

## Pocket Detection Methodology

Pocket detection in `POVME` is a multi-step process that systematically identifies biologically significant pockets on protein surfaces.
This methodology is grounded in computational geometry and configurable algorithms that balance precision with computational efficiency.

### Initial Point Selection

The first step involves selecting initial points around the protein structure.
These points are spaced according to the `pocket_detection_resolution` parameter in the configuration file.
This coarse resolution allows for efficient initial exploration of potential pocket regions.

Example Configuration:

```yaml
pocket_detection_resolution: 4.0
```

Code Example:

```python
from povme.points import GridMesh

# Generate a grid of points surrounding the protein
protein_box = molecule.information.get_bounding_box()
initial_points = GridMesh(protein_box, config.pocket_detection_resolution * 4)
```

### Convex Hull Calculation

The convex hull is computed to identify the smallest convex shape that encloses the alpha carbons of the protein.
This step excludes shallow surface indentations and ensures that only biologically relevant regions are considered.

Key algorithm: **Gift Wrapping Algorithm**.
This algorithm iteratively selects points to form triangular facets of the convex hull.

Code Example:

```python
from povme.points.hull import ConvexHull

# Calculate convex hull of alpha carbon coordinates
alpha_carbon_coords = molecule.selections.get_coordinates("alpha_carbons")
convex_hull = ConvexHull(alpha_carbon_coords)
```

### Removing Redundant Points

Points that fall outside the convex hull are removed, reducing computational overhead.
Additionally, points within a specified distance (`clashing_cutoff`) of protein atoms are excluded.

Example Configuration:

```yaml
clashing_cutoff: 3.0
```

Code Example:

```python
# Remove points outside the convex hull
points_inside_hull = convex_hull.filter_points(initial_points)

# Exclude points too close to protein atoms
filtered_points = points_inside_hull.remove_close_points(
molecule.get_coordinates(), config.clashing_cutoff
)
```

### Refining the Point Field

The remaining points are refined to improve pocket detection accuracy.
This includes:

1. **Increasing Point Density**: Points are added around existing ones for higher resolution, controlled by `pocket_measuring_resolution`.
2. **Filtering Isolated Points**: Points with fewer than `n_neighbors` are removed to eliminate noise.

Example Configuration:

```yaml
pocket_measuring_resolution: 1.0
n_neighbors: 4
```

### Identifying and Saving Pockets

Finally, the refined points are grouped into discrete pockets using clustering algorithms. Inclusion spheres are generated for each pocket, and the results are saved in PDB format.

Example Configuration:

```yaml
n_spheres: 5
sphere_padding: 5.0
```

Code Example:

```python
from povme.io import write_pdbs

# Separate points into pockets
pockets = final_points.separate_into_pockets()

# Save each pocket as a PDB file
write_pdbs(pockets, output_prefix="output/pocket")
```

## Using the `povme detect` CLI

`POVME` simplifies pocket detection through its `povme detect` CLI, which provides an intuitive and efficient way to run the detection process. Below, we outline the steps for using this command.

### Preparing the Configuration File

To begin, create a YAML configuration file that defines the parameters for pocket detection. Here is an example configuration:
To begin, create a YAML configuration file that will be used to update [`PocketDetectConfig`][config.detect.PocketDetectConfig] that defines the parameters for pocket detection.
Here is an example configuration:

```yaml
pocket_detection_resolution: 4.0
Expand All @@ -140,22 +15,26 @@ n_neighbors: 4
n_spheres: 5
sphere_padding: 5.0
use_ray: false
n_cores: 2
n_cores: 4
```

The parameters include:

- `pocket_detection_resolution`: The spacing between probe points for initial detection.
- `pocket_measuring_resolution`: A finer spacing for detailed measurement.
- `clashing_cutoff`: Minimum distance between probe points and protein atoms.
- `n_neighbors`: Minimum number of neighboring points for a point to be retained.
- `n_spheres`: Number of inclusion spheres per pocket.
- `sphere_padding`: Additional padding for inclusion spheres.
- `use_ray` and `n_cores`: Enable parallel computation for improved performance.
::: config.detect.PocketDetectConfig
options:
show_bases: false
heading_level: 3
show_root_heading: false
show_root_members_full_path: false
parameter_headings: true
show_symbol_type_heading: false
show_symbol_type_toc: false
show_root_toc_entry: false
filters:
- "!^log$"

### Running the Command
## Running the Command

Once the configuration file is ready, you can use the `povme detect` command to identify pockets. The command syntax is:
Once the configuration file is ready, you can use the `povme detect` command to identify pockets.
The command syntax is:

```bash
povme detect -c config.yaml -i protein.pdb -o output/
Expand All @@ -167,77 +46,77 @@ Here:
- `-i` specifies the input PDB file.
- `-o` specifies the output directory or file prefix.

### Example Workflow

1. **Input PDB File**: Ensure that your protein structure file (`protein.pdb`) is prepared. The PDB file should contain all relevant atoms and be free from major structural errors.
2. **Configuration File**: Save the YAML configuration as `config.yaml`.
3. **Run the Command**: Execute the following command:

```bash
povme detect -c config.yaml -i protein.pdb -o ./output/
```

4. **Review Output**: Navigate to the specified output directory to find the results.

### Analyzing the Results
## Analyzing the results

The output of `povme detect` includes several key files:
The `povme detect` command produces a set of PDB files that comprehensively describe the detected pockets and their associated parameters.
Each PDB file contains a set of points that represent a POVME-detected pocket.
For example,

- **Pocket PDB Files**: Files such as `output/pocket1.pdb` contain the three-dimensional points defining each detected pocket.
- **Log File**: Detailed logs summarize the detection process, including any warnings or errors encountered.
- **Inclusion Sphere Parameters**: Each pocket PDB file includes header comments listing the inclusion sphere parameters for that pocket.
```text
ATOM 1 A AAA A 1 35.000 19.000 30.000 A
ATOM 1 B AAA B 1 34.000 19.000 29.000 B
ATOM 2 B AAB B 2 34.000 20.000 29.000 B
ATOM 1 C AAA C 1 35.000 21.000 28.000 C
ATOM 2 C AAB C 2 36.000 20.000 27.000 C
ATOM 3 C AAC C 3 36.000 21.000 27.000 C
ATOM 4 C AAD C 4 36.000 21.000 28.000 C
ATOM 1 D AAA D 1 36.000 20.000 28.000 D
ATOM 1 E AAA E 1 35.000 20.000 29.000 E
ATOM 2 E AAB E 2 35.000 20.000 30.000 E
ATOM 3 E AAC E 3 35.000 21.000 29.000 E
ATOM 4 E AAD E 4 36.000 20.000 29.000 E
ATOM 5 E AAE E 5 36.000 21.000 29.000 E
```

In addition to these points, the PDB files contain remarks OF `PointsInclusionSphere` parameter inputs that would encompass this pocket plus any `sphere_padding`.
For example, the header of `pocket1.pdb` might look like this:

```text
REMARK Pocket #1
REMARK CHAIN A: PointsInclusionSphere 10.5 20.7 15.3 5.0
REMARK CHAIN A: PointsInclusionSphere 35.0 19.0 30.0 5.0
REMARK CHAIN B: PointsInclusionSphere 34.0 19.5 29.0 5.5
REMARK CHAIN C: PointsInclusionSphere 35.75 20.75 27.5 5.94
REMARK CHAIN D: PointsInclusionSphere 36.0 20.0 28.0 5.0
REMARK CHAIN E: PointsInclusionSphere 35.4 20.4 29.2 5.98
```

This indicates the center and radius of the inclusion sphere representing the pocket.

### Visualization

The output files can be visualized using molecular visualization tools such as PyMOL or VMD.
These tools allow you to inspect the detected pockets and verify their biological relevance.

## A Complete Example

Here is a step-by-step example demonstrating pocket detection on a sample protein.

### Example Configuration File (`config.yaml`)
This means we would use five inclusion spheres when computing volumes and would specify them in a `povme.yml` file like so.

```yaml
pocket_detection_resolution: 4.0
pocket_measuring_resolution: 1.0
clashing_cutoff: 3.0
n_neighbors: 4
n_spheres: 5
sphere_padding: 5.0
use_ray: false
n_cores: 2
points_inclusion_sphere:
- center: [35.0, 19.0, 30.0]
radius: 5.0
- center: [34.0, 19.5, 29.0]
radius: 5.5
- center: [35.75, 20.75, 27.5]
radius: 5.94
- center: [36.0, 20.0, 28.0]
radius: 5.0
- center: [35.4, 20.4, 29.2]
radius: 5.98
```

### Command to Run
## Visualization

```bash
povme detect -c config.yaml -i sample_protein.pdb -o results/
```

### Output Files

After running the command, the `results/` directory will contain:

1. `pocket1.pdb`: A PDB file defining the first detected pocket.
2. `pocket2.pdb`: Additional PDB files for other pockets.
3. `povme.log`: A log file summarizing the pocket detection process.

### Visualization

Open `pocket1.pdb` in PyMOL:

```bash
pymol results/pocket1.pdb
```
The output files can be visualized using molecular visualization tools such as PyMOL or VMD.
These tools allow you to inspect the detected pockets and verify their biological relevance.

This will display the first pocket, along with its inclusion spheres, allowing you to evaluate the detection results.
<div id="pocket-detect-rel1" class="mol-container"></div>
<script>
document.addEventListener('DOMContentLoaded', (event) => {
const viewer = molstar.Viewer.create('pocket-detect-rel1', {
layoutIsExpanded: false,
layoutShowControls: false,
layoutShowRemoteState: false,
layoutShowSequence: true,
layoutShowLog: false,
layoutShowLeftPanel: false,
viewportShowExpand: true,
viewportShowSelectionMode: true,
viewportShowAnimation: false,
pdbProvider: 'rcsb',
}).then(viewer => {
// viewer.loadStructureFromUrl("/files/example-povme-pockets.pdb", "pdb");
viewer.loadSnapshotFromUrl("/files/example-povme-pockets.molx", "molx");
});
});
</script>
Binary file added docs/files/example-povme-pockets.molx
Binary file not shown.
Loading
Loading