@datagrok/bio 1.5.6 → 1.5.9
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/css/helm.css +3 -0
- package/detectors.js +16 -17
- package/dist/package-test.js +1134 -425
- package/dist/package.js +906 -259
- package/files/samples/sample_FASTA.csv +66 -66
- package/files/samples/testDemog.csv +5851 -0
- package/files/samples/testHelm.csv +6 -0
- package/files/samples/{id.csv → testId.csv} +0 -0
- package/files/samples/{sar-small.csv → testSmiles.csv} +0 -0
- package/helm/JSDraw/Pistoia.HELM-uncompressed.js +9694 -0
- package/helm/JSDraw/Pistoia.HELM.js +27 -0
- package/helm/JSDraw/ReadMe.txt +8 -0
- package/helm/JSDraw/Scilligence.JSDraw2.Lite-uncompressed.js +31126 -0
- package/helm/JSDraw/Scilligence.JSDraw2.Lite.js +12 -0
- package/helm/JSDraw/Scilligence.JSDraw2.Resources.js +762 -0
- package/helm/JSDraw/dojo.js +250 -0
- package/helm/JSDraw/test.html +21 -0
- package/package.json +9 -2
- package/src/monomer-library.ts +199 -0
- package/src/package-test.ts +2 -0
- package/src/package.ts +41 -13
- package/src/tests/convert-test.ts +143 -22
- package/src/tests/detectors-test.ts +133 -156
- package/src/tests/renderer-test.ts +36 -0
- package/src/tests/splitter-test.ts +22 -0
- package/src/tests/types.ts +7 -0
- package/src/utils/atomic-works.ts +218 -97
- package/src/utils/cell-renderer.ts +211 -0
- package/src/utils/chem-palette.ts +280 -0
- package/src/utils/convert.ts +25 -16
- package/src/utils/misc.ts +29 -0
- package/src/utils/multiple-sequence-alignment.ts +1 -1
- package/src/utils/notation-converter.ts +120 -84
- package/src/utils/sequence-activity-cliffs.ts +2 -2
- package/src/utils/types.ts +13 -0
- package/src/utils/utils.ts +35 -30
- package/test-Bio-34f75e5127b8-b47d4664.html +260 -0
- package/files/sample_FASTA.csv +0 -66
- package/files/sample_FASTA_with_activities.csv +0 -66
- package/files/sample_MSA.csv +0 -541
package/css/helm.css
ADDED
package/detectors.js
CHANGED
|
@@ -13,16 +13,14 @@ class BioPackageDetectors extends DG.Package {
|
|
|
13
13
|
|
|
14
14
|
static mmSemType = 'Macromolecule';
|
|
15
15
|
|
|
16
|
-
static
|
|
17
|
-
FastaSeqPt: 'fasta:SEQ:PT', FastaSeqNt: 'fasta:SEQ:NT', FastaMsaPt: 'fasta:MSA:PT', FastaMsaNt: 'fasta:MSA:NT',
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
static AminoacidsFastaAlphabet = new Set([
|
|
16
|
+
static PeptideFastaAlphabet = new Set([
|
|
21
17
|
'G', 'L', 'Y', 'S', 'E', 'Q', 'D', 'N', 'F', 'A',
|
|
22
18
|
'K', 'R', 'H', 'C', 'V', 'P', 'W', 'I', 'M', 'T',
|
|
23
19
|
]);
|
|
24
20
|
|
|
25
|
-
static
|
|
21
|
+
static DnaFastaAlphabet = new Set(['A', 'C', 'G', 'T']);
|
|
22
|
+
|
|
23
|
+
static RnaFastaAlphabet = new Set(['A', 'C', 'G', 'U']);
|
|
26
24
|
|
|
27
25
|
|
|
28
26
|
/** @param s {String} - string to check
|
|
@@ -43,8 +41,9 @@ class BioPackageDetectors extends DG.Package {
|
|
|
43
41
|
}
|
|
44
42
|
|
|
45
43
|
const alphabetCandidates = [
|
|
46
|
-
['
|
|
47
|
-
['
|
|
44
|
+
['PT', BioPackageDetectors.PeptideFastaAlphabet],
|
|
45
|
+
['DNA', BioPackageDetectors.DnaFastaAlphabet],
|
|
46
|
+
['RNA', BioPackageDetectors.RnaFastaAlphabet],
|
|
48
47
|
];
|
|
49
48
|
|
|
50
49
|
// TODO: Detect HELM sequence
|
|
@@ -76,8 +75,8 @@ class BioPackageDetectors extends DG.Package {
|
|
|
76
75
|
// TODO: If separator detected, then extra efforts to detect alphabet are allowed.
|
|
77
76
|
const alphabet = BioPackageDetectors.detectAlphabet(stats.freq, alphabetCandidates, gapSymbol);
|
|
78
77
|
|
|
79
|
-
const forbidden = BioPackageDetectors.checkForbiddenWoSeparator(stats.freq);
|
|
80
|
-
if (separator ||
|
|
78
|
+
// const forbidden = BioPackageDetectors.checkForbiddenWoSeparator(stats.freq);
|
|
79
|
+
if (separator || alphabet != 'UN') {
|
|
81
80
|
const units = `${format}:${seqType}:${alphabet}`;
|
|
82
81
|
col.setTag(DG.TAGS.UNITS, units);
|
|
83
82
|
if (separator) col.setTag('separator', separator);
|
|
@@ -103,8 +102,8 @@ class BioPackageDetectors extends DG.Package {
|
|
|
103
102
|
const cleanFreq = Object.assign({}, ...Object.entries(freq)
|
|
104
103
|
.filter(([m, f]) => m != ' ' &&
|
|
105
104
|
!noSeparatorChemRe.test(m) && !noSeparatorAlphaDigitRe.test(m) &&
|
|
106
|
-
!BioPackageDetectors.
|
|
107
|
-
!BioPackageDetectors.
|
|
105
|
+
!BioPackageDetectors.PeptideFastaAlphabet.has(m) &&
|
|
106
|
+
!BioPackageDetectors.DnaFastaAlphabet.has(m))
|
|
108
107
|
.map(([m, f]) => ({[m]: f})));
|
|
109
108
|
if (Object.keys(cleanFreq).length == 0) return null;
|
|
110
109
|
|
|
@@ -124,11 +123,11 @@ class BioPackageDetectors extends DG.Package {
|
|
|
124
123
|
return Object.keys(freq).filter((m) => forbiddenRe.test(m)).length > 0;
|
|
125
124
|
}
|
|
126
125
|
|
|
127
|
-
/** Without a separator, special symbols or digits are not allowed as monomers. */
|
|
128
|
-
static checkForbiddenWoSeparator(freq) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
126
|
+
// /** Without a separator, special symbols or digits are not allowed as monomers. */
|
|
127
|
+
// static checkForbiddenWoSeparator(freq) {
|
|
128
|
+
// const forbiddenRe = /[\d!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/i;
|
|
129
|
+
// return Object.keys(freq).filter((m) => forbiddenRe.test(m)).length > 0;
|
|
130
|
+
// }
|
|
132
131
|
|
|
133
132
|
/** Stats of sequences with specified splitter func, returns { freq, sameLength } */
|
|
134
133
|
static getStats(seqCol, minLength, splitter) {
|