@datagrok/bio 1.5.4 → 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 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],