@datagrok/helm 2.2.0 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,210 @@
1
+ import * as grok from 'datagrok-api/grok';
2
+ import * as ui from 'datagrok-api/ui';
3
+ import * as DG from 'datagrok-api/dg';
4
+
5
+ import wu from 'wu';
6
+ import * as org from 'org';
7
+ import * as JSDraw2 from 'JSDraw2';
8
+ import Atom = JSDraw2.Atom;
9
+ import JsAtom = JSDraw2.JsAtom;
10
+
11
+ import {
12
+ after, before, category, delay, expect, test, expectArray, testEvent, expectFloat
13
+ } from '@datagrok-libraries/utils/src/test';
14
+ import {errInfo} from '@datagrok-libraries/bio/src/utils/err-info';
15
+ import {HelmType, MonomerLibSummaryType} from '@datagrok-libraries/bio/src/types';
16
+ import {IHelmHelper, getHelmHelper} from '@datagrok-libraries/bio/src/helm/helm-helper';
17
+ import {getMonomerLibHelper, IMonomerLibHelper} from '@datagrok-libraries/bio/src/monomer-works/monomer-utils';
18
+ import {UserLibSettings} from '@datagrok-libraries/bio/src/monomer-works/types';
19
+ import {
20
+ getUserLibSettings, setUserLibSettings, setUserLibSettingsForTests
21
+ } from '@datagrok-libraries/bio/src/monomer-works/lib-settings';
22
+ import {defaultMonomerLibSummary, expectMonomerLib} from '@datagrok-libraries/bio/src/tests/monomer-lib-tests';
23
+
24
+ import {GetMonomerFunc, getMonomerHandleArgs} from '../utils/get-monomer';
25
+
26
+ import {_package} from '../package-test';
27
+
28
+ type TestDataType = { args: { a: any, name?: string }, tgt: any };
29
+
30
+ const tests: { [testName: string]: TestDataType } = {
31
+ /* eslint-disable */
32
+ //@formatter:off
33
+ t0:{"args":{"a":"HELM_BASE","name":"A"},"tgt":{"id":"A","m":"HELM Core Monomer library\n Ketcher 10131612512D 1 1.00000 0.00000 0\n\n 11 12 0 0 0 999 V2000\n 0.9632 -3.5449 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 0.0970 -4.0450 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 0.0970 -5.0451 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 0.9630 -5.5451 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 1.8291 -5.0452 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1.8293 -4.0451 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n -0.8536 -5.3539 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n -1.4413 -4.5449 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -0.8535 -3.7357 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 0.9632 -2.5448 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n -1.1626 -6.3051 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1 10 1 0 0 0\n 1 6 2 0 0 0\n 1 2 1 0 0 0\n 9 2 1 0 0 0\n 2 3 2 0 0 0\n 7 3 1 0 0 0\n 3 4 1 0 0 0\n 4 5 2 0 0 0\n 5 6 1 0 0 0\n 7 8 1 0 0 0\n 7 11 1 0 0 0\n 8 9 2 0 0 0\nA 11\nR1\nM END\n","n":"Adenine","na":"A","rs":1,"at":{"R1":"H"}}},
34
+ t1:{"args":{"a":"HELM_BASE","name":"C"},"tgt":{"id":"C","m":"HELM Core Monomer library\nHELMMonomers071816.sdf \n\n 9 9 0 0 0 0 0 0 0 0999 V2000\n 10.7683 -10.8385 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 10.7683 -12.3385 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 9.4733 -13.0885 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 8.1683 -12.3385 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 8.1683 -10.8385 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 9.4733 -10.0885 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 9.4733 -8.5885 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 9.4733 -14.5885 0.0000 R1 0 0 0 0 0 0 0 0 0 0 0 0\n 12.0673 -13.0885 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0\n 2 3 1 0 0\n 3 4 1 0 0\n 4 5 2 0 0\n 5 6 1 0 0\n 1 6 2 0 0\n 6 7 1 0 0\n 3 8 1 0 0\n 2 9 2 0 0\nA 8\nR1\nM END\n","n":"Cytosine","na":"C","rs":1,"at":{"R1":"H"}}},
35
+ t2:{"args":{"a":"HELM_BASE","name":"G"},"tgt":{"id":"G","m":"HELM Core Monomer library\nHELMMonomers071816.sdf \n\n 12 13 0 0 0 0 0 0 0 0999 V2000\n 12.7698 -10.2854 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 12.7698 -11.7854 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 11.4733 -12.5380 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 10.1698 -11.7854 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 10.1698 -10.2854 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 11.4748 -9.5354 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 7.8623 -11.0354 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 8.7448 -9.8154 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 11.4748 -8.0354 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 14.0689 -12.5354 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 8.7448 -12.2479 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 8.2789 -13.6737 0.0000 R1 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0\n 2 3 2 0 0\n 3 4 1 0 0\n 4 5 2 0 0\n 5 6 1 0 0\n 1 6 1 0 0\n 7 8 2 0 0\n 5 8 1 0 0\n 6 9 2 0 0\n 2 10 1 0 0\n 4 11 1 0 0\n 7 11 1 0 0\n 11 12 1 0 0\nA 12\nR1\nM END\n","n":"Guanine","na":"G","rs":1,"at":{"R1":"H"}}},
36
+ t3:{"args":{"a":"HELM_LINKER","name":"p"},"tgt":{"id":"p","m":"HELM Core Monomer library\n Ketcher 10061618102D 1 1.00000 0.00000 0\n\n 5 4 0 0 0 999 V2000\n 15.7527 -12.0837 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 15.7527 -13.0837 0.0000 P 0 0 0 0 0 0 0 0 0 0 0 0\n 16.6188 -13.5837 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 15.2527 -13.9496 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 14.7868 -12.8248 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 2 4 2 0 0 0\n 2 5 1 0 0 0\nA 1\nR1\nA 3\nR2\nM END\n","n":"Phosphate","na":"p","rs":2,"at":{"R1":"OH","R2":"OH"}}},
37
+ t4:{"args":{"a":"HELM_SUGAR","name":"p"},"tgt":null},
38
+ t5:{"args":{"a":"HELM_SUGAR","name":"r"},"tgt":{"id":"r","m":"HELM Core Monomer library\n Ketcher 10111608242D 1 1.00000 0.00000 0\n\n 12 12 0 0 0 999 V2000\n -31.2431 12.8416 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.9523 11.8849 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.9523 11.8659 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.6254 12.8108 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.4231 13.4140 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -32.1882 13.1686 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5552 11.0872 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5220 10.0877 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.3803 11.0458 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -28.6686 13.1017 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -32.3775 14.1506 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -33.2435 14.6506 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 3 4 1 0 0 0\n 4 5 1 0 0 0\n 5 1 1 0 0 0\n 1 6 1 1 0 0\n 2 7 1 6 0 0\n 7 8 1 0 0 0\n 3 9 1 6 0 0\n 4 10 1 1 0 0\n 6 11 1 0 0 0\n 11 12 1 0 0 0\nA 8\nR2\nA 10\nR3\nA 12\nR1\nM END\n","n":"Ribose","na":"r","rs":3,"at":{"R1":"H","R2":"H","R3":"OH"}}},
39
+ t6:{"args":{"a":{"T":"ATOM","p":{"x":144,"y":0},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_SUGAR","id":null,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"r","color":null,"hcount":null,"selected":false,"f":null,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"_parent":"[object Object]","_aaid":4}},"tgt":{"id":"r","m":"HELM Core Monomer library\n Ketcher 10111608242D 1 1.00000 0.00000 0\n\n 12 12 0 0 0 999 V2000\n -31.2431 12.8416 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.9523 11.8849 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.9523 11.8659 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.6254 12.8108 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.4231 13.4140 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -32.1882 13.1686 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5552 11.0872 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5220 10.0877 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.3803 11.0458 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -28.6686 13.1017 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -32.3775 14.1506 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -33.2435 14.6506 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 3 4 1 0 0 0\n 4 5 1 0 0 0\n 5 1 1 0 0 0\n 1 6 1 1 0 0\n 2 7 1 6 0 0\n 7 8 1 0 0 0\n 3 9 1 6 0 0\n 4 10 1 1 0 0\n 6 11 1 0 0 0\n 11 12 1 0 0 0\nA 8\nR2\nA 10\nR3\nA 12\nR1\nM END\n","n":"Ribose","na":"r","rs":3,"at":{"R1":"H","R2":"H","R3":"OH"}}},
40
+ t7:{"args":{"a":{"T":"ATOM","p":{"x":144,"y":0},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_SUGAR","id":null,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"r","color":null,"hcount":null,"selected":false,"f":null,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"tag":null,"_parent":"[object Object]","_aaid":4}},"tgt":{"id":"r","m":"HELM Core Monomer library\n Ketcher 10111608242D 1 1.00000 0.00000 0\n\n 12 12 0 0 0 999 V2000\n -31.2431 12.8416 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.9523 11.8849 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.9523 11.8659 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.6254 12.8108 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.4231 13.4140 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -32.1882 13.1686 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5552 11.0872 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5220 10.0877 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.3803 11.0458 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -28.6686 13.1017 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -32.3775 14.1506 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -33.2435 14.6506 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 3 4 1 0 0 0\n 4 5 1 0 0 0\n 5 1 1 0 0 0\n 1 6 1 1 0 0\n 2 7 1 6 0 0\n 7 8 1 0 0 0\n 3 9 1 6 0 0\n 4 10 1 1 0 0\n 6 11 1 0 0 0\n 11 12 1 0 0 0\nA 8\nR2\nA 10\nR3\nA 12\nR1\nM END\n","n":"Ribose","na":"r","rs":3,"at":{"R1":"H","R2":"H","R3":"OH"}}},
41
+ t8:{"args":{"a":{"T":"ATOM","p":{"x":144,"y":48},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_BASE","id":null,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"G","color":null,"hcount":null,"selected":false,"f":null,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"tag":null,"_parent":"[object Object]","_aaid":5}},"tgt":{"id":"G","m":"HELM Core Monomer library\nHELMMonomers071816.sdf \n\n 12 13 0 0 0 0 0 0 0 0999 V2000\n 12.7698 -10.2854 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 12.7698 -11.7854 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 11.4733 -12.5380 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 10.1698 -11.7854 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 10.1698 -10.2854 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 11.4748 -9.5354 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 7.8623 -11.0354 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 8.7448 -9.8154 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 11.4748 -8.0354 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 14.0689 -12.5354 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 8.7448 -12.2479 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 8.2789 -13.6737 0.0000 R1 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0\n 2 3 2 0 0\n 3 4 1 0 0\n 4 5 2 0 0\n 5 6 1 0 0\n 1 6 1 0 0\n 7 8 2 0 0\n 5 8 1 0 0\n 6 9 2 0 0\n 2 10 1 0 0\n 4 11 1 0 0\n 7 11 1 0 0\n 11 12 1 0 0\nA 12\nR1\nM END\n","n":"Guanine","na":"G","rs":1,"at":{"R1":"H"}}},
42
+ t9:{"args":{"a":{"T":"ATOM","p":{"x":192,"y":0},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_LINKER","id":null,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"p","color":null,"hcount":null,"selected":false,"f":null,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"_parent":"[object Object]","_aaid":6}},"tgt":{"id":"p","m":"HELM Core Monomer library\n Ketcher 10061618102D 1 1.00000 0.00000 0\n\n 5 4 0 0 0 999 V2000\n 15.7527 -12.0837 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 15.7527 -13.0837 0.0000 P 0 0 0 0 0 0 0 0 0 0 0 0\n 16.6188 -13.5837 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 15.2527 -13.9496 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 14.7868 -12.8248 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 2 4 2 0 0 0\n 2 5 1 0 0 0\nA 1\nR1\nA 3\nR2\nM END\n","n":"Phosphate","na":"p","rs":2,"at":{"R1":"OH","R2":"OH"}}},
43
+ t10:{"args":{"a":{"T":"ATOM","p":{"x":192,"y":0},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_LINKER","id":null,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"p","color":null,"hcount":null,"selected":false,"f":null,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"tag":null,"_parent":"[object Object]","_aaid":6}},"tgt":{"id":"p","m":"HELM Core Monomer library\n Ketcher 10061618102D 1 1.00000 0.00000 0\n\n 5 4 0 0 0 999 V2000\n 15.7527 -12.0837 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 15.7527 -13.0837 0.0000 P 0 0 0 0 0 0 0 0 0 0 0 0\n 16.6188 -13.5837 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 15.2527 -13.9496 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 14.7868 -12.8248 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 2 4 2 0 0 0\n 2 5 1 0 0 0\nA 1\nR1\nA 3\nR2\nM END\n","n":"Phosphate","na":"p","rs":2,"at":{"R1":"OH","R2":"OH"}}},
44
+ t11:{"args":{"a":{"T":"ATOM","p":{"x":205,"y":136},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_SUGAR","id":null,"ambiguity":null,"annotation":"5'","annotationshowright":null},"locked":false,"hidden":null,"_rect":null,"elem":"r","color":null,"hcount":null,"selected":false,"f":0,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"_parent":"[object Object]","_aaid":1,"ringclosures":null,"_outside":false,"_haslabel":false},"name":"r"},"tgt":{"id":"r","m":"HELM Core Monomer library\n Ketcher 10111608242D 1 1.00000 0.00000 0\n\n 12 12 0 0 0 999 V2000\n -31.2431 12.8416 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.9523 11.8849 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.9523 11.8659 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.6254 12.8108 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.4231 13.4140 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -32.1882 13.1686 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5552 11.0872 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5220 10.0877 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.3803 11.0458 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -28.6686 13.1017 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -32.3775 14.1506 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -33.2435 14.6506 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 3 4 1 0 0 0\n 4 5 1 0 0 0\n 5 1 1 0 0 0\n 1 6 1 1 0 0\n 2 7 1 6 0 0\n 7 8 1 0 0 0\n 3 9 1 6 0 0\n 4 10 1 1 0 0\n 6 11 1 0 0 0\n 11 12 1 0 0 0\nA 8\nR2\nA 10\nR3\nA 12\nR1\nM END\n","n":"Ribose","na":"r","rs":3,"at":{"R1":"H","R2":"H","R3":"OH"}}},
45
+ t12:{"args":{"a":{"T":"ATOM","p":{"x":205,"y":184},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_BASE","id":1,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"A","color":null,"hcount":null,"selected":false,"f":0,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"tag":null,"_parent":"[object Object]","_aaid":2,"ringclosures":null,"_outside":false,"_haslabel":false},"name":"A"},"tgt":{"id":"A","m":"HELM Core Monomer library\n Ketcher 10131612512D 1 1.00000 0.00000 0\n\n 11 12 0 0 0 999 V2000\n 0.9632 -3.5449 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 0.0970 -4.0450 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 0.0970 -5.0451 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 0.9630 -5.5451 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 1.8291 -5.0452 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1.8293 -4.0451 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n -0.8536 -5.3539 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n -1.4413 -4.5449 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -0.8535 -3.7357 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 0.9632 -2.5448 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n -1.1626 -6.3051 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1 10 1 0 0 0\n 1 6 2 0 0 0\n 1 2 1 0 0 0\n 9 2 1 0 0 0\n 2 3 2 0 0 0\n 7 3 1 0 0 0\n 3 4 1 0 0 0\n 4 5 2 0 0 0\n 5 6 1 0 0 0\n 7 8 1 0 0 0\n 7 11 1 0 0 0\n 8 9 2 0 0 0\nA 11\nR1\nM END\n","n":"Adenine","na":"A","rs":1,"at":{"R1":"H"}}},
46
+ t13:{"args":{"a":{"T":"ATOM","p":{"x":240,"y":0},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_SUGAR","id":null,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"r","color":null,"hcount":null,"selected":false,"f":null,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"_parent":"[object Object]","_aaid":7}},"tgt":{"id":"r","m":"HELM Core Monomer library\n Ketcher 10111608242D 1 1.00000 0.00000 0\n\n 12 12 0 0 0 999 V2000\n -31.2431 12.8416 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.9523 11.8849 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.9523 11.8659 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.6254 12.8108 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.4231 13.4140 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -32.1882 13.1686 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5552 11.0872 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5220 10.0877 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.3803 11.0458 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -28.6686 13.1017 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -32.3775 14.1506 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -33.2435 14.6506 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 3 4 1 0 0 0\n 4 5 1 0 0 0\n 5 1 1 0 0 0\n 1 6 1 1 0 0\n 2 7 1 6 0 0\n 7 8 1 0 0 0\n 3 9 1 6 0 0\n 4 10 1 1 0 0\n 6 11 1 0 0 0\n 11 12 1 0 0 0\nA 8\nR2\nA 10\nR3\nA 12\nR1\nM END\n","n":"Ribose","na":"r","rs":3,"at":{"R1":"H","R2":"H","R3":"OH"}}},
47
+ t14:{"args":{"a":{"T":"ATOM","p":{"x":240,"y":0},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_SUGAR","id":null,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"r","color":null,"hcount":null,"selected":false,"f":null,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"tag":null,"_parent":"[object Object]","_aaid":7}},"tgt":{"id":"r","m":"HELM Core Monomer library\n Ketcher 10111608242D 1 1.00000 0.00000 0\n\n 12 12 0 0 0 999 V2000\n -31.2431 12.8416 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.9523 11.8849 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.9523 11.8659 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.6254 12.8108 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.4231 13.4140 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -32.1882 13.1686 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5552 11.0872 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5220 10.0877 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.3803 11.0458 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -28.6686 13.1017 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -32.3775 14.1506 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -33.2435 14.6506 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 3 4 1 0 0 0\n 4 5 1 0 0 0\n 5 1 1 0 0 0\n 1 6 1 1 0 0\n 2 7 1 6 0 0\n 7 8 1 0 0 0\n 3 9 1 6 0 0\n 4 10 1 1 0 0\n 6 11 1 0 0 0\n 11 12 1 0 0 0\nA 8\nR2\nA 10\nR3\nA 12\nR1\nM END\n","n":"Ribose","na":"r","rs":3,"at":{"R1":"H","R2":"H","R3":"OH"}}},
48
+ t15:{"args":{"a":{"T":"ATOM","p":{"x":240,"y":48},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_BASE","id":null,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"C","color":null,"hcount":null,"selected":false,"f":null,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"tag":null,"_parent":"[object Object]","_aaid":8}},"tgt":{"id":"C","m":"HELM Core Monomer library\nHELMMonomers071816.sdf \n\n 9 9 0 0 0 0 0 0 0 0999 V2000\n 10.7683 -10.8385 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 10.7683 -12.3385 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 9.4733 -13.0885 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 8.1683 -12.3385 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 8.1683 -10.8385 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 9.4733 -10.0885 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 9.4733 -8.5885 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 9.4733 -14.5885 0.0000 R1 0 0 0 0 0 0 0 0 0 0 0 0\n 12.0673 -13.0885 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0\n 2 3 1 0 0\n 3 4 1 0 0\n 4 5 2 0 0\n 5 6 1 0 0\n 1 6 2 0 0\n 6 7 1 0 0\n 3 8 1 0 0\n 2 9 2 0 0\nA 8\nR1\nM END\n","n":"Cytosine","na":"C","rs":1,"at":{"R1":"H"}}},
49
+ t16:{"args":{"a":{"T":"ATOM","p":{"x":253,"y":136},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_LINKER","id":null,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"p","color":null,"hcount":null,"selected":false,"f":0,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"_parent":"[object Object]","_aaid":3,"ringclosures":null,"_outside":false,"_haslabel":false},"name":"p"},"tgt":{"id":"p","m":"HELM Core Monomer library\n Ketcher 10061618102D 1 1.00000 0.00000 0\n\n 5 4 0 0 0 999 V2000\n 15.7527 -12.0837 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 15.7527 -13.0837 0.0000 P 0 0 0 0 0 0 0 0 0 0 0 0\n 16.6188 -13.5837 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 15.2527 -13.9496 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 14.7868 -12.8248 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 2 4 2 0 0 0\n 2 5 1 0 0 0\nA 1\nR1\nA 3\nR2\nM END\n","n":"Phosphate","na":"p","rs":2,"at":{"R1":"OH","R2":"OH"}}},
50
+ t17:{"args":{"a":{"T":"ATOM","p":{"x":288,"y":0},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_LINKER","id":null,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"p","color":null,"hcount":null,"selected":false,"f":null,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"tag":null,"_parent":"[object Object]","_aaid":9}},"tgt":{"id":"p","m":"HELM Core Monomer library\n Ketcher 10061618102D 1 1.00000 0.00000 0\n\n 5 4 0 0 0 999 V2000\n 15.7527 -12.0837 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 15.7527 -13.0837 0.0000 P 0 0 0 0 0 0 0 0 0 0 0 0\n 16.6188 -13.5837 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 15.2527 -13.9496 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 14.7868 -12.8248 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 2 4 2 0 0 0\n 2 5 1 0 0 0\nA 1\nR1\nA 3\nR2\nM END\n","n":"Phosphate","na":"p","rs":2,"at":{"R1":"OH","R2":"OH"}}},
51
+ t18:{"args":{"a":{"T":"ATOM","p":{"x":301,"y":136},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_SUGAR","id":null,"ambiguity":null,"annotation":null},"locked":false,"hidden":null,"_rect":null,"elem":"r","color":null,"hcount":null,"selected":false,"f":0,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"_parent":"[object Object]","_aaid":1,"ringclosures":null,"_outside":false,"_haslabel":false},"name":"r"},"tgt":{"id":"r","m":"HELM Core Monomer library\n Ketcher 10111608242D 1 1.00000 0.00000 0\n\n 12 12 0 0 0 999 V2000\n -31.2431 12.8416 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.9523 11.8849 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.9523 11.8659 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.6254 12.8108 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.4231 13.4140 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -32.1882 13.1686 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5552 11.0872 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5220 10.0877 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.3803 11.0458 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -28.6686 13.1017 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -32.3775 14.1506 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -33.2435 14.6506 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 3 4 1 0 0 0\n 4 5 1 0 0 0\n 5 1 1 0 0 0\n 1 6 1 1 0 0\n 2 7 1 6 0 0\n 7 8 1 0 0 0\n 3 9 1 6 0 0\n 4 10 1 1 0 0\n 6 11 1 0 0 0\n 11 12 1 0 0 0\nA 8\nR2\nA 10\nR3\nA 12\nR1\nM END\n","n":"Ribose","na":"r","rs":3,"at":{"R1":"H","R2":"H","R3":"OH"}}},
52
+ t19:{"args":{"a":{"T":"ATOM","p":{"x":301,"y":184},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_BASE","id":2,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"G","color":null,"hcount":null,"selected":false,"f":0,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"tag":null,"_parent":"[object Object]","_aaid":2,"ringclosures":null,"_outside":false,"_haslabel":false},"name":"G"},"tgt":{"id":"G","m":"HELM Core Monomer library\nHELMMonomers071816.sdf \n\n 12 13 0 0 0 0 0 0 0 0999 V2000\n 12.7698 -10.2854 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 12.7698 -11.7854 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 11.4733 -12.5380 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 10.1698 -11.7854 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 10.1698 -10.2854 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 11.4748 -9.5354 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 7.8623 -11.0354 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 8.7448 -9.8154 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 11.4748 -8.0354 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 14.0689 -12.5354 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 8.7448 -12.2479 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 8.2789 -13.6737 0.0000 R1 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0\n 2 3 2 0 0\n 3 4 1 0 0\n 4 5 2 0 0\n 5 6 1 0 0\n 1 6 1 0 0\n 7 8 2 0 0\n 5 8 1 0 0\n 6 9 2 0 0\n 2 10 1 0 0\n 4 11 1 0 0\n 7 11 1 0 0\n 11 12 1 0 0\nA 12\nR1\nM END\n","n":"Guanine","na":"G","rs":1,"at":{"R1":"H"}}},
53
+ t20:{"args":{"a":{"T":"ATOM","p":{"x":349,"y":136},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_LINKER","id":null,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"p","color":null,"hcount":null,"selected":false,"f":0,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"_parent":"[object Object]","_aaid":6,"ringclosures":null,"_outside":false,"_haslabel":false},"name":"p"},"tgt":{"id":"p","m":"HELM Core Monomer library\n Ketcher 10061618102D 1 1.00000 0.00000 0\n\n 5 4 0 0 0 999 V2000\n 15.7527 -12.0837 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 15.7527 -13.0837 0.0000 P 0 0 0 0 0 0 0 0 0 0 0 0\n 16.6188 -13.5837 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 15.2527 -13.9496 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 14.7868 -12.8248 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 2 4 2 0 0 0\n 2 5 1 0 0 0\nA 1\nR1\nA 3\nR2\nM END\n","n":"Phosphate","na":"p","rs":2,"at":{"R1":"OH","R2":"OH"}}},
54
+ t21:{"args":{"a":{"T":"ATOM","p":{"x":397,"y":136},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_SUGAR","id":null,"ambiguity":null,"annotation":null},"locked":false,"hidden":null,"_rect":null,"elem":"r","color":null,"hcount":null,"selected":false,"f":0,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"_parent":"[object Object]","_aaid":1,"ringclosures":null,"_outside":false,"_haslabel":false},"name":"r"},"tgt":{"id":"r","m":"HELM Core Monomer library\n Ketcher 10111608242D 1 1.00000 0.00000 0\n\n 12 12 0 0 0 999 V2000\n -31.2431 12.8416 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.9523 11.8849 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.9523 11.8659 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.6254 12.8108 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.4231 13.4140 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -32.1882 13.1686 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5552 11.0872 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5220 10.0877 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.3803 11.0458 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -28.6686 13.1017 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -32.3775 14.1506 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -33.2435 14.6506 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 3 4 1 0 0 0\n 4 5 1 0 0 0\n 5 1 1 0 0 0\n 1 6 1 1 0 0\n 2 7 1 6 0 0\n 7 8 1 0 0 0\n 3 9 1 6 0 0\n 4 10 1 1 0 0\n 6 11 1 0 0 0\n 11 12 1 0 0 0\nA 8\nR2\nA 10\nR3\nA 12\nR1\nM END\n","n":"Ribose","na":"r","rs":3,"at":{"R1":"H","R2":"H","R3":"OH"}}},
55
+ t22:{"args":{"a":{"T":"ATOM","p":{"x":397,"y":184},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_BASE","id":3,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"C","color":null,"hcount":null,"selected":false,"f":0,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"tag":null,"_parent":"[object Object]","_aaid":2,"ringclosures":null,"_outside":false,"_haslabel":false},"name":"C"},"tgt":{"id":"C","m":"HELM Core Monomer library\nHELMMonomers071816.sdf \n\n 9 9 0 0 0 0 0 0 0 0999 V2000\n 10.7683 -10.8385 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 10.7683 -12.3385 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 9.4733 -13.0885 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 8.1683 -12.3385 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 8.1683 -10.8385 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 9.4733 -10.0885 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 9.4733 -8.5885 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 9.4733 -14.5885 0.0000 R1 0 0 0 0 0 0 0 0 0 0 0 0\n 12.0673 -13.0885 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0\n 2 3 1 0 0\n 3 4 1 0 0\n 4 5 2 0 0\n 5 6 1 0 0\n 1 6 2 0 0\n 6 7 1 0 0\n 3 8 1 0 0\n 2 9 2 0 0\nA 8\nR1\nM END\n","n":"Cytosine","na":"C","rs":1,"at":{"R1":"H"}}},
56
+ t23:{"args":{"a":{"T":"ATOM","p":{"x":445,"y":136},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_LINKER","id":null,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"p","color":null,"hcount":null,"selected":false,"f":0,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"_parent":"[object Object]","_aaid":9,"ringclosures":null,"_outside":false,"_haslabel":false},"name":"p"},"tgt":{"id":"p","m":"HELM Core Monomer library\n Ketcher 10061618102D 1 1.00000 0.00000 0\n\n 5 4 0 0 0 999 V2000\n 15.7527 -12.0837 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 15.7527 -13.0837 0.0000 P 0 0 0 0 0 0 0 0 0 0 0 0\n 16.6188 -13.5837 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 15.2527 -13.9496 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 14.7868 -12.8248 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 2 4 2 0 0 0\n 2 5 1 0 0 0\nA 1\nR1\nA 3\nR2\nM END\n","n":"Phosphate","na":"p","rs":2,"at":{"R1":"OH","R2":"OH"}}},
57
+ t24:{"args":{"a":{"T":"ATOM","p":{"x":48,"y":0},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_SUGAR","id":null,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"r","color":null,"hcount":null,"selected":false,"f":null,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"_parent":"[object Object]","_aaid":1}},"tgt":{"id":"r","m":"HELM Core Monomer library\n Ketcher 10111608242D 1 1.00000 0.00000 0\n\n 12 12 0 0 0 999 V2000\n -31.2431 12.8416 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.9523 11.8849 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.9523 11.8659 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.6254 12.8108 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.4231 13.4140 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -32.1882 13.1686 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5552 11.0872 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5220 10.0877 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.3803 11.0458 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -28.6686 13.1017 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -32.3775 14.1506 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -33.2435 14.6506 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 3 4 1 0 0 0\n 4 5 1 0 0 0\n 5 1 1 0 0 0\n 1 6 1 1 0 0\n 2 7 1 6 0 0\n 7 8 1 0 0 0\n 3 9 1 6 0 0\n 4 10 1 1 0 0\n 6 11 1 0 0 0\n 11 12 1 0 0 0\nA 8\nR2\nA 10\nR3\nA 12\nR1\nM END\n","n":"Ribose","na":"r","rs":3,"at":{"R1":"H","R2":"H","R3":"OH"}}},
58
+ t25:{"args":{"a":{"T":"ATOM","p":{"x":48,"y":0},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_SUGAR","id":null,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"r","color":null,"hcount":null,"selected":false,"f":null,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"tag":null,"_parent":"[object Object]","_aaid":1}},"tgt":{"id":"r","m":"HELM Core Monomer library\n Ketcher 10111608242D 1 1.00000 0.00000 0\n\n 12 12 0 0 0 999 V2000\n -31.2431 12.8416 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.9523 11.8849 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.9523 11.8659 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.6254 12.8108 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -30.4231 13.4140 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -32.1882 13.1686 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5552 11.0872 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -31.5220 10.0877 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -29.3803 11.0458 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -28.6686 13.1017 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -32.3775 14.1506 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n -33.2435 14.6506 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 3 4 1 0 0 0\n 4 5 1 0 0 0\n 5 1 1 0 0 0\n 1 6 1 1 0 0\n 2 7 1 6 0 0\n 7 8 1 0 0 0\n 3 9 1 6 0 0\n 4 10 1 1 0 0\n 6 11 1 0 0 0\n 11 12 1 0 0 0\nA 8\nR2\nA 10\nR3\nA 12\nR1\nM END\n","n":"Ribose","na":"r","rs":3,"at":{"R1":"H","R2":"H","R3":"OH"}}},
59
+ t26:{"args":{"a":{"T":"ATOM","p":{"x":48,"y":48},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_BASE","id":null,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"A","color":null,"hcount":null,"selected":false,"f":null,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"tag":null,"_parent":"[object Object]","_aaid":2}},"tgt":{"id":"A","m":"HELM Core Monomer library\n Ketcher 10131612512D 1 1.00000 0.00000 0\n\n 11 12 0 0 0 999 V2000\n 0.9632 -3.5449 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 0.0970 -4.0450 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 0.0970 -5.0451 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 0.9630 -5.5451 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 1.8291 -5.0452 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1.8293 -4.0451 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n -0.8536 -5.3539 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n -1.4413 -4.5449 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n -0.8535 -3.7357 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n 0.9632 -2.5448 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0\n -1.1626 -6.3051 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 1 10 1 0 0 0\n 1 6 2 0 0 0\n 1 2 1 0 0 0\n 9 2 1 0 0 0\n 2 3 2 0 0 0\n 7 3 1 0 0 0\n 3 4 1 0 0 0\n 4 5 2 0 0 0\n 5 6 1 0 0 0\n 7 8 1 0 0 0\n 7 11 1 0 0 0\n 8 9 2 0 0 0\nA 11\nR1\nM END\n","n":"Adenine","na":"A","rs":1,"at":{"R1":"H"}}},
60
+ t27:{"args":{"a":{"T":"ATOM","p":{"x":96,"y":0},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_LINKER","id":null,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"p","color":null,"hcount":null,"selected":false,"f":null,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"_parent":"[object Object]","_aaid":3}},"tgt":{"id":"p","m":"HELM Core Monomer library\n Ketcher 10061618102D 1 1.00000 0.00000 0\n\n 5 4 0 0 0 999 V2000\n 15.7527 -12.0837 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 15.7527 -13.0837 0.0000 P 0 0 0 0 0 0 0 0 0 0 0 0\n 16.6188 -13.5837 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 15.2527 -13.9496 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 14.7868 -12.8248 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 2 4 2 0 0 0\n 2 5 1 0 0 0\nA 1\nR1\nA 3\nR2\nM END\n","n":"Phosphate","na":"p","rs":2,"at":{"R1":"OH","R2":"OH"}}},
61
+ t28:{"args":{"a":{"T":"ATOM","p":{"x":96,"y":0},"charge":0,"isotope":null,"radical":null,"group":null,"alias":null,"superatom":null,"attachpoints":[],"rgroup":null,"bio":{"type":"HELM_LINKER","id":null,"ambiguity":null},"locked":false,"hidden":null,"_rect":null,"elem":"p","color":null,"hcount":null,"selected":false,"f":null,"bonds":null,"id":null,"atommapid":null,"query":null,"hasError":null,"hs":null,"val":null,"tag":null,"_parent":"[object Object]","_aaid":3}},"tgt":{"id":"p","m":"HELM Core Monomer library\n Ketcher 10061618102D 1 1.00000 0.00000 0\n\n 5 4 0 0 0 999 V2000\n 15.7527 -12.0837 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 15.7527 -13.0837 0.0000 P 0 0 0 0 0 0 0 0 0 0 0 0\n 16.6188 -13.5837 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n 15.2527 -13.9496 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 14.7868 -12.8248 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0\n 1 2 1 0 0 0\n 2 3 1 0 0 0\n 2 4 2 0 0 0\n 2 5 1 0 0 0\nA 1\nR1\nA 3\nR2\nM END\n","n":"Phosphate","na":"p","rs":2,"at":{"R1":"OH","R2":"OH"}}},
62
+ //@formatter:off
63
+ /* eslint-enable */
64
+ };
65
+
66
+ category('getMonomer', ()=>{
67
+ let monomerLibHelper: IMonomerLibHelper;
68
+ /** Backup actual user's monomer libraries settings */
69
+ let userLibSettings: UserLibSettings;
70
+
71
+ before(async ()=>{
72
+ monomerLibHelper = await getMonomerLibHelper();
73
+ userLibSettings = await getUserLibSettings();
74
+
75
+ // Tests 'findMonomers' requires default monomer library loaded
76
+ await setUserLibSettingsForTests();
77
+ await monomerLibHelper.awaitLoaded();
78
+ await monomerLibHelper.loadLibraries(true); // load default libraries for tests
79
+ });
80
+
81
+ after(async ()=>{
82
+ await setUserLibSettings(userLibSettings);
83
+ await monomerLibHelper.loadLibraries(true);
84
+ });
85
+
86
+ test('original', async () =>{
87
+ const helmHelper: IHelmHelper = await getHelmHelper();
88
+ expect(helmHelper != null, true);
89
+ // @ts-ignore
90
+ const mainPkg: HelmPackage = helm._package;
91
+ const getMonomerFunc = mainPkg.getMonomerOriginal;
92
+
93
+ return _testAll('original', getMonomerFunc);
94
+ }, {isAggregated: true});
95
+
96
+ test('monomerLib', async () =>{
97
+ const monomerLib = monomerLibHelper.getBioLib();
98
+ expectMonomerLib(monomerLib);
99
+
100
+ const getMonomerFunc = org.helm.webeditor.Monomers.getMonomer;
101
+ return _testAll('monomerLib', getMonomerFunc);
102
+ }, {isAggregated: true});
103
+
104
+ function _testAll(prefix: string, getMonomerFunc: GetMonomerFunc): DG.DataFrame {
105
+ const resDf = DG.DataFrame.fromColumns([
106
+ DG.Column.fromStrings('subTest', []),
107
+ DG.Column.fromList(DG.COLUMN_TYPE.BOOL, 'success', []),
108
+ DG.Column.fromStrings('res', []),
109
+ DG.Column.fromStrings('tgt', []),
110
+ DG.Column.fromStrings('error', []),
111
+ DG.Column.fromStrings('stack', []),
112
+ ]);
113
+
114
+ // const testCount: number = Object.keys(tests).length + 1;
115
+ // //* eslint-disable no-array-constructor */
116
+ // const subTestList: string[] = new Array<string>(testCount);
117
+ // const successList: boolean[] = new Array<boolean>(testCount);
118
+ // const resList: string[] = new Array<string>(testCount);
119
+ // const tgtList:string[] = new Array<string>(testCount);
120
+ // const errorList: string[] = new Array<string>(testCount);
121
+ // const stackList: string[] = new Array<string>(testCount);
122
+ // /* eslint-enable no-array-constructor */
123
+
124
+ const resI = resDf.rows.addNew().idx;
125
+ resDf.set('subTest', resI, 'Monomer lib');
126
+ resDf.set('res', resI, '');
127
+ resDf.set('tgt', resI, '');
128
+ try {
129
+ const monomerLib = monomerLibHelper.getBioLib();
130
+ expectMonomerLib(monomerLib);
131
+ resDf.set('success', resI, true);
132
+ } catch (err) {
133
+ const [errMsg, errStack] = errInfo(err);
134
+ resDf.set('error', resI, errMsg);
135
+ resDf.set('stack', resI, errStack);
136
+ resDf.set('success', resI, false);
137
+ }
138
+
139
+ for (const [[testName, testData], testI] of wu.enumerate(Object.entries(tests))) {
140
+ const a: Atom<HelmType> | HelmType = getAtomFromJson(testData.args.a);
141
+ const [biotype, elem] = getMonomerHandleArgs(a, testData.args.name);
142
+ const tgt = testData.tgt;
143
+
144
+ const resI = resDf.rows.addNew().idx;
145
+ resDf.set('subTest', resI, `${prefix}-${testName}-${biotype}-${elem}`);
146
+ resDf.set('tgt', resI, JSON.stringify(tgt ? {id: tgt.id, n: tgt.n, rs: tgt.rs} : null));
147
+ try {
148
+ const res: any = getMonomerFunc(a, testData.args.name);
149
+ resDf.set('res', resI, JSON.stringify(res ? {id: res.id, n: res.n, rs: res.rs} : null));
150
+ expectObjectWithNull(res, tgt);
151
+ resDf.set('success', resI, true);
152
+ } catch (err) {
153
+ const [errMsg, errStack] = errInfo(err);
154
+ resDf.set('error', resI, errMsg);
155
+ resDf.set('stack', resI, errStack);
156
+ resDf.set('success', resI, false);
157
+ }
158
+ }
159
+ return resDf;
160
+ }
161
+
162
+ test('missing', async ()=> {
163
+ /* Tests getMonomer function adding missing monomers. */
164
+ const helmStr = 'PEPTIDE1{[mis1].R.[mis2].T.C.F}$$$$;';
165
+
166
+
167
+ expectMonomerLib(monomerLibHelper.getBioLib());
168
+ const editor = new JSDraw2.Editor(ui.div(), {viewonly: true});
169
+ editor.setHelm(helmStr);
170
+ const withMissing = JSON.parse(JSON.stringify(
171
+ defaultMonomerLibSummary)) as MonomerLibSummaryType;
172
+ withMissing['PEPTIDE'] += 2;
173
+ expectMonomerLib(monomerLibHelper.getBioLib(), withMissing);
174
+ });
175
+ });
176
+
177
+ function getAtomFromJson(argA: JsAtom<HelmType> | HelmType): Atom<HelmType> | HelmType {
178
+ let res: Atom<HelmType> | HelmType;
179
+ const a = argA as JsAtom<HelmType>;
180
+ if (a.T === 'ATOM')
181
+ res = new JSDraw2.Atom<HelmType>(a.p, a.elem, a.bio);
182
+ else
183
+ res = argA as HelmType;
184
+ return res;
185
+ }
186
+
187
+ export function expectObjectWithNull(actual: { [key: string]: any }, expected: { [key: string]: any }) {
188
+ if (actual == null && expected == null)
189
+ return;
190
+ else if (actual == null && expected != null)
191
+ throw new Error('actual is null, but expected is not null');
192
+ else if (actual!= null && expected == null)
193
+ throw new Error('actual is not null, but expected is null');
194
+ else {
195
+ for (const [expectedKey, expectedValue] of Object.entries(expected)) {
196
+ if (!(expectedKey in actual || actual.hasOwnProperty(expectedKey)))
197
+ throw new Error(`Expected property "${expectedKey}" not found`);
198
+
199
+ const actualValue = actual[expectedKey];
200
+ if (actualValue instanceof Array && expectedValue instanceof Array)
201
+ expectArray(actualValue, expectedValue);
202
+ else if (actualValue instanceof Object && expectedValue instanceof Object)
203
+ expectObjectWithNull(actualValue, expectedValue);
204
+ else if (Number.isFinite(actualValue) && Number.isFinite(expectedValue))
205
+ expectFloat(actualValue, expectedValue);
206
+ else if (actualValue != expectedValue)
207
+ throw new Error(`Expected (${expectedValue}) for key '${expectedKey}', got (${actualValue})`);
208
+ }
209
+ }
210
+ }
@@ -75,6 +75,7 @@ category('Helm', () => {
75
75
  'comples-monomer', 'complex-monomer+side-chain', 'complex-monomer+side-chain-RNA',
76
76
  'complex-side-chain', 'complex+side-chain+linker'
77
77
  ];
78
+
78
79
  test('parseHelm', async () => {
79
80
  const expectedResults = [
80
81
  ['meI', 'hHis', 'Aca', 'N', 'T', 'dK', 'Thr_PO3H2', 'D-Tyr_Et', 'Aze', 'dV', 'E', 'Phe_4Me'],
File without changes
@@ -1,69 +1,184 @@
1
1
  import * as grok from 'datagrok-api/grok';
2
2
  import * as ui from 'datagrok-api/ui';
3
3
  import * as DG from 'datagrok-api/dg';
4
- import {_package} from '../package';
5
4
 
6
- /* eslint-disable camelcase */
7
- export class DummyWebEditorMonomer {
8
- public readonly backgroundcolor: string = '#FF4444';
9
- public readonly linecolor: string = '#800000';
10
- public readonly textcolor: string = '#FFFFFF';
5
+ import * as org from 'org';
6
+
7
+ import {Monomer} from '@datagrok-libraries/bio/src/types/index';
8
+ import {
9
+ HELM_REQUIRED_FIELD as REQ, HELM_OPTIONAL_FIELDS as OPT, HELM_RGROUP_FIELDS as RGP,
10
+ } from '@datagrok-libraries/bio/src/utils/const';
11
+
12
+ export function getRS(smiles: string) {
13
+ const newS = smiles.match(/(?<=\[)[^\][]*(?=])/gm);
14
+ const res: { [name: string]: string } = {};
15
+ let el = '';
16
+ let digit;
17
+ if (!!newS) {
18
+ for (let i = 0; i < newS.length; i++) {
19
+ if (newS[i] != null) {
20
+ if (/\d/.test(newS[i])) {
21
+ digit = newS[i][newS[i].length - 1];
22
+ newS[i] = newS[i].replace(/[0-9]/g, '');
23
+ for (let j = 0; j < newS[i].length; j++) {
24
+ if (newS[i][j] != ':')
25
+ el += newS[i][j];
26
+ }
27
+ res['R' + digit] = el;
28
+ el = '';
29
+ }
30
+ }
31
+ }
32
+ }
33
+ return res;
34
+ }
35
+
36
+ export class LibraryWebEditorMonomer implements org.helm.WebEditorMonomer {
37
+ public get rs(): number { return Object.keys(this.at).length; }
11
38
 
12
- // no effect
13
- // public readonly na: string = 'NA';
14
- // public readonly nature: string = 'NA';
39
+ /* eslint-disable max-params */
40
+ protected constructor(
41
+ public readonly id: string,
42
+ public readonly m: string,
43
+ public readonly n: string,
44
+ public readonly na: string | undefined,
45
+ public readonly type: org.helm.PolymerType,
46
+ public readonly mt: org.helm.MonomerType,
47
+ public readonly at: org.helm.WebEditorRGroups,
48
+ ) /* eslint-enable max-params */ {}
49
+
50
+ static fromMonomer(biotype: org.helm.HelmType, monomer: Monomer): org.helm.WebEditorMonomer {
51
+ let at: org.helm.WebEditorRGroups = {};
52
+ const smiles = monomer[REQ.SMILES];
53
+ if (monomer.rgroups.length > 0) {
54
+ monomer.rgroups.forEach((it) => {
55
+ at[it[RGP.LABEL]] = it[RGP.CAP_GROUP_NAME];
56
+ });
57
+ } else if (smiles) {
58
+ // Generate R-Groups from SMILES
59
+ at = getRS(smiles);
60
+ } else {
61
+ // broken
62
+ return new BrokenWebEditorMonomer(biotype, monomer[REQ.SYMBOL]);
63
+ }
64
+
65
+ return new LibraryWebEditorMonomer(
66
+ monomer[REQ.SYMBOL],
67
+ monomer[REQ.MOLFILE],
68
+ monomer[REQ.NAME],
69
+ monomer[OPT.NATURAL_ANALOG],
70
+ monomer[REQ.POLYMER_TYPE],
71
+ monomer[REQ.MONOMER_TYPE],
72
+ at);
73
+ }
74
+ }
75
+
76
+ /* eslint-disable camelcase */
77
+ export abstract class DummyWebEditorMonomer implements org.helm.WebEditorMonomer {
78
+ //@formatter:off
79
+ public abstract get backgroundcolor(): string | undefined;
80
+ public abstract get linecolor(): string | undefined;
81
+ public abstract get textcolor(): string | undefined;
82
+ //@formatter:on
15
83
 
16
84
  /** R-Group index os single digit only is allowed in Pistoia code */
17
- public readonly at: { [rg: string]: string } = {
85
+ public readonly at: org.helm.WebEditorRGroups = {
18
86
  R1: 'H', R2: 'H', R3: 'H', R4: 'H', R5: 'H', R6: 'H', R7: 'H', R8: 'H', R9: 'H'
19
87
  };
20
88
 
21
- constructor(
89
+ public get rs(): number { return Object.keys(this.at).length; }
90
+
91
+ protected constructor(
22
92
  public readonly biotype: string,
23
- /** symbol, elem */ public readonly id: string,
24
- /** name */ public readonly n: string = 'missing',
25
- /** molfile*/ public readonly m?: string,
93
+ /** symbol */ public readonly id: string,
94
+ /** name */ public readonly n: string | undefined = 'missing',
95
+ /** molfile */ public readonly m: string | undefined = undefined,
96
+ /* Pistoia.HELM deletes .type and .mt in Monomers.addOneMonomer() */
97
+ /** polymer type */ public readonly type: org.helm.PolymerType | undefined = undefined,
98
+ /** monomer type */ public readonly mt: org.helm.MonomerType | undefined = undefined,
26
99
  ) {
27
100
  if (!this.id)
28
- throw new Error('Not supported undefined [id].');
29
-
30
- return new Proxy(this, {
31
- get: (target: any, prop: string | symbol, _receiver: any) => {
32
- const logPrefix = `${this.toLog()}.proxy.get( '${String(prop)}' )`;
33
- switch (prop) {
34
- case 'id':
35
- case 'at':
36
- case 'na':
37
- case 'nature':
38
- case 'backgroundcolor':
39
- case 'linecolor':
40
- case 'textcolor': {
41
- // these attributes are known and handled
42
- return target[prop];
43
- }
44
- case 'rs': {
45
- /* R-Group count (?), 2 is default for monomer "?" */
46
- throw new Error('Not supported get "rs" attribute.');
47
- }
48
- default:
49
- // Unexpected attribute requested
50
- _package.logger.warning(`${logPrefix}`);
51
- return target[prop];
52
- }
53
- },
54
- set: (target, prop, value: any, _receiver: any): boolean => {
55
- throw new Error(`Not supported set '${String(prop)}' attribute, any.`);
56
- },
57
- apply: (target: any, thisArg: any, argArray: any[]): any | undefined => {
58
- throw new Error(`Not supported call (apply) '${thisArg.toString()}' method, any.`);
59
- }
60
- });
101
+ throw new Error('Invalid arg undefined [id].');
102
+
103
+ // return new Proxy(this, {
104
+ // get: (target: any, prop: string | symbol, _receiver: any) => {
105
+ // const logPrefix = `${this.toLog()}.proxy.get( '${String(prop)}' )`;
106
+ // switch (prop) {
107
+ // case 'id':
108
+ // case 'at':
109
+ // case 'na':
110
+ // case 'nature':
111
+ // case 'backgroundcolor':
112
+ // case 'linecolor':
113
+ // case 'textcolor': {
114
+ // // these attributes are known and handled
115
+ // return target[prop];
116
+ // }
117
+ // case 'rs': {
118
+ // /* R-Group count (?), 2 is default for monomer "?" */
119
+ // throw new Error('Not supported get "rs" attribute.');
120
+ // }
121
+ // default:
122
+ // // Unexpected attribute requested
123
+ // _package.logger.warning(`${logPrefix}`);
124
+ // return target[prop];
125
+ // }
126
+ // },
127
+ // set: (target, prop, value: any, _receiver: any): boolean => {
128
+ // throw new Error(`Not supported set '${String(prop)}' attribute, any.`);
129
+ // },
130
+ // apply: (target: any, thisArg: any, argArray: any[]): any | undefined => {
131
+ // throw new Error(`Not supported call (apply) '${thisArg.toString()}' method, any.`);
132
+ // }
133
+ // });
61
134
  }
62
135
 
63
136
  private static objCounter: number = -1;
64
137
  private readonly objId: number = ++DummyWebEditorMonomer.objCounter;
65
138
 
139
+ private readonly className: string = 'DummyWebEditorMonomer';
140
+
66
141
  protected toLog(): string {
67
- return `Helm: DummyWebEditorMonomer<${this.objId}>`;
142
+ return `Helm: ${this.className}<${this.objId}>`;
143
+ }
144
+ }
145
+
146
+ export class GapWebEditorMonomer extends DummyWebEditorMonomer {
147
+ public readonly backgroundcolor: string = '#FFFFFF';
148
+ public readonly linecolor: string = '#808080';
149
+ public readonly textcolor: string = '#808080';
150
+
151
+ constructor(biotype: string, id: string) {
152
+ super(biotype, id, 'gap');
153
+ }
154
+ }
155
+
156
+ export class AmbiguousWebEditorMonomer extends DummyWebEditorMonomer {
157
+ public readonly backgroundcolor: string = '#808080';
158
+ public readonly linecolor: string = '#000000';
159
+ public readonly textcolor: string = '#000000';
160
+
161
+ constructor(biotype: string, id: string) {
162
+ super(biotype, id, 'ambiguous');
163
+ }
164
+ }
165
+
166
+ export class MissingWebEditorMonomer extends DummyWebEditorMonomer {
167
+ public readonly backgroundcolor: string = '#FF4444';
168
+ public readonly linecolor: string = '#800000';
169
+ public readonly textcolor: string = '#FFFFFF';
170
+
171
+ constructor(biotype: string, id: string) {
172
+ super(biotype, id, 'missing');
173
+ }
174
+ }
175
+
176
+ export class BrokenWebEditorMonomer extends DummyWebEditorMonomer {
177
+ public readonly backgroundcolor: string = '#FFFF44';
178
+ public readonly linecolor: string = '#800000';
179
+ public readonly textcolor: string = '#000000';
180
+
181
+ constructor(biotype: string, id: string) {
182
+ super(biotype, id, 'broken');
68
183
  }
69
184
  }
@@ -2,10 +2,10 @@ import * as grok from 'datagrok-api/grok';
2
2
  import * as DG from 'datagrok-api/dg';
3
3
  import * as ui from 'datagrok-api/ui';
4
4
 
5
- import * as org from 'org';
6
5
  import * as JSDraw2 from 'JSDraw2';
7
6
 
8
- import {IMonomerLib} from '@datagrok-libraries/bio/src/types/index';
7
+ import {helmTypeToPolymerType} from '@datagrok-libraries/bio/src/monomer-works/monomer-works';
8
+ import {PolymerType} from '@datagrok-libraries/bio/src/types';
9
9
 
10
10
  import {HelmMonomerPlacer, ISeqMonomer} from '../helm-monomer-placer';
11
11
 
@@ -80,32 +80,21 @@ export function getHoveredMonomerFallback(
80
80
  }
81
81
  left = (argsX >= sumLengths[left]) ? left : left - 1; // correct left to between sumLengths
82
82
  if (left >= 0)
83
- hoveredSeqMonomer = getSeqMonomerFromHelm(allParts[0], allParts[left], helmPlacer.monomerLib);
83
+ hoveredSeqMonomer = getSeqMonomerFromHelm(allParts[0], allParts[left]);
84
84
  return hoveredSeqMonomer;
85
85
  }
86
86
 
87
87
  function getSeqMonomerFromHelmAtom(atom: JSDraw2.IEditorMolAtom): ISeqMonomer {
88
- let polymerType: string | undefined = undefined;
89
- switch (atom.bio.type) {
90
- case 'HELM_BASE':
91
- case 'HELM_SUGAR': // r - ribose, d - deoxyribose
92
- case 'HELM_LINKER': // p - phosphate
93
- polymerType = 'RNA';
94
- break;
95
- case 'HELM_AA':
96
- polymerType = 'PEPTIDE';
97
- break;
98
- default:
99
- polymerType = 'PEPTIDE';
100
- }
88
+ const polymerType = helmTypeToPolymerType(atom.bio.type);
101
89
  return {symbol: atom.elem, polymerType: polymerType};
102
90
  }
103
91
 
104
92
  function getSeqMonomerFromHelm(
105
- helmPrefix: string, symbol: string, monomerLib: IMonomerLib
93
+ helmPrefix: string, symbol: string
106
94
  ): ISeqMonomer {
107
95
  let resSeqMonomer: ISeqMonomer | undefined = undefined;
108
- for (const polymerType of monomerLib.getPolymerTypes()) {
96
+ const polymerTypeList: PolymerType[] = ['RNA', 'PEPTIDE', 'CHEM', 'BLOB', 'G'];
97
+ for (const polymerType of polymerTypeList) {
109
98
  if (helmPrefix.startsWith(polymerType))
110
99
  resSeqMonomer = {symbol: symbol, polymerType: polymerType};
111
100
  }