@datagrok/bio 2.13.8 → 2.14.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/.eslintrc.json +10 -2
- package/CHANGELOG.md +15 -0
- package/dist/248.js.map +1 -1
- package/dist/package-test.js +6 -6
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +3 -3
- package/dist/package.js.map +1 -1
- package/files/monomer-sets/monomer-set-PEPTIDE.json +93 -0
- package/files/monomer-sets/monomer-set-RNA.json +29 -0
- package/files/schemas/monomer-set-schema.json +48 -0
- package/package.json +5 -5
- package/src/analysis/sequence-similarity-viewer.ts +5 -2
- package/src/demo/bio01-similarity-diversity.ts +3 -2
- package/src/demo/bio01b-hierarchical-clustering-and-activity-cliffs.ts +1 -1
- package/src/package.ts +12 -7
- package/src/tests/activity-cliffs-tests.ts +2 -2
- package/src/tests/detectors-tests.ts +14 -7
- package/src/tests/monomer-libraries-tests.ts +6 -6
- package/src/tests/renderers-monomer-placer-tests.ts +2 -2
- package/src/tests/scoring.ts +2 -2
- package/src/tests/substructure-filters-tests.ts +2 -2
- package/src/tests/to-atomic-level-tests.ts +3 -3
- package/src/utils/helm-to-molfile/converter/converter.ts +1 -1
- package/src/utils/monomer-lib/lib-manager.ts +118 -21
- package/src/utils/monomer-lib/library-file-manager/event-manager.ts +25 -8
- package/src/utils/monomer-lib/library-file-manager/file-manager.ts +122 -35
- package/src/utils/monomer-lib/library-file-manager/ui.ts +1 -1
- package/src/utils/monomer-lib/monomer-lib.ts +23 -6
- package/src/utils/monomer-lib/monomer-set.ts +61 -0
- package/src/widgets/bio-substructure-filter-helm.ts +2 -2
- package/src/widgets/bio-substructure-filter.ts +19 -14
- package/webpack.config.js +3 -2
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../schemas/monomer-set-schema.json",
|
|
3
|
+
"description": "Amino-acids types",
|
|
4
|
+
"placeholders": {
|
|
5
|
+
"AA:aliphatic": {
|
|
6
|
+
"description": "Aliphatic amino acids",
|
|
7
|
+
"monomerType": "Backbone",
|
|
8
|
+
"polymerType": "PEPTIDE",
|
|
9
|
+
"set": [
|
|
10
|
+
{
|
|
11
|
+
"source": "HELMCoreLibrary.json",
|
|
12
|
+
"symbol": "G",
|
|
13
|
+
"notes": "Glycine"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"source": "HELMCoreLibrary.json",
|
|
17
|
+
"symbol": "A",
|
|
18
|
+
"notes": "Alanine"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"source": "HELMCoreLibrary.json",
|
|
22
|
+
"symbol": "V",
|
|
23
|
+
"notes": "Valine"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"source": "HELMCoreLibrary.json",
|
|
27
|
+
"symbol": "L",
|
|
28
|
+
"notes": "Leucine"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"source": "HELMCoreLibrary.json",
|
|
32
|
+
"symbol": "I",
|
|
33
|
+
"notes": "Isoleucine"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"AA:neutral": {
|
|
38
|
+
"description": "Neutral amino acids",
|
|
39
|
+
"monomerType": "Backbone",
|
|
40
|
+
"polymerType": "PEPTIDE",
|
|
41
|
+
"set": [
|
|
42
|
+
{
|
|
43
|
+
"source": "HELMCoreLibrary.json",
|
|
44
|
+
"symbol": "N",
|
|
45
|
+
"notes": "Asparagine"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"source": "HELMCoreLibrary.json",
|
|
49
|
+
"symbol": "Q",
|
|
50
|
+
"notes": "Glutamine"
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
"AA:acidic": {
|
|
55
|
+
"description": "acidic amino acids",
|
|
56
|
+
"monomerType": "Backbone",
|
|
57
|
+
"polymerType": "PEPTIDE",
|
|
58
|
+
"set": [
|
|
59
|
+
{
|
|
60
|
+
"source": "HELMCoreLibrary.json",
|
|
61
|
+
"symbol": "D",
|
|
62
|
+
"notes": "Aspartic Acid"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"source": "HELMCoreLibrary.json",
|
|
66
|
+
"symbol": "E",
|
|
67
|
+
"notes": "Glutamic Acid"
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
},
|
|
71
|
+
"AA:basic": {
|
|
72
|
+
"description": "basic amino acids",
|
|
73
|
+
"polymerType": "PEPTIDE",
|
|
74
|
+
"set": [
|
|
75
|
+
{
|
|
76
|
+
"source": "HELMCoreLibrary.json",
|
|
77
|
+
"symbol": "H",
|
|
78
|
+
"notes": "Histidine"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"source": "HELMCoreLibrary.json",
|
|
82
|
+
"symbol": "K",
|
|
83
|
+
"notes": "Lysine"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"source": "HELMCoreLibrary.json",
|
|
87
|
+
"symbol": "R",
|
|
88
|
+
"notes": "Arginine"
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../schemas/monomer-set-schema.json",
|
|
3
|
+
"description": "RNA sugar types",
|
|
4
|
+
"placeholders": {
|
|
5
|
+
"r:pentose": {
|
|
6
|
+
"description": "Five-carbon sugars in ribonucleic acids backbone",
|
|
7
|
+
"monomerType": "Backbone",
|
|
8
|
+
"polymerType": "RNA",
|
|
9
|
+
"set": [
|
|
10
|
+
{
|
|
11
|
+
"source": "HELMCoreLibrary.json",
|
|
12
|
+
"symbol": "r",
|
|
13
|
+
"notes": "ribose"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"source": "HELMCoreLibrary.json",
|
|
17
|
+
"symbol": "d",
|
|
18
|
+
"notes": "deoxyribose"
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"r:hexose": {
|
|
23
|
+
"description": "Six-carbon sugars in ribonucleic acids backbone",
|
|
24
|
+
"monomerType": "Backbone",
|
|
25
|
+
"polymerType": "RNA",
|
|
26
|
+
"set": []
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"description": "Monomer Sets JSON Schema v1 for combinatorial libraries",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"properties": {
|
|
6
|
+
"description": {
|
|
7
|
+
"type": "string"
|
|
8
|
+
},
|
|
9
|
+
"placeholders": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"additionalProperties": {
|
|
12
|
+
"type": "object",
|
|
13
|
+
"properties": {
|
|
14
|
+
"description": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"monomerType": {
|
|
18
|
+
"enum": ["Backbone", "Branch", "Terminal"]
|
|
19
|
+
},
|
|
20
|
+
"polymerType": {
|
|
21
|
+
"enum": ["PEPTIDE", "RNA"]
|
|
22
|
+
},
|
|
23
|
+
"set": {
|
|
24
|
+
"type": "array",
|
|
25
|
+
"items": {
|
|
26
|
+
"type": "object",
|
|
27
|
+
"description": "Link to a monomer of a monomer library",
|
|
28
|
+
"required": ["source", "symbol"],
|
|
29
|
+
"properties": {
|
|
30
|
+
"source": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "Monomer library name, path."
|
|
33
|
+
},
|
|
34
|
+
"symbol": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "Monomer symbol from the library"
|
|
37
|
+
},
|
|
38
|
+
"notes": {
|
|
39
|
+
"type": "string"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "Aleksandr Tanas",
|
|
6
6
|
"email": "atanas@datagrok.ai"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.
|
|
8
|
+
"version": "2.14.2",
|
|
9
9
|
"description": "Bioinformatics support (import/export of sequences, conversion, visualization, analysis). [See more](https://github.com/datagrok-ai/public/blob/master/packages/Bio/README.md) for details.",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@biowasm/aioli": "^3.1.0",
|
|
40
|
-
"@datagrok-libraries/bio": "^5.42.
|
|
40
|
+
"@datagrok-libraries/bio": "^5.42.9",
|
|
41
41
|
"@datagrok-libraries/chem-meta": "^1.2.5",
|
|
42
42
|
"@datagrok-libraries/math": "^1.1.12",
|
|
43
|
-
"@datagrok-libraries/ml": "^6.6.
|
|
43
|
+
"@datagrok-libraries/ml": "^6.6.19",
|
|
44
44
|
"@datagrok-libraries/tutorials": "^1.3.13",
|
|
45
45
|
"@datagrok-libraries/utils": "^4.2.22",
|
|
46
46
|
"@webgpu/types": "^0.1.40",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"wu": "latest"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@datagrok-libraries/helm-web-editor": "^1.1.
|
|
62
|
-
"@datagrok-libraries/js-draw-lite": "^0.0.
|
|
61
|
+
"@datagrok-libraries/helm-web-editor": "^1.1.8",
|
|
62
|
+
"@datagrok-libraries/js-draw-lite": "^0.0.6",
|
|
63
63
|
"@datagrok/chem": "^1.9.2",
|
|
64
64
|
"@datagrok/dendrogram": "^1.2.29",
|
|
65
65
|
"@datagrok/helm": "^2.2.1",
|
|
@@ -30,12 +30,14 @@ export class SequenceSimilarityViewer extends SequenceSearchBaseViewer {
|
|
|
30
30
|
mmDistanceMatrix: Float32Array;
|
|
31
31
|
knn?: KnnResult;
|
|
32
32
|
kPrevNeighbors: number = 0;
|
|
33
|
+
demo?: boolean;
|
|
33
34
|
|
|
34
|
-
constructor() {
|
|
35
|
+
constructor(demo?: boolean) {
|
|
35
36
|
super('similarity');
|
|
36
37
|
this.cutoff = this.float('cutoff', 0.01, {min: 0, max: 1});
|
|
37
38
|
this.hotSearch = this.bool('hotSearch', true);
|
|
38
39
|
this.similarColumnLabel = this.string('similarColumnLabel', null);
|
|
40
|
+
this.demo = demo;
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
init(): void {
|
|
@@ -70,7 +72,8 @@ export class SequenceSimilarityViewer extends SequenceSearchBaseViewer {
|
|
|
70
72
|
const targetMolRow = this.idxs?.getRawData().findIndex((it) => it == this.targetMoleculeIdx);
|
|
71
73
|
const targetScoreCell = grid.cell('score', targetMolRow!);
|
|
72
74
|
targetScoreCell.cell.value = null;
|
|
73
|
-
(grok.shell.
|
|
75
|
+
const view = this.demo ? (grok.shell.view('Browse')! as DG.BrowseView)!.preview! as DG.TableView : grok.shell.v as DG.TableView;
|
|
76
|
+
view.grid.root.addEventListener('click', (_event: MouseEvent) => {
|
|
74
77
|
this.gridSelect = false;
|
|
75
78
|
});
|
|
76
79
|
updateDivInnerHTML(this.root, grid.root);
|
|
@@ -37,10 +37,11 @@ export async function demoBio01UI() {
|
|
|
37
37
|
delay: 2000,
|
|
38
38
|
})
|
|
39
39
|
.step('Find the most similar sequences to the current one', async () => {
|
|
40
|
-
const simViewer =
|
|
40
|
+
const simViewer = new SequenceSimilarityViewer(true);
|
|
41
|
+
view.addViewer(simViewer, {
|
|
41
42
|
moleculeColumnName: 'sequence',
|
|
42
43
|
similarColumnLabel: 'Similar to current',
|
|
43
|
-
})
|
|
44
|
+
});
|
|
44
45
|
view.dockManager.dock(simViewer, DG.DOCK_TYPE.RIGHT, null, 'Similarity search', 0.35);
|
|
45
46
|
}, {
|
|
46
47
|
description: `Add 'Sequence Similarity Search' viewer.`,
|
|
@@ -53,7 +53,7 @@ export async function demoBio01bUI() {
|
|
|
53
53
|
const seqEncodingFunc = DG.Func.find({name: 'macromoleculePreprocessingFunction', package: 'Bio'})[0];
|
|
54
54
|
activityCliffsViewer = (await activityCliffs(
|
|
55
55
|
df, df.getCol('Sequence'), df.getCol('Activity'),
|
|
56
|
-
80, dimRedMethod, MmDistanceFunctionsNames.LEVENSHTEIN, seqEncodingFunc, {})) as DG.ScatterPlotViewer;
|
|
56
|
+
80, dimRedMethod, MmDistanceFunctionsNames.LEVENSHTEIN, seqEncodingFunc, {}, true)) as DG.ScatterPlotViewer;
|
|
57
57
|
view.dockManager.dock(activityCliffsViewer, DG.DOCK_TYPE.RIGHT, null, 'Activity Cliffs', 0.35);
|
|
58
58
|
|
|
59
59
|
// Show grid viewer with the cliffs
|
package/src/package.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {MmDistanceFunctionsNames} from '@datagrok-libraries/ml/src/macromolecule
|
|
|
11
11
|
import {BitArrayMetrics, KnownMetrics} from '@datagrok-libraries/ml/src/typed-metrics';
|
|
12
12
|
import {NOTATION, TAGS as bioTAGS} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
13
13
|
import {SeqHandler, SeqTemps} from '@datagrok-libraries/bio/src/utils/seq-handler';
|
|
14
|
-
import {IMonomerLib} from '@datagrok-libraries/bio/src/types';
|
|
14
|
+
import {IMonomerLib, IMonomerSet} from '@datagrok-libraries/bio/src/types';
|
|
15
15
|
import {SeqPalette} from '@datagrok-libraries/bio/src/seq-palettes';
|
|
16
16
|
import {FastaFileHandler} from '@datagrok-libraries/bio/src/utils/fasta-handler';
|
|
17
17
|
import {_toAtomicLevel} from '@datagrok-libraries/bio/src/monomer-works/to-atomic-level';
|
|
@@ -78,9 +78,9 @@ import {CyclizedNotationProvider} from './utils/cyclized';
|
|
|
78
78
|
import {getMolColumnFromHelm} from './utils/helm-to-molfile/utils';
|
|
79
79
|
import {PackageSettingsEditorWidget} from './widgets/package-settings-editor-widget';
|
|
80
80
|
import {getUserLibSettings, setUserLibSettings} from '@datagrok-libraries/bio/src/monomer-works/lib-settings';
|
|
81
|
-
import {
|
|
81
|
+
import {calculateScoresWithEmptyValues} from './utils/calculate-scores';
|
|
82
82
|
|
|
83
|
-
export const _package = new BioPackage();
|
|
83
|
+
export const _package = new BioPackage(/*{debug: true}/**/);
|
|
84
84
|
|
|
85
85
|
// /** Avoid reassigning {@link monomerLib} because consumers subscribe to {@link IMonomerLib.onChanged} event */
|
|
86
86
|
// let monomerLib: MonomerLib | null = null;
|
|
@@ -107,6 +107,7 @@ export class SeqPaletteCustom implements SeqPalette {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
let monomerLib: IMonomerLib | null = null;
|
|
110
|
+
let monomerSets: IMonomerSet | null = null;
|
|
110
111
|
|
|
111
112
|
//tags: init
|
|
112
113
|
export async function initBio() {
|
|
@@ -123,8 +124,9 @@ export async function initBio() {
|
|
|
123
124
|
libSettings.explicit = [];
|
|
124
125
|
await setUserLibSettings(libSettings);
|
|
125
126
|
}
|
|
126
|
-
await monomerLibManager.
|
|
127
|
-
monomerLib = monomerLibManager.
|
|
127
|
+
await Promise.all([monomerLibManager.loadMonomerLib(), monomerLibManager.loadMonomerSets()]);
|
|
128
|
+
monomerLib = monomerLibManager.getMonomerLib();
|
|
129
|
+
monomerSets = monomerLibManager.getMonomerSets();
|
|
128
130
|
})(),
|
|
129
131
|
(async () => {
|
|
130
132
|
const pkgProps = await _package.getProperties();
|
|
@@ -438,12 +440,13 @@ export async function getRegionTopMenu(
|
|
|
438
440
|
//input: string similarityMetric { choices:["Hamming", "Levenshtein", "Monomer chemical distance"] }
|
|
439
441
|
//input: func preprocessingFunction
|
|
440
442
|
//input: object options {optional: true}
|
|
443
|
+
//input: bool demo {optional: true}
|
|
441
444
|
//output: viewer result
|
|
442
445
|
//editor: Bio:SeqActivityCliffsEditor
|
|
443
446
|
export async function activityCliffs(table: DG.DataFrame, molecules: DG.Column<string>, activities: DG.Column,
|
|
444
447
|
similarity: number, methodName: DimReductionMethods,
|
|
445
448
|
similarityMetric: MmDistanceFunctionsNames | BitArrayMetrics, preprocessingFunction: DG.Func,
|
|
446
|
-
options?: (IUMAPOptions | ITSNEOptions) & Options): Promise<DG.Viewer | undefined> {
|
|
449
|
+
options?: (IUMAPOptions | ITSNEOptions) & Options, demo?: boolean): Promise<DG.Viewer | undefined> {
|
|
447
450
|
if (!checkInputColumnUI(molecules, 'Activity Cliffs'))
|
|
448
451
|
return;
|
|
449
452
|
const axesNames = getEmbeddingColsNames(table);
|
|
@@ -473,6 +476,8 @@ export async function activityCliffs(table: DG.DataFrame, molecules: DG.Column<s
|
|
|
473
476
|
createTooltipElement,
|
|
474
477
|
createPropPanelElement,
|
|
475
478
|
createLinesGrid,
|
|
479
|
+
undefined,
|
|
480
|
+
demo
|
|
476
481
|
);
|
|
477
482
|
return sp;
|
|
478
483
|
};
|
|
@@ -595,7 +600,7 @@ export async function sequenceSpaceTopMenu(table: DG.DataFrame, molecules: DG.Co
|
|
|
595
600
|
export async function toAtomicLevel(table: DG.DataFrame, seqCol: DG.Column, nonlinear: boolean): Promise<void> {
|
|
596
601
|
const pi = DG.TaskBarProgressIndicator.create('Converting to atomic level ...');
|
|
597
602
|
try {
|
|
598
|
-
const monomerLib = (await getMonomerLibHelper()).
|
|
603
|
+
const monomerLib = (await getMonomerLibHelper()).getMonomerLib();
|
|
599
604
|
await sequenceToMolfile(table, seqCol, nonlinear, monomerLib);
|
|
600
605
|
} finally {
|
|
601
606
|
pi.close();
|
|
@@ -36,7 +36,7 @@ category('activityCliffs', async () => {
|
|
|
36
36
|
|
|
37
37
|
// Test 'helm' requires default monomer library loaded
|
|
38
38
|
await setUserLibSettingsForTests();
|
|
39
|
-
await monomerLibHelper.
|
|
39
|
+
await monomerLibHelper.loadMonomerLib(true); // load default libraries
|
|
40
40
|
|
|
41
41
|
viewList = [];
|
|
42
42
|
dfList = [];
|
|
@@ -48,7 +48,7 @@ category('activityCliffs', async () => {
|
|
|
48
48
|
|
|
49
49
|
// UserDataStorage.put() replaces existing data
|
|
50
50
|
await setUserLibSettings(userLibSettings);
|
|
51
|
-
await monomerLibHelper.
|
|
51
|
+
await monomerLibHelper.loadMonomerLib(true); // load user settings libraries
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
test('activityCliffsOpens', async () => {
|
|
@@ -99,6 +99,13 @@ C1CCCCC1
|
|
|
99
99
|
CCCCCC`,
|
|
100
100
|
neg: ['col1'],
|
|
101
101
|
},
|
|
102
|
+
'negSmilesWithSquareBrackets': {
|
|
103
|
+
csv: `col1
|
|
104
|
+
Cl.c1ccc2nc3ccccc3cc2c1
|
|
105
|
+
Oc1cccc2cc3ccccc3cc12
|
|
106
|
+
[SeH]c1ccc2ccccc2c1`,
|
|
107
|
+
neg: ['col1'],
|
|
108
|
+
},
|
|
102
109
|
'negFastaUnSingleChar': {
|
|
103
110
|
csv: `col1
|
|
104
111
|
Alanine
|
|
@@ -247,7 +254,7 @@ MWRSWY-CKHPMWRSWY-CKHP`;
|
|
|
247
254
|
peptidesComplex = 'peptidesComplex',
|
|
248
255
|
peptidesSimple = 'peptidesSimple',
|
|
249
256
|
fastaCsv = 'fastaCsv',
|
|
250
|
-
fastaFasta = 'fastaFasta',
|
|
257
|
+
// fastaFasta = 'fastaFasta',
|
|
251
258
|
fastaPtCsv = 'fastaPtCsv',
|
|
252
259
|
msaComplex = 'msaComplex',
|
|
253
260
|
helmCsv = 'helmCsv',
|
|
@@ -268,7 +275,7 @@ MWRSWY-CKHPMWRSWY-CKHP`;
|
|
|
268
275
|
}
|
|
269
276
|
|
|
270
277
|
const samples: { [key: string]: string } = {
|
|
271
|
-
[Samples.fastaFasta]: 'System:AppData/Bio/samples/FASTA.fasta',
|
|
278
|
+
// [Samples.fastaFasta]: 'System:AppData/Bio/samples/FASTA.fasta',
|
|
272
279
|
[Samples.fastaPtCsv]: 'System:AppData/Bio/samples/FASTA_PT.csv',
|
|
273
280
|
[Samples.msaComplex]: 'System:AppData/Bio/samples/MSA.csv',
|
|
274
281
|
[Samples.fastaCsv]: 'System:AppData/Bio/samples/FASTA.csv',
|
|
@@ -408,11 +415,11 @@ MWRSWY-CKHPMWRSWY-CKHP`;
|
|
|
408
415
|
});
|
|
409
416
|
});
|
|
410
417
|
|
|
411
|
-
test('samplesFastaFasta', async () => {
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
});
|
|
418
|
+
// test('samplesFastaFasta', async () => {
|
|
419
|
+
// await _testDf(readSamples(Samples.fastaFasta), {
|
|
420
|
+
// 'sequence': new PosCol(NOTATION.FASTA, ALIGNMENT.SEQ, ALPHABET.PT, 20, false),
|
|
421
|
+
// });
|
|
422
|
+
// });
|
|
416
423
|
|
|
417
424
|
// peptidesComplex contains monomers with spaces in AlignedSequence columns, which are forbidden
|
|
418
425
|
// test('samplesPeptidesComplexPositiveAlignedSequence', async () => {
|
|
@@ -27,19 +27,19 @@ category('monomerLibraries', () => {
|
|
|
27
27
|
test('default', async () => {
|
|
28
28
|
// Clear settings to test default
|
|
29
29
|
await setUserLibSettings({exclude: [], explicit: []});
|
|
30
|
-
await monomerLibHelper.
|
|
30
|
+
await monomerLibHelper.loadMonomerLib(true); // test defaultLib
|
|
31
31
|
|
|
32
32
|
// Currently default monomer lib set is of all files at LIB_PATH (at least HELMCoreLibrary.json)
|
|
33
|
-
const currentMonomerLib = monomerLibHelper.
|
|
33
|
+
const currentMonomerLib = monomerLibHelper.getMonomerLib();
|
|
34
34
|
expect(currentMonomerLib.getPolymerTypes().length > 0, true);
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
test('forTests', async () => {
|
|
38
38
|
await setUserLibSettingsForTests();
|
|
39
|
-
await monomerLibHelper.
|
|
39
|
+
await monomerLibHelper.loadMonomerLib(true); // test defaultLib
|
|
40
40
|
|
|
41
41
|
// Currently default monomer lib set is of all files at LIB_PATH (at least HELMCoreLibrary.json)
|
|
42
|
-
const currentMonomerLib = monomerLibHelper.
|
|
42
|
+
const currentMonomerLib = monomerLibHelper.getMonomerLib();
|
|
43
43
|
// HELMCoreLibrary.json checks
|
|
44
44
|
expect(currentMonomerLib.getPolymerTypes().length, 2);
|
|
45
45
|
expect(currentMonomerLib.getMonomerSymbolsByType('PEPTIDE').length, 322);
|
|
@@ -59,8 +59,8 @@ category('monomerLibraries', () => {
|
|
|
59
59
|
libSettings.explicit = [];
|
|
60
60
|
await setUserLibSettings(libSettings);
|
|
61
61
|
|
|
62
|
-
await monomerLibHelper.
|
|
63
|
-
const currentMonomerLib = monomerLibHelper.
|
|
62
|
+
await monomerLibHelper.loadMonomerLib(true);
|
|
63
|
+
const currentMonomerLib = monomerLibHelper.getMonomerLib();
|
|
64
64
|
const polymerTypes = currentMonomerLib.getPolymerTypes();
|
|
65
65
|
expect(polymerTypes.length === 0, true);
|
|
66
66
|
});
|
|
@@ -26,12 +26,12 @@ category('renderers: monomerPlacer', () => {
|
|
|
26
26
|
|
|
27
27
|
await setUserLibSettingsForTests();
|
|
28
28
|
await libHelper.awaitLoaded();
|
|
29
|
-
await libHelper.
|
|
29
|
+
await libHelper.loadMonomerLib(true);
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
after(async () => {
|
|
33
33
|
await setUserLibSettings(libSettings);
|
|
34
|
-
await libHelper.
|
|
34
|
+
await libHelper.loadMonomerLib(true);
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
const tests = {
|
package/src/tests/scoring.ts
CHANGED
|
@@ -42,13 +42,13 @@ PEPTIDE1{[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[1Nal].[
|
|
|
42
42
|
userLibSettings = await getUserLibSettings();
|
|
43
43
|
|
|
44
44
|
await setUserLibSettingsForTests();
|
|
45
|
-
await monomerLibHelper.
|
|
45
|
+
await monomerLibHelper.loadMonomerLib(true); // load default libraries
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
after(async () => {
|
|
49
49
|
// UserDataStorage.put() replaces existing data
|
|
50
50
|
await setUserLibSettings(userLibSettings);
|
|
51
|
-
await monomerLibHelper.
|
|
51
|
+
await monomerLibHelper.loadMonomerLib(true); // load user settings libraries
|
|
52
52
|
});
|
|
53
53
|
|
|
54
54
|
test('Identity', async () => {
|
|
@@ -37,13 +37,13 @@ category('bio-substructure-filters', async () => {
|
|
|
37
37
|
|
|
38
38
|
// Test 'helm' requires default monomer library loaded
|
|
39
39
|
await setUserLibSettingsForTests();
|
|
40
|
-
await monomerLibHelper.
|
|
40
|
+
await monomerLibHelper.loadMonomerLib(true); // load default libraries
|
|
41
41
|
});
|
|
42
42
|
|
|
43
43
|
after(async () => {
|
|
44
44
|
// UserDataStorage.put() replaces existing data
|
|
45
45
|
await setUserLibSettings(userLibSettings);
|
|
46
|
-
await monomerLibHelper.
|
|
46
|
+
await monomerLibHelper.loadMonomerLib(true); // load user settings libraries
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
test('fasta', async () => {
|
|
@@ -64,7 +64,7 @@ category('toAtomicLevel', async () => {
|
|
|
64
64
|
userLibSettings = await getUserLibSettings();
|
|
65
65
|
// Clear settings to test default
|
|
66
66
|
await setUserLibSettingsForTests();
|
|
67
|
-
await monomerLibHelper.
|
|
67
|
+
await monomerLibHelper.loadMonomerLib(true);
|
|
68
68
|
|
|
69
69
|
for (const [testName, testData] of Object.entries(TestsData)) {
|
|
70
70
|
const inputPath = testData.inPath;
|
|
@@ -77,7 +77,7 @@ category('toAtomicLevel', async () => {
|
|
|
77
77
|
|
|
78
78
|
after(async () => {
|
|
79
79
|
await setUserLibSettings(userLibSettings);
|
|
80
|
-
await monomerLibHelper.
|
|
80
|
+
await monomerLibHelper.loadMonomerLib(true);
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
async function getTestResult(source: DG.DataFrame, target: DG.DataFrame): Promise<void> {
|
|
@@ -217,7 +217,7 @@ async function _testToAtomicLevel(
|
|
|
217
217
|
df: DG.DataFrame, seqColName: string = 'seq', monomerLibHelper: IMonomerLibHelper
|
|
218
218
|
): Promise<DG.Column | null> {
|
|
219
219
|
const seqCol: DG.Column<string> = df.getCol(seqColName);
|
|
220
|
-
const monomerLib: IMonomerLib = monomerLibHelper.
|
|
220
|
+
const monomerLib: IMonomerLib = monomerLibHelper.getMonomerLib();
|
|
221
221
|
const res = await _toAtomicLevel(df, seqCol, monomerLib);
|
|
222
222
|
if (res.warnings.length > 0)
|
|
223
223
|
_package.logger.warning(`_toAtomicLevel() warnings ${res.warnings.join('\n')}`);
|
|
@@ -84,7 +84,7 @@ export class HelmToMolfileConverter {
|
|
|
84
84
|
private async convertToMolfileV3KColumn(): Promise<DG.Column<string>> {
|
|
85
85
|
const polymerGraphColumn: DG.Column<string> = await this.getPolymerGraphColumn();
|
|
86
86
|
const rdKitModule = await grok.functions.call('Chem:getRdKitModule');
|
|
87
|
-
const monomerLib: IMonomerLib = (await getMonomerLibHelper()).
|
|
87
|
+
const monomerLib: IMonomerLib = (await getMonomerLibHelper()).getMonomerLib();
|
|
88
88
|
const molfileList = polymerGraphColumn.toList().map(
|
|
89
89
|
(pseudoMolfile: string, idx: number) => {
|
|
90
90
|
const helm = this.helmColumn.get(idx);
|