Commit d41357dc authored by Jacob Durrant's avatar Jacob Durrant

Updates to make binana work in the browser.

parent 7a524266
......@@ -2507,7 +2507,7 @@ class Binana:
# The meat of the class
def __init__(self, ligand_pdbqt_filename, receptor_pdbqt_filename, parameters):
# JY- giving Binana filename attributes so json_file() can name the output file
self.ligfi = ligand_pdbqt_filename
self.ligfi = ligand_pdbqt_filename
self.recfi = receptor_pdbqt_filename
# JY
ligand = PDB()
......@@ -3150,8 +3150,8 @@ class Binana:
if parameters.params["output_dir"] != "":
if not os.path.exists(parameters.params["output_dir"]):
os.mkdir(parameters.params["output_dir"])
# call json_file
# call json_file
# have it return the dictionary and dump to a json file
json_output = self.json_file(close_contacts_labels, contacts_labels, hbonds_labels, hydrophobic_labels, pi_stacking_labels, T_stacking_labels, pi_cat_labels, salt_bridge_labels)
print("json output:")
......@@ -3631,7 +3631,7 @@ class Binana:
f = open(parameters.params["output_dir"] + "state.vmd", "w")
f.write(self.vmd_state_file())
f.close()
if (
parameters.params["output_file"] == ""
and parameters.params["output_dir"] == ""
......@@ -3705,7 +3705,7 @@ class Binana:
+ pdb_salt_bridges.save_PDB_String()
+ "TER\n"
)
"""# call json_file
"""# call json_file
# have it return the dictionary and dump to a json file
json_output = self.json_file(close_contacts_labels, contacts_labels, hbonds_labels, hydrophobic_labels, pi_stacking_labels, T_stacking_labels, pi_cat_labels, salt_bridge_labels)
print(json_output)"""
......@@ -4056,12 +4056,12 @@ class Binana:
return "\n".join(vmd)
# takes care of pairwise interactions
# takes care of pairwise interactions
# interaction_name: string
# interaction_labels: list containind raw data to be parsed into the dictionary
# returns list
def json_helper(self, interaction_labels):
# set counter for interaction
# set counter for interaction
i = 0
interaction_list = []
......@@ -4079,7 +4079,7 @@ class Binana:
for detail in receptor_atom_details:
if detail == "":
receptor_atom_details.remove(detail)
# add each detail to the appropriate key in ligand_atoms and receptor_atoms
#json_output[interaction_name][i] = {
interaction_list[i] = {
......@@ -4101,21 +4101,21 @@ class Binana:
"atomIndex": int(receptor_atom_details[4])
}
]
}
}
# increment counter
i += 1
return interaction_list
# json output
def json_file(
self,
close_contact_interactions,
contact_interactions,
hydrogen_bonds,
hydrophobic_interactions,
pi_stacking_interactions,
t_stacking_interactions,
cat_pi_interactions,
self,
close_contact_interactions,
contact_interactions,
hydrogen_bonds,
hydrophobic_interactions,
pi_stacking_interactions,
t_stacking_interactions,
cat_pi_interactions,
salt_bridge_interactions
):
json_output = {}
......@@ -4128,14 +4128,14 @@ class Binana:
json_output["tStackingInteractions"] = []
json_output["cationPiInteractions"] = []
json_output["saltBridges"] = []
# populate the lists
# use helper function to populate lists for pairwise interactions
json_output["contactsWithin2.5A"] = self.json_helper(close_contact_interactions)
json_output["contactsWithin4.0A"] = self.json_helper(contact_interactions)
json_output["hydrophobicContacts"] = self.json_helper(hydrophobic_interactions)
# reset counter for interaction
# reset counter for interaction
i = 0
# hydrogen bonds
for atom_pairs in hydrogen_bonds:
......@@ -4190,7 +4190,7 @@ class Binana:
# increment counter
i += 1
# reset counter for interaction
# reset counter for interaction
i = 0
# pi-pi stacking interactions
for atom_pair in pi_stacking_interactions:
......@@ -4240,10 +4240,10 @@ class Binana:
"atomIndex": detail[4]
}
)
# increment counter
# increment counter
i += 1
# reset counter for interaction
# reset counter for interaction
i = 0
# t stacking interactions
for atom_pair in t_stacking_interactions:
......@@ -4293,10 +4293,10 @@ class Binana:
"atomIndex": detail[4]
}
)
# increment counter
# increment counter
i += 1
# reset counter for interaction
# reset counter for interaction
i = 0
# cat-pi stacking interactions
for atom_pair in cat_pi_interactions:
......@@ -4346,10 +4346,10 @@ class Binana:
"atomIndex": detail[4]
}
)
# increment counter
# increment counter
i += 1
# reset counter for interaction
# reset counter for interaction
i = 0
# salt bridge interactions
for atom_pair in salt_bridge_interactions:
......@@ -4399,13 +4399,13 @@ class Binana:
"atomIndex": detail[4]
}
)
# increment counter
# increment counter
i += 1
# dump to json file
outputFileName = self.ligfi[:-6] + "_" + self.recfi[:-6] + "_output.json"
#with open('output.json', 'w') as jfile:
with open(outputFileName, 'w') as jfile:
with open(outputFileName, 'w') as jfile:
json.dump(json_output, jfile)
# return json object to terminal
return json_output
......@@ -4669,27 +4669,30 @@ def intro():
for i in wrapped:
print(i)
def main():
intro()
intro()
cmd_params = CommandLineParameters(sys.argv[:])
cmd_params = CommandLineParameters(sys.argv[:])
if cmd_params.okay_to_proceed() == False:
print(
"Error: You need to specify the ligand and receptor PDBQT files to analyze using\nthe -receptor and -ligand tags from the command line.\n"
)
sys.exit(0)
if cmd_params.okay_to_proceed() == False:
print(
"Error: You need to specify the ligand and receptor PDBQT files to analyze using\nthe -receptor and -ligand tags from the command line.\n"
)
sys.exit(0)
if cmd_params.error != "":
print("Warning: The following command-line parameters were not recognized:")
print((" " + cmd_params.error + "\n"))
if cmd_params.error != "":
print("Warning: The following command-line parameters were not recognized:")
print((" " + cmd_params.error + "\n"))
lig = cmd_params.params["ligand"]
rec = cmd_params.params["receptor"]
lig = cmd_params.params["ligand"]
rec = cmd_params.params["receptor"]
# ligand = PDB()
# receptor = PDB()
# ligand.LoadPDB(lig)
# receptor.LoadPDB(rec)
# ligand = PDB()
# receptor = PDB()
# ligand.LoadPDB(lig)
# receptor.LoadPDB(rec)
d = Binana(lig, rec, cmd_params)
d = Binana(lig, rec, cmd_params)
if __name__ == "__main__":
main()
......@@ -2,11 +2,11 @@
# for binana.py
from point import Point
from shiv import r_just
"""
Class Atom defines an atom
"""
class Atom:
# Initilaize an atom
def __init__(self):
......@@ -68,12 +68,11 @@ class Atom:
# Param index (integer): index of the point
def create_PDB_line(self, index):
output = "ATOM "
output = output + str(index).rjust(6) + self.atom_name.rjust(5)
+self.residue.rjust(4)
output = output + ("%.3f" % self.coordinates.x).rjust(18)
output = output + ("%.3f" % self.coordinates.y).rjust(8)
output = output + ("%.3f" % self.coordinates.z).rjust(8)
output = output + self.element.rjust(24)
output = output + r_just(str(index), 6) + r_just(self.atom_name, 5) + r_just(self.residue, 4)
output = output + r_just("%.3f" % self.coordinates.x, 18)
output = output + r_just("%.3f" % self.coordinates.y, 8)
output = output + r_just("%.3f" % self.coordinates.z, 8)
output = output + r_just(self.element, 24)
return output
# Returns the number of an atom's nearest neighbors
......@@ -189,5 +188,8 @@ class Atom:
pass
self.chain = line[21:22]
if self.chain == " ":
self.chain = "X"
if self.residue.strip() == "":
self.residue = " MOL"
This diff is collapsed.
# this file contains the CommandLineParameters class
# for binana.py
import os
"""
Class CommmandLineParameters
"""
......
# this file contains the Point class
# for binana.py
import math
from shiv import r_just
class Point:
x = 99999.0
......@@ -57,10 +57,9 @@ class Point:
# Param index (integer): index of the point
def create_PDB_line(self, index):
output = "ATOM "
output = output + str(index).rjust(6) + "X".rjust(5) + "XXX".rjust(4)
output = output + ("%.3f" % self.x).rjust(18)
output = output + ("%.3f" % self.y).rjust(8)
output = output + ("%.3f" % self.z).rjust(8)
output = output + "X".rjust(24)
output = output + r_just(str(index), 6) + r_just("X", 5) + r_just("XXX", 4)
output = output + r_just("%.3f" % self.x, 18)
output = output + r_just("%.3f" % self.y, 8)
output = output + r_just("%.3f" % self.z, 8)
output = output + r_just("X", 24)
return output
# A number of python libraries aren't compatible with transcript. This file
# provides alternate functions.
import sys
fake_fs = {}
# sys.argv dosn't make sense in this context.
argv = []
# os.sep not available
sep = "/"
# os.mkdir not needed.
def mkdir(d):
# No need to make directories when using transcrypt.
return
# os.path.exists
class Path():
def exists(d):
# No need to implement.
return True
path = Path()
# sys.exit doesn't work
def exit(n):
return
# textwrap.wrap
def wrap(s, _):
# So no wrapping...
return [s]
# strange that many math functions are defined but not math.fabs
def fabs(n):
if n < 0:
return -n
return n
# json.dump doesn't work
def dump(data, open_file):
txt = str(data).replace('"', '\\"').replace("'", '"')
open_file.write(txt)
# rjust not implemented in transcrypt, so use pure python substitute.
def r_just(s, c):
while len(s) < c:
s = " " + s
return s
# opening, reading, and writing to files doesn't make sense in browser.
class OpenFile:
def __init__(self, flnm, mode="r"):
self.flnm = flnm
self.mode = mode
if mode == "w":
fake_fs[flnm] = ""
def write(self, s):
fake_fs[self.flnm] += s
def read(self):
return fake_fs[self.flnm]
def readlines(self):
return [l + "\n" for l in fake_fs[self.flnm].split("\n")]
def close(self):
return
This source diff could not be displayed because it is too large. You can view the blob instead.
'use strict';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=[];
//# sourceMappingURL=__future__.map
\ No newline at end of file
'use strict';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{r_just}from"./shiv.js";import{Point}from"./point.js";var __name__="atom";export var Atom=__class__("Atom",[object],{__module__:__name__,get __init__(){return __get__(this,function(self){self.atom_name="";self.residue="";self.coordinates=Point(99999,
99999,99999);self.element="";self.PDB_index="";self.line="";self.atom_type="";self.indecies_of_atoms_connecting=[];self.charge=0;self.resid=0;self.chain="";self.structure="";self.comment=""})},get copy_of(){return __get__(this,function(self){var theatom=Atom();theatom.atom_name=self.atom_name;theatom.residue=self.residue;theatom.coordinates=self.coordinates.copy_of();theatom.element=self.element;theatom.PDB_index=self.PDB_index;theatom.line=self.line;theatom.atom_type=self.atom_type;theatom.indecies_of_atoms_connecting=
self.indecies_of_atoms_connecting.__getslice__(0,null,1);theatom.charge=self.charge;theatom.resid=self.resid;theatom.chain=self.chain;theatom.structure=self.structure;theatom.comment=self.comment;return theatom})},get string_id(){return __get__(this,function(self){var to_return="";if(self.chain.strip()!="")var to_return=to_return+self.chain.strip()+":";var to_return=to_return+self.residue.strip()+"("+str(self.resid)+"):"+self.atom_name.strip()+"("+str(self.PDB_index)+")";return to_return})},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(__mod__("%.3f",self.coordinates.x),18);var output=output+r_just(__mod__("%.3f",self.coordinates.y),8);var output=output+r_just(__mod__("%.3f",self.coordinates.z),8);var output=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))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")return"BACKBONE";else return"SIDECHAIN"})},get read_PDB_line(){return __get__(this,function(self,line){self.line=line;self.atom_name=line.__getslice__(11,16,1).strip();if(len(self.atom_name)==1)self.atom_name=
self.atom_name+" ";else if(len(self.atom_name)==2)self.atom_name=self.atom_name+" ";else if(len(self.atom_name)==3)self.atom_name=self.atom_name+" ";self.coordinates=Point(float(line.__getslice__(30,38,1)),float(line.__getslice__(38,46,1)),float(line.__getslice__(46,54,1)));self.atom_type=line.__getslice__(77,79,1).strip().upper();if(line.__getslice__(69,76,1).strip()!="")self.charge=float(line.__getslice__(69,76,1));else self.charge=0;if(self.element==""){var two_letters=self.atom_name.__getslice__(0,
2,1).strip().upper();if(two_letters=="BR")self.element="BR";else if(two_letters=="CL")self.element="CL";else if(two_letters=="BI")self.element="BI";else if(two_letters=="AS")self.element="AS";else if(two_letters=="AG")self.element="AG";else if(two_letters=="LI")self.element="LI";else if(two_letters=="MG")self.element="MG";else if(two_letters=="MN")self.element="MN";else if(two_letters=="RH")self.element="RH";else if(two_letters=="ZN")self.element="ZN";else if(two_letters=="FE")self.element="FE";else{self.element=
self.atom_name;self.element=self.element.py_replace("0","");self.element=self.element.py_replace("1","");self.element=self.element.py_replace("2","");self.element=self.element.py_replace("3","");self.element=self.element.py_replace("4","");self.element=self.element.py_replace("5","");self.element=self.element.py_replace("6","");self.element=self.element.py_replace("7","");self.element=self.element.py_replace("8","");self.element=self.element.py_replace("9","");self.element=self.element.py_replace("@",
"");self.element=self.element.__getslice__(0,1,1).strip().upper()}}self.PDB_index=line.__getslice__(6,12,1).strip();self.residue=line.__getslice__(16,20,1);self.residue=" "+self.residue.__getslice__(-3,null,1);try{self.resid=int(line.__getslice__(23,26,1))}catch(__except0__){}self.chain=line.__getslice__(21,22,1);if(self.chain==" ")self.chain="X";if(self.residue.strip()=="")self.residue=" MOL"})}});
//# sourceMappingURL=atom.map
\ No newline at end of file
This diff is collapsed.
{"options": {"source": "binana.py", "anno": false, "alimod": false, "build": false, "complex": false, "docat": false, "dassert": false, "dcheck": false, "dextex": false, "dlog": false, "dmap": false, "dnostrip": false, "dstat": false, "dtree": false, "esv": null, "ecom": false, "fcall": false, "gen": false, "iconv": false, "jscall": false, "jskeys": false, "jsmod": false, "kwargs": false, "keycheck": false, "license": false, "map": false, "nomin": false, "opov": false, "parent": null, "run": false, "symbols": null, "sform": false, "tconv": false, "unit": null, "verbose": false, "x": null, "xreex": false, "xglobs": false, "xpath": null, "xtiny": false, "star": false}, "modules": [{"source": "/Users/jdurrant/anaconda/envs/Python36/lib/python3.6/site-packages/transcrypt/modules/org/transcrypt/__runtime__.py", "target": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/__target__/org.transcrypt.__runtime__.js"}, {"source": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/binana.py", "target": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/__target__/binana.js"}, {"source": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/command_line_parameters.py", "target": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/__target__/command_line_parameters.js"}, {"source": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/shiv.py", "target": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/__target__/shiv.js"}, {"source": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/math_functions.py", "target": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/__target__/math_functions.js"}, {"source": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/point.py", "target": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/__target__/point.js"}, {"source": "/Users/jdurrant/anaconda/envs/Python36/lib/python3.6/site-packages/transcrypt/modules/math/__init__.py", "target": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/__target__/math.js"}, {"source": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/mol.py", "target": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/__target__/mol.js"}, {"source": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/atom.py", "target": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/__target__/atom.js"}, {"source": "/Users/jdurrant/anaconda/envs/Python36/lib/python3.6/site-packages/transcrypt/modules/re/__init__.py", "target": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/__target__/re.js"}, {"source": "/Users/jdurrant/anaconda/envs/Python36/lib/python3.6/site-packages/transcrypt/modules/re/translate.py", "target": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/__target__/re.translate.js"}, {"source": "/Users/jdurrant/anaconda/envs/Python36/lib/python3.6/site-packages/transcrypt/modules/__future__/__init__.py", "target": "/Users/jdurrant/Documents/Work/durrant_git/binana/browser_testing/output/python_src/binana_package/__target__/__future__.js"}]}
\ No newline at end of file
'use strict';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 os from"./shiv.js";var __name__="command_line_parameters";export var CommandLineParameters=__class__("CommandLineParameters",[object],{__module__:__name__,params:dict({}),get is_num(){return __get__(this,function(self,num){try{var t=float(num);
return t}catch(__except0__){if(isinstance(__except0__,ValueError))return num;else throw __except0__;}})},get __init__(){return __get__(this,function(self,parameters){self.params["close_contacts_dist1_cutoff"]=2.5;self.params["close_contacts_dist2_cutoff"]=4;self.params["electrostatic_dist_cutoff"]=4;self.params["active_site_flexibility_dist_cutoff"]=4;self.params["hydrophobic_dist_cutoff"]=4;self.params["hydrogen_bond_dist_cutoff"]=4;self.params["hydrogen_bond_angle_cutoff"]=40;self.params["pi_padding_dist"]=
.75;self.params["pi_pi_interacting_dist_cutoff"]=7.5;self.params["pi_stacking_angle_tolerance"]=30;self.params["T_stacking_angle_tolerance"]=30;self.params["T_stacking_closest_dist_cutoff"]=5;self.params["cation_pi_dist_cutoff"]=6;self.params["salt_bridge_dist_cutoff"]=5.5;self.params["receptor"]="";self.params["ligand"]="";self.params["output_dir"]="";self.params["output_file"]="";for(var index=0;index<len(parameters);index++){var item=parameters[index];if(item.__getslice__(0,1,1)=="-"){var key=
item.py_replace("-","");var value=self.is_num(parameters[index+1]);if(__in__(key,list(self.params.py_keys()))){self.params[key]=value;parameters[index]="";parameters[index+1]=""}}}self.error="";for(var index=1;index<len(parameters);index++){var item=parameters[index];if(item!="")self.error=self.error+item+" "}if(self.params["output_dir"]!="")if(self.params["output_dir"].__getslice__(-1,null,1)!=os.sep)self.params["output_dir"]=self.params["output_dir"]+os.sep;if(self.params["output_dir"]!=""&&self.params["output_file"]==
"")self.params["output_file"]=self.params["output_dir"]+"output.pdb"})},get okay_to_proceed(){return __get__(this,function(self){if(self.params["receptor"]!=""&&self.params["ligand"]!="")return true;else return false})}});
//# sourceMappingURL=command_line_parameters.map
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
'use strict';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;export var e=Math.E;export var exp=Math.exp;export var expm1=function(x){return Math.exp(x)-1};export var log=function(x,base){return base===undefined?Math.log(x):Math.log(x)/Math.log(base)};export var log1p=function(x){return Math.log(x+
1)};export var log2=function(x){return Math.log(x)/Math.LN2};export var log10=function(x){return Math.log(x)/Math.LN10};export var pow=Math.pow;export var sqrt=Math.sqrt;export var sin=Math.sin;export var cos=Math.cos;export var tan=Math.tan;export var asin=Math.asin;export var acos=Math.acos;export var atan=Math.atan;export var atan2=Math.atan2;export var hypot=Math.hypot;export var degrees=function(x){return x*180/Math.PI};export var radians=function(x){return x*Math.PI/180};export var sinh=Math.sinh;
export var cosh=Math.cosh;export var tanh=Math.tanh;export var asinh=Math.asinh;export var acosh=Math.acosh;export var atanh=Math.atanh;export var floor=Math.floor;export var ceil=Math.ceil;export var trunc=Math.trunc;export var isnan=isNaN;export var inf=Infinity;export var nan=NaN;export var modf=function(n){var sign=n>=0?1:-1;var __left0__=divmod(abs(n),1);var f=__left0__[0];var mod=__left0__[1];return tuple([mod*sign,f*sign])};
//# sourceMappingURL=math.map
\ No newline at end of file
'use strict';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{Point}from"./point.js";import*as __module_math__ from"./math.js";__nest__(math,"",__module_math__);var __name__="math_functions";export var MathFunctions=__class__("MathFunctions",[object],{__module__:__name__,get planrity(){return __get__(this,
function(self,point1,point2,point3,point4){var x1=point1.x;var y1=point1.y;var z1=point1.z;var x2=point2.x;var y2=point2.y;var z2=point2.z;var x3=point3.x;var y3=point3.y;var z3=point3.z;var x4=point4.x;var y4=point4.y;var z4=point4.z;var A=y1*(z2-z3)+y2*(z3-z1)+y3*(z1-z2);var B=z1*(x2-x3)+z2*(x3-x1)+z3*(x1-x2);var C=x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2);var D=-x1*(y2*z3-y3*z2)+-x2*(y3*z1-y1*z3)+-x3*(y1*z2-y2*z1);var distance=shiv.fabs(A*x4+B*y4+C*z4+D)/math.sqrt(math.pow(A,2)+math.pow(B,2)+math.pow(C,
2));var A1=y1*(z2-z4)+y2*(z4-z1)+y4*(z1-z2);var B1=z1*(x2-x4)+z2*(x4-x1)+z4*(x1-x2);var C1=x1*(y2-y4)+x2*(y4-y1)+x4*(y1-y2);var D1=-x1*(y2*z4-y4*z2)+-x2*(y4*z1-y1*z4)+-x4*(y1*z2-y2*z1);var distance1=shiv.fabs(A1*x3+B1*y3+C1*z3+D1)/math.sqrt(math.pow(A1,2)+math.pow(B1,2)+math.pow(C1,2));var A2=y1*(z4-z3)+y4*(z3-z1)+y3*(z1-z4);var B2=z1*(x4-x3)+z4*(x3-x1)+z3*(x1-x4);var C2=x1*(y4-y3)+x4*(y3-y1)+x3*(y1-y4);var D2=-x1*(y4*z3-y3*z4)+-x4*(y3*z1-y1*z3)+-x3*(y1*z4-y4*z1);var distance2=shiv.fabs(A2*x2+B2*
y2+C2*z2+D2)/math.sqrt(math.pow(A2,2)+math.pow(B2,2)+math.pow(C2,2));var A3=y4*(z2-z3)+y2*(z3-z4)+y3*(z4-z2);var B3=z4*(x2-x3)+z2*(x3-x4)+z3*(x4-x2);var C3=x4*(y2-y3)+x2*(y3-y4)+x3*(y4-y2);var D3=-x4*(y2*z3-y3*z2)+-x2*(y3*z4-y4*z3)+-x3*(y4*z2-y2*z4);var distance3=shiv.fabs(A3*x1+B3*y1+C3*z1+D3)/math.sqrt(math.pow(A3,2)+math.pow(B3,2)+math.pow(C3,2));var final_dist=-1;if(distance<distance1&&distance<distance2&&distance<distance3)var final_dist=distance;else if(distance1<distance&&distance1<distance2&&
distance1<distance3)var final_dist=distance1;else if(distance2<distance&&distance2<distance1&&distance2<distance3)var final_dist=distance2;else if(distance3<distance&&distance3<distance1&&distance3<distance2)var final_dist=distance3;return final_dist})},get vector_subtraction(){return __get__(this,function(self,vector1,vector2){return Point(vector1.x-vector2.x,vector1.y-vector2.y,vector1.z-vector2.z)})},get cross_product(){return __get__(this,function(self,Pt1,Pt2){var response=Point(0,0,0);response.x=
Pt1.y*Pt2.z-Pt1.z*Pt2.y;response.y=Pt1.z*Pt2.x-Pt1.x*Pt2.z;response.z=Pt1.x*Pt2.y-Pt1.y*Pt2.x;return response})},get vector_scalar_multiply(){return __get__(this,function(self,vector,scalar){return Point(vector.x*scalar,vector.y*scalar,vector.z*scalar)})},get dot_product(){return __get__(this,function(self,point1,point2){return point1.x*point2.x+point1.y*point2.y+point1.z*point2.z})},get dihedral(){return __get__(this,function(self,point1,point2,point3,point4){var b1=self.vector_subtraction(point2,
point1);var b2=self.vector_subtraction(point3,point2);var b3=self.vector_subtraction(point4,point3);var b2Xb3=self.cross_product(b2,b3);var b1Xb2=self.cross_product(b1,b2);var b1XMagb2=self.vector_scalar_multiply(b1,b2.magnitude());var radians=math.atan2(self.dot_product(b1XMagb2,b2Xb3),self.dot_product(b1Xb2,b2Xb3));return radians})},get angle_between_three_points(){return __get__(this,function(self,point1,point2,point3){var vector1=self.vector_subtraction(point1,point2);var vector2=self.vector_subtraction(point3,
point2);return self.angle_between_points(vector1,vector2)})},get angle_between_points(){return __get__(this,function(self,point1,point2){var new_point1=self.return_normalized_vector(point1);var new_point2=self.return_normalized_vector(point2);var dot_prod=self.dot_product(new_point1,new_point2);if(dot_prod>1)var dot_prod=1;if(dot_prod<-1)var dot_prod=-1;return math.acos(dot_prod)})},get return_normalized_vector(){return __get__(this,function(self,vector){var dist=self.distance(Point(0,0,0),vector);
return Point(vector.x/dist,vector.y/dist,vector.z/dist)})},get distance(){return __get__(this,function(self,point1,point2){var deltax=point1.x-point2.x;var deltay=point1.y-point2.y;var deltaz=point1.z-point2.z;return math.sqrt(math.pow(deltax,2)+math.pow(deltay,2)+math.pow(deltaz,2))})},get project_point_onto_plane(){return __get__(this,function(self,a_point,plane_coefficients){var a=plane_coefficients[0];var b=plane_coefficients[1];var c=plane_coefficients[2];var d=plane_coefficients[3];var s=a_point.x;
var u=a_point.y;var v=a_point.z;var t=(d-a*s-b*u-c*v)/(a*a+b*b+c*c);var x=s+a*t;var y=u+b*t;var z=v+c*t;return Point(x,y,z)})}});
//# sourceMappingURL=math_functions.map
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
'use strict';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{r_just}from"./shiv.js";import*as __module_math__ from"./math.js";__nest__(math,"",__module_math__);var __name__="point";export var Point=__class__("Point",[object],{__module__:__name__,x:99999,y:99999,z:99999,get __init__(){return __get__(this,
function(self,x,y,z){self.x=x;self.y=y;self.z=z})},get copy_of(){return __get__(this,function(self){return Point(self.x,self.y,self.z)})},get print_coors(){return __get__(this,function(self){print(str(self.x)+"\t"+str(self.y)+"\t"+str(self.z))})},get snap(){return __get__(this,function(self,reso){self.x=round(self.x/reso)*reso;self.y=round(self.y/reso)*reso;self.z=round(self.z/reso)*reso})},get dist_to(){return __get__(this,function(self,apoint){return math.sqrt(math.pow(self.x-apoint.x,2)+math.pow(self.y-
apoint.y,2)+math.pow(self.z-apoint.z,2))})},get description(){return __get__(this,function(self){return str(self.x)+" "+str(self.y)+" "+str(self.z)})},get magnitude(){return __get__(this,function(self){return self.dist_to(Point(0,0,0))})},get create_PDB_line(){return __get__(this,function(self,index){var output="ATOM ";var output=output+r_just(str(index),6)+r_just("X",5)+r_just("XXX",4);var output=output+r_just(__mod__("%.3f",self.x),18);var output=output+r_just(__mod__("%.3f",self.y),8);var output=
output+r_just(__mod__("%.3f",self.z),8);var output=output+r_just("X",24);return output})}});
//# sourceMappingURL=point.map
\ No newline at end of file
This diff is collapsed.
'use strict';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";__nest__(re,"",__module_re__);var __name__="re.translate";export var VERBOSE=false;export var MAX_SHIFTREDUCE_LOOPS=1E3;export var stringFlags="aiLmsux";export var Group=__class__("Group",[object],
{__module__:__name__,get __init__(){return __get__(this,function(self,start,end,klass){self.start=start;self.end=end;self.klass=klass})},get __repr__(){return __get__(this,function(self){return str(tuple([self.start,self.end,self.klass]))})}});export var generateGroupSpans=function(tokens){var groupInfo=[];var idx=0;for(var token of tokens){if(__t__(token.py_name.startswith("(")))groupInfo.append(Group(idx,null,token.py_name));else if(__t__(token.py_name==")"))for(var group of py_reversed(groupInfo))if(__t__(group.end===
null))group.end=idx;idx++}return groupInfo};export var countCaptureGroups=function(tokens){var groupInfo=generateGroupSpans(tokens);var count=0;for(var token of tokens)if(__t__(token.py_name=="("))count++;return count};export var getCaptureGroup=function(groupInfo,namedGroups,groupRef){try{var id=int(groupRef)}catch(__except0__){var id=namedGroups[groupRef]}var search=0;for(var group of groupInfo)if(__t__(group.klass=="(")){search++;if(__t__(search==id))return group}};export var splitIfElse=function(tokens,
namedGroups){var variants=[];var groupInfo=generateGroupSpans(tokens);for(var group of groupInfo)if(__t__(group.klass=="(?<")){var iff=tokens.__getslice__(0,null,1);var els=tokens.__getslice__(0,null,1);var conStart=group.start;var conEnd=group.end;var ref=tokens[conStart+1].py_name;var captureGroup=getCaptureGroup(groupInfo,namedGroups,ref);var captureGroupModifier=tokens[captureGroup.end+1];if(__t__(__t__(__in__(captureGroupModifier.py_name,["?","*"]))||captureGroupModifier.py_name.startswith("{0,"))){if(__t__(captureGroupModifier.py_name==
"?"))iff[captureGroup.end+1]=null;else if(__t__(captureGroupModifier.py_name=="*"))iff[captureGroup.end+1]=Token("+");else if(__t__(captureGroupModifier.py_name.startswith("{0,")))iff[captureGroup.end+1].py_name.__setslice__(0,3,null,"{1,");els[captureGroup.end+1]=null;var hasElse=false;for(var idx=conStart;idx<conEnd;idx++)if(__t__(tokens[idx].py_name=="|")){var hasElse=true;els.py_pop(conEnd);iff.__setslice__(idx,conEnd+1,null,[]);els.__setslice__(conStart,idx+1,null,[]);break}if(__t__(!__t__(hasElse))){els.__setslice__(conStart,
conEnd+1,null,[]);iff.py_pop(conEnd)}iff.__setslice__(conStart,conStart+3,null,[]);els.__setslice__(captureGroup.start,captureGroup.end+1,null,[Token("("),Token(")")]);iff.remove(null);els.remove(null);variants.append(iff);variants.append(els)}else{var pastIff=false;for(var idx=conStart;idx<conEnd;idx++)if(__t__(iff[idx].py_name=="|")){var iff=tokens.__getslice__(0,idx,1);iff.extend(tokens.__getslice__(conEnd+1,null,1));break}iff.__setslice__(conStart,conStart+3,null,[]);variants.append(iff)}break}if(__t__(!__t__(variants)))return[tokens];
var allVariants=[];for(var variant of variants)allVariants.extend(splitIfElse(variant,namedGroups));return allVariants};export var Token=__class__("Token",[object],{__module__:__name__,get __init__(){return __get__(this,function(self,py_name,paras,pure){if(typeof paras=="undefined"||paras!=null&&paras.hasOwnProperty("__kwargtrans__"))var paras=null;if(typeof pure=="undefined"||pure!=null&&pure.hasOwnProperty("__kwargtrans__"))var pure=false;if(__t__(paras===null))var paras=[];self.py_name=py_name;
self.paras=paras;self.pure=pure;self.isModeGroup=false})},get __repr__(){return __get__(this,function(self){return self.py_name})},get resolve(){return __get__(this,function(self){var paras="";for(var para of self.paras)paras+=str(para);return self.py_name+paras})}});export var shift=function(stack,queue){var done=!__t__(bool(queue));if(__t__(!__t__(done))){stack.append(Token(queue[0],[],true));var queue=queue.__getslice__(1,null,1)}return tuple([stack,queue,done])};export var shiftReduce=function(stack,
queue,namedGroups,flags){var done=false;var high=len(stack)-1;if(__t__(len(stack)<2)){var __left0__=shift(stack,queue);var stack=__left0__[0];var queue=__left0__[1];var done=__left0__[2];return tuple([stack,queue,flags,done])}var s0=__t__(len(stack)>0)?stack[high]:Token("");var s1=__t__(len(stack)>1)?stack[high-1]:Token("");if(__t__(VERBOSE)){for(var token of stack)console.log(token.resolve(),"\t",__kwargtrans__({end:""}));console.log("")}if(__t__(s1.py_name=="\\"))if(__t__(s0.py_name=="A"))stack.__setslice__(-__t__(2),
null,null,[Token("^")]);else if(__t__(s0.py_name=="a"))stack.__setslice__(-__t__(2),null,null,[Token("\\07")]);else if(__t__(s0.py_name=="Z"))stack.__setslice__(-__t__(2),null,null,[Token("$")]);else stack.__setslice__(-__t__(2),null,null,[Token("\\"+s0.py_name)]);else if(__t__(__t__(s0.py_name=="$")&&s0.pure)){stack.py_pop();stack.extend([Token("(?="),Token("\\n"),Token("?"),Token("$"),Token(")")])}else if(__t__(s1.py_name=="{")){if(__t__(__t__(s0.py_name==",")&&len(s1.paras)==0)){s1.paras.append("0");
s1.paras.append(",")}else if(__t__(s0.py_name=="}")){s1.paras.append("}");s1.py_name=s1.resolve();s1.paras=[]}else s1.paras.append(s0.py_name);var stack=stack.__getslice__(0,-__t__(1),1)}else if(__t__(__t__(s1.py_name=="[")&&s0.py_name=="^"))stack.__setslice__(-__t__(2),null,null,[Token("[^")]);else if(__t__(__t__(s1.py_name=="(")&&s0.py_name=="?"))stack.__setslice__(-__t__(2),null,null,[Token("(?")]);else if(__t__(__t__(__in__(s1.py_name,["*","+","?"]))&&s0.py_name=="?"))stack.__setslice__(-__t__(2),
null,null,[Token(s1.py_name+"?")]);else if(__t__(__t__(s1.isModeGroup)&&s0.py_name==")"))var stack=stack.__getslice__(0,-__t__(2),1);else if(__t__(s1.py_name=="(?"))if(__t__(__in__(s0.py_name,stringFlags))){if(__t__(s0.py_name=="i"))flags|=re.IGNORECASE;else if(__t__(s0.py_name=="L"))flags|=re.LOCALE;else if(__t__(s0.py_name=="m"))flags|=re.MULTILINE;else if(__t__(s0.py_name=="s"))flags|=re.DOTALL;else if(__t__(s0.py_name=="u"))flags|=re.UNICODE;else if(__t__(s0.py_name=="x"))flags|=re.VERBOSE;else if(__t__(s0.py_name==
"a"))flags|=re.ASCII;stack.py_pop();s1.isModeGroup=true}else{if(__t__(s0.py_name=="("))s0.py_name="<";var newToken=Token("(?"+s0.py_name);stack.__setslice__(-__t__(2),null,null,[newToken])}else if(__t__(s1.py_name=="(?<"))if(__t__(s0.py_name==")")){stack.__setslice__(-__t__(1),null,null,[Token("".join(s1.paras)),Token(">")]);s1.paras=[]}else{s1.paras.append(s0.py_name);stack.py_pop()}else if(__t__(s1.py_name=="(?P"))stack.__setslice__(-__t__(2),null,null,[Token("(?P"+s0.py_name)]);else if(__t__(s1.py_name==
"(?P<"))if(__t__(s0.py_name==">")){namedGroups["".join(s1.paras)]=countCaptureGroups(stack)+1;stack.__setslice__(-__t__(2),null,null,[Token("(")])}else{s1.paras.append(s0.py_name);stack.py_pop()}else if(__t__(s1.py_name=="(?P="))if(__t__(s0.py_name==")"))stack.__setslice__(-__t__(2),null,null,[Token("\\"+str(namedGroups[s1.paras[0]]))]);else if(__t__(!__t__(s1.paras))){s1.paras.append(s0.py_name);stack.py_pop()}else{s1.paras[0]+=s0.py_name;stack.py_pop()}else if(__t__(s1.py_name=="(?#"))if(__t__(s0.py_name==
")"))var stack=stack.__getslice__(0,-__t__(2),1);else var stack=stack.__getslice__(0,-__t__(1),1);else{var __left0__=shift(stack,queue);var stack=__left0__[0];var queue=__left0__[1];var done=__left0__[2]}return tuple([stack,queue,flags,done])};export var translate=function(rgx){var stack=[];var queue=list(rgx);var flags=0;var namedGroups=dict();var nloop=0;while(__t__(true)){nloop++;if(__t__(nloop>MAX_SHIFTREDUCE_LOOPS)){var __except0__=Exception();__except0__.__cause__=null;throw __except0__;}var __left0__=
shiftReduce(stack,queue,namedGroups,flags);var stack=__left0__[0];var queue=__left0__[1];var flags=__left0__[2];var done=__left0__[3];if(__t__(done))break}var variants=splitIfElse(stack,namedGroups);var n_splits=len(variants);var final=[];for(var i=0;i<len(variants);i++){final.extend(variants[i]);if(__t__(i<len(variants)-1))final.append(Token("|"))}var stack=final;var groupInfo=generateGroupSpans(stack);var resolvedTokens=[];for(var token of stack){var stringed=token.resolve();if(__t__(__t__(flags&
re.DOTALL)&&stringed=="."))var stringed="[\\s\\S]";resolvedTokens.append(stringed)}return tuple([resolvedTokens,flags,namedGroups,countCaptureGroups(stack),n_splits])};
//# sourceMappingURL=re.translate.map
\ No newline at end of file
'use strict';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 sys from"./shiv.js";var __name__="shiv";export var fake_fs=dict({});export var argv=[];export var sep="/";export var mkdir=function(d){return};export var Path=__class__("Path",[object],{__module__:__name__,get exists(){return __get__(this,
function(d){return true})}});export var path=Path();export var exit=function(n){return};export var wrap=function(s,_){return[s]};export var fabs=function(n){if(n<0)return-n;return n};export var dump=function(data,open_file){var txt=str(data).py_replace('"','\\"').py_replace("'",'"');open_file.write(txt)};export var r_just=function(s,c){while(len(s)<c)var s=" "+s;return s};export var OpenFile=__class__("OpenFile",[object],{__module__:__name__,get __init__(){return __get__(this,function(self,flnm,mode){if(typeof mode==
"undefined"||mode!=null&&mode.hasOwnProperty("__kwargtrans__"))var mode="r";self.flnm=flnm;self.mode=mode;if(mode=="w")fake_fs[flnm]=""})},get write(){return __get__(this,function(self,s){fake_fs[self.flnm]+=s})},get read(){return __get__(this,function(self){return fake_fs[self.flnm]})},get readlines(){return __get__(this,function(self){return function(){var __accu0__=[];for(var l of fake_fs[self.flnm].py_split("\n"))__accu0__.append(l+"\n");return __accu0__}()})},get close(){return __get__(this,
function(self){return})}});
//# sourceMappingURL=shiv.map
\ No newline at end of file
Changes
=======
1.3
---
1. BINANA is now requires Python3. Python2 support has been discontinued.
2. Added documentation files in MarkDown format.
3. Updated code formatting some (using black formatter).
4. Added README.md.
5. Added roadmap.
6. Updated example files, now located at `examples/`.
1.2.0
-----
1. The version previously hosted on
[SourceForge](https://sourceforge.net/projects/binana/).
# Contributor Covenant Code of Conduct
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks