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

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

parent 6c2f57df
......@@ -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:09
// Transcrypt'ed from Python, 2021-11-09 00:25:33
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 {fabs} from './binana._utils.shim.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:09
// Transcrypt'ed from Python, 2021-11-09 00:25:33
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 {Mol} from './binana._structure.mol.js';
......@@ -30,24 +30,28 @@ export var get_salt_bridges = function (ligand, receptor, cutoff) {
}
var key = 'SALT-BRIDGE_' + structure;
for (var index of receptor_charge.indices) {
pdb_salt_bridges.add_new_atom (receptor.all_atoms [index].copy_of ());
var idx = int (index);
var atom = receptor.all_atoms [idx];
pdb_salt_bridges.add_new_atom (atom.copy_of ());
}
for (var index of ligand_charge.indices) {
pdb_salt_bridges.add_new_atom (ligand.all_atoms [index].copy_of ());
var idx = int (index);
var atom = ligand.all_atoms [idx];
pdb_salt_bridges.add_new_atom (atom.copy_of ());
}
hashtable_entry_add_one (salt_bridges, key);
salt_bridge_labels.append (tuple ([('[' + ' / '.join ((function () {
var __accu0__ = [];
for (var index of ligand_charge.indices) {
__accu0__.append (ligand.all_atoms [index].string_id ());
__accu0__.append (ligand.all_atoms [int (index)].string_id ());
}
return __accu0__;
return py_iter (__accu0__);
}) ())) + ']', ('[' + ' / '.join ((function () {
var __accu0__ = [];
for (var index of receptor_charge.indices) {
__accu0__.append (receptor.all_atoms [index].string_id ());
__accu0__.append (receptor.all_atoms [int (index)].string_id ());
}
return __accu0__;
return py_iter (__accu0__);
}) ())) + ']']));
}
}
......
......@@ -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
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__ = 'binana.interactions.default_params';
export var CLOSE_CONTACTS_DIST1_CUTOFF = 2.5;
......
......@@ -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:09
// Transcrypt'ed from Python, 2021-11-09 00:25:33
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 _closest from './binana.interactions._closest.js';
......@@ -22,7 +22,7 @@ __nest__ (binana, '', __module_binana__);
import {ACTIVE_SITE_FLEXIBILITY_DIST_CUTOFF, CATION_PI_DIST_CUTOFF, CLOSE_CONTACTS_DIST1_CUTOFF, CLOSE_CONTACTS_DIST2_CUTOFF, ELECTROSTATIC_DIST_CUTOFF, HYDROGEN_HALOGEN_BOND_ANGLE_CUTOFF, HYDROGEN_HALOGEN_BOND_DIST_CUTOFF, HYDROPHOBIC_DIST_CUTOFF, PI_PADDING_DIST, PI_PI_INTERACTING_DIST_CUTOFF, PI_STACKING_ANGLE_TOLERANCE, SALT_BRIDGE_DIST_CUTOFF, T_STACKING_ANGLE_TOLERANCE, T_STACKING_CLOSEST_DIST_CUTOFF} from './binana.interactions.default_params.js';
import {_set_default} from './binana._utils.shim.js';
import * as default_params from './binana.interactions.default_params.js';
export {CLOSE_CONTACTS_DIST2_CUTOFF, _cat_pi, PI_PADDING_DIST, _flexibility, CATION_PI_DIST_CUTOFF, _closest, _electrostatic_energies, default_params, HYDROPHOBIC_DIST_CUTOFF, CLOSE_CONTACTS_DIST1_CUTOFF, SALT_BRIDGE_DIST_CUTOFF, _hydrophobics, T_STACKING_ANGLE_TOLERANCE, _close, _ligand_atom_types, HYDROGEN_HALOGEN_BOND_ANGLE_CUTOFF, ACTIVE_SITE_FLEXIBILITY_DIST_CUTOFF, ELECTROSTATIC_DIST_CUTOFF, _set_default, PI_PI_INTERACTING_DIST_CUTOFF, _salt_bridges, HYDROGEN_HALOGEN_BOND_DIST_CUTOFF, T_STACKING_CLOSEST_DIST_CUTOFF, PI_STACKING_ANGLE_TOLERANCE, _hydrogen_halogen_bonds, _pi_pi};
export {HYDROPHOBIC_DIST_CUTOFF, default_params, T_STACKING_ANGLE_TOLERANCE, HYDROGEN_HALOGEN_BOND_ANGLE_CUTOFF, PI_PADDING_DIST, _pi_pi, _salt_bridges, PI_STACKING_ANGLE_TOLERANCE, ACTIVE_SITE_FLEXIBILITY_DIST_CUTOFF, _hydrophobics, _electrostatic_energies, _flexibility, _hydrogen_halogen_bonds, T_STACKING_CLOSEST_DIST_CUTOFF, CLOSE_CONTACTS_DIST1_CUTOFF, CLOSE_CONTACTS_DIST2_CUTOFF, SALT_BRIDGE_DIST_CUTOFF, _ligand_atom_types, _closest, _close, CATION_PI_DIST_CUTOFF, PI_PI_INTERACTING_DIST_CUTOFF, HYDROGEN_HALOGEN_BOND_DIST_CUTOFF, _set_default, _cat_pi, ELECTROSTATIC_DIST_CUTOFF};
var __name__ = 'binana.interactions';
export var get_cation_pi = function (ligand, receptor, cutoff, pi_padding) {
if (typeof cutoff == 'undefined' || (cutoff != null && cutoff.hasOwnProperty ("__kwargtrans__"))) {;
......
......@@ -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 _get_params from './binana._cli_params._get_params.js';
......@@ -13,7 +13,7 @@ import * as load_ligand_receptor from './binana.load_ligand_receptor.js';
import * as fs from './binana.fs.js';
import * as __module_binana__ from './binana.js';
__nest__ (binana, '', __module_binana__);
export {fs, output, _get_params, interactions, load_ligand_receptor, _start};
export {fs, _get_params, _start, output, interactions, load_ligand_receptor};
var __name__ = '__main__';
export var _sys = binana.sys;
export var run = function (args) {
......
......@@ -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 = {};
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';
......@@ -13,7 +13,7 @@ import * as __module_math__ from './math.js';
__nest__ (math, '', __module_math__);
import * as __module_binana__ from './binana.js';
__nest__ (binana, '', __module_binana__);
export {_Point, _Mol, _math_functions};
export {_math_functions, _Point, _Mol};
var __name__ = 'binana.load_ligand_receptor';
export var _ligand_receptor_dists = null;
export var _ligand_receptor_aromatic_dists = null;
......
......@@ -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:10
// Transcrypt'ed from Python, 2021-11-09 00:25:34
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 shim from './binana._utils.shim.js';
......@@ -10,7 +10,7 @@ import * as __module_binana__ from './binana.js';
__nest__ (binana, '', __module_binana__);
import * as vmd_state from './binana.output._directory.vmd_state.js';
import * as pdbs from './binana.output._directory.pdbs.js';
export {vmd_state, pdbs, shim};
export {pdbs, vmd_state, shim};
var __name__ = 'binana.output._directory';
export var os = shim;
export var make_directory_output = function (parameters, closest, close, active_site_flexibility, hydrophobics, hydrogen_bonds, halogen_bonds, pi_pi, cat_pi, salt_bridges, ligand, receptor) {
......
......@@ -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:10
// Transcrypt'ed from Python, 2021-11-09 00:25:34
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__ = 'binana.output._directory.pdbs';
export var output_dir_pdbs = function (pdb_closest_contacts, parameters, pdb_close_contacts, pdb_contacts_alpha_helix, pdb_contacts_beta_sheet, pdb_contacts_other_2nd_structure, pdb_back_bone, pdb_side_chain, pdb_hydrophobic, pdb_hbonds, pdb_halbonds, pdb_pistack, pdb_pi_T, pdb_pi_cat, pdb_salt_bridges, ligand, receptor) {
......
......@@ -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:10
// Transcrypt'ed from Python, 2021-11-09 00:25:34
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 {OpenFile} from './binana._utils.shim.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:09
// Transcrypt'ed from Python, 2021-11-09 00:25:34
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 json from './binana._utils.shim.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:09
// Transcrypt'ed from Python, 2021-11-09 00:25:34
var binana = {};
var re = {};
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';
......
......@@ -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:09
// Transcrypt'ed from Python, 2021-11-09 00:25:33
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 {OpenFile as _openFile} from './binana._utils.shim.js';
......@@ -13,7 +13,7 @@ import * as pdb_file from './binana.output.pdb_file.js';
import * as _log from './binana.output._log.js';
import * as dictionary from './binana.output.dictionary.js';
import * as _directory from './binana.output._directory.js';
export {_directory, _openFile, dictionary, _json, pdb_file, _log};
export {_openFile, _directory, _json, dictionary, pdb_file, _log};
var __name__ = 'binana.output';
export var _write_main = function (parameters, ligand, receptor, closest, close, hydrophobics, hydrogen_bonds, halogen_bonds, salt_bridges, pi_pi, cat_pi, electrostatic_energies, active_site_flexibility, ligand_atom_types) {
var json_output = binana.output.dictionary.collect (closest, close, hydrophobics, hydrogen_bonds, halogen_bonds, salt_bridges, pi_pi, cat_pi, electrostatic_energies, active_site_flexibility, ligand_atom_types, __kwargtrans__ ({ligand_rotatable_bonds: ligand.rotatable_bonds_count}));
......
......@@ -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:09
// Transcrypt'ed from Python, 2021-11-09 00:25:33
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 {OpenFile} from './binana._utils.shim.js';
......
// Transcrypt'ed from Python, 2021-11-05 16:24:08
// Transcrypt'ed from Python, 2021-11-09 00:25:32
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, 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__ = 'math';
export var pi = Math.PI;
......
// Transcrypt'ed from Python, 2021-11-05 16:24:08
// Transcrypt'ed from Python, 2021-11-09 00:25:32
var __name__ = 'org.transcrypt.__runtime__';
export var __envir__ = {};
__envir__.interpreter_name = 'python';
......
// Transcrypt'ed from Python, 2021-11-05 16:24:09
// Transcrypt'ed from Python, 2021-11-09 00:25:34
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 {translate} from './re.translate.js';
export {translate};
......
// Transcrypt'ed from Python, 2021-11-05 16:24:10
// Transcrypt'ed from Python, 2021-11-09 00:25:34
var re = {};
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_re__ from './re.js';
......
......@@ -4,9 +4,25 @@
# this file contains the Atom class for binana.py
import math
import binana
from binana._structure.point import Point
from binana._utils.shim import r_just, round_to_thousandths_to_str
from binana._utils._math_functions import angle_between_three_points
# __pragma__ ('skip')
# Python
from math import fabs
# __pragma__ ('noskip')
"""?
# Transcrypt
import binana._utils
from binana._utils import shim
from binana._utils.shim import fabs
?"""
"""
Class Atom defines an atom
......@@ -81,10 +97,10 @@ class Atom:
+ r_just(self.residue, 4)
)
output = output + r_just(round_to_thousandths_to_str(self.coordinates.x), 18)
output = output + r_just(round_to_thousandths_to_str(self.coordinates.y), 8)
output = output + r_just(round_to_thousandths_to_str(self.coordinates.z), 8)
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
# Returns the number of an atom's nearest neighbors
......@@ -96,19 +112,14 @@ class Atom:
# Param self (Atom)
# Param index (float): index of atom to be added
def add_neighbor_atom_index(self, index):
if not (index in self.indecies_of_atoms_connecting):
if index not in self.indecies_of_atoms_connecting:
self.indecies_of_atoms_connecting.append(index)
# Returns whether the atom is part of the backbone or a sidechain
# Only really applies to proteins, assuming standard atom names
# Param self (Atom)
def side_chain_or_backbone(self):
if (
self.atom_name.strip() == "CA"
or self.atom_name.strip() == "C"
or self.atom_name.strip() == "O"
or self.atom_name.strip() == "N"
):
if self.atom_name.strip() in ["CA", "C", "O", "N"]:
return "BACKBONE"
else:
return "SIDECHAIN"
......@@ -205,3 +216,25 @@ class Atom:
if self.residue.strip() == "":
self.residue = " MOL"
# TODO: Might make more sense to put this in mol.
def has_sp3_geometry(self, parent_mol):
ncrs = [
parent_mol.all_atoms[i].coordinates
for i in self.indecies_of_atoms_connecting
]
ccr = self.coordinates
to_deg = 180.0 / math.pi
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)
average_angle = sum(angles) / float(len(angles))
return fabs(average_angle - 109.0) < 5.0
......@@ -10,7 +10,6 @@ from binana._structure.point import Point
from binana._structure.atom import Atom
from binana._utils._math_functions import (
distance,
angle_between_three_points,
vector_subtraction,
cross_product,
dihedral,
......@@ -39,6 +38,18 @@ from binana._utils.shim import OpenFile as openFile
Class Mol handles PDB filing
"""
# O-H distance is 0.96 A, N-H is 1.01 A. See
# http://www.science.uwaterloo.ca/~cchieh/cact/c120/bondel.html
_max_donor_X_dist = {
"H": 1.3,
"I": 2.04 * 1.4, # O-I: 2.04 per avogadro
"BR": 1.86 * 1.4, # O-Br: 1.86
"Br": 1.86 * 1.4,
"CL": 1.71 * 1.4, # O-Cl: 1.71
"Cl": 1.71 * 1.4,
"F": 1.33 * 1.4, # O-F: 1.33
}
class Mol:
......@@ -87,6 +98,7 @@ class Mol:
]
self.aromatic_rings = []
self.charges = [] # a list of points
self.has_hydrogens = False
def load_pdb_from_text(
self,
......@@ -124,7 +136,7 @@ class Mol:
# aren't loaded This basically gets rid of rotamers, I think.
atom_already_loaded = []
for t in range(0, len(lines)):
for t in range(len(lines)):
line = lines[t]
if line[:3] == "END" and line[:7] != "ENDROOT" and line[:9] != "ENDBRANCH":
......@@ -152,6 +164,9 @@ class Mol:
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
and temp_atom.coordinates.x < max_x
......@@ -161,20 +176,12 @@ class Mol:
and 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)
# this string uniquely identifies each atom
key = (
temp_atom.atom_name.strip()
......@@ -201,23 +208,24 @@ class Mol:
if (
key not in atom_already_loaded
or not temp_atom.residue.strip() in self.protein_resnames
or temp_atom.residue.strip() not in self.protein_resnames
):
# So either the atom hasn't been loaded, or else
# it's a non-protein atom So note that non-protein
# atoms can have redundant names, but protein
# atoms cannot. This is because protein residues
# often contain rotamers
atom_already_loaded.append(
key
) # So each atom can only be loaded once. No rotamers.
self.all_atoms[
autoindex
] = temp_atom # So you're actually reindexing everything here.
# So each atom can only be loaded once. No rotamers.
atom_already_loaded.append(key)
# So you're actually reindexing everything here.
self.all_atoms[autoindex] = temp_atom
if temp_atom.residue[-3:] not in self.protein_resnames:
self.non_protein_atoms[autoindex] = temp_atom
autoindex = autoindex + 1
autoindex += 1
self.check_protein_format()
......@@ -228,6 +236,12 @@ class Mol:
self.assign_aromatic_rings()
self.assign_charges()
if not 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("")
# Load PDB file
# Param file_name (string)
# Param min_x (float): minimum x coordinate
......@@ -293,13 +307,10 @@ class Mol:
# Returns a new PDB line
# Param self (Mol)
def save_pdb_string(self):
to_output = ""
# Write coordinates of all atoms
for atom_index in self.all_atoms.keys():
to_output += self.all_atoms[atom_index].create_pdb_line(atom_index) + "\n"
return to_output
return "".join(
self.all_atoms[atom_index].create_pdb_line(atom_index) + "\n"
for atom_index in self.all_atoms.keys()
)
# Adds a new atom to this Mol
# Param self (Mol)
......@@ -308,11 +319,11 @@ class Mol:
# first get available index
t = 1
all_atom_keys = list(self.all_atoms.keys())
"""?
all_atom_keys = [int(k) for k in all_atom_keys]
?"""
while t in all_atom_keys:
t += 1
......@@ -330,7 +341,7 @@ class Mol:
# Param self (Mol)
# Param index (integer): index of atom
# Param connected_atom_element (string): element in question
def connected_atoms_of_given_element(self, index, connected_atom_element):
def connected_atoms_of_element(self, index, connected_atom_element):
atom = self.all_atoms[index]
connected_atoms = []
for index2 in atom.indecies_of_atoms_connecting:
......@@ -380,6 +391,16 @@ class Mol:
self.check_protein_format_process_residue(residue, last_key)
def warn_bad_atom_name(self, name, residue):
self.printout(
'Warning: There is no atom named "'
+ 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("")
# Correct format of the protein and residues
# Param self (Mol)
# Param residue ()
......@@ -388,304 +409,103 @@ class Mol:
temp = last_key.strip().split("_")
resname = temp[0]
real_resname = resname[-3:]
resid = temp[1]
chain = temp[2]
# resid = temp[1]
# chain = temp[2]
if real_resname in self.protein_resnames: # so it's a protein residue
if "N" not in 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 "C" not in residue: