@datagrok/bio 2.22.11 → 2.23.0
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 +10 -0
- package/detectors.js +14 -0
- package/dist/455.js +1 -1
- package/dist/455.js.map +1 -1
- package/dist/package-test.js +3 -3
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +2 -2
- package/dist/package.js.map +1 -1
- package/dockerfiles/container.json +2 -2
- package/files/samples/BILN.csv +625 -0
- package/files/samples/BILN_W_HELM.csv +5114 -0
- package/package.json +6 -6
- package/src/package-api.ts +11 -0
- package/src/package.g.ts +54 -24
- package/src/package.ts +65 -13
- package/src/tests/biln-tests.ts +167 -0
- package/src/tests/converters-test.ts +14 -0
- package/src/tests/detectors-tests.ts +7 -0
- package/src/tests/renderers-test.ts +1 -1
- package/src/tests/viewers.ts +11 -16
- package/src/utils/biln.ts +69 -0
- package/src/utils/cell-renderer.ts +7 -11
- package/src/utils/convert.ts +3 -2
- package/src/utils/monomer-lib/monomer-manager/monomer-manager.ts +48 -1
- package/src/utils/save-as-fasta.ts +25 -22
- package/src/utils/seq-helper/seq-handler.ts +139 -33
- package/src/utils/seq-helper/seq-helper.ts +1 -1
- package/src/widgets/representations.ts +1 -1
- package/src/widgets/to-atomic-level-widget.ts +12 -4
- package/test-console-output-1.log +1071 -3014
- package/test-record-1.mp4 +0 -0
|
@@ -4,6 +4,7 @@ import * as DG from 'datagrok-api/dg';
|
|
|
4
4
|
import * as OCL from 'openchemlib/full';
|
|
5
5
|
import {NOTATION} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
6
6
|
import {_package, PackageFunctions} from '../package';
|
|
7
|
+
import {SeqTemps} from '@datagrok-libraries/bio/src/utils/macromolecule/seq-handler';
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
export async function toAtomicLevelSingle(sequence: DG.SemanticValue): Promise<{mol: string, errorText: string}> {
|
|
@@ -17,7 +18,7 @@ export async function toAtomicLevelSingle(sequence: DG.SemanticValue): Promise<{
|
|
|
17
18
|
errorText = 'Atomic level conversion requeires a sequence column';
|
|
18
19
|
return {errorText, mol: ''};
|
|
19
20
|
}
|
|
20
|
-
const supportedUnits: string[] = [NOTATION.FASTA, NOTATION.SEPARATOR, NOTATION.HELM];
|
|
21
|
+
const supportedUnits: string[] = [NOTATION.FASTA, NOTATION.SEPARATOR, NOTATION.HELM, NOTATION.BILN];
|
|
21
22
|
//todo: add support for custom notations
|
|
22
23
|
if (!supportedUnits.includes(sequence.cell.column.meta.units?.toLowerCase() ?? '')) {
|
|
23
24
|
errorText = 'Unsupported sequence notation. please use Bio | Polytool | Convert';
|
|
@@ -29,8 +30,8 @@ export async function toAtomicLevelSingle(sequence: DG.SemanticValue): Promise<{
|
|
|
29
30
|
errorText = 'No sequence handler found';
|
|
30
31
|
return {errorText, mol: ''};
|
|
31
32
|
}
|
|
32
|
-
if ((seqSh.getSplitted(sequence.cell.rowIndex,
|
|
33
|
-
errorText = 'Maximum number of monomers is
|
|
33
|
+
if ((seqSh.getSplitted(sequence.cell.rowIndex, 60)?.length ?? 100) > 50) {
|
|
34
|
+
errorText = 'Maximum number of monomers is 50';
|
|
34
35
|
return {errorText, mol: ''};
|
|
35
36
|
}
|
|
36
37
|
const singleValCol = DG.Column.fromStrings('singleVal', [sequence.value]);
|
|
@@ -39,7 +40,14 @@ export async function toAtomicLevelSingle(sequence: DG.SemanticValue): Promise<{
|
|
|
39
40
|
Object.entries(sequence.cell.column.tags).forEach(([key, value]) => {
|
|
40
41
|
singleValCol.setTag(key, value as string);
|
|
41
42
|
});
|
|
42
|
-
|
|
43
|
+
|
|
44
|
+
// if column has notation provider, we need to copy it over
|
|
45
|
+
if (sequence.cell.column.temp[SeqTemps.notationProvider])
|
|
46
|
+
singleValCol.temp[SeqTemps.notationProvider] = sequence.cell.column.temp[SeqTemps.notationProvider];
|
|
47
|
+
// helm and biln will have cyclization marks, so we need to use POM to convert them
|
|
48
|
+
const shouldUsePOM = (seqSh.getSplitted(sequence.cell.rowIndex).graphInfo?.connections?.length ?? 0) > 0;
|
|
49
|
+
await PackageFunctions.toAtomicLevel(sDf, singleValCol,
|
|
50
|
+
shouldUsePOM, false);
|
|
43
51
|
if (sDf.columns.length < 2) {
|
|
44
52
|
errorText = 'No structure generated';
|
|
45
53
|
return {errorText, mol: ''};
|