@datagrok/sequence-translator 1.0.15 → 1.0.17
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 +16 -3
- package/detectors.js +0 -28
- package/dist/package-test.js +4372 -3957
- package/dist/package.js +3875 -3460
- package/package.json +4 -2
- package/setup-unlink-clean.sh +21 -0
- package/src/apps/oligo-sd-file-app.ts +58 -0
- package/src/autostart/calculations.ts +11 -8
- package/src/autostart/constants.ts +0 -12
- package/src/autostart/registration.ts +194 -157
- package/src/{axolabs/define-pattern.ts → axolabs-tab/axolabs-tab.ts} +2 -2
- package/src/axolabs-tab/define-pattern.ts +874 -0
- package/src/{axolabs → axolabs-tab}/draw-svg.ts +1 -1
- package/src/{axolabs → axolabs-tab}/helpers.ts +2 -2
- package/src/{autostart → hardcode-to-be-eliminated}/ICDs.ts +0 -0
- package/src/{autostart → hardcode-to-be-eliminated}/IDPs.ts +0 -0
- package/src/{structures-works → hardcode-to-be-eliminated}/const.ts +0 -0
- package/src/{axolabs → hardcode-to-be-eliminated}/constants.ts +0 -0
- package/src/{structures-works → hardcode-to-be-eliminated}/converters.ts +1 -1
- package/src/{structures-works → hardcode-to-be-eliminated}/map.ts +2 -2
- package/src/{autostart → hardcode-to-be-eliminated}/salts.ts +0 -0
- package/src/{autostart → hardcode-to-be-eliminated}/sources.ts +0 -0
- package/src/{autostart → hardcode-to-be-eliminated}/users.ts +0 -0
- package/src/{main/main-view.ts → main-tab/main-tab.ts} +28 -80
- package/src/package.ts +77 -13
- package/src/sdf-tab/sdf-tab.ts +163 -0
- package/src/{structures-works → sdf-tab}/sequence-codes-tools.ts +8 -5
- package/src/tests/smiles-tests.ts +2 -2
- package/src/utils/const.ts +0 -0
- package/src/{helpers.ts → utils/helpers.ts} +3 -3
- package/src/utils/parse.ts +27 -0
- package/src/utils/sdf-add-columns.ts +118 -0
- package/src/utils/sdf-save-table.ts +56 -0
- package/src/utils/structures-works/draw-molecule.ts +84 -0
- package/src/{structures-works → utils/structures-works}/from-monomers.ts +15 -16
- package/src/{structures-works → utils/structures-works}/mol-transformations.ts +34 -52
- package/{test-SequenceTranslator-91c83d8913ff-f94596bc.html → test-SequenceTranslator-6288c2fbe346-695b7b55.html} +10 -10
- package/src/structures-works/save-sense-antisense.ts +0 -91
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import * as grok from 'datagrok-api/grok';
|
|
2
|
-
import * as ui from 'datagrok-api/ui';
|
|
3
|
-
import * as DG from 'datagrok-api/dg';
|
|
4
|
-
|
|
5
|
-
import {download} from '../helpers';
|
|
6
|
-
import {sequenceToMolV3000} from '../structures-works/from-monomers';
|
|
7
|
-
import {linkStrandsV3000} from '../structures-works/mol-transformations';
|
|
8
|
-
import {getFormat} from '../structures-works/sequence-codes-tools';
|
|
9
|
-
|
|
10
|
-
export function saveSdf(as: string, ss: string,
|
|
11
|
-
oneEntity: boolean, useChirality: boolean,
|
|
12
|
-
invertSS: boolean, invertAS: boolean,
|
|
13
|
-
as2: string | null = null, invertAS2: boolean | null) {
|
|
14
|
-
const formatAs = getFormat(as);
|
|
15
|
-
const formatSs = getFormat(ss);
|
|
16
|
-
let formatAs2: string | null = null;
|
|
17
|
-
let molAS2: string | null = null;
|
|
18
|
-
|
|
19
|
-
const molSS = sequenceToMolV3000(ss, invertSS, false, formatSs!);
|
|
20
|
-
const molAS = sequenceToMolV3000(as, invertAS, false, formatAs!);
|
|
21
|
-
|
|
22
|
-
if (as2 != null && as2 != '') {
|
|
23
|
-
formatAs2 = getFormat(as2!);
|
|
24
|
-
molAS2 = sequenceToMolV3000(as2, invertAS2!, false, formatAs2!);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
let result: string;
|
|
28
|
-
if (oneEntity) {
|
|
29
|
-
const antiStrands = molAS2 == null ? [molAS] : [molAS, molAS2];
|
|
30
|
-
result = linkStrandsV3000({senseStrands: [molSS], antiStrands: antiStrands}, useChirality) + '\n$$$$\n';
|
|
31
|
-
|
|
32
|
-
} else {
|
|
33
|
-
result =
|
|
34
|
-
molSS + '\n' +
|
|
35
|
-
`> <Sequence>\nSense Strand\n$$$$\n` +
|
|
36
|
-
molAS + '\n' +
|
|
37
|
-
`> <Sequence>\nAnti Sense\n$$$$\n`;
|
|
38
|
-
|
|
39
|
-
if (molAS2)
|
|
40
|
-
result += molAS2+ '\n' +
|
|
41
|
-
`> <Sequence>\nAnti Sense 2\n$$$$\n`;
|
|
42
|
-
}
|
|
43
|
-
download(ss.replace(/\s/g, '') + '.sdf', encodeURIComponent(result));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export function saveSenseAntiSense() {
|
|
47
|
-
const moleculeSvgDiv = ui.block([]);
|
|
48
|
-
const ssInput = ui.textInput('Sense Strand', '');
|
|
49
|
-
const asInput = ui.textInput('Anti Sense', '');
|
|
50
|
-
const asInput2 = ui.textInput('Anti Sense 2', '');
|
|
51
|
-
const straight = "5 prime -> 3 prime";
|
|
52
|
-
const inverse = "3 prime -> 5 prime";
|
|
53
|
-
let ssInverse = false;
|
|
54
|
-
let asInverse = false;
|
|
55
|
-
let as2Inverse = false;
|
|
56
|
-
|
|
57
|
-
const changeSense = ui.choiceInput('SS direction', straight, [straight, inverse]);
|
|
58
|
-
changeSense.onChanged(() => {ssInverse = changeSense.value == inverse;});
|
|
59
|
-
const changeAntiSense = ui.choiceInput('AS direction', straight, [straight, inverse]);
|
|
60
|
-
changeAntiSense.onChanged(() => {asInverse = changeAntiSense.value == inverse;});
|
|
61
|
-
const changeAntiSense2 = ui.choiceInput('AS 2 direction', straight, [straight, inverse]);
|
|
62
|
-
changeAntiSense2.onChanged(() => {asInverse = changeAntiSense.value == inverse;});
|
|
63
|
-
|
|
64
|
-
const saveOption = ui.switchInput('Save as one entity', true);
|
|
65
|
-
const chirality = ui.switchInput('Use chiral', true);
|
|
66
|
-
const saveBtn = ui.button('Save SDF', () =>
|
|
67
|
-
saveSdf(asInput.value, ssInput.value, saveOption.value, chirality.value, ssInverse, asInverse, asInput2.value, as2Inverse));
|
|
68
|
-
|
|
69
|
-
const saveSection = ui.panel([
|
|
70
|
-
ui.div([
|
|
71
|
-
ui.div([
|
|
72
|
-
ui.divH([ui.h1('Inputs')]),
|
|
73
|
-
ui.divV([
|
|
74
|
-
ssInput,
|
|
75
|
-
asInput,
|
|
76
|
-
asInput2,
|
|
77
|
-
ui.div([changeSense], {style: {width: '40'}}),
|
|
78
|
-
changeSense,
|
|
79
|
-
changeAntiSense,
|
|
80
|
-
changeAntiSense2,
|
|
81
|
-
saveOption,
|
|
82
|
-
chirality,
|
|
83
|
-
ui.buttonsInput([saveBtn]),
|
|
84
|
-
], 'ui-form'),
|
|
85
|
-
], 'ui-form'),
|
|
86
|
-
], 'ui-form'),
|
|
87
|
-
moleculeSvgDiv,
|
|
88
|
-
]);
|
|
89
|
-
|
|
90
|
-
return saveSection;
|
|
91
|
-
}
|