@datagrok/bio 2.4.25 → 2.4.28
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/css/msa.css +6 -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 +1 -1
- package/scripts/sequence_generator.py +2 -2
- package/src/demo/bio03-atomic-level.ts +6 -5
- package/src/demo/bio05-helm-msa-sequence-space.ts +1 -0
- package/src/package.ts +11 -10
- package/src/tests/renderers-test.ts +1 -1
- package/src/tests/splitters-test.ts +4 -7
- package/src/utils/constants.ts +16 -0
- package/src/utils/multiple-sequence-alignment-ui.ts +73 -38
- package/src/utils/multiple-sequence-alignment.ts +13 -3
- package/src/utils/types.ts +7 -1
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "Leonid Stolbov",
|
|
6
6
|
"email": "lstolbov@datagrok.ai"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.4.
|
|
8
|
+
"version": "2.4.28",
|
|
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",
|
|
@@ -151,8 +151,8 @@ def generate_sequences(
|
|
|
151
151
|
motif_length = mean_range(average_motif_length, dispersion)
|
|
152
152
|
|
|
153
153
|
# sys.stderr.write(f"Cluster {n_cluster:2} motif template: {motif_notation(motif_template)}\n")
|
|
154
|
-
total_length = mean_range(average_random_length * 2,
|
|
155
|
-
prefix_length = mean_range(average_random_length,
|
|
154
|
+
total_length = mean_range(average_random_length * 2, dispersion) + motif_length
|
|
155
|
+
prefix_length = mean_range(average_random_length, dispersion // 2)
|
|
156
156
|
suffix_length = total_length - motif_length - prefix_length
|
|
157
157
|
sys.stderr.write(f"Generating sequences for cluster {n_cluster}\n")
|
|
158
158
|
for n_seq, seq, activity, is_cliff in generate_cluster(
|
|
@@ -9,9 +9,10 @@ import {handleError} from './utils';
|
|
|
9
9
|
import {DemoScript} from '@datagrok-libraries/tutorials/src/demo-script';
|
|
10
10
|
import {delay} from '@datagrok-libraries/utils/src/test';
|
|
11
11
|
|
|
12
|
-
const dataFn: string = 'samples/sample_FASTA.csv';
|
|
13
|
-
|
|
14
12
|
export async function demoBio03UI(): Promise<void> {
|
|
13
|
+
const dataFn: string = 'samples/sample_HELM.csv';
|
|
14
|
+
const seqColName = 'HELM';
|
|
15
|
+
|
|
15
16
|
let df: DG.DataFrame;
|
|
16
17
|
let view: DG.TableView;
|
|
17
18
|
let dlg: DG.Dialog;
|
|
@@ -29,21 +30,21 @@ export async function demoBio03UI(): Promise<void> {
|
|
|
29
30
|
view = grok.shell.addTableView(df);
|
|
30
31
|
for (let colI: number = 0; colI < view.grid.columns.length; colI++) {
|
|
31
32
|
const gCol: DG.GridColumn = view.grid.columns.byIndex(colI)!;
|
|
32
|
-
if (!([
|
|
33
|
+
if (!([seqColName, 'Activity'].includes(gCol.name))) gCol.visible = false;
|
|
33
34
|
}
|
|
34
35
|
}, {
|
|
35
36
|
description: `Load dataset with macromolecules of 'fasta' notation, 'PT' alphabet (protein, aminoacids).`,
|
|
36
37
|
delay: 2000,
|
|
37
38
|
})
|
|
38
39
|
.step('To atomic level', async () => {
|
|
39
|
-
const seqCol = df.getCol(
|
|
40
|
+
const seqCol = df.getCol(seqColName);
|
|
40
41
|
await toAtomicLevel(df, seqCol);
|
|
41
42
|
}, {
|
|
42
43
|
description: 'Get atomic level structures of Macromolecules.',
|
|
43
44
|
delay: 2000,
|
|
44
45
|
})
|
|
45
46
|
.step('Sketcher', async () => {
|
|
46
|
-
const molColName: string =
|
|
47
|
+
const molColName: string = `molfile(${seqColName})`;
|
|
47
48
|
df.currentCell = df.cell(1, molColName);
|
|
48
49
|
const mol: string = df.currentCell.value;
|
|
49
50
|
|
|
@@ -61,6 +61,7 @@ export async function demoBio05UI(): Promise<void> {
|
|
|
61
61
|
.step('Analyse sequence composition', async () => {
|
|
62
62
|
wlViewer = await df.plot.fromType('WebLogo', {
|
|
63
63
|
sequenceColumnName: msaHelmColName,
|
|
64
|
+
positionWidth: 40,
|
|
64
65
|
maxHeight: 50,
|
|
65
66
|
}) as DG.Viewer & IWebLogoViewer;
|
|
66
67
|
view.dockManager.dock(wlViewer, DG.DOCK_TYPE.DOWN, null, 'Composition analysis', 0.2);
|
package/src/package.ts
CHANGED
|
@@ -506,16 +506,17 @@ export async function sdfToJsonLib(table: DG.DataFrame) {
|
|
|
506
506
|
const jsonMonomerLibrary = createJsonMonomerLibFromSdf(table);
|
|
507
507
|
}
|
|
508
508
|
|
|
509
|
-
//
|
|
510
|
-
//
|
|
511
|
-
//
|
|
512
|
-
//
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
509
|
+
// 2023-05-17 Representations does not work at BioIT
|
|
510
|
+
// //name: Representations
|
|
511
|
+
// //tags: panel, widgets
|
|
512
|
+
// //input: cell macroMolecule {semType: Macromolecule}
|
|
513
|
+
// //output: widget result
|
|
514
|
+
// export async function peptideMolecule(macroMolecule: DG.Cell): Promise<DG.Widget> {
|
|
515
|
+
// const monomersLibFile = await _package.files.readAsText(HELM_CORE_LIB_FILENAME);
|
|
516
|
+
// const monomersLibObject: any[] = JSON.parse(monomersLibFile);
|
|
517
|
+
//
|
|
518
|
+
// return representationsWidget(macroMolecule, monomersLibObject);
|
|
519
|
+
// }
|
|
519
520
|
|
|
520
521
|
//name: importFasta
|
|
521
522
|
//description: Opens FASTA file
|
|
@@ -2,9 +2,9 @@ import * as grok from 'datagrok-api/grok';
|
|
|
2
2
|
import * as ui from 'datagrok-api/ui';
|
|
3
3
|
import * as DG from 'datagrok-api/dg';
|
|
4
4
|
|
|
5
|
-
import {after, before, category, test, expect, expectArray, expectObject} from '@datagrok-libraries/utils/src/test';
|
|
5
|
+
import {after, before, category, test, expect, expectArray, expectObject, delay} from '@datagrok-libraries/utils/src/test';
|
|
6
6
|
import * as C from '../utils/constants';
|
|
7
|
-
import {
|
|
7
|
+
import {_package, getHelmMonomers} from '../package';
|
|
8
8
|
import {errorToConsole} from '@datagrok-libraries/utils/src/to-console';
|
|
9
9
|
import {TAGS as bioTAGS, splitterAsFasta, splitterAsHelm} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
10
10
|
|
|
@@ -89,12 +89,9 @@ category('splitters', () => {
|
|
|
89
89
|
// call to calculate 'cell.renderer' tag
|
|
90
90
|
await grok.data.detectSemanticTypes(df);
|
|
91
91
|
|
|
92
|
-
|
|
93
|
-
tvList.push(tv);
|
|
94
|
-
|
|
95
|
-
splitToMonomers();
|
|
92
|
+
await grok.functions.call('Bio:splitToMonomers');
|
|
96
93
|
expect(df.columns.names().includes('17'), true);
|
|
97
|
-
}
|
|
94
|
+
});
|
|
98
95
|
|
|
99
96
|
test('getHelmMonomers', async () => {
|
|
100
97
|
const df: DG.DataFrame = DG.DataFrame.fromCsv(
|
package/src/utils/constants.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import {pepseaMethods} from './pepsea';
|
|
2
|
+
|
|
1
3
|
export enum COLUMNS_NAMES {
|
|
2
4
|
SPLIT_COL = '~split',
|
|
3
5
|
ACTIVITY = '~activity',
|
|
@@ -59,3 +61,17 @@ export namespace PEPSEA {
|
|
|
59
61
|
export const SEPARATOR = '.';
|
|
60
62
|
}
|
|
61
63
|
|
|
64
|
+
export const kalignVersion = '3.3.1';
|
|
65
|
+
|
|
66
|
+
export const msaDefaultOptions = {
|
|
67
|
+
pepsea: {
|
|
68
|
+
gapOpen: 1.53,
|
|
69
|
+
gapExtend: 0,
|
|
70
|
+
method: pepseaMethods[0],
|
|
71
|
+
},
|
|
72
|
+
kalign: {
|
|
73
|
+
gapOpen: null,
|
|
74
|
+
gapExtend: null,
|
|
75
|
+
terminalGap: null,
|
|
76
|
+
},
|
|
77
|
+
} as const;
|
|
@@ -8,22 +8,24 @@ import {pepseaMethods, runPepsea} from './pepsea';
|
|
|
8
8
|
import {checkInputColumnUI} from './check-input-column';
|
|
9
9
|
import {NotationConverter} from '@datagrok-libraries/bio/src/utils/notation-converter';
|
|
10
10
|
import {_package} from '../package';
|
|
11
|
-
|
|
11
|
+
import {multipleSequenceAlginmentUIOptions} from './types';
|
|
12
|
+
import {kalignVersion, msaDefaultOptions} from './constants';
|
|
13
|
+
import '../../css/msa.css';
|
|
12
14
|
export class MsaWarning extends Error {
|
|
13
15
|
constructor(message: string, options?: ErrorOptions) {
|
|
14
16
|
super(message, options);
|
|
15
17
|
}
|
|
16
18
|
}
|
|
17
|
-
type multipleSequenceAlginmentUIOptions = {col?: DG.Column<string> | null, clustersCol?: DG.Column | null,
|
|
18
|
-
pepsea?: {method?: typeof pepseaMethods[number], gapOpen?: number, gapExtend?: number}};
|
|
19
19
|
|
|
20
|
-
export async function multipleSequenceAlignmentUI(
|
|
20
|
+
export async function multipleSequenceAlignmentUI(
|
|
21
|
+
options: multipleSequenceAlginmentUIOptions = {}
|
|
22
|
+
): Promise<DG.Column> {
|
|
21
23
|
return new Promise(async (resolve, reject) => {
|
|
22
24
|
options.clustersCol ??= null;
|
|
23
25
|
options.pepsea ??= {};
|
|
24
|
-
options.pepsea.method ??=
|
|
25
|
-
options.pepsea.gapOpen ??=
|
|
26
|
-
options.pepsea.gapExtend ??=
|
|
26
|
+
options.pepsea.method ??= msaDefaultOptions.pepsea.method;
|
|
27
|
+
options.pepsea.gapOpen ??= msaDefaultOptions.pepsea.gapOpen;
|
|
28
|
+
options.pepsea.gapExtend ??= msaDefaultOptions.pepsea.gapExtend;
|
|
27
29
|
|
|
28
30
|
const table = options.col?.dataFrame ?? grok.shell.t;
|
|
29
31
|
const seqCol = options.col ?? table.columns.bySemType(DG.SEMTYPE.MACROMOLECULE);
|
|
@@ -33,20 +35,32 @@ export async function multipleSequenceAlignmentUI(options: multipleSequenceAlgin
|
|
|
33
35
|
reject(new MsaWarning(errMsg));
|
|
34
36
|
}
|
|
35
37
|
|
|
36
|
-
// UI
|
|
38
|
+
// UI for PepSea alignment
|
|
37
39
|
const methodInput = ui.choiceInput('Method', options.pepsea.method, pepseaMethods);
|
|
38
40
|
methodInput.setTooltip('Alignment method');
|
|
41
|
+
|
|
42
|
+
// UI for Kalign alignment
|
|
43
|
+
const terminalGapInput = ui.floatInput('Terminal gap', options?.kalign?.terminalGap ?? null);
|
|
44
|
+
terminalGapInput.setTooltip('Penalty for opening a gap at the beginning or end of the sequence');
|
|
45
|
+
const kalignVersionDiv = ui.p(`Kalign version: ${kalignVersion}`, 'kalign-version');
|
|
46
|
+
|
|
47
|
+
// shared UI
|
|
39
48
|
const gapOpenInput = ui.floatInput('Gap open', options.pepsea.gapOpen);
|
|
40
49
|
gapOpenInput.setTooltip('Gap opening penalty at group-to-group alignment');
|
|
41
50
|
const gapExtendInput = ui.floatInput('Gap extend', options.pepsea.gapExtend);
|
|
42
51
|
gapExtendInput.setTooltip('Gap extension penalty to skip the alignment');
|
|
43
|
-
|
|
52
|
+
|
|
53
|
+
const pepseaInputRootStyles: CSSStyleDeclaration[] = [methodInput.root.style];
|
|
54
|
+
const kalignInputRootStyles: CSSStyleDeclaration[] = [terminalGapInput.root.style, kalignVersionDiv.style];
|
|
55
|
+
|
|
44
56
|
let performAlignment: (() => Promise<DG.Column<string>>) | undefined;
|
|
45
57
|
|
|
46
58
|
// TODO: allow only macromolecule colums to be chosen
|
|
47
59
|
const colInput = ui.columnInput('Sequence', table, seqCol, async () => {
|
|
48
60
|
performAlignment = await onColInputChange(
|
|
49
|
-
colInput.value, table,
|
|
61
|
+
colInput.value, table, pepseaInputRootStyles, kalignInputRootStyles,
|
|
62
|
+
methodInput, clustersColInput, gapOpenInput, gapExtendInput, terminalGapInput
|
|
63
|
+
);
|
|
50
64
|
}
|
|
51
65
|
) as DG.InputBase<DG.Column<string>>;
|
|
52
66
|
colInput.setTooltip('Sequences column to use for alignment');
|
|
@@ -56,7 +70,9 @@ export async function multipleSequenceAlignmentUI(options: multipleSequenceAlgin
|
|
|
56
70
|
//if column is specified (from tests), run alignment and resolve with the result
|
|
57
71
|
if (options.col) {
|
|
58
72
|
performAlignment = await onColInputChange(
|
|
59
|
-
options.col, table,
|
|
73
|
+
options.col, table, pepseaInputRootStyles, kalignInputRootStyles,
|
|
74
|
+
methodInput, clustersColInput, gapOpenInput, gapExtendInput, terminalGapInput
|
|
75
|
+
);
|
|
60
76
|
|
|
61
77
|
await onDialogOk(colInput, table, performAlignment, resolve, reject);
|
|
62
78
|
return;
|
|
@@ -67,7 +83,9 @@ export async function multipleSequenceAlignmentUI(options: multipleSequenceAlgin
|
|
|
67
83
|
.add(methodInput)
|
|
68
84
|
.add(gapOpenInput)
|
|
69
85
|
.add(gapExtendInput)
|
|
70
|
-
.
|
|
86
|
+
.add(terminalGapInput)
|
|
87
|
+
.add(kalignVersionDiv)
|
|
88
|
+
.onOK(async () => { await onDialogOk(colInput, table, performAlignment, resolve, reject); })
|
|
71
89
|
.show();
|
|
72
90
|
});
|
|
73
91
|
}
|
|
@@ -106,13 +124,11 @@ async function onDialogOk(
|
|
|
106
124
|
|
|
107
125
|
|
|
108
126
|
async function onColInputChange(
|
|
109
|
-
col: DG.Column<string>,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
gapOpenInput: DG.InputBase<number | null>,
|
|
115
|
-
gapExtendInput: DG.InputBase<number | null>
|
|
127
|
+
col: DG.Column<string>, table: DG.DataFrame,
|
|
128
|
+
pepseaInputRootStyles: CSSStyleDeclaration[], kalignInputRootStyles: CSSStyleDeclaration[],
|
|
129
|
+
methodInput: DG.InputBase<string | null>, clustersColInput: DG.InputBase<DG.Column<any> | null>,
|
|
130
|
+
gapOpenInput: DG.InputBase<number | null>, gapExtendInput: DG.InputBase<number | null>,
|
|
131
|
+
terminalGapInput: DG.InputBase<number | null>
|
|
116
132
|
): Promise<(() => Promise<DG.Column<string>>) | undefined> {
|
|
117
133
|
try {
|
|
118
134
|
if (col.semType !== DG.SEMTYPE.MACROMOLECULE)
|
|
@@ -122,8 +138,10 @@ async function onColInputChange(
|
|
|
122
138
|
if (checkInputColumnUI(col, col.name,
|
|
123
139
|
[NOTATION.FASTA, NOTATION.SEPARATOR], [ALPHABET.DNA, ALPHABET.RNA, ALPHABET.PT], false)
|
|
124
140
|
) { // Kalign - natural alphabets. if the notation is separator, convert to fasta and then run kalign
|
|
125
|
-
|
|
126
|
-
|
|
141
|
+
switchDialog(pepseaInputRootStyles, kalignInputRootStyles, 'kalign');
|
|
142
|
+
gapOpenInput.value = null;
|
|
143
|
+
gapExtendInput.value = null;
|
|
144
|
+
terminalGapInput.value = null;
|
|
127
145
|
const potentialColNC = new NotationConverter(col);
|
|
128
146
|
const performCol: DG.Column<string> = potentialColNC.isFasta() ? col :
|
|
129
147
|
potentialColNC.convert(NOTATION.FASTA);
|
|
@@ -131,28 +149,27 @@ async function onColInputChange(
|
|
|
131
149
|
} else if (checkInputColumnUI(col, col.name,
|
|
132
150
|
[NOTATION.HELM], [], false)
|
|
133
151
|
) { // PepSeA branch - Helm notation or separator notation with unknown alphabets
|
|
134
|
-
|
|
135
|
-
|
|
152
|
+
switchDialog(pepseaInputRootStyles, kalignInputRootStyles, 'pepsea');
|
|
153
|
+
gapOpenInput.value = msaDefaultOptions.pepsea.gapOpen;
|
|
154
|
+
gapExtendInput.value = msaDefaultOptions.pepsea.gapExtend;
|
|
136
155
|
|
|
137
156
|
return async () => await runPepsea(col, unusedName, methodInput.value!,
|
|
138
157
|
gapOpenInput.value!, gapExtendInput.value!, clustersColInput.value);
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
158
|
+
} else if (checkInputColumnUI(col, col.name, [NOTATION.SEPARATOR], [ALPHABET.UN], false)) {
|
|
159
|
+
//if the column is separator with unknown alphabet, it might be helm. check if it can be converted to helm
|
|
160
|
+
const potentialColNC = new NotationConverter(col);
|
|
161
|
+
if (!await potentialColNC.checkHelmCompatibility())
|
|
162
|
+
return;
|
|
163
|
+
const helmCol = potentialColNC.convert(NOTATION.HELM);
|
|
164
|
+
switchDialog(pepseaInputRootStyles, kalignInputRootStyles, 'pepsea');
|
|
165
|
+
gapOpenInput.value = msaDefaultOptions.pepsea.gapOpen;
|
|
166
|
+
gapExtendInput.value = msaDefaultOptions.pepsea.gapExtend;
|
|
167
|
+
// convert to helm and assign alignment function to PepSea
|
|
168
|
+
|
|
169
|
+
return async () => await runPepsea(helmCol, unusedName, methodInput.value!,
|
|
151
170
|
gapOpenInput.value!, gapExtendInput.value!, clustersColInput.value);
|
|
152
171
|
} else {
|
|
153
|
-
|
|
154
|
-
inputRootStyle.display = 'none';
|
|
155
|
-
|
|
172
|
+
switchDialog(pepseaInputRootStyles, kalignInputRootStyles, 'kalign');
|
|
156
173
|
return;
|
|
157
174
|
}
|
|
158
175
|
} catch (err: any) {
|
|
@@ -161,3 +178,21 @@ async function onColInputChange(
|
|
|
161
178
|
_package.logger.error(errMsg);
|
|
162
179
|
}
|
|
163
180
|
}
|
|
181
|
+
|
|
182
|
+
type MSADialogType = 'kalign' | 'pepsea';
|
|
183
|
+
|
|
184
|
+
function switchDialog(
|
|
185
|
+
pepseaInputRootStyles: CSSStyleDeclaration[], kalignInputRootStyles: CSSStyleDeclaration[], dialogType: MSADialogType
|
|
186
|
+
) {
|
|
187
|
+
if (dialogType === 'kalign') {
|
|
188
|
+
for (const inputRootStyle of pepseaInputRootStyles)
|
|
189
|
+
inputRootStyle.display = 'none';
|
|
190
|
+
for (const inputRootStyle of kalignInputRootStyles)
|
|
191
|
+
inputRootStyle.removeProperty('display');
|
|
192
|
+
} else {
|
|
193
|
+
for (const inputRootStyle of kalignInputRootStyles)
|
|
194
|
+
inputRootStyle.display = 'none';
|
|
195
|
+
for (const inputRootStyle of pepseaInputRootStyles)
|
|
196
|
+
inputRootStyle.removeProperty('display');
|
|
197
|
+
}
|
|
198
|
+
}
|
|
@@ -7,6 +7,7 @@ import {ALIGNMENT, TAGS as bioTAGS} from '@datagrok-libraries/bio/src/utils/macr
|
|
|
7
7
|
import Aioli from '@biowasm/aioli';
|
|
8
8
|
|
|
9
9
|
import {AlignedSequenceEncoder} from '@datagrok-libraries/bio/src/sequence-encoder';
|
|
10
|
+
import {kalignVersion} from './constants';
|
|
10
11
|
const fastaInputFilename = 'input.fa';
|
|
11
12
|
const fastaOutputFilename = 'result.fasta';
|
|
12
13
|
|
|
@@ -27,10 +28,14 @@ function _stringsToFasta(sequences: string[]): string {
|
|
|
27
28
|
* @param {boolean} isAligned Whether the column is aligned.
|
|
28
29
|
* @param {string | undefined} unUsedName
|
|
29
30
|
* @param {DG.Column | null} clustersCol Column with clusters.
|
|
31
|
+
* @param {number | undefined} gapOpen Gap open penalty.
|
|
32
|
+
* @param {number | undefined} gapExtend Gap extend penalty.
|
|
33
|
+
* @param {number | undefined} terminalGap Terminal gap penalty.
|
|
30
34
|
* @return {Promise<DG.Column>} Aligned sequences.
|
|
31
35
|
*/
|
|
32
36
|
export async function runKalign(srcCol: DG.Column<string>, isAligned: boolean = false, unUsedName: string = '',
|
|
33
|
-
clustersCol: DG.Column | null = null
|
|
37
|
+
clustersCol: DG.Column | null = null, gapOpen?: number, gapExtend?: number, terminalGap?: number
|
|
38
|
+
): Promise<DG.Column> {
|
|
34
39
|
let sequences: string[] = srcCol.toList();
|
|
35
40
|
|
|
36
41
|
if (isAligned)
|
|
@@ -55,7 +60,7 @@ export async function runKalign(srcCol: DG.Column<string>, isAligned: boolean =
|
|
|
55
60
|
|
|
56
61
|
const CLI = await new Aioli([
|
|
57
62
|
'base/1.0.0',
|
|
58
|
-
{tool: 'kalign', version:
|
|
63
|
+
{tool: 'kalign', version: kalignVersion, reinit: true}
|
|
59
64
|
]);
|
|
60
65
|
const tgtCol = DG.Column.string(unUsedName, sequencesLength);
|
|
61
66
|
|
|
@@ -64,7 +69,12 @@ export async function runKalign(srcCol: DG.Column<string>, isAligned: boolean =
|
|
|
64
69
|
const fasta = _stringsToFasta(clusterSequences);
|
|
65
70
|
|
|
66
71
|
await CLI.fs.writeFile(fastaInputFilename, fasta);
|
|
67
|
-
const
|
|
72
|
+
const gapOpenCommand = `${gapOpen !== undefined ? ` --gpo ${gapOpen}` : ''}`;
|
|
73
|
+
const gapExtendCommand = `${gapExtend !== undefined ? ` --gpe ${gapExtend}` : ''}`;
|
|
74
|
+
const terminalGapCommand = `${terminalGap !== undefined ? ` --tgpe ${terminalGap}` : ''}`;
|
|
75
|
+
const extraParams = `${gapOpenCommand}${gapExtendCommand}${terminalGapCommand}`;
|
|
76
|
+
|
|
77
|
+
const output = await CLI.exec(`kalign ${fastaInputFilename} -f fasta -o ${fastaOutputFilename}${extraParams}`);
|
|
68
78
|
console.warn(output);
|
|
69
79
|
|
|
70
80
|
const buf = await CLI.cat(fastaOutputFilename);
|
package/src/utils/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as DG from 'datagrok-api/dg';
|
|
2
|
-
|
|
2
|
+
import {pepseaMethods} from './pepsea';
|
|
3
3
|
export type DataFrameDict = {[key: string]: DG.DataFrame};
|
|
4
4
|
|
|
5
5
|
export namespace BarChart {
|
|
@@ -11,3 +11,9 @@ export type UTypedArray = Uint8Array | Uint16Array | Uint32Array;
|
|
|
11
11
|
//AAR: (Position: (index: indexList))
|
|
12
12
|
export type SubstitutionsInfo = Map<string, Map<string, Map<number, number[] | UTypedArray>>>;
|
|
13
13
|
export type SelectionObject = {[postiton: string]: string[]};
|
|
14
|
+
|
|
15
|
+
export type multipleSequenceAlginmentUIOptions = {
|
|
16
|
+
col?: DG.Column<string> | null, clustersCol?: DG.Column | null,
|
|
17
|
+
pepsea?: {method?: typeof pepseaMethods[number], gapOpen?: number, gapExtend?: number},
|
|
18
|
+
kalign?: {gapOpen?: number, gapExtend?: number, terminalGap?: number}
|
|
19
|
+
};
|