@datagrok/helm 2.1.34 → 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.
- package/.eslintrc.json +1 -1
- package/CHANGELOG.md +30 -0
- package/dist/package-test.js +1 -1
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/package.json +12 -12
- package/src/cell-renderer.ts +21 -153
- package/src/constants.ts +0 -11
- package/src/helm-helper.ts +9 -10
- package/src/helm-monomer-placer.ts +21 -85
- package/src/helm-web-editor.ts +5 -2
- package/src/package-test.ts +6 -2
- package/src/package-utils.ts +150 -0
- package/src/package.ts +96 -100
- package/src/tests/get-monomer-tests.ts +210 -0
- package/src/tests/helm-service-tests.ts +97 -0
- package/src/tests/helm-tests.ts +1 -0
- package/src/tests/properties-widget-tests.ts +4 -2
- package/src/tests/renderers-tests.ts +97 -22
- package/src/types/dojo.ts +3 -0
- package/src/types/index.ts +0 -0
- package/src/utils/dummy-monomer.ts +184 -0
- package/src/utils/get-hovered.ts +104 -0
- package/src/utils/get-monomer.ts +111 -0
- package/src/utils/helm-grid-cell-renderer.ts +199 -0
- package/src/utils/helm-service.ts +130 -0
- package/src/utils/index.ts +7 -7
- package/webpack.config.js +7 -0
- /package/src/tests/{get-molfiles.ts → get-molfiles-tests.ts} +0 -0
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
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 {Subject} from 'rxjs';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
category, expect, test, awaitCheck, delay, testEvent, before, after
|
|
9
|
+
} from '@datagrok-libraries/utils/src/test';
|
|
10
|
+
import {
|
|
11
|
+
getHelmService, HelmServiceBase, HelmAux, HelmProps
|
|
12
|
+
} from '@datagrok-libraries/bio/src/viewers/helm-service';
|
|
13
|
+
import {RenderTask} from '@datagrok-libraries/bio/src/utils/cell-renderer-async-base';
|
|
14
|
+
|
|
15
|
+
import {getMonomerLibHelper, IMonomerLibHelper} from '@datagrok-libraries/bio/src/monomer-works/monomer-utils';
|
|
16
|
+
import {UserLibSettings} from '@datagrok-libraries/bio/src/monomer-works/types';
|
|
17
|
+
import {
|
|
18
|
+
getUserLibSettings, setUserLibSettings, setUserLibSettingsForTests
|
|
19
|
+
} from '@datagrok-libraries/bio/src/monomer-works/lib-settings';
|
|
20
|
+
|
|
21
|
+
import {_package} from '../package-test';
|
|
22
|
+
|
|
23
|
+
category('HelmService', () => {
|
|
24
|
+
let monomerLibHelper: IMonomerLibHelper;
|
|
25
|
+
/** Backup actual user's monomer libraries settings */
|
|
26
|
+
let userLibSettings: UserLibSettings;
|
|
27
|
+
|
|
28
|
+
let helmSvc: HelmServiceBase;
|
|
29
|
+
|
|
30
|
+
before(async () => {
|
|
31
|
+
const logPrefix = `Helm: tests: HelmService: before`;
|
|
32
|
+
_package.logger.debug(`${logPrefix}, start`);
|
|
33
|
+
try {
|
|
34
|
+
monomerLibHelper = await getMonomerLibHelper();
|
|
35
|
+
userLibSettings = await getUserLibSettings();
|
|
36
|
+
|
|
37
|
+
await delay(1000); // for loading monomer libraries files
|
|
38
|
+
// Test 'helm' requires default monomer library loaded
|
|
39
|
+
await setUserLibSettingsForTests();
|
|
40
|
+
await monomerLibHelper.loadLibraries(true); // load default libraries
|
|
41
|
+
const libSummary = monomerLibHelper.getBioLib().getSummary();
|
|
42
|
+
|
|
43
|
+
helmSvc = await getHelmService();
|
|
44
|
+
await helmSvc.reset();
|
|
45
|
+
|
|
46
|
+
_package.logger.debug(`${logPrefix}, end`);
|
|
47
|
+
} finally {
|
|
48
|
+
_package.logger.debug(`${logPrefix}, fina`);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
after(async () => {
|
|
53
|
+
const logPrefix = `Helm: tests: HelmService: after`;
|
|
54
|
+
_package.logger.debug(`${logPrefix}, start`);
|
|
55
|
+
|
|
56
|
+
await helmSvc.reset();
|
|
57
|
+
|
|
58
|
+
await setUserLibSettings(userLibSettings);
|
|
59
|
+
await monomerLibHelper.loadLibraries(true); // load user settings libraries
|
|
60
|
+
_package.logger.debug(`${logPrefix}, end`);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test('helm', async () => {
|
|
64
|
+
const logPrefix: string = `Helm: tests: HelmService: helm`;
|
|
65
|
+
_package.logger.debug(`${logPrefix}, start`);
|
|
66
|
+
const helmStr: string = 'PEPTIDE1{I.H.A.N.T.Thr_PO3H2.Aca.D-Tyr_Et}$$$$';
|
|
67
|
+
let consumerId: number | null = null;
|
|
68
|
+
let taskAux: HelmAux | null = null;
|
|
69
|
+
const event = new Subject<void>();
|
|
70
|
+
await testEvent(event,
|
|
71
|
+
() => {
|
|
72
|
+
},
|
|
73
|
+
() => {
|
|
74
|
+
const task: RenderTask<HelmProps, HelmAux> = {
|
|
75
|
+
name: 'test1',
|
|
76
|
+
props: {
|
|
77
|
+
helm: helmStr,
|
|
78
|
+
backColor: DG.Color.fromHtml('#FFFFFF'),
|
|
79
|
+
width: 300, height: 100,
|
|
80
|
+
},
|
|
81
|
+
onAfterRender: (canvas: HTMLCanvasElement, aux: HelmAux) => {
|
|
82
|
+
taskAux = aux;
|
|
83
|
+
event.next();
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
helmSvc.reset();
|
|
87
|
+
consumerId = helmSvc.render(consumerId, task, 0);
|
|
88
|
+
}, 7000);
|
|
89
|
+
expect(taskAux !== null, true, 'Helm task aux is null');
|
|
90
|
+
expect(taskAux!.mol.atoms.length > 0, true, 'Polymer mol atoms empty');
|
|
91
|
+
expect(taskAux!.mol.atoms.length, 8);
|
|
92
|
+
expect(taskAux!.mol.bonds.length, 7);
|
|
93
|
+
expect(helmSvc.errorCount, 0, 'There was errors in NglGlService.');
|
|
94
|
+
expect(consumerId !== null, true, 'consumerId not assigned');
|
|
95
|
+
_package.logger.debug(`${logPrefix}, end`);
|
|
96
|
+
}, {timeout: 10000});
|
|
97
|
+
});
|
package/src/tests/helm-tests.ts
CHANGED
|
@@ -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'],
|
|
@@ -5,7 +5,9 @@ import * as grok from 'datagrok-api/grok';
|
|
|
5
5
|
import {after, before, category, expect, expectObject, test} from '@datagrok-libraries/utils/src/test';
|
|
6
6
|
import {ALPHABET, NOTATION, TAGS as bioTAGS} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
7
7
|
import {SeqHandler} from '@datagrok-libraries/bio/src/utils/seq-handler';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
getUserLibSettings, setUserLibSettings, setUserLibSettingsForTests
|
|
10
|
+
} from '@datagrok-libraries/bio/src/monomer-works/lib-settings';
|
|
9
11
|
import {getMonomerLibHelper, IMonomerLibHelper} from '@datagrok-libraries/bio/src/monomer-works/monomer-utils';
|
|
10
12
|
|
|
11
13
|
import {getPropertiesDict} from '../widgets/properties-widget';
|
|
@@ -88,7 +90,7 @@ category('properties-widget', () => {
|
|
|
88
90
|
function testPropertiesDict(
|
|
89
91
|
seq: string, units: NOTATION, separator: string | undefined, alphabet: ALPHABET | undefined, expPropDict: {}
|
|
90
92
|
) {
|
|
91
|
-
const col = DG.Column.
|
|
93
|
+
const col = DG.Column.fromStrings('seq', [seq]) as DG.Column<string>;
|
|
92
94
|
col.semType = DG.SEMTYPE.MACROMOLECULE;
|
|
93
95
|
col.setTag(DG.TAGS.UNITS, units);
|
|
94
96
|
if (separator) col.setTag(bioTAGS.separator, separator);
|
|
@@ -3,33 +3,108 @@ import * as ui from 'datagrok-api/ui';
|
|
|
3
3
|
import * as DG from 'datagrok-api/dg';
|
|
4
4
|
|
|
5
5
|
import $ from 'cash-dom';
|
|
6
|
+
import {fromEvent} from 'rxjs';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
after, before, category, test, expect, awaitCheck, delay, testEvent
|
|
10
|
+
} from '@datagrok-libraries/utils/src/test';
|
|
8
11
|
import {NOTATION} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
12
|
+
import {getMonomerLibHelper, IMonomerLibHelper} from '@datagrok-libraries/bio/src/monomer-works/monomer-utils';
|
|
13
|
+
import {UserLibSettings} from '@datagrok-libraries/bio/src/monomer-works/types';
|
|
14
|
+
import {
|
|
15
|
+
getUserLibSettings, setUserLibSettings, setUserLibSettingsForTests
|
|
16
|
+
} from '@datagrok-libraries/bio/src/monomer-works/lib-settings';
|
|
17
|
+
|
|
18
|
+
import {awaitGrid} from './utils';
|
|
9
19
|
import {TAGS as helmTAGS} from '../constants';
|
|
10
20
|
|
|
21
|
+
import {_package} from '../package-test';
|
|
22
|
+
|
|
11
23
|
category('renderers', () => {
|
|
24
|
+
let monomerLibHelper: IMonomerLibHelper;
|
|
25
|
+
/** Backup actual user's monomer libraries settings */
|
|
26
|
+
let userLibSettings: UserLibSettings;
|
|
27
|
+
|
|
28
|
+
before(async () => {
|
|
29
|
+
monomerLibHelper = await getMonomerLibHelper();
|
|
30
|
+
userLibSettings = await getUserLibSettings();
|
|
31
|
+
|
|
32
|
+
// Test 'helm' requires default monomer library loaded
|
|
33
|
+
await setUserLibSettingsForTests();
|
|
34
|
+
await monomerLibHelper.loadLibraries(true); // load default libraries
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
after(async () => {
|
|
38
|
+
// UserDataStorage.put() replaces existing data
|
|
39
|
+
await setUserLibSettings(userLibSettings);
|
|
40
|
+
await monomerLibHelper.loadLibraries(true); // load user settings libraries
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
|
|
12
44
|
test('missedInLib', async () => { await _testMissedInLib(); });
|
|
13
|
-
});
|
|
14
45
|
|
|
15
|
-
async
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
46
|
+
test('scatterPlotTooltip', async () => { await _testScatterPlotTooltip(); });
|
|
47
|
+
|
|
48
|
+
async function _testMissedInLib() {
|
|
49
|
+
const df: DG.DataFrame = await grok.dapi.files.readCsv('System:AppData/Helm/tests/sample_HELM-missedInLib.csv');
|
|
50
|
+
const helmCol: DG.Column<string> = df.getCol('HELM');
|
|
51
|
+
|
|
52
|
+
const tv: DG.TableView = grok.shell.addTableView(df);
|
|
53
|
+
await awaitCheck(() => {
|
|
54
|
+
return $(tv.root).find('.d4-grid canvas').length > 0;
|
|
55
|
+
}, 'Table view canvas not found', 100);
|
|
56
|
+
|
|
57
|
+
expect(helmCol.semType, DG.SEMTYPE.MACROMOLECULE);
|
|
58
|
+
expect(helmCol.getTag(DG.TAGS.UNITS), NOTATION.HELM);
|
|
59
|
+
expect(helmCol.getTag(DG.TAGS.CELL_RENDERER), 'helm');
|
|
60
|
+
|
|
61
|
+
const cellRendererErrorJson: string = helmCol.getTag(helmTAGS.cellRendererRenderError);
|
|
62
|
+
if (!!cellRendererErrorJson) {
|
|
63
|
+
const cellRendererError: any = JSON.parse(cellRendererErrorJson);
|
|
64
|
+
const err = new Error(cellRendererError['message']);
|
|
65
|
+
err.stack = cellRendererError['stack'];
|
|
66
|
+
throw err;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const helmCoordsCsv = `seq,x,y
|
|
71
|
+
PEPTIDE1{I.H.A.N.T.Thr_PO3H2.Aca.D-Tyr_Et}$$$$,0,0
|
|
72
|
+
RNA1{r(A)p.r(C)p.r(G)p.r(U)p}$$$$,1,0
|
|
73
|
+
RNA1{d(A)p.d(C)p.d(G)p.d(U)p}|PEPTIDE1{I.H.A.N.T.Thr_PO3H2}$$$$,0,1
|
|
74
|
+
`;
|
|
75
|
+
|
|
76
|
+
async function _testScatterPlotTooltip(): Promise<void> {
|
|
77
|
+
const df = DG.DataFrame.fromCsv(helmCoordsCsv);
|
|
78
|
+
df.currentRowIdx = 0;
|
|
79
|
+
const view = grok.shell.addTableView(df);
|
|
80
|
+
const sp: DG.ScatterPlotViewer = df.plot.scatter({x: 'x', y: 'y'});
|
|
81
|
+
view.dockManager.dock(sp, DG.DOCK_TYPE.RIGHT, null);
|
|
82
|
+
await Promise.all([
|
|
83
|
+
testEvent(sp.onAfterDrawScene, () => {}, () => { sp.invalidateCanvas(); }, 1000),
|
|
84
|
+
awaitGrid(view.grid, 500)
|
|
85
|
+
]);
|
|
86
|
+
|
|
87
|
+
const spBcr = sp.root.getBoundingClientRect();
|
|
88
|
+
const wp = sp.worldToScreen(1, 0);
|
|
89
|
+
const ev = new MouseEvent('mousemove', {
|
|
90
|
+
cancelable: true, bubbles: true, view: window, button: 0,
|
|
91
|
+
clientX: spBcr.left + wp.x, clientY: spBcr.top + wp.y
|
|
92
|
+
});
|
|
93
|
+
const spCanvas = $(sp.root).find('canvas').get()[0] as HTMLCanvasElement;
|
|
94
|
+
await testEvent(fromEvent(spCanvas, 'mousemove'), () => {
|
|
95
|
+
_package.logger.debug(`Test: event, currentRowIdx=${df.currentRowIdx}`);
|
|
96
|
+
expect($(ui.tooltip.root).find('div table.d4-row-tooltip-table tr td canvas').length, 1);
|
|
97
|
+
expect(sp.hitTest(wp.x, wp.y), 1);
|
|
98
|
+
}, () => {
|
|
99
|
+
spCanvas.dispatchEvent(ev);
|
|
100
|
+
}, 500);
|
|
101
|
+
// TODO: Any error occurred become 'Cannot read properties of null (reading 'get$columns')' because of scatter plot
|
|
102
|
+
//await testEvent(sp.onAfterDrawScene, () => {}, () => { sp.invalidateCanvas(); }, 200);
|
|
103
|
+
await awaitGrid(view.grid, 500);
|
|
34
104
|
}
|
|
35
|
-
}
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
File without changes
|