isambard-uob / isambard

Intelligent System for Analysis, Model Building And Rational Design of biomolecules.
https://isambard-uob.github.io/isambard/
MIT License
20 stars 7 forks source link

Finding H-bonds and KIHs with Isambard2 #13

Open broncio123 opened 6 years ago

broncio123 commented 6 years ago

Hi,

I'm struggling to find a way with the ampal module to get all H-bonds (Sidechain-Sidechain, Sidechain-Mainchain, etc) and Knobs into Holes, given a PDB.

With previous isambard versions I used to do something like:

import isambard_dev

# Passed a PDB which already includes hydrogens     
p = isambard_dev.ampal.convert_pdb_to_ampal(pdb_path)

hbonds = isambard_dev.interactions.find_hydrogen_bonds(p)
# Find all H-bonds and select those between sidechain atoms
sc_hbonds = [hb for hb in hbonds if hb.is_sidechain_sidechain == True]

# Get donor/acceptor info
hb = sc_hbonds[0]
donor_H = [hb.donor.ampal_parent.id , hb.donor.res_label]
acceptor_O = [hb.acceptor.ampal_parent.id , hb.acceptor.res_label]

and

kihs = isambard_dev.add_ons.knobs_into_holes.find_kihs(p)

# Get KIH info
kih = kihs[0]
knob_data = kih.knob.unique_id
hole_data = [kih.hole[x].unique_id for x in range(len(kih.hole))]

I would appreciate any help so that I can upgrade my code to Isambard2.

Cheers, Broncio

kls93 commented 6 years ago

This functionality is in isambard_dev but not isambard v2 - I'll see if it's possible to port the find_hydrogen_bonds function across.

Thanks, Kathryn