Commit 063873b2 authored by jdurrant's avatar jdurrant
Browse files

Before removing cruft from old hydrogen/halogen-bond code.

parent 6c2f57df
......@@ -17,10 +17,25 @@ WIP
hydrogen_halogen_bond_angle_cutoff
11. Removed ability to toggle on and off cylinder interactions, to simplify UI. Always on for those interaction where appropriate.
12. Some interactions are shown as spheres, others as bonds. Keeps it simplier.
13. Improved ability to detect salt bridges even if protein and ligand models do not have hydrogen atoms. TODO: Try to detect hydrogen bonds too.
TODO:
Halogen bonds mention in all documentation?
Halogen bonds counted twice? Good to check. In the chart in log file.
CAPTURE WARNINGS. Also, move no-hydrogen warning to below table to be less
obtrusive.
Consider "S" as donor/acceptors? Need to investigate.
Much of hydrogen-bond detecting code should go into mol. Also, use protein
definitions where possible, like you do for electrostatics. But in case of
hydrogen bonds detecvt only on the ffly (otherwise too many).
Test should also test version of protein without hydrogens
2.0
---
......
// Transcrypt'ed from Python, 2021-11-05 16:24:09
// Transcrypt'ed from Python, 2021-11-09 00:25:33
import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
var __name__ = '__future__';
export var all_feature_names = [];
......
......@@ -2,7 +2,7 @@
// LICENSE.md or go to https://opensource.org/licenses/Apache-2.0 for full
// details. Copyright 2020 Jacob D. Durrant.
// Transcrypt'ed from Python, 2021-11-05 16:24:08
// Transcrypt'ed from Python, 2021-11-09 00:25:32
var binana = {};
import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
import * as __module_binana__ from './binana.js';
......
......@@ -2,7 +2,7 @@
// LICENSE.md or go to https://opensource.org/licenses/Apache-2.0 for full
// details. Copyright 2020 Jacob D. Durrant.
// Transcrypt'ed from Python, 2021-11-05 16:24:08
// Transcrypt'ed from Python, 2021-11-09 00:25:32
var __future__ = {};
var binana = {};
var math = {};
......
......@@ -2,13 +2,21 @@
// LICENSE.md or go to https://opensource.org/licenses/Apache-2.0 for full
// details. Copyright 2020 Jacob D. Durrant.
// Transcrypt'ed from Python, 2021-11-05 16:24:09
// Transcrypt'ed from Python, 2021-11-09 00:25:33
var binana = {};
var math = {};
import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
import {fabs} from './binana._utils.shim.js';
import * as shim from './binana._utils.shim.js';
import * as __module_binana__utils__ from './binana._utils.js';
__nest__ (binana, '_utils', __module_binana__utils__);
import {angle_between_three_points} from './binana._utils._math_functions.js';
import {r_just, round_to_thousandths_to_str} from './binana._utils.shim.js';
import {Point} from './binana._structure.point.js';
import * as __module_binana__ from './binana.js';
__nest__ (binana, '', __module_binana__);
import * as __module_math__ from './math.js';
__nest__ (math, '', __module_math__);
var __name__ = 'binana._structure.atom';
export var Atom = __class__ ('Atom', [object], {
__module__: __name__,
......@@ -55,22 +63,22 @@ export var Atom = __class__ ('Atom', [object], {
get create_pdb_line () {return __get__ (this, function (self, index) {
var output = 'ATOM ';
var output = ((output + r_just (str (index), 6)) + r_just (self.atom_name, 5)) + r_just (self.residue, 4);
var output = output + r_just (round_to_thousandths_to_str (self.coordinates.x), 18);
var output = output + r_just (round_to_thousandths_to_str (self.coordinates.y), 8);
var output = output + r_just (round_to_thousandths_to_str (self.coordinates.z), 8);
var output = output + r_just (self.element, 24);
output += r_just (round_to_thousandths_to_str (self.coordinates.x), 18);
output += r_just (round_to_thousandths_to_str (self.coordinates.y), 8);
output += r_just (round_to_thousandths_to_str (self.coordinates.z), 8);
output += r_just (self.element, 24);
return output;
});},
get number_of_neighbors () {return __get__ (this, function (self) {
return len (self.indecies_of_atoms_connecting);
});},
get add_neighbor_atom_index () {return __get__ (this, function (self, index) {
if (!(__in__ (index, self.indecies_of_atoms_connecting))) {
if (!__in__ (index, self.indecies_of_atoms_connecting)) {
self.indecies_of_atoms_connecting.append (index);
}
});},
get side_chain_or_backbone () {return __get__ (this, function (self) {
if (self.atom_name.strip () == 'CA' || self.atom_name.strip () == 'C' || self.atom_name.strip () == 'O' || self.atom_name.strip () == 'N') {
if (__in__ (self.atom_name.strip (), ['CA', 'C', 'O', 'N'])) {
return 'BACKBONE';
}
else {
......@@ -164,6 +172,29 @@ export var Atom = __class__ ('Atom', [object], {
if (self.residue.strip () == '') {
self.residue = ' MOL';
}
});},
get has_sp3_geometry () {return __get__ (this, function (self, parent_mol) {
var ncrs = (function () {
var __accu0__ = [];
for (var i of self.indecies_of_atoms_connecting) {
__accu0__.append (parent_mol.all_atoms [i].coordinates);
}
return __accu0__;
}) ();
var ccr = self.coordinates;
var to_deg = 180.0 / math.pi;
var angles = [angle_between_three_points (ncrs [0], ccr, ncrs [1]) * to_deg];
if (len (ncrs) > 2) {
angles.append (angle_between_three_points (ncrs [0], ccr, ncrs [2]) * to_deg);
angles.append (angle_between_three_points (ncrs [1], ccr, ncrs [2]) * to_deg);
}
if (len (ncrs) > 3) {
angles.append (angle_between_three_points (ncrs [0], ccr, ncrs [3]) * to_deg);
angles.append (angle_between_three_points (ncrs [1], ccr, ncrs [3]) * to_deg);
angles.append (angle_between_three_points (ncrs [2], ccr, ncrs [3]) * to_deg);
}
var average_angle = sum (angles) / float (len (angles));
return fabs (average_angle - 109.0) < 5.0;
});}
});
......
......@@ -2,7 +2,7 @@
// LICENSE.md or go to https://opensource.org/licenses/Apache-2.0 for full
// details. Copyright 2020 Jacob D. Durrant.
// Transcrypt'ed from Python, 2021-11-05 16:24:08
// Transcrypt'ed from Python, 2021-11-09 00:25:33
var binana = {};
var math = {};
import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
......@@ -12,7 +12,7 @@ import * as shim from './binana._utils.shim.js';
import * as __module_binana__utils__ from './binana._utils.js';
__nest__ (binana, '_utils', __module_binana__utils__);
import {_set_default} from './binana._utils.shim.js';
import {angle_between_three_points, cross_product, dihedral, distance, vector_subtraction} from './binana._utils._math_functions.js';
import {cross_product, dihedral, distance, vector_subtraction} from './binana._utils._math_functions.js';
import {Atom} from './binana._structure.atom.js';
import {Point} from './binana._structure.point.js';
import * as __module_math__ from './math.js';
......@@ -21,6 +21,7 @@ import * as __module_binana__ from './binana.js';
__nest__ (binana, '', __module_binana__);
var __name__ = 'binana._structure.mol';
export var textwrap = shim;
export var _max_donor_X_dist = dict ({'H': 1.3, 'I': 2.04 * 1.4, 'BR': 1.86 * 1.4, 'Br': 1.86 * 1.4, 'CL': 1.71 * 1.4, 'Cl': 1.71 * 1.4, 'F': 1.33 * 1.4});
export var Mol = __class__ ('Mol', [object], {
__module__: __name__,
get __init__ () {return __get__ (this, function (self) {
......@@ -36,6 +37,7 @@ export var Mol = __class__ ('Mol', [object], {
self.protein_resnames = ['ALA', 'ARG', 'ASN', 'ASP', 'ASH', 'ASX', 'CYS', 'CYM', 'CYX', 'GLN', 'GLU', 'GLH', 'GLX', 'GLY', 'HIS', 'HID', 'HIE', 'HIP', 'ILE', 'LEU', 'LYS', 'LYN', 'MET', 'PHE', 'PRO', 'SER', 'THR', 'TRP', 'TYR', 'VAL'];
self.aromatic_rings = [];
self.charges = [];
self.has_hydrogens = false;
});},
get load_pdb_from_text () {return __get__ (this, function (self, text_content, filename_to_use, min_x, max_x, min_y, max_y, min_z, max_z) {
if (typeof filename_to_use == 'undefined' || (filename_to_use != null && filename_to_use.hasOwnProperty ("__kwargtrans__"))) {;
......@@ -88,37 +90,28 @@ export var Mol = __class__ ('Mol', [object], {
if (len (line) >= 7 && (line.__getslice__ (0, 4, 1) == 'ATOM' || line.__getslice__ (0, 6, 1) == 'HETATM')) {
var temp_atom = Atom ();
temp_atom.read_pdb_line (line);
if (temp_atom.element == 'H') {
self.has_hydrogens = true;
}
if (temp_atom.coordinates.x > min_x && temp_atom.coordinates.x < max_x && temp_atom.coordinates.y > min_y && temp_atom.coordinates.y < max_y && temp_atom.coordinates.z > min_z && temp_atom.coordinates.z < max_z) {
if (self.max_x < temp_atom.coordinates.x) {
self.max_x = temp_atom.coordinates.x;
}
if (self.max_y < temp_atom.coordinates.y) {
self.max_y = temp_atom.coordinates.y;
}
if (self.max_z < temp_atom.coordinates.z) {
self.max_z = temp_atom.coordinates.z;
}
if (self.min_x > temp_atom.coordinates.x) {
self.min_x = temp_atom.coordinates.x;
}
if (self.min_y > temp_atom.coordinates.y) {
self.min_y = temp_atom.coordinates.y;
}
if (self.min_z > temp_atom.coordinates.z) {
self.min_z = temp_atom.coordinates.z;
}
self.max_x = max (self.max_x, temp_atom.coordinates.x);
self.max_y = max (self.max_y, temp_atom.coordinates.y);
self.max_z = max (self.max_z, temp_atom.coordinates.z);
self.min_x = min (self.min_x, temp_atom.coordinates.x);
self.min_y = min (self.min_y, temp_atom.coordinates.y);
self.min_z = min (self.min_z, temp_atom.coordinates.z);
var key = (((((temp_atom.atom_name.strip () + '_') + str (temp_atom.resid)) + '_') + temp_atom.residue.strip ()) + '_') + temp_atom.chain.strip ();
if (__in__ (key, atom_already_loaded) && __in__ (temp_atom.residue.strip (), self.protein_resnames)) {
self.printout (('Warning: Duplicate protein atom detected: "' + temp_atom.line.strip ()) + '". Not loading this duplicate.');
print ('');
}
if (!__in__ (key, atom_already_loaded) || !(__in__ (temp_atom.residue.strip (), self.protein_resnames))) {
if (!__in__ (key, atom_already_loaded) || !__in__ (temp_atom.residue.strip (), self.protein_resnames)) {
atom_already_loaded.append (key);
self.all_atoms [autoindex] = temp_atom;
if (!__in__ (temp_atom.residue.__getslice__ (-(3), null, 1), self.protein_resnames)) {
self.non_protein_atoms [autoindex] = temp_atom;
}
var autoindex = autoindex + 1;
autoindex++;
}
}
}
......@@ -127,6 +120,10 @@ export var Mol = __class__ ('Mol', [object], {
self.create_bonds_by_distance ();
self.assign_aromatic_rings ();
self.assign_charges ();
if (!(self.has_hydrogens)) {
self.printout ('WARNING: Detected molecule with no hydrogen atoms. Did you forget to add them? Adding hydrogen atoms improves salt-bridge and hydrogen-bond detection.');
print ('');
}
});},
get load_pdb_file () {return __get__ (this, function (self, filename, min_x, max_x, min_y, max_y, min_z, max_z) {
if (typeof min_x == 'undefined' || (min_x != null && min_x.hasOwnProperty ("__kwargtrans__"))) {;
......@@ -174,11 +171,13 @@ export var Mol = __class__ ('Mol', [object], {
f.close ();
});},
get save_pdb_string () {return __get__ (this, function (self) {
var to_output = '';
for (var atom_index of self.all_atoms.py_keys ()) {
to_output += self.all_atoms [atom_index].create_pdb_line (atom_index) + '\n';
}
return to_output;
return ''.join ((function () {
var __accu0__ = [];
for (var atom_index of self.all_atoms.py_keys ()) {
__accu0__.append (self.all_atoms [atom_index].create_pdb_line (atom_index) + '\n');
}
return py_iter (__accu0__);
}) ());
});},
get add_new_atom () {return __get__ (this, function (self, atom) {
var t = 1;
......@@ -200,7 +199,7 @@ export var Mol = __class__ ('Mol', [object], {
self.all_atoms [atom_index].residue = resname;
}
});},
get connected_atoms_of_given_element () {return __get__ (this, function (self, index, connected_atom_element) {
get connected_atoms_of_element () {return __get__ (this, function (self, index, connected_atom_element) {
var atom = self.all_atoms [index];
var connected_atoms = [];
for (var index2 of atom.indecies_of_atoms_connecting) {
......@@ -230,7 +229,7 @@ export var Mol = __class__ ('Mol', [object], {
for (var atom_index of self.all_atoms.py_keys ()) {
var atom = self.all_atoms [atom_index];
var key = (((atom.residue + '_') + str (atom.resid)) + '_') + atom.chain;
if (first === true) {
if (first) {
var curr_res = key;
var first = false;
}
......@@ -244,181 +243,143 @@ export var Mol = __class__ ('Mol', [object], {
}
self.check_protein_format_process_residue (residue, last_key);
});},
get warn_bad_atom_name () {return __get__ (this, function (self, py_name, residue) {
self.printout (((('Warning: There is no atom named "' + py_name) + '" in the protein residue ') + residue) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine secondary structure. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
});},
get check_protein_format_process_residue () {return __get__ (this, function (self, residue, last_key) {
var temp = last_key.strip ().py_split ('_');
var resname = temp [0];
var real_resname = resname.__getslice__ (-(3), null, 1);
var resid = temp [1];
var chain = temp [2];
if (__in__ (real_resname, self.protein_resnames)) {
if (!__in__ ('N', residue)) {
self.printout (('Warning: There is no atom named "N" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine secondary structure. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('N', last_key);
}
if (!__in__ ('C', residue)) {
self.printout (('Warning: There is no atom named "C" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine secondary structure. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('C', last_key);
}
if (!__in__ ('CA', residue)) {
self.printout (('Warning: There is no atom named "CA" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine secondary structure. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CA', last_key);
}
if (real_resname == 'GLU' || real_resname == 'GLH' || real_resname == 'GLX') {
if (__in__ (real_resname, ['GLU', 'GLH', 'GLX'])) {
if (!__in__ ('OE1', residue)) {
self.printout (('Warning: There is no atom named "OE1" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine salt-bridge interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('OE1', last_key);
}
if (!__in__ ('OE2', residue)) {
self.printout (('Warning: There is no atom named "OE2" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine salt-bridge interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('OE2', last_key);
}
}
if (real_resname == 'ASP' || real_resname == 'ASH' || real_resname == 'ASX') {
if (__in__ (real_resname, ['ASP', 'ASH', 'ASX'])) {
if (!__in__ ('OD1', residue)) {
self.printout (('Warning: There is no atom named "OD1" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine salt-bridge interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('OD1', last_key);
}
if (!__in__ ('OD2', residue)) {
self.printout (('Warning: There is no atom named "OD2" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine salt-bridge interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('OD2', last_key);
}
}
if (real_resname == 'LYS' || real_resname == 'LYN') {
if (!__in__ ('NZ', residue)) {
self.printout (('Warning: There is no atom named "NZ" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-cation and salt-bridge interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
}
if (__in__ (real_resname, ['LYS', 'LYN']) && !__in__ ('NZ', residue)) {
self.warn_bad_atom_name ('NZ', last_key);
}
if (real_resname == 'ARG') {
if (!__in__ ('NH1', residue)) {
self.printout (('Warning: There is no atom named "NH1" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-cation and salt-bridge interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('NH1', last_key);
}
if (!__in__ ('NH2', residue)) {
self.printout (('Warning: There is no atom named "NH2" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-cation and salt-bridge interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('NH2', last_key);
}
}
if (real_resname == 'HIS' || real_resname == 'HID' || real_resname == 'HIE' || real_resname == 'HIP') {
if (__in__ (real_resname, ['HIS', 'HID', 'HIE', 'HIP'])) {
if (!__in__ ('NE2', residue)) {
self.printout (('Warning: There is no atom named "NE2" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-cation and salt-bridge interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('NE2', last_key);
}
if (!__in__ ('ND1', residue)) {
self.printout (('Warning: There is no atom named "ND1" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-cation and salt-bridge interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('ND1', last_key);
}
}
if (real_resname == 'PHE') {
if (!__in__ ('CG', residue)) {
self.printout (('Warning: There is no atom named "CG" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CG', last_key);
}
if (!__in__ ('CD1', residue)) {
self.printout (('Warning: There is no atom named "CD1" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CD1', last_key);
}
if (!__in__ ('CD2', residue)) {
self.printout (('Warning: There is no atom named "CD2" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CD2', last_key);
}
if (!__in__ ('CE1', residue)) {
self.printout (('Warning: There is no atom named "CE1" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CE1', last_key);
}
if (!__in__ ('CE2', residue)) {
self.printout (('Warning: There is no atom named "CE2" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CE2', last_key);
}
if (!__in__ ('CZ', residue)) {
self.printout (('Warning: There is no atom named "CZ" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CZ', last_key);
}
}
if (real_resname == 'TYR') {
if (!__in__ ('CG', residue)) {
self.printout (('Warning: There is no atom named "CG" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CG', last_key);
}
if (!__in__ ('CD1', residue)) {
self.printout (('Warning: There is no atom named "CD1" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CD1', last_key);
}
if (!__in__ ('CD2', residue)) {
self.printout (('Warning: There is no atom named "CD2" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CD2', last_key);
}
if (!__in__ ('CE1', residue)) {
self.printout (('Warning: There is no atom named "CE1" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CE1', last_key);
}
if (!__in__ ('CE2', residue)) {
self.printout (('Warning: There is no atom named "CE2" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CE2', last_key);
}
if (!__in__ ('CZ', residue)) {
self.printout (('Warning: There is no atom named "CZ" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CZ', last_key);
}
}
if (real_resname == 'TRP') {
if (!__in__ ('CG', residue)) {
self.printout (('Warning: There is no atom named "CG" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CG', last_key);
}
if (!__in__ ('CD1', residue)) {
self.printout (('Warning: There is no atom named "CD1" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CD1', last_key);
}
if (!__in__ ('CD2', residue)) {
self.printout (('Warning: There is no atom named "CD2" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CD2', last_key);
}
if (!__in__ ('NE1', residue)) {
self.printout (('Warning: There is no atom named "NE1" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('NE1', last_key);
}
if (!__in__ ('CE2', residue)) {
self.printout (('Warning: There is no atom named "CE2" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CE2', last_key);
}
if (!__in__ ('CE3', residue)) {
self.printout (('Warning: There is no atom named "CE3" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CE3', last_key);
}
if (!__in__ ('CZ2', residue)) {
self.printout (('Warning: There is no atom named "CZ2" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CZ2', last_key);
}
if (!__in__ ('CZ3', residue)) {
self.printout (('Warning: There is no atom named "CZ3" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CZ3', last_key);
}
if (!__in__ ('CH2', residue)) {
self.printout (('Warning: There is no atom named "CH2" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CH2', last_key);
}
}
if (real_resname == 'HIS' || real_resname == 'HID' || real_resname == 'HIE' || real_resname == 'HIP') {
if (__in__ (real_resname, ['HIS', 'HID', 'HIE', 'HIP'])) {
if (!__in__ ('CG', residue)) {
self.printout (('Warning: There is no atom named "CG" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CG', last_key);
}
if (!__in__ ('ND1', residue)) {
self.printout (('Warning: There is no atom named "ND1" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('ND1', last_key);
}
if (!__in__ ('CD2', residue)) {
self.printout (('Warning: There is no atom named "CD2" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CD2', last_key);
}
if (!__in__ ('CE1', residue)) {
self.printout (('Warning: There is no atom named "CE1" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('CE1', last_key);
}
if (!__in__ ('NE2', residue)) {
self.printout (('Warning: There is no atom named "NE2" in the protein residue ' + last_key) + '. Please use standard naming conventions for all protein residues. This atom is needed to determine pi-pi and pi-cation interactions. If this residue is far from the active site, this warning may not affect the NNScore.');
print ('');
self.warn_bad_atom_name ('NE2', last_key);
}
}
}
......@@ -430,7 +391,7 @@ export var Mol = __class__ ('Mol', [object], {
for (var atom_index2 of self.non_protein_atoms.py_keys ()) {
if (atom_index1 != atom_index2) {
var atom2 = self.non_protein_atoms [atom_index2];
if (!(__in__ (atom2.residue.__getslice__ (-(3), null, 1), self.protein_resnames))) {
if (!__in__ (atom2.residue.__getslice__ (-(3), null, 1), self.protein_resnames)) {
var dist = distance (atom1.coordinates, atom2.coordinates);
if (dist < self.bond_length (atom1.element, atom2.element) * 1.2) {
atom1.add_neighbor_atom_index (atom_index2);
......@@ -442,251 +403,259 @@ export var Mol = __class__ ('Mol', [object], {
}
}
});},
get update_distance () {return __get__ (this, function (self, element1, element2, orig_distance, match) {
var __left0__ = match;
var match_element1 = __left0__ [0];
var match_element2 = __left0__ [1];
var match_dist = __left0__ [2];
if (element1 == match_element1 && element2 == match_element2) {
return match_dist;
}
if (element1 == match_element2 && element2 == match_element1) {
return match_dist;
}
return orig_distance;
});},
get bond_length () {return __get__ (this, function (self, element1, element2) {
var distance = 0.0;
if (element1 == 'C' && element2 == 'C') {
var distance = 1.53;
}
if (element1 == 'N' && element2 == 'N') {
var distance = 1.425;
}
if (element1 == 'O' && element2 == 'O') {
var distance = 1.469;
}
if (element1 == 'S' && element2 == 'S') {
var distance = 2.048;
}
if (element1 == 'C' && element2 == 'H' || element1 == 'H' && element2 == 'C') {
var distance = 1.059;
}
if (element1 == 'C' && element2 == 'N' || element1 == 'N' && element2 == 'C') {
var distance = 1.469;
}
if (element1 == 'C' && element2 == 'O' || element1 == 'O' && element2 == 'C') {