Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add OPLS ref to the docs #594

Merged
merged 8 commits into from
Mar 19, 2024
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
12 changes: 10 additions & 2 deletions deeprank2/utils/parsing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ def get_vanderwaals_parameters(self, atom: Atom) -> VanderwaalsParam:
type_ = action["TYPE"]

if type_ is None:
_log.warning(f"Atom {atom} is unknown to the forcefield; vanderwaals_parameters set to (0.0, 0.0, 0.0, 0.0)")
_log.warning(
f"Atom {atom} is unknown to the forcefield, vanderwaals_parameters set to (0.0, 0.0, 0.0, 0.0).\n"
" This will affect `vanderwaals` feature.\n"
" Check https://deeprank2.readthedocs.io/en/latest/features.html#nonbond-energies for more details.",
)
return VanderwaalsParam(0.0, 0.0, 0.0, 0.0)
return self._vanderwaals_parameters[type_]

Expand Down Expand Up @@ -94,7 +98,11 @@ def get_charge(self, atom: Atom) -> float:
charge = float(action["CHARGE"])

if charge is None:
_log.warning(f"Atom {atom} is unknown to the forcefield; charge is set to 0.0")
_log.warning(
f"Atom {atom} is unknown to the forcefield, `electrostatic` and `atom_charge` charge is set to 0.0.\n"
" This will affect `electrostatic` and `atom_charge` features.\n"
" Check https://deeprank2.readthedocs.io/en/latest/features.html#nonbond-energies for more details.",
)
return 0.0
return charge

Expand Down
7 changes: 6 additions & 1 deletion docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,14 @@ These features relate to the structural relationship between nodes.

#### Nonbond energies:

These features measure nonbond energy potentials between nodes.
These features measure nonbond energy potentials between nodes, and are calculated using [OPLS forcefield](https://en.wikipedia.org/wiki/OPLS).
For residue graphs, the pairwise sum of potentials for all atoms from each residue is used. Note that no distance cutoff is used and the radius of influence is assumed to be infinite, although the potentials tends to 0 at large distance. Also edges are only assigned within a given cutoff radius when graphs are created.

Nonbond energies are set to 0 for any atom pairs (on the same chain) that are within a cutoff radius of 3.6 Å, as these are assumed to be covalent neighbors or linked by no more than 2 covalent bonds (i.e. 1-3 pairs).

- `electrostatic`: Electrostatic potential (also known as Coulomb potential) between two nodes, calculated using interatomic distances and charges of each atom (float).
- `vanderwaals`: Van der Waals potential (also known as Lennard-Jones potential) between two nodes, calculated using interatomic distance/s and a list of atoms with vanderwaals parameters (`deeprank2.domain.forcefield.protein-allhdg5-4_new`, float). Atom pairs within a cutoff radius of 4.2 Å (but above 3.6 Å) are assumed to be separated by separated by exactly 2 covalent bonds (i.e. 1-4 pairs) and use a set of lower energy parameters.

Charge and vanderwaals parameters are set to 0 for those atoms that are unknown to the OPLS forcefield, treating such cases as missing values. If this happens for many of the atoms in the PDB file/s provided, depending on the specific dataset it may be worth it to drop the features affected, i.e., `electrostatic`, `vanderwaals`, and `atom_charge`.

- It may be useful to generate histograms of the processed data to further investigate the distribution of these features' values before deciding whether to drop them. Refer to the `data_generation_xxx.ipynb` [tutorial files](https://github.com/DeepRank/deeprank2/tree/main/tutorials) for comprehensive instructions on transforming the data into a Pandas dataframe and generating histograms of the features.
Loading