@datagrok/bio 1.5.2 → 1.5.5
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 +11 -0
- package/dist/package-test.js +215 -81
- package/dist/package.js +183 -62
- package/files/samples/id.csv +313 -0
- package/files/samples/sample_HELM.csv +540 -540
- package/files/samples/sample_MSA.csv +540 -540
- package/files/samples/sar-small.csv +201 -0
- package/package.json +1 -1
- package/src/const.ts +0 -1
- package/src/package.ts +14 -12
- package/src/tests/convert-test.ts +31 -0
- package/src/tests/detectors-test.ts +37 -16
- package/src/utils/convert.ts +15 -3
- package/src/utils/multiple-sequence-alignment.ts +13 -8
- package/src/utils/notation-converter.ts +131 -0
- package/src/utils/sequence-space.ts +4 -4
- package/src/utils/split-to-monomers.ts +8 -0
package/detectors.js
CHANGED
|
@@ -24,12 +24,23 @@ class BioPackageDetectors extends DG.Package {
|
|
|
24
24
|
|
|
25
25
|
static NucleotidesFastaAlphabet = new Set(['A', 'C', 'G', 'T']);
|
|
26
26
|
|
|
27
|
+
|
|
28
|
+
/** @param s {String} - string to check
|
|
29
|
+
* @returns {boolean} */
|
|
30
|
+
static isHelm(s) {
|
|
31
|
+
return s.startsWith('PEPTIDE1{') || s.startsWith('RNA1{') || s.startsWith('CHEM1{') || s.startsWith('BLOB1{');
|
|
32
|
+
}
|
|
33
|
+
|
|
27
34
|
//tags: semTypeDetector
|
|
28
35
|
//input: column col
|
|
29
36
|
//output: string semType
|
|
30
37
|
detectMacromolecule(col) {
|
|
31
38
|
// To collect alphabet freq three strategies can be used:
|
|
32
39
|
// as chars, as fasta (single or within square brackets), as with the separator.
|
|
40
|
+
if (DG.Detector.sampleCategories(col, (s) => BioPackageDetectors.isHelm(s), 1)) {
|
|
41
|
+
col.setTag(DG.TAGS.UNITS, 'HELM');
|
|
42
|
+
return BioPackageDetectors.mmSemType;
|
|
43
|
+
}
|
|
33
44
|
|
|
34
45
|
const alphabetCandidates = [
|
|
35
46
|
['NT', BioPackageDetectors.NucleotidesFastaAlphabet],
|