Commit 9cf3ee83 authored by jdurrant's avatar jdurrant
Browse files

Removed javascript_grid_gen directory.

parent 66923e01
*****
OpenBabel09102001113D
66 66 0 0 1 0 0 0 0 0999 V2000
14.6200 9.9440 24.4710 C 0 0 0 0 0 0 0 0 0 0 0 0
15.7480 8.9120 24.4560 C 0 0 0 0 0 0 0 0 0 0 0 0
16.0850 8.4010 25.5410 O 0 0 0 0 0 0 0 0 0 0 0 0
16.3130 8.6420 23.3670 O 0 0 0 0 0 0 0 0 0 0 0 0
13.2690 9.2400 24.5300 C 0 0 0 0 0 0 0 0 0 0 0 0
12.9530 8.6610 25.9060 C 0 0 0 0 0 0 0 0 0 0 0 0
11.5780 8.0220 25.9870 C 0 0 0 0 0 0 0 0 0 0 0 0
10.7970 8.0380 25.0250 O 0 0 0 0 0 0 0 0 0 0 0 0
11.2470 7.5340 27.1750 N 0 0 0 0 0 0 0 0 0 0 0 0
9.9720 6.8700 27.4160 C 0 0 2 0 0 0 0 0 0 0 0 0
9.3670 7.3930 28.7190 C 0 0 0 0 0 0 0 0 0 0 0 0
10.0850 7.8880 29.5910 O 0 0 0 0 0 0 0 0 0 0 0 0
10.2030 5.3550 27.5530 C 0 0 0 0 0 0 0 0 0 0 0 0
11.4450 4.7020 26.3760 S 0 0 0 0 0 0 0 0 0 0 0 0
8.0510 7.2770 28.8380 N 0 0 0 0 0 0 0 0 0 0 0 0
7.3820 7.6900 30.0580 C 0 0 0 0 0 0 0 0 0 0 0 0
6.9000 9.1180 30.0690 C 0 0 0 0 0 0 0 0 0 0 0 0
6.0060 9.4220 30.8870 O 0 0 0 0 0 0 0 0 0 0 0 0
7.3950 9.9270 29.2540 O 0 0 0 0 0 0 0 0 0 0 0 0
5.7920 2.7370 28.0810 C 0 0 0 0 0 0 0 0 0 0 0 0
5.1050 2.1790 29.1650 O 0 0 0 0 0 0 0 0 0 0 0 0
7.1260 2.3100 27.8760 C 0 0 0 0 0 0 0 0 0 0 0 0
7.8880 2.8040 26.8050 C 0 0 0 0 0 0 0 0 0 0 0 0
7.3230 3.7760 25.8990 C 0 0 0 0 0 0 0 0 0 0 0 0
5.9880 4.1980 26.1300 C 0 0 0 0 0 0 0 0 0 0 0 0
5.2430 3.6890 27.1990 C 0 0 0 0 0 0 0 0 0 0 0 0
8.0950 4.3720 24.7030 C 0 0 0 0 0 0 0 0 0 0 0 0
7.5850 5.1970 23.9310 O 0 0 0 0 0 0 0 0 0 0 0 0
9.6100 3.9850 24.4110 C 0 0 1 0 0 0 0 0 0 0 0 0
9.8770 3.3130 23.0520 C 0 0 0 0 0 0 0 0 0 0 0 0
11.1860 2.5160 22.9220 C 0 0 0 0 0 0 0 0 0 0 0 0
10.6730 5.0250 24.7730 C 0 0 0 0 0 0 0 0 0 0 0 0
4.0210 1.1970 29.0350 C 0 0 0 0 0 0 0 0 0 0 0 0
3.8530 0.2730 30.2430 C 0 0 0 0 0 0 0 0 0 0 0 0
4.7490 -0.5720 30.4860 O 0 0 0 0 0 0 0 0 0 0 0 0
2.8040 0.3540 30.9250 O 0 0 0 0 0 0 0 0 0 0 0 0
7.8760 1.1450 28.9840 Cl 0 0 0 0 0 0 0 0 0 0 0 0
9.5230 2.1350 26.6450 Cl 0 0 0 0 0 0 0 0 0 0 0 0
14.7284 10.5851 25.3582 H 0 0 0 0 0 0 0 0 0 0 0 0
13.2699 8.4196 23.7972 H 0 0 0 0 0 0 0 0 0 0 0 0
12.4849 9.9654 24.2674 H 0 0 0 0 0 0 0 0 0 0 0 0
13.0051 9.4725 26.6467 H 0 0 0 0 0 0 0 0 0 0 0 0
13.7076 7.8972 26.1452 H 0 0 0 0 0 0 0 0 0 0 0 0
11.8946 7.6247 27.9316 H 0 0 0 0 0 0 0 0 0 0 0 0
9.2861 7.0690 26.5794 H 0 0 0 0 0 0 0 0 0 0 0 0
9.2481 4.8387 27.3750 H 0 0 0 0 0 0 0 0 0 0 0 0
10.5479 5.1456 28.5763 H 0 0 0 0 0 0 0 0 0 0 0 0
7.5156 6.9020 28.0812 H 0 0 0 0 0 0 0 0 0 0 0 0
8.0859 7.5612 30.8934 H 0 0 0 0 0 0 0 0 0 0 0 0
6.5111 7.0350 30.2080 H 0 0 0 0 0 0 0 0 0 0 0 0
5.5377 4.9275 25.4666 H 0 0 0 0 0 0 0 0 0 0 0 0
4.2263 4.0327 27.3514 H 0 0 0 0 0 0 0 0 0 0 0 0
9.7941 3.1773 25.1346 H 0 0 0 0 0 0 0 0 0 0 0 0
9.8899 4.1026 22.2863 H 0 0 0 0 0 0 0 0 0 0 0 0
9.0447 2.6221 22.8523 H 0 0 0 0 0 0 0 0 0 0 0 0
11.2564 2.0891 21.9107 H 0 0 0 0 0 0 0 0 0 0 0 0
11.1963 1.7042 23.6641 H 0 0 0 0 0 0 0 0 0 0 0 0
12.0415 3.1847 23.0981 H 0 0 0 0 0 0 0 0 0 0 0 0
10.1990 6.0171 24.8039 H 0 0 0 0 0 0 0 0 0 0 0 0
11.4535 5.0155 23.9979 H 0 0 0 0 0 0 0 0 0 0 0 0
4.2260 0.5740 28.1519 H 0 0 0 0 0 0 0 0 0 0 0 0
3.0781 1.7438 28.8871 H 0 0 0 0 0 0 0 0 0 0 0 0
14.6731 10.5345 23.5803 H 0 0 0 0 0 0 0 0 0 0 0 0
5.6703 8.7752 31.4760 H 0 0 0 0 0 0 0 0 0 0 0 0
2.1566 0.9977 30.7141 H 0 0 0 0 0 0 0 0 0 0 0 0
16.0245 9.0518 22.5753 H 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0 0 0 0
1 39 1 0 0 0 0
1 63 1 0 0 0 0
2 4 1 0 0 0 0
2 3 2 0 0 0 0
4 66 1 0 0 0 0
5 1 1 0 0 0 0
5 40 1 0 0 0 0
5 41 1 0 0 0 0
6 5 1 0 0 0 0
6 42 1 0 0 0 0
6 43 1 0 0 0 0
7 6 1 0 0 0 0
7 8 2 0 0 0 0
9 7 1 0 0 0 0
9 44 1 0 0 0 0
10 9 1 0 0 0 0
10 11 1 0 0 0 0
10 45 1 6 0 0 0
11 15 1 0 0 0 0
11 12 2 0 0 0 0
13 10 1 0 0 0 0
13 46 1 0 0 0 0
13 47 1 0 0 0 0
14 13 1 0 0 0 0
15 16 1 0 0 0 0
15 48 1 0 0 0 0
16 17 1 0 0 0 0
16 49 1 0 0 0 0
16 50 1 0 0 0 0
17 19 2 0 0 0 0
17 18 1 0 0 0 0
18 64 1 0 0 0 0
20 21 1 0 0 0 0
21 33 1 0 0 0 0
22 20 2 0 0 0 0
22 37 1 0 0 0 0
23 22 1 0 0 0 0
23 38 1 0 0 0 0
24 23 2 0 0 0 0
24 25 1 0 0 0 0
25 26 2 0 0 0 0
25 51 1 0 0 0 0
26 20 1 0 0 0 0
26 52 1 0 0 0 0
27 24 1 0 0 0 0
27 28 2 0 0 0 0
29 27 1 0 0 0 0
29 30 1 0 0 0 0
29 53 1 1 0 0 0
30 31 1 0 0 0 0
30 54 1 0 0 0 0
30 55 1 0 0 0 0
31 56 1 0 0 0 0
31 57 1 0 0 0 0
31 58 1 0 0 0 0
32 29 1 0 0 0 0
32 14 1 0 0 0 0
32 59 1 0 0 0 0
32 60 1 0 0 0 0
33 34 1 0 0 0 0
33 61 1 0 0 0 0
33 62 1 0 0 0 0
34 36 1 0 0 0 0
34 35 2 0 0 0 0
36 65 1 0 0 0 0
M END
$$$$
COMPND *****
AUTHOR GENERATED BY OPEN BABEL 2.4.1
HETATM 1 C UNK A 0 14.620 9.944 24.471 1.00 0.00 C
HETATM 2 C UNK A 0 15.748 8.912 24.456 1.00 0.00 C
HETATM 3 O UNK A 0 16.085 8.401 25.541 1.00 0.00 O
HETATM 4 O UNK A 0 16.313 8.642 23.367 1.00 0.00 O
HETATM 5 C UNK A 0 13.269 9.240 24.530 1.00 0.00 C
HETATM 6 C UNK A 0 12.953 8.661 25.906 1.00 0.00 C
HETATM 7 C UNK A 0 11.578 8.022 25.987 1.00 0.00 C
HETATM 8 O UNK A 0 10.797 8.038 25.025 1.00 0.00 O
HETATM 9 N UNK A 1 11.247 7.534 27.175 1.00 0.00 N
HETATM 10 C UNK A 1 9.972 6.870 27.416 1.00 0.00 C
HETATM 11 C UNK A 1 9.367 7.393 28.719 1.00 0.00 C
HETATM 12 O UNK A 1 10.085 7.888 29.591 1.00 0.00 O
HETATM 13 C UNK A 1 10.203 5.355 27.553 1.00 0.00 C
HETATM 14 S UNK A 1 11.445 4.702 26.376 1.00 0.00 S
ATOM 15 N GLY A 2 8.051 7.277 28.838 1.00 0.00 N
ATOM 16 CA GLY A 2 7.382 7.690 30.058 1.00 0.00 C
ATOM 17 C GLY A 2 6.900 9.118 30.069 1.00 0.00 C
ATOM 18 OXT GLY A 2 6.006 9.422 30.887 1.00 0.00 O
ATOM 19 O GLY A 2 7.395 9.927 29.254 1.00 0.00 O
HETATM 20 C UNK A 1 5.792 2.737 28.081 1.00 0.00 C
HETATM 21 O UNK A 1 5.105 2.179 29.165 1.00 0.00 O
HETATM 22 C UNK A 1 7.126 2.310 27.876 1.00 0.00 C
HETATM 23 C UNK A 1 7.888 2.804 26.805 1.00 0.00 C
HETATM 24 C UNK A 1 7.323 3.776 25.899 1.00 0.00 C
HETATM 25 C UNK A 1 5.988 4.198 26.130 1.00 0.00 C
HETATM 26 C UNK A 1 5.243 3.689 27.199 1.00 0.00 C
HETATM 27 C UNK A 1 8.095 4.372 24.703 1.00 0.00 C
HETATM 28 O UNK A 1 7.585 5.197 23.931 1.00 0.00 O
HETATM 29 C UNK A 1 9.610 3.985 24.411 1.00 0.00 C
HETATM 30 C UNK A 1 9.877 3.313 23.052 1.00 0.00 C
HETATM 31 C UNK A 1 11.186 2.516 22.922 1.00 0.00 C
HETATM 32 C UNK A 1 10.673 5.025 24.773 1.00 0.00 C
HETATM 33 C UNK A 1 4.021 1.197 29.035 1.00 0.00 C
HETATM 34 C UNK A 1 3.853 0.273 30.243 1.00 0.00 C
HETATM 35 O UNK A 1 4.749 -0.572 30.486 1.00 0.00 O
HETATM 36 O UNK A 1 2.804 0.354 30.925 1.00 0.00 O
HETATM 37 CL UNK A 1 7.876 1.145 28.984 1.00 0.00 Cl
HETATM 38 CL UNK A 1 9.523 2.135 26.645 1.00 0.00 Cl
HETATM 39 H UNK A 0 14.728 10.585 25.358 1.00 0.00 H
HETATM 40 H UNK A 0 13.270 8.420 23.797 1.00 0.00 H
HETATM 41 H UNK A 0 12.485 9.965 24.267 1.00 0.00 H
HETATM 42 H UNK A 0 13.005 9.473 26.647 1.00 0.00 H
HETATM 43 H UNK A 0 13.708 7.897 26.145 1.00 0.00 H
HETATM 44 H UNK A 1 11.895 7.625 27.932 1.00 0.00 H
HETATM 45 H UNK A 1 9.286 7.069 26.579 1.00 0.00 H
HETATM 46 H UNK A 1 9.248 4.839 27.375 1.00 0.00 H
HETATM 47 H UNK A 1 10.548 5.146 28.576 1.00 0.00 H
ATOM 48 H GLY A 2 7.516 6.902 28.081 1.00 0.00 H
ATOM 49 HA1 GLY A 2 8.086 7.561 30.893 1.00 0.00 H
ATOM 50 HA2 GLY A 2 6.511 7.035 30.208 1.00 0.00 H
HETATM 51 H UNK A 1 5.538 4.928 25.467 1.00 0.00 H
HETATM 52 H UNK A 1 4.226 4.033 27.351 1.00 0.00 H
HETATM 53 H UNK A 1 9.794 3.177 25.135 1.00 0.00 H
HETATM 54 H UNK A 1 9.890 4.103 22.286 1.00 0.00 H
HETATM 55 H UNK A 1 9.045 2.622 22.852 1.00 0.00 H
HETATM 56 H UNK A 1 11.256 2.089 21.911 1.00 0.00 H
HETATM 57 H UNK A 1 11.196 1.704 23.664 1.00 0.00 H
HETATM 58 H UNK A 1 12.041 3.185 23.098 1.00 0.00 H
HETATM 59 H UNK A 1 10.199 6.017 24.804 1.00 0.00 H
HETATM 60 H UNK A 1 11.454 5.016 23.998 1.00 0.00 H
HETATM 61 H UNK A 1 4.226 0.574 28.152 1.00 0.00 H
HETATM 62 H UNK A 1 3.078 1.744 28.887 1.00 0.00 H
HETATM 63 H UNK A 0 14.673 10.534 23.580 1.00 0.00 H
ATOM 64 HXT GLY A 2 5.670 8.775 31.476 1.00 0.00 H
HETATM 65 H UNK A 1 2.157 0.998 30.714 1.00 0.00 H
HETATM 66 H UNK A 0 16.024 9.052 22.575 1.00 0.00 H
CONECT 1 2 39 63 5
CONECT 2 1 4 3
CONECT 3 2
CONECT 4 2 66
CONECT 5 1 40 41 6
CONECT 6 5 42 43 7
CONECT 7 6 8 9
CONECT 8 7
CONECT 9 7 44 10
CONECT 10 9 11 45 13
CONECT 11 10 15 12
CONECT 12 11
CONECT 13 10 46 47 14
CONECT 14 13 32
CONECT 15 11 16 48
CONECT 16 15 17 49 50
CONECT 17 16 19 18
CONECT 18 17 64
CONECT 19 17
CONECT 20 21 22 26
CONECT 21 20 33
CONECT 22 20 37 23
CONECT 23 22 38 24
CONECT 24 23 25 27
CONECT 25 24 26 51
CONECT 26 25 20 52
CONECT 27 24 28 29
CONECT 28 27
CONECT 29 27 30 53 32
CONECT 30 29 31 54 55
CONECT 31 30 56 57 58
CONECT 32 29 14 59 60
CONECT 33 21 34 61 62
CONECT 34 33 36 35
CONECT 35 34
CONECT 36 34 65
CONECT 37 22
CONECT 38 23
CONECT 39 1
CONECT 40 5
CONECT 41 5
CONECT 42 6
CONECT 43 6
CONECT 44 9
CONECT 45 10
CONECT 46 13
CONECT 47 13
CONECT 48 15
CONECT 49 16
CONECT 50 16
CONECT 51 25
CONECT 52 26
CONECT 53 29
CONECT 54 30
CONECT 55 30
CONECT 56 31
CONECT 57 31
CONECT 58 31
CONECT 59 32
CONECT 60 32
CONECT 61 33
CONECT 62 33
CONECT 63 1
CONECT 64 18
CONECT 65 36
CONECT 66 4
MASTER 0 0 0 0 0 0 0 0 66 0 66 0
END
This diff is collapsed.
This diff is collapsed.
Remember that all atoms in same layer. Good to divide by layer so you can
parallelize in browser.
Remember:
# __p_ragma__ ('js', "debugger")
DONE
====
remove hydrogen atoms
'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__="gridder.fake_rdkit";export var element_names_with_two_letters=["BR","CL","BI","AS","AG","LI","MG","RH","ZN","MN"];export var element_to_atomic_num=dict({"H":1,
"HE":2,"LI":3,"BE":4,"B":5,"C":6,"N":7,"O":8,"F":9,"NE":10,"NA":11,"MG":12,"AL":13,"SI":14,"P":15,"S":16,"CL":17,"AR":18,"K":19,"CA":20});export var Point=__class__("Point",[object],{__module__:__name__,get __init__(){return __get__(this,function(self,coor){self.x=coor[0];self.y=coor[1];self.z=coor[2]})},get __getitem__(){return __get__(this,function(self,key){if(key==0)return self.x;if(key==1)return self.y;if(key==2)return self.z;return 0})}});export var Atom=__class__("Atom",[object],{__module__:__name__,
get __init__(){return __get__(this,function(self,coor,py_name,element,resname){self.coor=Point(coor);self.py_name=py_name;self.element=element;self.resname=resname})},get GetAtomicNum(){return __get__(this,function(self){var elem=__in__(self.element,element_to_atomic_num)?element_to_atomic_num[self.element]:100;return elem})}});export var Mol=__class__("Mol",[object],{__module__:__name__,get __init__(){return __get__(this,function(self){self.atoms=[]})},get add_atom(){return __get__(this,function(self,
coor,py_name,element,resname){self.atoms.append(Atom(coor,py_name,element,resname))})},get GetAtomWithIdx(){return __get__(this,function(self,i){return self.atoms[i]})},get GetNumAtoms(){return __get__(this,function(self){return len(self.atoms)})},get GetConformer(){return __get__(this,function(self){return self})},get GetAtomPosition(){return __get__(this,function(self,i){return self.atoms[i].coor})}});export var MolIterator=__class__("MolIterator",[object],{__module__:__name__,get __init__(){return __get__(this,
function(self,mol){self.mols=[mol]})},get __iter__(){return __get__(this,function(self){return self})},[Symbol.iterator](){return this.__iter__()},get __next__(){return __get__(this,function(self){if(len(self.mols)==0){var __except0__=StopIteration;__except0__.__cause__=null;throw __except0__;}return self.mols.py_pop()})},next:__jsUsePyNext__});export var Chem=__class__("Chem",[object],{__module__:__name__,get MolFromPDBFile(){return function(filetxt,sanitize){var mol=Mol();var lines_src=filetxt.py_split("\n");
var lines=function(){var __accu0__=[];for(var l of lines_src)if(l.startswith("ATOM")||l.startswith("HETATM"))__accu0__.append(l);return __accu0__}();var coors=function(){var __accu0__=[];for(var l of lines)__accu0__.append([float(l.__getslice__(30,38,1)),float(l.__getslice__(38,46,1)),float(l.__getslice__(46,54,1))]);return __accu0__}();var names=function(){var __accu0__=[];for(var l of lines)__accu0__.append(l.__getslice__(11,16,1).strip());return __accu0__}();var elements_prep=function(){var __accu0__=
[];for(var n of names)__accu0__.append(n.upper().strip());return __accu0__}();for(var [i,e]of enumerate(elements_prep)){for(var num of"0123456789")var e=e.py_replace(num,"");elements_prep[i]=e}var elements_prep=function(){var __accu0__=[];for(var e of elements_prep)__accu0__.append(e.__getslice__(0,2,1));return __accu0__}();var elements=[];for(var e of elements_prep)elements.append(Chem.name_to_element(e));var resnames=function(){var __accu0__=[];for(var l of lines)__accu0__.append(l.__getslice__(16,
21,1).strip());return __accu0__}();for(var i=0;i<len(coors);i++)mol.add_atom(coors[i],names[i],elements[i],resnames[i]);return mol}},get name_to_element(){return function(py_name){if(__in__(py_name,element_names_with_two_letters))return py_name;else return py_name.__getslice__(0,1,1)}},get SDMolSupplier(){return function(filetxt,sanitize){if(typeof sanitize=="undefined"||sanitize!=null&&sanitize.hasOwnProperty("__kwargtrans__"))var sanitize=false;var mol=Mol();var txt=filetxt;var atoms=re.findall("^ *?[\\-0-9]+?\\.[\\-0-9]+? *?[\\-0-9]+?\\.[\\-0-9]+? *?[\\-0-9]+?\\.[\\-0-9]+? *?[a-zA-Z]+? *?[\\-0-9]+? *?[\\-0-9]+? *?[\\-0-9]+? *?[\\-0-9]+? *?[\\-0-9]+? *?[\\-0-9]+? *?$",
txt,re.MULTILINE);var atoms=function(){var __accu0__=[];for(var a of atoms)__accu0__.append(a.strip().py_split().__getslice__(0,4,1));return __accu0__}();for(var [x,y,z,py_name]of atoms)mol.add_atom([float(x),float(y),float(z)],py_name,Chem.name_to_element(py_name),"");var py_iter=MolIterator(mol);return py_iter}}});
//# sourceMappingURL=gridder.fake_rdkit.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*as __module_math__ from"./math.js";__nest__(math,"",__module_math__);var __name__="gridder.grid_util";export var GPU_DIM=8;export var grid_to_real_no_rot=function(x,y,z,half_width,res,center){return tuple([grid_to_real_no_rot_one_axis(x,
half_width,res,center.x),grid_to_real_no_rot_one_axis(y,half_width,res,center.y),grid_to_real_no_rot_one_axis(z,half_width,res,center.z)])};export var grid_to_real_no_rot_one_axis=function(val_axis,half_width,res,center_axis){var tval_axis=val_axis-half_width;var tval_axis=tval_axis*res;var tval_axis=tval_axis+center_axis;return tval_axis};export var filter_atoms_no_rot=function(atom_coords,atom_layers,width,res,center){var PAD=1.75;var half_width=width/2;var __left0__=grid_to_real_no_rot(0,0,0,half_width,
res,center);var ax=__left0__[0];var ay=__left0__[1];var az=__left0__[2];var __left0__=grid_to_real_no_rot(width-1,width-1,width-1,half_width,res,center);var bx=__left0__[0];var by=__left0__[1];var bz=__left0__[2];var filt_coords=[];var filt_layers=[];for(var i=0;i<len(atom_coords);i++){var __left0__=atom_coords[i];var x=__left0__[0];var y=__left0__[1];var z=__left0__[2];if(x>ax-PAD&&y>ay-PAD&&z>az-PAD&&x<bx+PAD&&y<by+PAD&&z<bz+PAD){filt_coords.append(atom_coords[i]);filt_layers.append(atom_layers[i])}}return tuple([filt_coords,
filt_layers])};export var mol_gridify2_one_channel=function(grid,layer_offset,abs_channel_to_consider,width,res,center,filt_coords,filt_layers){var r=1.75;var r2=r*r;var half_width=width/2;for(var i=0;i<len(filt_coords);i++){var ft_with_offset=layer_offset+filt_layers[i];if(ft_with_offset!=abs_channel_to_consider)continue;var __left0__=filt_coords[i];var nx=__left0__[0];var ny=__left0__[1];var nz=__left0__[2];var rng=range(width);for(var x of rng){var tx=grid_to_real_no_rot_one_axis(x,half_width,
res,center.x);var d2_x_prt=Math.pow(nx-tx,2);for(var y of rng){var ty=grid_to_real_no_rot_one_axis(y,half_width,res,center.y);var d2_x_prt_plus_d2_y_prt=d2_x_prt+Math.pow(ny-ty,2);for(var z of rng){var tz=grid_to_real_no_rot_one_axis(z,half_width,res,center.z);var d2=d2_x_prt_plus_d2_y_prt+Math.pow(nz-tz,2);if(d2>r2)continue;grid[0][ft_with_offset][x][y][z]+=math.exp(-2*d2/r2)}}}}return grid};export var flatten_tensor=function(grid,shape){var flat=[];for(var i1=0;i1<shape[0];i1++)for(var i2=0;i2<
shape[1];i2++)for(var i3=0;i3<shape[2];i3++)for(var i4=0;i4<shape[3];i4++)for(var i5=0;i5<shape[4];i5++)flat.append(grid[i1][i2][i3][i4][i5]);return flat};export var make_tensor=function(shape){var t=[];for(var i1=0;i1<shape[0];i1++){var t1=[];for(var i2=0;i2<shape[1];i2++){var t2=[];for(var i3=0;i3<shape[2];i3++){var t3=[];for(var i4=0;i4<shape[3];i4++){var t4=[];for(var i5=0;i5<shape[4];i5++)t4.append(0);t3.append(t4)}t2.append(t3)}t1.append(t2)}t.append(t1)}return t};export var get_raw_batch_one_channel=
function(r_coords,r_types,p_coords,p_types,conn,num_samples,width,res,channel){var num_samples=num_samples===null?1:num_samples;var width=width===null?24:width;var res=res===null?.5:res;var parent_channels=4;var rec_channels=5;var B=num_samples;var T=rec_channels+parent_channels;var N=width;var shape=tuple([B,T,N,N,N]);var grid=make_tensor(shape);if(channel<parent_channels){var coords=p_coords;var types=p_types;var offset=0}else{var coords=r_coords;var types=r_types;var offset=parent_channels}var __left0__=
filter_atoms_no_rot(coords,types,width,res,conn);var filt_coords=__left0__[0];var filt_layers=__left0__[1];var grid=mol_gridify2_one_channel(grid,offset,channel,width,res,conn,filt_coords,filt_layers);return flatten_tensor(grid,shape)};
//# sourceMappingURL=gridder.grid_util.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*as __module_math__ from"./math.js";__nest__(math,"",__module_math__);import{Chem}from"./gridder.fake_rdkit.js";var __name__="gridder.util";export var get_coords=function(mol){var conf=mol.GetConformer();var coords=function(){var __accu0__=
[];for(var i=0;i<conf.GetNumAtoms();i++)__accu0__.append(conf.GetAtomPosition(i));return __accu0__}();return coords};export var get_atomic_nums=function(mol){return function(){var __accu0__=[];for(var i=0;i<mol.GetNumAtoms();i++)__accu0__.append(mol.GetAtomWithIdx(i).GetAtomicNum());return __accu0__}()};export var generate_fragments=function(mol,max_heavy_atoms,only_single_bonds){var max_heavy_atoms=max_heavy_atoms===null?0:max_heavy_atoms;var only_single_bonds=only_single_bonds===null?true:only_single_bonds;
var splits=[];var splits=[tuple([mol,null])];return splits};export var load_receptor=function(rec_path){var rec=Chem.MolFromPDBFile(rec_path,__kwargtrans__({sanitize:false}));var rec=remove_water(rec);var rec=remove_hydrogens(rec);return rec};export var remove_hydrogens=function(m){m.atoms=function(){var __accu0__=[];for(var a of m.atoms)if(a.element!="H")__accu0__.append(a);return __accu0__}();return m};export var remove_water=function(m){m.atoms=function(){var __accu0__=[];for(var a of m.atoms)if(!__in__(a.resname,
["WAT","HOH","TIP","TIP3","OH2"]))__accu0__.append(a);return __accu0__}();var merged=m;return merged};export var combine_all=function(frags){if(len(frags)==0)return null;var c=frags[0];for(var f of frags.__getslice__(1,null,1))var c=Chem.CombineMols(c,f);return c};export var load_ligand=function(sdf){var lig=py_next(Chem.SDMolSupplier(sdf,__kwargtrans__({sanitize:false})));var lig=remove_water(lig);var lig=remove_hydrogens(lig);var frags=generate_fragments(lig,null,null);return tuple([lig,frags])};
export var mol_to_points=function(mol,atom_types,note_sulfur){if(typeof note_sulfur=="undefined"||note_sulfur!=null&&note_sulfur.hasOwnProperty("__kwargtrans__"))var note_sulfur=true;var atom_types=atom_types===null?[6,7,8,16]:atom_types;var coords=get_coords(mol);var atomic_nums=get_atomic_nums(mol);var layers=[];for(var t of atomic_nums)if(t==1)layers.append(-1);else if(t==6)layers.append(0);else if(t==7)layers.append(1);else if(t==8)layers.append(2);else if(!note_sulfur)layers.append(3);else if(t==
16)layers.append(3);else layers.append(4);var coords=function(){var __accu0__=[];for(var [i,c]of enumerate(coords))if(layers[i]!=-1)__accu0__.append(c);return __accu0__}();var layers=function(){var __accu0__=[];for(var l of layers)if(l!=-1)__accu0__.append(l);return __accu0__}();return tuple([coords,layers])};export var get_connection_point=function(frag){var dummy_idx=get_atomic_nums(frag).index(0);var coords=get_coords(frag)[dummy_idx];return coords};export var frag_dist_to_receptor_raw=function(coords,
frag){var conn=get_connection_point(frag);var dists=[];for(var i=0;i<len(coords);i++){var coord=coords[i];var tmp=[coord[0]-conn.x,coord[1]-conn.y,coord[2]-conn.z];var tmp=[Math.pow(tmp[0],2),Math.pow(tmp[1],2),Math.pow(tmp[2],2)];var s=sum(tmp);dists.append(s)}var min_dist=math.sqrt(min(dists));return min_dist};export var mol_array=function(mol){var coords=get_coords(mol);var types=get_atomic_nums(mol);var arr=[];for(var [i,coor]of enumerate(coords))arr.append([coor.x,coor.y,coor.z,types[i]]);return arr};
//# sourceMappingURL=gridder.util.map
\ No newline at end of file
<html>
<head>
<title>Test Page</title>
<style>
textarea {
width: 750px;
height: 100px;
}
</style>
<script type="module">
import * as make_grid from './make_grid.js';
// Make make_grid available globally
window["make_grid"] = make_grid;
</script>
</head>
<body>
<script>
</script>
</body>
</html>
'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{Point}from"./gridder.fake_rdkit.js";import{get_raw_batch_one_channel}from"./gridder.grid_util.js";import{get_connection_point,load_ligand,load_receptor,mol_to_points}from"./gridder.util.js";var __name__="__main__";export var pre_grid_gen=function(receptor,
ligand,grid_center){var rec=load_receptor(receptor);var lig=load_receptor(ligand);var __left0__=mol_to_points(rec,null,__kwargtrans__({note_sulfur:true}));var rec_coords=__left0__[0];var rec_layers=__left0__[1];var __left0__=mol_to_points(lig,null,__kwargtrans__({note_sulfur:false}));var parent_coords=__left0__[0];var parent_layers=__left0__[1];var conn=Point(grid_center);return tuple([rec_coords,rec_layers,parent_coords,parent_layers,conn])};export var make_grid_given_channel=function(rec_coords,
rec_layers,parent_coords,parent_layers,conn,channel){return get_raw_batch_one_channel(rec_coords,rec_layers,parent_coords,parent_layers,conn,1,24,.75,channel)};export var sum_channel_grids=function(grids){var summed_grid=function(){var __accu0__=[];for(var i=0;i<len(grids[0]);i++)__accu0__.append(0);return __accu0__}();for(var i=0;i<len(summed_grid);i++)for(var grid of grids)summed_grid[i]=summed_grid[i]+grid[i];return summed_grid};if(__name__=="__main__");
//# sourceMappingURL=make_grid.map
\ No newline at end of file
{"options": {"source": "make_grid.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": true, "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/moiety_predictor/javascript_grid_gen/__target__/org.transcrypt.__runtime__.js"}, {"source": "/Users/jdurrant/Documents/Work/durrant_git/moiety_predictor/javascript_grid_gen/make_grid.py", "target": "/Users/jdurrant/Documents/Work/durrant_git/moiety_predictor/javascript_grid_gen/__target__/make_grid.js"}, {"source": "/Users/jdurrant/Documents/Work/durrant_git/moiety_predictor/javascript_grid_gen/gridder/fake_rdkit.py", "target": "/Users/jdurrant/Documents/Work/durrant_git/moiety_predictor/javascript_grid_gen/__target__/gridder.fake_rdkit.js"}, {"source": "/Users/jdurrant/anaconda/envs/Python36/lib/python3.6/site-packages/transcrypt/modules/re/__init__.py", "target": "/Users/jdurrant/Documents/Work/durrant_git/moiety_predictor/javascript_grid_gen/__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/moiety_predictor/javascript_grid_gen/__target__/re.translate.js"}, {"source": "/Users/jdurrant/Documents/Work/durrant_git/moiety_predictor/javascript_grid_gen/gridder/grid_util.py", "target": "/Users/jdurrant/Documents/Work/durrant_git/moiety_predictor/javascript_grid_gen/__target__/gridder.grid_util.js"}, {"source": "/Users/jdurrant/anaconda/envs/Python36/lib/python3.6/site-packages/transcrypt/modules/math/__init__.py", "target": "/Users/jdurrant/Documents/Work/durrant_git/moiety_predictor/javascript_grid_gen/__target__/math.js"}, {"source": "/Users/jdurrant/Documents/Work/durrant_git/moiety_predictor/javascript_grid_gen/gridder/util.py", "target": "/Users/jdurrant/Documents/Work/durrant_git/moiety_predictor/javascript_grid_gen/__target__/gridder.util.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,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';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};var __name__="re";export var T=1<<0;export var TEMPLATE=T;export var I=1<<1;export var IGNORECASE=I;export var L=1<<2;export var LOCALE=L;export var M=1<<3;export var MULTILINE=M;export var S=
1<<4;export var DOTALL=S;export var U=1<<5;export var UNICODE=U;export var X=1<<6;export var VERBOSE=X;export var DEBUG=1<<7;export var A=1<<8;export var ASCII=A;export var Y=1<<16;export var STICKY=Y;export var G=1<<17;export var GLOBAL=G;export var J=1<<19;export var JSSTRICT=J;export var error=__class__("error",[Exception],{__module__:__name__,get __init__(){return __get__(this,function(self,msg,error,pattern,flags,pos){if(typeof pattern=="undefined"||pattern!=null&&pattern.hasOwnProperty("__kwargtrans__"))var pattern=
null;if(typeof flags=="undefined"||flags!=null&&flags.hasOwnProperty("__kwargtrans__"))var flags=0;if(typeof pos=="undefined"||pos!=null&&pos.hasOwnProperty("__kwargtrans__"))var pos=null;Exception.__init__(self,msg,__kwargtrans__({error:error}));self.pattern=pattern;self.flags=flags;self.pos=pos})}});export var ReIndexError=__class__("ReIndexError",[IndexError],{__module__:__name__,get __init__(){return __get__(this,function(self){IndexError.__init__(self,"no such group")})}});export var Match=__class__("Match",
[object],{__module__:__name__,get __init__(){return __get__(this,function(self,mObj,string,pos,endpos,rObj,namedGroups){if(typeof namedGroups=="undefined"||namedGroups!=null&&namedGroups.hasOwnProperty("__kwargtrans__"))var namedGroups=null;for(var [index,match]of enumerate(mObj))mObj[index]=mObj[index]==undefined?null:mObj[index];self._obj=mObj;self._pos=pos;self._endpos=endpos;self._re=rObj;self._string=string;self._namedGroups=namedGroups;self._lastindex=self._lastMatchGroup();if(self._namedGroups!==
null)self._lastgroup=self._namedGroups[self._lastindex];else self._lastgroup=null})},get _getPos(){return __get__(this,function(self){return self._pos})},get _setPos(){return __get__(this,function(self,val){var __except0__=AttributeError("readonly attribute");__except0__.__cause__=null;throw __except0__;})},get _getEndPos(){return __get__(this,function(self){return self._endpos})},get _setEndPos(){return __get__(this,function(self,val){var __except0__=AttributeError("readonly attribute");__except0__.__cause__=
null;throw __except0__;})},get _getRe(){return __get__(this,function(self){return self._re})},get _setRe(){return __get__(this,function(self,val){var __except0__=AttributeError("readonly attribute");__except0__.__cause__=null;throw __except0__;})},get _getString(){return __get__(this,function(self){return self._string})},get _setString(){return __get__(this,function(self,val){var __except0__=AttributeError("readonly attribute");__except0__.__cause__=null;throw __except0__;})},get _getLastGroup(){return __get__(this,
function(self){return self._lastgroup})},get _setLastGroup(){return __get__(this,function(self,val){var __except0__=AttributeError("readonly attribute");__except0__.__cause__=null;throw __except0__;})},get _getLastIndex(){return __get__(this,function(self){return self._lastindex})},get _setLastIndex(){return __get__(this,function(self,val){var __except0__=AttributeError("readonly attribute");__except0__.__cause__=null;throw __except0__;})},get _lastMatchGroup(){return __get__(this,function(self){if(len(self._obj)>
1){for(var i=len(self._obj)-1;i>0;i--)if(self._obj[i]!==null)return i;return null}else return null})},get expand(){return __get__(this,function(self,template){var __except0__=NotImplementedError();__except0__.__cause__=null;throw __except0__;})},get group(){return __get__(this,function(self){var args=tuple([].slice.apply(arguments).slice(1));var ret=[];if(len(args)>0)for(var index of args)if(py_typeof(index)===str)if(self._namedGroups!==null){if(!__in__(index,self._namedGroups.py_keys())){var __except0__=
ReIndexError();__except0__.__cause__=null;throw __except0__;}ret.append(self._obj[self._namedGroups[index]])}else{var __except0__=NotImplementedError("No NamedGroups Available");__except0__.__cause__=null;throw __except0__;}else{if(index>=len(self._obj)){var __except0__=ReIndexError();__except0__.__cause__=null;throw __except0__;}ret.append(self._obj[index])}else ret.append(self._obj[0]);if(len(ret)==1)return ret[0];else return tuple(ret)})},get groups(){return __get__(this,function(self,py_default){if(typeof py_default==
"undefined"||py_default!=null&&py_default.hasOwnProperty("__kwargtrans__"))var py_default=null;if(len(self._obj)>1){var ret=self._obj.__getslice__(1,null,1);return tuple(function(){var __accu0__=[];for(var x of ret)__accu0__.append(x!==null?x:py_default);return __accu0__}())}else return tuple()})},get groupdict(){return __get__(this,function(self,py_default){if(typeof py_default=="undefined"||py_default!=null&&py_default.hasOwnProperty("__kwargtrans__"))var py_default=null;if(self._namedGroups!==
null){var ret=dict({});for(var [gName,gId]of self._namedGroups.py_items()){var value=self._obj[gId];ret[gName]=value!==null?value:py_default}return ret}else{var __except0__=NotImplementedError("No NamedGroups Available");__except0__.__cause__=null;throw __except0__;}})},get start(){return __get__(this,function(self,group){if(typeof group=="undefined"||group!=null&&group.hasOwnProperty("__kwargtrans__"))var group=0;var gId=0;if(py_typeof(group)===str)if(self._namedGroups!==null){if(!__in__(group,self._namedGroups.py_keys())){var __except0__=
ReIndexError();__except0__.__cause__=null;throw __except0__;}var gId=self._namedGroups[group]}else{var __except0__=NotImplementedError("No NamedGroups Available");__except0__.__cause__=null;throw __except0__;}else var gId=group;if(gId>=len(self._obj)){var __except0__=ReIndexError();__except0__.__cause__=null;throw __except0__;}if(gId==0)return self._obj.index;else if(self._obj[gId]!==null){var r=compile(escape(self._obj[gId]),self._re.flags);var m=r.search(self._obj[0]);if(m)return self._obj.index+
m.start();else{var __except0__=Exception("Failed to find capture group");__except0__.__cause__=null;throw __except0__;}}else return-1})},get end(){return __get__(this,function(self,group){if(typeof group=="undefined"||group!=null&&group.hasOwnProperty("__kwargtrans__"))var group=0;var gId=0;if(py_typeof(group)===str)if(self._namedGroups!==null){if(!__in__(group,self._namedGroups.py_keys())){var __except0__=ReIndexError();__except0__.__cause__=null;throw __except0__;}var gId=self._namedGroups[group]}else{var __except0__=
NotImplementedError("No NamedGroups Available");__except0__.__cause__=null;throw __except0__;}else var gId=group;if(gId>=len(self._obj)){var __except0__=ReIndexError();__except0__.__cause__=null;throw __except0__;}if(gId==0)return self._obj.index+len(self._obj[0]);else if(self._obj[gId]!==null){var r=compile(escape(self._obj[gId]),self._re.flags);var m=r.search(self._obj[0]);if(m)return self._obj.index+m.end();else{var __except0__=Exception("Failed to find capture group");__except0__.__cause__=null;
throw __except0__;}}else return-1})},get span(){return __get__(this,function(self,group){if(typeof group=="undefined"||group!=null&&group.hasOwnProperty("__kwargtrans__"))var group=0;return tuple([self.start(group),self.end(group)])})}});Object.defineProperty(Match,"pos",property.call(Match,Match._getPos,Match._setPos));Object.defineProperty(Match,"endpos",property.call(Match,Match._getEndPos,Match._setEndPos));Object.defineProperty(Match,"re",property.call(Match,Match._getRe,Match._setRe));Object.defineProperty(Match,
"string",property.call(Match,Match._getString,Match._setString));Object.defineProperty(Match,"lastgroup",property.call(Match,Match._getLastGroup,Match._setLastGroup));Object.defineProperty(Match,"lastindex",property.call(Match,Match._getLastIndex,Match._setLastIndex));export var Regex=__class__("Regex",[object],{__module__:__name__,get __init__(){return __get__(this,function(self,pattern,flags){if(!((flags&ASCII)>0))flags|=UNICODE;self._flags=flags;var __left0__=self._compileWrapper(pattern,flags);
self._jsFlags=__left0__[0];self._obj=__left0__[1];self._jspattern=pattern;self._pypattern=pattern;var __left0__=self._compileWrapper(pattern+"|",flags);var _=__left0__[0];var groupCounterRegex=__left0__[1];self._groups=groupCounterRegex.exec("").length-1;self._groupindex=null})},get _getPattern(){return __get__(this,function(self){var ret=self._pypattern.py_replace("\\","\\\\");return ret})},get _setPattern(){return __get__(this,function(self,val){var __except0__=AttributeError("readonly attribute");
__except0__.__cause__=null;throw __except0__;})},get _getFlags(){return __get__(this,function(self){return self._flags})},get _setFlags(){return __get__(this,function(self,val){var __except0__=AttributeError("readonly attribute");__except0__.__cause__=null;throw __except0__;})},get _getGroups(){return __get__(this,function(self){return self._groups})},get _setGroups(){return __get__(this,function(self,val){var __except0__=AttributeError("readonly attribute");__except0__.__cause__=null;throw __except0__;
})},get _getGroupIndex(){return __get__(this,function(self){if(self._groupindex===null)return dict({});else return self._groupindex})},get _setGroupIndex(){return __get__(this,function(self,val){var __except0__=AttributeError("readonly attribute");__except0__.__cause__=null;throw __except0__;})},get _compileWrapper(){return __get__(this,function(self,pattern,flags){if(typeof flags=="undefined"||flags!=null&&flags.hasOwnProperty("__kwargtrans__"))var flags=0;var jsFlags=self._convertFlags(flags);var rObj=
null;var errObj=null;try{rObj=new RegExp(pattern,jsFlags)}catch(err){errObj=err}if(errObj!==null){var __except0__=error(errObj.message,errObj,pattern,flags);__except0__.__cause__=null;throw __except0__;}return tuple([jsFlags,rObj])})},get _convertFlags(){return __get__(this,function(self,flags){var bitmaps=[tuple([DEBUG,""]),tuple([IGNORECASE,"i"]),tuple([MULTILINE,"m"]),tuple([STICKY,"y"]),tuple([GLOBAL,"g"]),tuple([UNICODE,"u"])];var ret="".join(function(){var __accu0__=[];for(var x of bitmaps)if((x[0]&
flags)>0)__accu0__.append(x[1]);return __accu0__}());return ret})},get _getTargetStr(){return __get__(this,function(self,string,pos,endpos){var endPtr=len(string);if(endpos!==null)if(endpos<endPtr)var endPtr=endpos;if(endPtr<0)var endPtr=0;var ret=string.__getslice__(pos,endPtr,1);return ret})},get _patternHasCaptures(){return __get__(this,function(self){return self._groups>0})},get search(){return __get__(this,function(self,string,pos,endpos){if(typeof pos=="undefined"||pos!=null&&pos.hasOwnProperty("__kwargtrans__"))var pos=
0;if(typeof endpos=="undefined"||endpos!=null&&endpos.hasOwnProperty("__kwargtrans__"))var endpos=null;if(endpos===null)var endpos=len(string);var rObj=self._obj;var m=rObj.exec(string);if(m)if(m.index<pos||m.index>endpos)return null;else return Match(m,string,pos,endpos,self,self._groupindex);else return null})},get match(){return __get__(this,function(self,string,pos,endpos){if(typeof pos=="undefined"||pos!=null&&pos.hasOwnProperty("__kwargtrans__"))var pos=0;if(typeof endpos=="undefined"||endpos!=
null&&endpos.hasOwnProperty("__kwargtrans__"))var endpos=null;var target=string;if(endpos!==null)var target=target.__getslice__(0,endpos,1);else var endpos=len(string);var rObj=self._obj;var m=rObj.exec(target);if(m)if(m.index==pos)return Match(m,string,pos,endpos,self,self._groupindex);else return null;else return null})},get fullmatch(){return __get__(this,function(self,string,pos,endpos){if(typeof pos=="undefined"||pos!=null&&pos.hasOwnProperty("__kwargtrans__"))var pos=0;if(typeof endpos=="undefined"||
endpos!=null&&endpos.hasOwnProperty("__kwargtrans__"))var endpos=null;var target=string;var strEndPos=len(string);if(endpos!==null){var target=target.__getslice__(0,endpos,1);var strEndPos=endpos}var rObj=self._obj;var m=rObj.exec(target);if(m){var obsEndPos=m.index+len(m[0]);if(m.index==pos&&obsEndPos==strEndPos)return Match(m,string,pos,strEndPos,self,self._groupindex);else return null}else return null})},get py_split(){return __get__(this,function(self,string,maxsplit){if(typeof maxsplit=="undefined"||
maxsplit!=null&&maxsplit.hasOwnProperty("__kwargtrans__"))var maxsplit=0;if(maxsplit<0)return[string];var mObj=null;var rObj=self._obj;if(maxsplit==0){var mObj=string.py_split(rObj);return mObj}else{var flags=self._flags;flags|=GLOBAL;var __left0__=self._compileWrapper(self._jspattern,flags);var _=__left0__[0];var rObj=__left0__[1];var ret=[];var lastM=null;var cnt=0;for(var i=0;i<maxsplit;i++){var m=rObj.exec(string);if(m){cnt++;if(lastM!==null){var start=lastM.index+len(lastM[0]);var head=string.__getslice__(start,
m.index,1);ret.append(head);if(len(m)>1)ret.extend(m.__getslice__(1,null,1))}else{var head=string.__getslice__(0,m.index,1);ret.append(head);if(len(m)>1)ret.extend(m.__getslice__(1,null,1))}var lastM=m}else break}if(lastM!==null){var endPos=lastM.index+len(lastM[0]);var end=string.__getslice__(endPos,null,1);ret.append(end)}return ret}})},get _findAllMatches(){return __get__(this,function(self,string,pos,endpos){if(typeof pos=="undefined"||pos!=null&&pos.hasOwnProperty("__kwargtrans__"))var pos=0;
if(typeof endpos=="undefined"||endpos!=null&&endpos.hasOwnProperty("__kwargtrans__"))var endpos=null;var target=self._getTargetStr(string,pos,endpos);var flags=self._flags;flags|=GLOBAL;var __left0__=self._compileWrapper(self._jspattern,flags);var _=__left0__[0];var rObj=__left0__[1];var ret=[];while(true){var m=rObj.exec(target);if(m)ret.append(m);else break}return ret})},get findall(){return __get__(this,function(self,string,pos,endpos){if(typeof pos=="undefined"||pos!=null&&pos.hasOwnProperty("__kwargtrans__"))var pos=
0;if(typeof endpos=="undefined"||endpos!=null&&endpos.hasOwnProperty("__kwargtrans__"))var endpos=null;var mlist=self._findAllMatches(string,pos,endpos);var mSelect=function(m){if(len(m)>2)return tuple(m.__getslice__(1,null,1));else if(len(m)==2)return m[1];else return m[0]};var ret=map(mSelect,mlist);return ret})},get finditer(){return __get__(this,function(self,string,pos,endpos){if(typeof endpos=="undefined"||endpos!=null&&endpos.hasOwnProperty("__kwargtrans__"))var endpos=null;var mlist=self._findAllMatches(string,
pos,endpos);var ret=map(function __lambda__(m){return Match(m,string,0,len(string),self,self._groupindex)},mlist);return py_iter(ret)})},get sub(){return __get__(this,function(self,repl,string,count){if(typeof count=="undefined"||count!=null&&count.hasOwnProperty("__kwargtrans__"))var count=0;var __left0__=self.subn(repl,string,count);var ret=__left0__[0];var _=__left0__[1];return ret})},get subn(){return __get__(this,function(self,repl,string,count){if(typeof count=="undefined"||count!=null&&count.hasOwnProperty("__kwargtrans__"))var count=
0;var flags=self._flags;flags|=GLOBAL;var __left0__=self._compileWrapper(self._jspattern,flags);var _=__left0__[0];var rObj=__left0__[1];var ret="";var totalMatch=0;var lastEnd=-1;while(true){if(count>0)if(totalMatch>=count)if(lastEnd<0)return tuple([ret,totalMatch]);else{ret+=string.__getslice__(lastEnd,m.index,1);return tuple([ret,totalMatch])}var m=rObj.exec(string);if(m){if(lastEnd<0)ret+=string.__getslice__(0,m.index,1);else ret+=string.__getslice__(lastEnd,m.index,1);if(callable(repl)){var content=
repl(Match(m,string,0,len(string),self,self._groupindex));ret+=content}else ret+=repl;totalMatch++;var lastEnd=m.index+len(m[0])}else if(lastEnd<0)return tuple([string,0]);else{ret+=string.__getslice__(lastEnd,null,1);return tuple([ret,totalMatch])}}})}});Object.defineProperty(Regex,"pattern",property.call(Regex,Regex._getPattern,Regex._setPattern));Object.defineProperty(Regex,"flags",property.call(Regex,Regex._getFlags,Regex._setFlags));Object.defineProperty(Regex,"groups",property.call(Regex,Regex._getGroups,
Regex._setGroups));Object.defineProperty(Regex,"groupindex",property.call(Regex,Regex._getGroupIndex,Regex._setGroupIndex));export var PyRegExp=__class__("PyRegExp",[Regex],{__module__:__name__,get __init__(){return __get__(this,function(self,pyPattern,flags){var __left0__=translate(pyPattern);var jsTokens=__left0__[0];var inlineFlags=__left0__[1];var namedGroups=__left0__[2];var nCapGroups=__left0__[3];var n_splits=__left0__[4];flags|=inlineFlags;var jsPattern="".join(jsTokens);Regex.__init__(self,
jsPattern,flags);self._pypattern=pyPattern;self._nsplits=n_splits;self._jsTokens=jsTokens;self._capgroups=nCapGroups;self._groupindex=namedGroups})}});export var compile=function(pattern,flags){if(typeof flags=="undefined"||flags!=null&&flags.hasOwnProperty("__kwargtrans__"))var flags=0;if(flags&JSSTRICT)var p=Regex(pattern,flags);else var p=PyRegExp(pattern,flags);return p};export var search=function(pattern,string,flags){if(typeof flags=="undefined"||flags!=null&&flags.hasOwnProperty("__kwargtrans__"))var flags=
0;var p=compile(pattern,flags);return p.search(string)};export var match=function(pattern,string,flags){if(typeof flags=="undefined"||flags!=null&&flags.hasOwnProperty("__kwargtrans__"))var flags=0;var p=compile(pattern,flags);return p.match(string)};export var fullmatch=function(pattern,string,flags){if(typeof flags=="undefined"||flags!=null&&flags.hasOwnProperty("__kwargtrans__"))var flags=0;var p=compile(pattern,flags);return p.fullmatch(string)};export var py_split=function(pattern,string,maxsplit,
flags){if(typeof maxsplit=="undefined"||maxsplit!=null&&maxsplit.hasOwnProperty("__kwargtrans__"))var maxsplit=0;if(typeof flags=="undefined"||flags!=null&&flags.hasOwnProperty("__kwargtrans__"))var flags=0;var p=compile(pattern,flags);return p.py_split(string,maxsplit)};export var findall=function(pattern,string,flags){if(typeof flags=="undefined"||flags!=null&&flags.hasOwnProperty("__kwargtrans__"))var flags=0;var p=compile(pattern,flags);return p.findall(string)};export var finditer=function(pattern,
string,flags){if(typeof flags=="undefined"||flags!=null&&flags.hasOwnProperty("__kwargtrans__"))var flags=0;var p=compile(pattern,flags);return p.finditer(string)};export var sub=function(pattern,repl,string,count,flags){if(typeof count=="undefined"||count!=null&&count.hasOwnProperty("__kwargtrans__"))var count=0;if(typeof flags=="undefined"||flags!=null&&flags.hasOwnProperty("__kwargtrans__"))var flags=0;var p=compile(pattern,flags);return p.sub(repl,string,count)};export var subn=function(pattern,
repl,string,count,flags){if(typeof count=="undefined"||count!=null&&count.hasOwnProperty("__kwargtrans__"))var count=0;if(typeof flags=="undefined"||flags!=null&&flags.hasOwnProperty("__kwargtrans__"))var flags=0;var p=compile(pattern,flags);return p.subn(repl,string,count)};export var escape=function(string){var ret=null;var replfunc=function(m){if(m[0]=="\\")return"\\\\\\\\";else return"\\\\"+m[0]};var r=/[^A-Za-z:;\d]/g;ret=string.replace(r,replfunc);if(ret!==null)return ret;else{var __except0__=
Exception("Failed to escape the passed string");__except0__.__cause__=null;throw __except0__;}};export var purge=function(){};
//# sourceMappingURL=re.map
\ No newline at end of file