@datagrok/helm 3.0.0 → 3.0.2
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/CHANGELOG.md +18 -0
- package/CLAUDE.md +78 -92
- package/css/helm.css +40 -0
- package/dist/489.js +1 -1
- package/dist/489.js.map +1 -1
- 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/files/samples/helm-showcase.csv +7 -9
- package/package.json +13 -10
- package/src/helm-helper.ts +81 -2
- package/src/package-api.ts +1 -0
- package/src/package-test.ts +0 -4
- package/src/package.g.ts +2 -0
- package/src/package.ts +4 -1
- package/test-console-output-1.log +124 -72
- package/test-playwright-report.json +118 -0
- package/test-record-1.mp4 +0 -0
- package/test-report-playwright.csv +1 -0
- package/tsconfig.json +2 -1
|
@@ -8,20 +8,18 @@ Modified residues (meL/meY),Peptide / modified,PEPTIDE1{[meL].A.G.[meY].T}$$$$
|
|
|
8
8
|
Head-to-tail cyclic (5),Peptide / cyclic,"PEPTIDE1{A.C.D.E.F}$PEPTIDE1,PEPTIDE1,5:R2-1:R1$$$V2.0"
|
|
9
9
|
Disulfide cyclic,Peptide / cyclic,"PEPTIDE1{A.C.D.E.F.C}$PEPTIDE1,PEPTIDE1,2:R3-6:R3$$$V2.0"
|
|
10
10
|
Cyclic head-to-tail (32-mer),Peptide / cyclic,"PEPTIDE1{A.C.D.E.F.G.H.I.K.L.M.N.P.Q.R.S.T.V.W.Y.A.C.D.E.F.G.H.I.K.L.M.N}$PEPTIDE1,PEPTIDE1,32:R2-1:R1$$$V2.0"
|
|
11
|
-
Inner side-chain cycle (R3-R3),Peptide / cyclic,"PEPTIDE1{A.C.D.E.F.G.
|
|
12
|
-
Two side-chain bridges (bicyclic),Peptide / multicyclic,"PEPTIDE1{A.C.D.E.F.
|
|
11
|
+
Inner side-chain cycle (R3-R3),Peptide / cyclic,"PEPTIDE1{A.C.D.E.F.G.C.I.K.L}$PEPTIDE1,PEPTIDE1,3:R3-7:R3$$$V2.0"
|
|
12
|
+
Two side-chain bridges (bicyclic),Peptide / multicyclic,"PEPTIDE1{A.C.D.E.F.D.D.I.K.L.dC.N}$PEPTIDE1,PEPTIDE1,2:R3-6:R3|PEPTIDE1,PEPTIDE1,7:R3-11:R3$$$V2.0"
|
|
13
13
|
"Stapled helix (i, i+4)",Peptide / cyclic,"PEPTIDE1{A.C.D.E.C.G.H.I}$PEPTIDE1,PEPTIDE1,2:R3-5:R3$$$V2.0"
|
|
14
14
|
Branched tri-ring (R3-R3 bridges),Peptide / multicyclic,"PEPTIDE1{C.A.C.A.C.A}|PEPTIDE2{C.A.C.A.C.A}|PEPTIDE3{C.A.C.A.C.A}$PEPTIDE1,PEPTIDE2,1:R3-1:R3|PEPTIDE2,PEPTIDE3,3:R3-3:R3|PEPTIDE3,PEPTIDE1,5:R3-5:R3$$$V2.0"
|
|
15
|
-
Disulfide-rich (insulin-like),Peptide / multicyclic,"PEPTIDE1{G.I.V.E.Q.C.C.T.S.I.C.S.L.Y.Q.L.E.N.Y.C.N}|PEPTIDE2{F.V.N.Q.H.L.C.G.S.H.L.V.E.A.L.Y.L.V.C.G.E.R.G.F.F.Y.T.P
|
|
15
|
+
Disulfide-rich (insulin-like),Peptide / multicyclic,"PEPTIDE1{G.I.V.E.Q.C.C.T.S.I.C.S.L.Y.Q.L.E.N.Y.C.N}|PEPTIDE2{F.V.N.Q.H.L.C.G.S.H.L.V.E.A.L.Y.L.V.C.G.E.R.G.F.F.Y.T.P}$PEPTIDE1,PEPTIDE2,7:R3-7:R3|PEPTIDE1,PEPTIDE2,20:R3-19:R3|PEPTIDE1,PEPTIDE1,6:R3-11:R3$$$V2.0"
|
|
16
16
|
Two disconnected chains,Peptide / linear,PEPTIDE1{A.C}|PEPTIDE2{G.H}$$$$V2.0
|
|
17
|
-
"Ambiguous position (A,G,C)",Peptide / ambiguity,"PEPTIDE1{(A,G,C)}$$$$"
|
|
18
17
|
RNA tetramer (ribose),Nucleic acid / single,RNA1{r(A)p.r(C)p.r(G)p.r(U)p}$$$$V2.0
|
|
19
18
|
DNA tetramer (deoxy),Nucleic acid / single,RNA1{d(A)p.d(C)p.d(G)p.d(T)p}$$$$V2.0
|
|
20
19
|
RNA 30-mer,Nucleic acid / single,RNA1{r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p}$$$$V2.0
|
|
21
20
|
2'-Fluoro modified ribose,Nucleic acid / modified,RNA1{[fl2r](A)p.[fl2r](C)p.r(G)p.r(U)p}$$$$V2.0
|
|
22
|
-
Phosphorothioate (PS) backbone,Nucleic acid / modified,RNA1{m(G)[
|
|
23
|
-
2'-OMe gapmer (PS wings),Nucleic acid / modified,RNA1{m(A)[
|
|
24
|
-
Bracket repeat (rA)x3,Nucleic acid / modified,RNA1{(r(A)p)'3'}$$$$V2.0
|
|
21
|
+
Phosphorothioate (PS) backbone,Nucleic acid / modified,RNA1{m(G)[cmp].m(A)[msp].m(C)[eop].m(U)[sp]}$$$$V2.0
|
|
22
|
+
2'-OMe gapmer (PS wings),Nucleic acid / modified,RNA1{m(A)[sp].m(C)[sp].d(G)p.d(A)p.d(T)p.d(C)p.m(G)[sp].m(U)[sp]}$$$$V2.0
|
|
25
23
|
Mini duplex (2bp),Nucleic acid / duplex,"RNA1{r(A)p.r(C)p}|RNA2{r(G)p.r(U)p}$RNA1,RNA2,2:pair-5:pair$$$V2.0"
|
|
26
24
|
Blunt duplex (8bp),Nucleic acid / duplex,"RNA1{r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p}|RNA2{r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p}$RNA1,RNA2,2:pair-23:pair|RNA1,RNA2,5:pair-20:pair|RNA1,RNA2,8:pair-17:pair|RNA1,RNA2,11:pair-14:pair|RNA1,RNA2,14:pair-11:pair|RNA1,RNA2,17:pair-8:pair|RNA1,RNA2,20:pair-5:pair|RNA1,RNA2,23:pair-2:pair$$$V2.0"
|
|
27
25
|
Blunt duplex (12bp),Nucleic acid / duplex,"RNA1{r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p}|RNA2{r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p}$RNA1,RNA2,2:pair-35:pair|RNA1,RNA2,5:pair-32:pair|RNA1,RNA2,8:pair-29:pair|RNA1,RNA2,11:pair-26:pair|RNA1,RNA2,14:pair-23:pair|RNA1,RNA2,17:pair-20:pair|RNA1,RNA2,20:pair-17:pair|RNA1,RNA2,23:pair-14:pair|RNA1,RNA2,26:pair-11:pair|RNA1,RNA2,29:pair-8:pair|RNA1,RNA2,32:pair-5:pair|RNA1,RNA2,35:pair-2:pair$$$V2.0"
|
|
@@ -48,9 +46,9 @@ Asymmetric duplex (21 sense / 19 anti),Nucleic acid / siRNA,"RNA1{r(A)p.r(C)p.r(
|
|
|
48
46
|
Palindromic self-pairing duplex,Nucleic acid / duplex,"RNA1{r(G)p.r(C)p.r(G)p.r(C)p.r(G)p.r(C)p.r(G)p.r(C)p}|RNA2{r(G)p.r(C)p.r(G)p.r(C)p.r(G)p.r(C)p.r(G)p.r(C)p}$RNA1,RNA2,2:pair-23:pair|RNA1,RNA2,5:pair-20:pair|RNA1,RNA2,8:pair-17:pair|RNA1,RNA2,11:pair-14:pair|RNA1,RNA2,14:pair-11:pair|RNA1,RNA2,17:pair-8:pair|RNA1,RNA2,20:pair-5:pair|RNA1,RNA2,23:pair-2:pair$$$V2.0"
|
|
49
47
|
DNA blunt duplex (10bp),Nucleic acid / duplex,"RNA1{d(A)p.d(C)p.d(G)p.d(T)p.d(A)p.d(C)p.d(G)p.d(T)p.d(A)p.d(C)p}|RNA2{d(G)p.d(T)p.d(A)p.d(C)p.d(G)p.d(T)p.d(A)p.d(C)p.d(G)p.d(T)p}$RNA1,RNA2,2:pair-29:pair|RNA1,RNA2,5:pair-26:pair|RNA1,RNA2,8:pair-23:pair|RNA1,RNA2,11:pair-20:pair|RNA1,RNA2,14:pair-17:pair|RNA1,RNA2,17:pair-14:pair|RNA1,RNA2,20:pair-11:pair|RNA1,RNA2,23:pair-8:pair|RNA1,RNA2,26:pair-5:pair|RNA1,RNA2,29:pair-2:pair$$$V2.0"
|
|
50
48
|
Tricyclic peptide (3 disulfide bridges),Peptide / multicyclic,"PEPTIDE1{C.A.C.A.C.A.C.A.C.A.C.A}$PEPTIDE1,PEPTIDE1,1:R3-5:R3|PEPTIDE1,PEPTIDE1,3:R3-9:R3|PEPTIDE1,PEPTIDE1,7:R3-11:R3$$$V2.0"
|
|
51
|
-
Lasso peptide (macrolactam + tail),Peptide / cyclic,"PEPTIDE1{A.C.D.E.F.G.H.I}$PEPTIDE1,PEPTIDE1,4:
|
|
49
|
+
Lasso peptide (macrolactam + tail),Peptide / cyclic,"PEPTIDE1{A.C.D.E.F.G.H.I}$PEPTIDE1,PEPTIDE1,4:R3-1:R1$$$V2.0"
|
|
52
50
|
RNA 40-mer single strand,Nucleic acid / single,RNA1{r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p}$$$$V2.0
|
|
53
51
|
Two peptides bridged by one disulfide,Peptide / multicyclic,"PEPTIDE1{A.C.D.E}|PEPTIDE2{F.G.C.H}$PEPTIDE1,PEPTIDE2,2:R3-3:R3$$$V2.0"
|
|
54
52
|
"siRNA 25-mer, 2-nt 3′ overhangs",Nucleic acid / siRNA,"RNA1{r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p}|RNA2{r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p.r(A)p.r(C)p.r(G)p.r(U)p}$RNA1,RNA2,2:pair-71:pair|RNA1,RNA2,5:pair-68:pair|RNA1,RNA2,8:pair-65:pair|RNA1,RNA2,11:pair-62:pair|RNA1,RNA2,14:pair-59:pair|RNA1,RNA2,17:pair-56:pair|RNA1,RNA2,20:pair-53:pair|RNA1,RNA2,23:pair-50:pair|RNA1,RNA2,26:pair-47:pair|RNA1,RNA2,29:pair-44:pair|RNA1,RNA2,32:pair-41:pair|RNA1,RNA2,35:pair-38:pair|RNA1,RNA2,38:pair-35:pair|RNA1,RNA2,41:pair-32:pair|RNA1,RNA2,44:pair-29:pair|RNA1,RNA2,47:pair-26:pair|RNA1,RNA2,50:pair-23:pair|RNA1,RNA2,53:pair-20:pair|RNA1,RNA2,56:pair-17:pair|RNA1,RNA2,59:pair-14:pair|RNA1,RNA2,62:pair-11:pair|RNA1,RNA2,65:pair-8:pair|RNA1,RNA2,68:pair-5:pair$$$V2.0"
|
|
55
53
|
"Hairpin, long apical loop",Nucleic acid / structure,"RNA1{r(G)p.r(C)p.r(G)p.r(A)p.r(A)p.r(A)p.r(A)p.r(A)p.r(A)p.r(C)p.r(G)p.r(C)p}$RNA1,RNA1,2:pair-35:pair|RNA1,RNA1,5:pair-32:pair|RNA1,RNA1,8:pair-29:pair$$$V2.0"
|
|
56
|
-
Peptide–PEG2–RNA triple conjugate,Conjugate / mixed,"PEPTIDE1{A.C.D.E.F}|RNA1{r(A)p.r(C)p.r(G)p}|CHEM1{[PEG2]}$PEPTIDE1,CHEM1,5:R2-1:R1|CHEM1,RNA1,1:R2-1:R1$$$V2.0"
|
|
54
|
+
Peptide–PEG2–RNA triple conjugate,Conjugate / mixed,"PEPTIDE1{A.C.D.E.F}|RNA1{r(A)p.r(C)p.r(G)p}|CHEM1{[PEG2]}$PEPTIDE1,CHEM1,5:R2-1:R1|CHEM1,RNA1,1:R2-1:R1$$$V2.0"
|
package/package.json
CHANGED
|
@@ -1,31 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datagrok/helm",
|
|
3
3
|
"friendlyName": "Helm",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.2",
|
|
5
5
|
"author": {
|
|
6
|
-
"name": "
|
|
7
|
-
"email": "
|
|
6
|
+
"name": "Davit Rizhinashvili",
|
|
7
|
+
"email": "drizhinashvili@datagrok.ai"
|
|
8
8
|
},
|
|
9
9
|
"description": "Provides support for HELM notation (importing, detecting, rendering, conversion).",
|
|
10
10
|
"sources": [
|
|
11
11
|
"css/helm.css"
|
|
12
12
|
],
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@datagrok-libraries/bio": "^6.0.
|
|
14
|
+
"@datagrok-libraries/bio": "^6.0.2",
|
|
15
15
|
"@datagrok-libraries/chem-meta": "^1.2.9",
|
|
16
|
-
"@datagrok-libraries/hwe": "^1.0.
|
|
16
|
+
"@datagrok-libraries/hwe": "^1.0.1",
|
|
17
|
+
"@datagrok-libraries/test": "^1.3.1",
|
|
17
18
|
"@datagrok-libraries/utils": "^4.6.9",
|
|
18
19
|
"cash-dom": "^8.1.1",
|
|
19
|
-
"datagrok-api": "^1.
|
|
20
|
+
"datagrok-api": "^1.27.3",
|
|
20
21
|
"dayjs": "^1.10.6",
|
|
21
22
|
"lru-cache": "^10.4.3",
|
|
22
23
|
"rxjs": "^6.5.5",
|
|
23
|
-
"wu": "^2.1.0"
|
|
24
|
-
"@datagrok-libraries/test": "^1.1.0"
|
|
24
|
+
"wu": "^2.1.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@datagrok/bio": "^2.25.1",
|
|
28
28
|
"@datagrok/chem": "^1.17.0",
|
|
29
|
+
"@playwright/test": "^1.48.0",
|
|
29
30
|
"@types/node": "17.0.45",
|
|
30
31
|
"@types/webpack-env": "^1.18.5",
|
|
31
32
|
"@types/wu": "^2.1.44",
|
|
@@ -78,6 +79,8 @@
|
|
|
78
79
|
},
|
|
79
80
|
"category": "Bioinformatics",
|
|
80
81
|
"overrides": {
|
|
81
|
-
"datagrok-api": "$datagrok-api"
|
|
82
|
-
|
|
82
|
+
"datagrok-api": "$datagrok-api",
|
|
83
|
+
"uuid": "^11.1.1"
|
|
84
|
+
},
|
|
85
|
+
"playwrightTests": "playwright"
|
|
83
86
|
}
|
package/src/helm-helper.ts
CHANGED
|
@@ -15,6 +15,9 @@ import type {RDModule} from '@datagrok-libraries/chem-meta/src/rdkit-api';
|
|
|
15
15
|
|
|
16
16
|
import {HelmInput} from './widgets/helm-input';
|
|
17
17
|
import {getHoveredMonomerFromEditorMol} from './utils/get-hovered';
|
|
18
|
+
import * as DG from 'datagrok-api/dg';
|
|
19
|
+
import * as grok from 'datagrok-api/grok';
|
|
20
|
+
import * as ui from 'datagrok-api/ui';
|
|
18
21
|
/* eslint-enable max-len */
|
|
19
22
|
|
|
20
23
|
import {_package} from './package';
|
|
@@ -24,8 +27,10 @@ import {_package} from './package';
|
|
|
24
27
|
// (`HelmHelperAdapter` over `HelmService`). The legacy forked Pistoia HELM Web
|
|
25
28
|
// Editor (`org.helm.webeditor` / JSDraw2 / Dojo) is gone — this class no longer
|
|
26
29
|
// touches any of those globals.
|
|
27
|
-
import {HelmHelperAdapter, bridgeMonomerLib, HelmService} from '@datagrok-libraries/hwe';
|
|
30
|
+
import {HelmHelperAdapter, bridgeMonomerLib, HelmService, PolymerTypes} from '@datagrok-libraries/hwe';
|
|
28
31
|
import type {IMonomerLibBaseLike, MonomersFuncsLike} from '@datagrok-libraries/hwe';
|
|
32
|
+
import {NOTATION} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
33
|
+
import {ISeqHandler} from '@datagrok-libraries/bio/src/utils/macromolecule/seq-handler';
|
|
29
34
|
|
|
30
35
|
export class HelmHelper implements IHelmHelper {
|
|
31
36
|
private static instanceCount: number = 0;
|
|
@@ -52,7 +57,15 @@ export class HelmHelper implements IHelmHelper {
|
|
|
52
57
|
private get editorAdapter(): HelmHelperAdapter {
|
|
53
58
|
if (this._editorAdapter === null) {
|
|
54
59
|
const monomerLib = _package._libHelper!.getMonomerLib() as unknown as IMonomerLibBaseLike;
|
|
55
|
-
const
|
|
60
|
+
const paneProviders: Map<string, (helm: string) => Promise<HTMLElement>> = new Map();
|
|
61
|
+
paneProviders.set('FASTA', async (helm) => this._toFastaProvider(helm));
|
|
62
|
+
paneProviders.set('BILN', async (helm) => this._toBilnProvider(helm));
|
|
63
|
+
paneProviders.set('Molecular Structure', async (helm) => this._atomicLevelProvider(helm));
|
|
64
|
+
paneProviders.set('Composition Analysis', async (helm) => this._compositionAnalysisProvider(helm));
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
const service = new HelmService({monomerLib: bridgeMonomerLib(monomerLib),
|
|
68
|
+
rdkitModule: this.rdKitModule, extraPanes: paneProviders});
|
|
56
69
|
this._editorAdapter = new HelmHelperAdapter({service, seqHelper: this.seqHelper});
|
|
57
70
|
}
|
|
58
71
|
return this._editorAdapter;
|
|
@@ -127,4 +140,70 @@ export class HelmHelper implements IHelmHelper {
|
|
|
127
140
|
removeGaps(srcHelm: string): HelmConvertRes {
|
|
128
141
|
return this.editorAdapter.removeGaps(srcHelm);
|
|
129
142
|
}
|
|
143
|
+
|
|
144
|
+
private _singeHelmDf: DG.DataFrame | null = null;
|
|
145
|
+
private _getSingleHelmDf(helm: string) {
|
|
146
|
+
if (this._singeHelmDf === null) {
|
|
147
|
+
const col = DG.Column.fromStrings('helm', [helm]);
|
|
148
|
+
col.setTag('quality', DG.SEMTYPE.MACROMOLECULE);
|
|
149
|
+
col.setTag('units', 'helm');
|
|
150
|
+
col.setTag('.alphabetIsMultichar', 'true');
|
|
151
|
+
col.setTag('alphabet', 'UN');
|
|
152
|
+
// set the width of widget in tag.
|
|
153
|
+
const ww = Math.floor(window.innerWidth * 0.6);
|
|
154
|
+
col.setTag('.toAtomicWidgetWidth', ww.toString());
|
|
155
|
+
this._singeHelmDf = DG.DataFrame.fromColumns([col]);
|
|
156
|
+
}
|
|
157
|
+
this._singeHelmDf.col('helm')!.set(0, helm);
|
|
158
|
+
return this._singeHelmDf;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
private _singleHelmSh: ISeqHandler | null = null;
|
|
162
|
+
private _getSingleHelmDfSh(helm: string) {
|
|
163
|
+
if (!this._singleHelmSh) {
|
|
164
|
+
const df = this._getSingleHelmDf(helm);
|
|
165
|
+
this._singleHelmSh = this.seqHelper.getSeqHandler(df.col('helm')!);
|
|
166
|
+
}
|
|
167
|
+
return this._singleHelmSh;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
private async _atomicLevelProvider(helm: string) {
|
|
171
|
+
const df = this._getSingleHelmDf(helm);
|
|
172
|
+
const semValue = DG.SemanticValue.fromTableCell(df.cell(0, 'helm')!);
|
|
173
|
+
const w: DG.Widget = await grok.functions.call('Bio:toAtomicLevelPanel', {sequence: semValue}) as DG.Widget;
|
|
174
|
+
return w.root;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
private async _compositionAnalysisProvider(helm: string) {
|
|
178
|
+
const df = this._getSingleHelmDf(helm);
|
|
179
|
+
const semValue = DG.SemanticValue.fromTableCell(df.cell(0, 'helm')!);
|
|
180
|
+
const w: DG.Widget = await grok.functions.call('Bio:compositionAnalysisWidget', {sequence: semValue}) as DG.Widget;
|
|
181
|
+
return w.root;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
private _toBilnProvider(helm: string) {
|
|
185
|
+
const parseResult = this.editorAdapter.service.parse(helm);
|
|
186
|
+
if (parseResult.mol.chains.length < 1 || parseResult.mol.chains.some((c) => c.polymerType !== PolymerTypes.PEPTIDE))
|
|
187
|
+
return ui.divText('Unsupported sequence for BILN');
|
|
188
|
+
const sh = this._getSingleHelmDfSh(helm);
|
|
189
|
+
const ta = ui.input.textArea('', {});
|
|
190
|
+
ta.value = sh.getConverter(NOTATION.BILN)(helm);
|
|
191
|
+
ta.input.setAttribute('disabled', 'true');
|
|
192
|
+
ta.input.style.width = '100%';
|
|
193
|
+
return ta.input;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
private _toFastaProvider(helm: string) {
|
|
197
|
+
const parseResult = this.editorAdapter.service.parse(helm);
|
|
198
|
+
if (parseResult.mol.chains.length !== 1 ||
|
|
199
|
+
parseResult.mol.atoms.length !== parseResult.mol.bonds.filter((b) => b.kind !== 'hbond').length + 1
|
|
200
|
+
)
|
|
201
|
+
return ui.divText('Unsupported sequence for FASTA');
|
|
202
|
+
const sh = this._getSingleHelmDfSh(helm);
|
|
203
|
+
const ta = ui.input.textArea('', {});
|
|
204
|
+
ta.value = sh.getConverter(NOTATION.FASTA)(helm);
|
|
205
|
+
ta.input.setAttribute('disabled', 'true');
|
|
206
|
+
ta.input.style.width = '100%';
|
|
207
|
+
return ta.input;
|
|
208
|
+
}
|
|
130
209
|
}
|
package/src/package-api.ts
CHANGED
package/src/package-test.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import * as DG from 'datagrok-api/dg';
|
|
2
2
|
import * as grok from 'datagrok-api/grok';
|
|
3
3
|
|
|
4
|
-
// Do not import anything from JsDrawLite or HelmWebEditor, only to the main Helm package
|
|
5
|
-
// import {JSDraw2ModuleType} from '@datagrok/js-draw-lite/src/types/jsdraw2';
|
|
6
|
-
// import {HelmType, OrgHelmModuleType} from '@datagrok/helm-web-editor/src/types/org-helm';
|
|
7
|
-
|
|
8
4
|
import {runTests, tests, TestContext, initAutoTests as initTests} from '@datagrok-libraries/test/src/test';
|
|
9
5
|
|
|
10
6
|
import './tests/_first-tests';
|
package/src/package.g.ts
CHANGED
|
@@ -43,6 +43,8 @@ export async function propertiesWidget(sequence: DG.SemanticValue) : Promise<any
|
|
|
43
43
|
return await PackageFunctions.propertiesWidget(sequence);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
//name: Get Molfiles from HELM
|
|
47
|
+
//description: Convert a column of HELM macromolecules into a column of molfiles
|
|
46
48
|
//input: column col { semType: Macromolecule }
|
|
47
49
|
//output: column result
|
|
48
50
|
export function getMolfiles(col: DG.Column<any>) : any {
|
package/src/package.ts
CHANGED
|
@@ -186,7 +186,10 @@ export class PackageFunctions {
|
|
|
186
186
|
return getPropertiesWidget(sequence);
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
@grok.decorators.func(
|
|
189
|
+
@grok.decorators.func({
|
|
190
|
+
'name': 'Get Molfiles from HELM',
|
|
191
|
+
'description': 'Convert a column of HELM macromolecules into a column of molfiles',
|
|
192
|
+
})
|
|
190
193
|
static getMolfiles(
|
|
191
194
|
@grok.decorators.param({'type': 'column', 'options': {'semType': 'Macromolecule'}}) col: DG.Column<string>): DG.Column<string> {
|
|
192
195
|
const helmStrList = col.toList();
|