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
408 changes: 408 additions & 0 deletions alphaspace2/LinF9Scoring.py

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions alphaspace2/LinF9data/Vina_atom_radii.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#atom_type,Radii
H,0.00
HD,0.00
C,1.90
A,1.90
N,1.80
NA,1.80
O,1.70
OA,1.70
S,2.00
SA,2.00
P,2.10
F,1.50
Cl,1.80
CL,1.80
Br,2.00
BR,2.00
I,2.20
Mn,1.20
MN,1.20
Mg,1.20
MG,1.20
Zn,1.20
ZN,1.20
Ca,1.20
CA,1.20
Fe,1.20
FE,1.20
Ni,1.20
NI,1.20
Na,1.20
Co,1.20
CO,1.20
Cu,1.20
CU,1.20
Cd,1.20
CD,1.20
K,1.20
SE,1.75
Se,1.75
27 changes: 27 additions & 0 deletions alphaspace2/LinF9data/colors_chimera.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
seagreen
my_gold
my_pink
my_teal
my_orange
my_blue
my_dkpurple
my_ltblue
my_peri
my_peach
tan
plum
my_ltgreen
olivedrab
firebrick
pink
dodgerblue
mediumpurple
my_lime
goldenrod
aquamarine
my_rasp
darkslateblue
darkmagenta
rosybrown
my_coral
my_foam
27 changes: 27 additions & 0 deletions alphaspace2/LinF9data/colors_table.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
green
yellow
pink
teal
orange
blue
purple
ltblue
peri
peach
tan
mauve
ltgreen
olive
brick
ltpink
dodgerbl
ltpurple
lime
gold
aqua
raspberry
dkblue
dkpruple
rosybrown
coral
seafoam
203 changes: 203 additions & 0 deletions alphaspace2/LinF9data/hp_types_dict.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
#RES_name,ATOM_name,ATOM_element,for_ACC,for_DON
ALA,C,C,N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,Zn,NNP,PP
FE,FE,Fe,NNP,PP
MG,MG,Mg,NNP,PP
MN,MN,Mn,NNP,PP
CA,CA,Ca,NNP,PP
13 changes: 9 additions & 4 deletions alphaspace2/Snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,13 @@ def genPockets(self):
self._pocket_xyz[i] = np.mean(self._alpha_xyz[indices], axis=0)
self._pocket_space[i] = np.sum(self._alpha_space[indices], axis=0)

def genBScore(self, receptor):
from .VinaScoring import _pre_process_pdbqt, _get_probe_score
def genBScore(self, receptor, score_function="Vina"):
if score_function == "Vina":
from .VinaScoring import _pre_process_pdbqt, _get_probe_score
elif score_function == "Lin_F9":
from .LinF9Scoring import _pre_process_pdbqt, _get_probe_score
else:
raise ValueError("The scoring function " + score_function + " has not been implemented yet")

if hasattr(receptor, 'adv_atom_types'):
logging.debug('Vina Atom type found, calculating beta scores')
Expand Down Expand Up @@ -165,15 +170,15 @@ def calculateContact(self, coords):
self._pocket_contact = np.array(
[np.any(self._alpha_contact[alpha_indices]) for alpha_indices in self._pocket_alpha_index_list])

def run(self, receptor, binder=None):
def run(self, receptor, binder=None, score_function="Vina"):

self.genAlphas(receptor)

self.genPockets()

self.genBetas()

self.genBScore(receptor)
self.genBScore(receptor, score_function=score_function)

if binder is not None:
self.calculateContact(coords=binder.xyz[0] * 10)
Expand Down
10 changes: 5 additions & 5 deletions alphaspace2/VinaScoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,11 @@ def annotateVinaAtomTypes(receptor, pdbqt):
adv_atom_type = line[77:79].strip()
adv_atom_types.append(adv_atom_type)

if receptor.top.n_atoms < len(adv_atom_types):
print("Redundant Atom types in pdbqt file found, trimming last {} entries".format(
{receptor.top.n_atoms - len(adv_atom_types)}))
adv_atom_types = adv_atom_types[:receptor.top.n_atoms]
partial_charges = partial_charges[:receptor.top.n_atoms]
if receptor.top.n_atoms < len(adv_atom_types):
print("Redundant Atom types in pdbqt file found, trimming last {} entries".format(
{receptor.top.n_atoms - len(adv_atom_types)}))
adv_atom_types = adv_atom_types[:receptor.top.n_atoms]
partial_charges = partial_charges[:receptor.top.n_atoms]

receptor.partial_charges = partial_charges
receptor.adv_atom_types = adv_atom_types
2 changes: 1 addition & 1 deletion alphaspace2/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def _findInRange(query_points, ref_points, cutoff):

def _markInRange(query_points, ref_points, cutoff):
indices = _findInRange(query_points, ref_points, cutoff)
query_bool = np.zeros(len(query_points), dtype=np.bool)
query_bool = np.zeros(len(query_points), dtype=bool)
query_bool[indices] = 1
return query_bool

Expand Down