|
| 1 | +# vcontacts-wrapper (vconpy) |
| 2 | + |
| 3 | +A lightweight Python package to prepare arguments and run **Vcontacts**, |
| 4 | +a tool to compute surface areas in contact using the constrained Voronoi procedure from the paper: |
| 5 | + |
| 6 | +> **Quantification of protein surfaces, volumes and atom-atom contacts using a constrained Voronoi procedure** |
| 7 | +> (doi: [10.1093/bioinformatics/18.10.1365](https://doi.org/10.1093/bioinformatics/18.10.1365)) |
| 8 | +
|
| 9 | +This wrapper makes it easy to call the `Vcontacts` executables (`vcon_surfaces` or `vcon_nrgten`) directly from Python, capture their output, and optionally parse `.vcon` files into Python dictionaries. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Installation |
| 14 | + |
| 15 | +```bash |
| 16 | +pip install vcon-py |
| 17 | +``` |
| 18 | + |
| 19 | +--- |
| 20 | + |
| 21 | +## Example Usage |
| 22 | + |
| 23 | +```python |
| 24 | +from vconpy import run_vcon |
| 25 | + |
| 26 | +# Run Vcontacts |
| 27 | +result_surfaces = run_vcon( |
| 28 | + "/path/to/receptor.pdb", |
| 29 | + vcon_type="surfaces" |
| 30 | +) |
| 31 | + |
| 32 | +# Run Vcontacts and return a dictionary instead of outputting a file |
| 33 | +result_nrgten = run_vcon( |
| 34 | + "/path/to/receptor.pdb", |
| 35 | + as_dictionary=True |
| 36 | +) |
| 37 | + |
| 38 | +# NRGTEN requires setting showbonded as True |
| 39 | +result_nrgten = run_vcon( |
| 40 | + "/path/to/receptor.pdb", |
| 41 | + as_dictionary=True, |
| 42 | + showbonded=True |
| 43 | +) |
| 44 | + |
| 45 | +print(result_nrgten.surface_dictionary) # dict of atom-atom contact areas |
| 46 | +``` |
| 47 | + |
| 48 | +--- |
| 49 | + |
| 50 | +## Arguments |
| 51 | + |
| 52 | +| Argument | Type | Description | Default | |
| 53 | +|------------------|--------|----------------------------------------------------------------------------------------------------------------------------------|--------------| |
| 54 | +| `pdb_filename` | `str` | Path to the input PDB file. | **Required** | |
| 55 | +| `showbonded` | `bool` | If `True`, include covalently bonded atoms in the contacts (`-all` flag). | `False` | |
| 56 | +| `normalize` | `bool` | If `True`, normalize contacts to percent of total contact area. Otherwise, contacts are given in SAS units (Ų). (`-norm` flag). | `False` | |
| 57 | +| `planedef` | `str` | Plane definition for analysis. Options: `X` (extended radical plane), `R` (radical plane), `B` (bisecting plane). | `None` | |
| 58 | +| `as_dictionary` | `bool` | If `True`, returns a Python dictionary. The `.vcon` file is deleted after parsing. | `False` | |
| 59 | + |
| 60 | +--- |
| 61 | + |
| 62 | +## Returns |
| 63 | + |
| 64 | +The function returns a `VconResult` namedtuple with the following fields: |
| 65 | + |
| 66 | +| Field | Type | Description | |
| 67 | +|----------------------|--------|------------------------------------------------------------------------| |
| 68 | +| `vcon_filename` | `str` | Path to the generated `.vcon` file. | |
| 69 | +| `surface_dictionary` | `dict` | Dictionary of atom-atom contact areas (only if `as_dictionary=True`). | |
| 70 | +| `stdout` | `str` | Standard output from the Vcontacts process. | |
| 71 | +| `stderr` | `str` | Standard error from the Vcontacts process. | |
| 72 | +| `returncode` | `int` | Exit code from the Vcontacts process. | |
| 73 | + |
| 74 | +--- |
| 75 | + |
| 76 | +## Raises |
| 77 | + |
| 78 | +| Error | Condition | |
| 79 | +|-------------|---------------------------------------------------------------------------| |
| 80 | +| `ValueError` | Raised if the input file does not exist, or if `vcon_type` is invalid. | |
| 81 | +| `VconError` | Raised if the Vcontacts executable is missing, not executable, or fails. | |
| 82 | + |
| 83 | +--- |
0 commit comments