@datagrok/bio 2.11.18 → 2.11.20
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/detectors.js +2 -2
- 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 +2 -9
- package/src/analysis/sequence-space.ts +4 -4
- package/src/package.ts +5 -3
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "Leonid Stolbov",
|
|
6
6
|
"email": "lstolbov@datagrok.ai"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.11.
|
|
8
|
+
"version": "2.11.20",
|
|
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",
|
|
@@ -30,18 +30,11 @@
|
|
|
30
30
|
"propertyType": "string",
|
|
31
31
|
"defaultValue": ".",
|
|
32
32
|
"nullable": false
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"name": "Debug",
|
|
36
|
-
"propertyType": "string_list",
|
|
37
|
-
"choices": ["detectors", "WebLogo"],
|
|
38
|
-
"defaultValue": [],
|
|
39
|
-
"nullable": false
|
|
40
33
|
}
|
|
41
34
|
],
|
|
42
35
|
"dependencies": {
|
|
43
36
|
"@biowasm/aioli": "^3.1.0",
|
|
44
|
-
"@datagrok-libraries/bio": "^5.39.
|
|
37
|
+
"@datagrok-libraries/bio": "^5.39.14",
|
|
45
38
|
"@datagrok-libraries/chem-meta": "^1.2.1",
|
|
46
39
|
"@datagrok-libraries/ml": "^6.3.67",
|
|
47
40
|
"@datagrok-libraries/tutorials": "^1.3.11",
|
|
@@ -5,7 +5,7 @@ import {ISequenceSpaceParams} from '@datagrok-libraries/ml/src/viewers/activity-
|
|
|
5
5
|
import {invalidateMols, MONOMERIC_COL_TAGS} from '../substructure-search/substructure-search';
|
|
6
6
|
import {mmDistanceFunctionArgs} from '@datagrok-libraries/ml/src/macromolecule-distance-functions/types';
|
|
7
7
|
import {UnitsHandler} from '@datagrok-libraries/bio/src/utils/units-handler';
|
|
8
|
-
import {
|
|
8
|
+
import {getMonomerSubstitutionMatrix} from '@datagrok-libraries/bio/src/monomer-works/monomer-utils';
|
|
9
9
|
import * as grok from 'datagrok-api/grok';
|
|
10
10
|
import {MmDistanceFunctionsNames} from '@datagrok-libraries/ml/src/macromolecule-distance-functions';
|
|
11
11
|
|
|
@@ -56,7 +56,7 @@ export async function sequenceSpaceByFingerprints(spaceParams: ISequenceSpacePar
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
export async function getEncodedSeqSpaceCol(
|
|
59
|
-
seqCol: DG.Column, similarityMetric: BitArrayMetrics | MmDistanceFunctionsNames
|
|
59
|
+
seqCol: DG.Column, similarityMetric: BitArrayMetrics | MmDistanceFunctionsNames, fingerprintType: string = 'Morgan'
|
|
60
60
|
): Promise<{seqList:string[], options: {[_:string]: any}}> {
|
|
61
61
|
// encodes sequences using utf charachters to also support multichar and non fasta sequences
|
|
62
62
|
const ncUH = UnitsHandler.getOrCreate(seqCol);
|
|
@@ -85,7 +85,7 @@ export async function getEncodedSeqSpaceCol(
|
|
|
85
85
|
let options = {};
|
|
86
86
|
if (similarityMetric === MmDistanceFunctionsNames.MONOMER_CHEMICAL_DISTANCE) {
|
|
87
87
|
const monomers = Array.from(charCodeMap.keys());
|
|
88
|
-
const monomerRes = await
|
|
88
|
+
const monomerRes = await getMonomerSubstitutionMatrix(monomers, fingerprintType);
|
|
89
89
|
// the susbstitution matrix contains similarity, but we need distances
|
|
90
90
|
monomerRes.scoringMatrix.forEach((row, i) => {
|
|
91
91
|
row.forEach((val, j) => {
|
|
@@ -101,7 +101,7 @@ export async function getEncodedSeqSpaceCol(
|
|
|
101
101
|
alphabetIndexes: monomerHashToMatrixMap} satisfies mmDistanceFunctionArgs;
|
|
102
102
|
} else if (similarityMetric === MmDistanceFunctionsNames.NEEDLEMANN_WUNSCH) {
|
|
103
103
|
const monomers = Array.from(charCodeMap.keys());
|
|
104
|
-
const monomerRes = await
|
|
104
|
+
const monomerRes = await getMonomerSubstitutionMatrix(monomers, fingerprintType);
|
|
105
105
|
// the susbstitution matrix contains similarity, but we need distances
|
|
106
106
|
// monomerRes.scoringMatrix.forEach((row, i) => {
|
|
107
107
|
// row.forEach((val, j) => {
|
package/src/package.ts
CHANGED
|
@@ -500,11 +500,13 @@ export async function activityCliffs(df: DG.DataFrame, macroMolecule: DG.Column<
|
|
|
500
500
|
//input: string metric
|
|
501
501
|
//input: double gapOpen = 1 {caption: Gap open penalty; default: 1; optional: true}
|
|
502
502
|
//input: double gapExtend = 0.6 {caption: Gap extension penalty; default: 0.6; optional: true}
|
|
503
|
+
// eslint-disable-next-line max-len
|
|
504
|
+
//input: string fingerprintType = Morgan {caption: Fingerprint type; choices: ['Morgan', 'RDKit', 'Pattern']; default: Morgan; optional: true}
|
|
503
505
|
//output: object result
|
|
504
506
|
export async function macromoleculePreprocessingFunction(
|
|
505
|
-
col: DG.Column, metric: MmDistanceFunctionsNames, gapOpen: number = 1, gapExtend: number = 0.6
|
|
506
|
-
): Promise<PreprocessFunctionReturnType> {
|
|
507
|
-
const {seqList, options} = await getEncodedSeqSpaceCol(col, metric);
|
|
507
|
+
col: DG.Column, metric: MmDistanceFunctionsNames, gapOpen: number = 1, gapExtend: number = 0.6,
|
|
508
|
+
fingerprintType = 'Morgan'): Promise<PreprocessFunctionReturnType> {
|
|
509
|
+
const {seqList, options} = await getEncodedSeqSpaceCol(col, metric, fingerprintType);
|
|
508
510
|
return {entries: seqList, options: {...options, gapOpen, gapExtend}};
|
|
509
511
|
}
|
|
510
512
|
|