-
Notifications
You must be signed in to change notification settings - Fork 1
/
amw.sql.in
132 lines (129 loc) · 2.45 KB
/
amw.sql.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
DROP TABLE If Exists _OCSCHEMA_.amw;
CREATE TABLE _OCSCHEMA_.amw (
atomic_smarts Text,
atomic_weight numeric,
atomic_symbol character(2)
);
Grant Select on _OCSCHEMA_.amw To Public;
COPY _OCSCHEMA_.amw (atomic_smarts, atomic_weight, atomic_symbol) FROM stdin;
[#1] 1.01 H
[#2] 4.00 He
[#3] 6.94 Li
[#4] 9.01 Be
[#5] 10.81 B
[#6] 12.01 C
[#7] 14.01 N
[#8] 16.00 O
[#9] 19.00 F
[#10] 20.18 Ne
[#11] 22.99 Na
[#12] 24.31 Mg
[#13] 26.98 Al
[#14] 28.09 Si
[#15] 30.97 P
[#16] 32.06 S
[#17] 35.45 Cl
[#18] 39.95 Ar
[#19] 39.10 K
[#20] 40.08 Ca
[#21] 44.96 Sc
[#22] 47.88 Ti
[#23] 50.94 V
[#24] 52.00 Cr
[#25] 54.94 Mn
[#26] 55.85 Fe
[#27] 58.93 Co
[#28] 58.69 Ni
[#29] 63.55 Cu
[#30] 65.39 Zu
[#31] 69.72 Ga
[#32] 72.59 Ge
[#33] 74.92 As
[#34] 78.96 Se
[#35] 79.90 Br
[#36] 83.80 Kr
[#37] 85.47 Rb
[#38] 87.62 Sr
[#39] 88.91 Y
[#40] 91.22 Zr
[#41] 92.91 Nb
[#42] 95.94 Mo
[#43] 98.00 Tc
[#44] 101.07 Ru
[#45] 102.91 Rh
[#46] 106.42 Pd
[#47] 107.87 Ag
[#48] 112.41 Cd
[#49] 114.82 In
[#50] 118.71 Sn
[#51] 121.75 Sb
[#52] 127.60 Te
[#53] 126.91 I
[#54] 131.29 Xe
[#55] 132.91 Cs
[#56] 137.34 Ba
[#57] 138.91 La
[#58] 140.12 Ce
[#59] 140.91 Pr
[#60] 144.24 Nd
[#61] 145.00 Pm
[#62] 150.36 Sm
[#63] 151.96 Eu
[#64] 157.25 Gd
[#65] 158.93 Tb
[#66] 162.50 Dy
[#67] 164.93 Ho
[#68] 167.26 Er
[#69] 168.93 Tm
[#70] 173.04 Yb
[#71] 174.97 Lu
[#72] 178.49 Hf
[#73] 180.95 Ta
[#74] 183.85 W
[#75] 186.21 Re
[#76] 190.20 Os
[#77] 192.22 Ir
[#78] 195.08 Pt
[#79] 196.97 Au
[#80] 200.59 Hg
[#81] 204.38 Tl
[#82] 207.20 Pb
[#83] 208.98 Bi
[#84] 209.00 Po
[#85] 210.00 At
[#86] 222.00 Rn
[#87] 223.00 Fr
[#88] 226.03 Ra
[#89] 227.03 Ac
[#90] 232.04 Th
[#91] 231.04 Pa
[#92] 238.03 U
[#93] 237.05 Np
[#94] 244.00 Pu
[#95] 243.00 Am
[#96] 247.00 Cm
[#97] 247.00 Bk
[#98] 251.00 Cf
[#99] 252.00 Es
[#100] 257.00 Fm
[#101] 258.00 Md
[#102] 259.00 No
[#103] 260.00 Lr
[*;h1] 1.01 H1
[*;h2] 2.02 H2
[*;h3] 3.03 H3
[*;h4] 4.04 H4
[*;h5] 5.05 H5
[*;h6] 6.06 H6
\.
COMMENT ON TABLE _OCSCHEMA_.amw IS 'average molecular weight';
COMMENT ON COLUMN _OCSCHEMA_.amw.atomic_smarts IS 'atomic number';
COMMENT ON COLUMN _OCSCHEMA_.amw.atomic_weight IS 'average atomic weight';
COMMENT ON COLUMN _OCSCHEMA_.amw.atomic_symbol IS 'atomic symbol';
Create OR Replace FUNCTION _OCSCHEMA_.amw(Text)
Returns numeric AS '
Select sum(atomic_weight*_SCHEMA_.count_matches($1,atomic_smarts))
from _OCSCHEMA_.amw;
' LANGUAGE sql IMMUTABLE;
Comment on FUNCTION _OCSCHEMA_.amw(Text)
Is 'average molecular weight of smiles';