Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ examples/*
.vscode/*
.pytest_cache/*
.mypy_cache
arpeggio.egg-info
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ Arpeggio is written in Python and currently has the following dependencies:
* Python (v3.6)
* Numpy
* BioPython (>= v1.60)
* OpenBabel (with Python bindings)
* OpenBabel (>=3.0)
* PDBeCIF

If you need to use Arpeggio programmatically or to run for many structures:

The easiest way to set up with Arpeggio is using [Conda](https://docs.conda.io/en/latest/). In your conda environment run the two following commands:

```bash
conda install -c openbabel openbabel
conda install -c conda-forge openbabel
pip install git+https://github.com/PDBeurope/arpeggio.git@master#egg=arpeggio
```

Expand All @@ -63,7 +63,7 @@ conda activate arpeggio-env

`arpeggio 1tqn_h.cif [options]`

e.g.
e.g.

`arpeggio -s /A/508/ -o out/ 1tqn_h.cif`

Expand Down
23 changes: 11 additions & 12 deletions arpeggio/core/interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from functools import reduce

import numpy as np
import openbabel as ob
from openbabel import openbabel as ob
from Bio.PDB import NeighborSearch
from Bio.PDB.Atom import DisorderedAtom
from Bio.PDB.PDBParser import PDBParser
Expand Down Expand Up @@ -226,7 +226,7 @@ def minimize_hydrogens(self, minimisation_forcefield, minimisation_method, minim

for ob_atom in ob.OBMolAtomIter(self.ob_mol):

if not ob_atom.IsHydrogen():
if not ob_atom.GetAtomicNum() == ob.Hydrogen:
constraints.AddAtomConstraint(ob_atom.GetIdx())

logging.debug('Constrained non-hydrogen atoms.')
Expand Down Expand Up @@ -1226,9 +1226,6 @@ def __calculate_group_group_contacts(self):
if amide_key == amide_key2:
continue

if amide_key == 441 and amide2 == 442:
print('foo')

# CHECK RING IS INVOLVED WITH THE SELECTION OR BINDING SITE
if amide_key2 not in self.selection_plus_amide_ids:
continue
Expand Down Expand Up @@ -1493,14 +1490,14 @@ def _add_atomic_radii(self):
# ADD VDW RADII TO ENTITY ATOMS
# USING OPENBABEL VDW RADII
for atom in self.s_atoms:
atom.vdw_radius = ob.etab.GetVdwRad(self.ob_mol.GetAtomById(self.bio_to_ob[atom]).GetAtomicNum())
atom.vdw_radius = ob.GetVdwRad(self.ob_mol.GetAtomById(self.bio_to_ob[atom]).GetAtomicNum())

logging.debug('Added VdW radii.')

# ADD COVALENT RADII TO ENTITY ATOMS
# USING OPENBABEL VDW RADII
for atom in self.s_atoms:
atom.cov_radius = ob.etab.GetCovalentRad(self.ob_mol.GetAtomById(self.bio_to_ob[atom]).GetAtomicNum())
atom.cov_radius = ob.GetCovalentRad(self.ob_mol.GetAtomById(self.bio_to_ob[atom]).GetAtomicNum())

logging.debug('Added covalent radii.')

Expand All @@ -1516,7 +1513,7 @@ def _add_hydrogens_to_biopython(self):

# GET THE BONDED ATOMS OF THE OBATOM
for atom_neighbour in ob.OBAtomAtomIter(atom):
if atom_neighbour.IsHydrogen():
if atom_neighbour.GetAtomicNum() == ob.Hydrogen:

# APPEND THE HYDROGEN COORDINATES TO THE BIOPYTHON ATOM 'h_coords' ATTRIBUTE
biopython_atom.h_coords.append(np.array([atom_neighbour.GetX(), atom_neighbour.GetY(), atom_neighbour.GetZ()]))
Expand Down Expand Up @@ -1877,21 +1874,23 @@ def _initialize_residue_sift(self):

def _handle_hydrogens(self):
"""Determine atom valences and explicit hydrogen counts.
Methods renamed according to the: https://open-babel.readthedocs.io/en/latest/UseTheLibrary/migration.html

"""
for ob_atom in ob.OBMolAtomIter(self.ob_mol):
if not self.input_has_hydrogens:
if ob_atom.IsHydrogen():
if ob_atom.GetAtomicNum() == ob.Hydrogen:
continue

# `http://openbabel.org/api/2.3/classOpenBabel_1_1OBAtom.shtml`
# CURRENT NUMBER OF EXPLICIT CONNECTIONS
valence = ob_atom.GetValence()
valence = ob_atom.GetExplicitDegree()

# MAXIMUM NUMBER OF CONNECTIONS EXPECTED
implicit_valence = ob_atom.GetImplicitValence()
implicit_valence = ob_atom.GetImplicitHCount()

# BOND ORDER
bond_order = ob_atom.BOSum()
bond_order = ob_atom.GetExplicitValence()

# NUMBER OF BOUND HYDROGENS
num_hydrogens = ob_atom.ExplicitHydrogenCount()
Expand Down
Loading