@datagrok/bio 1.7.14 → 1.7.19

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
@@ -21,9 +21,10 @@ class BioPackageDetectors extends DG.Package {
21
21
  static RnaFastaAlphabet = new Set(['A', 'C', 'G', 'U']);
22
22
 
23
23
  static SmilesRawAlphabet = new Set([
24
- 'B', 'C', 'c', 'E', 'H', 'L', 'M', 'N', 'O', 'S', 'F', '(', ')',
24
+ 'A', 'B', 'C', 'E', 'F', 'H', 'I', 'K', 'L', 'M', 'N', 'O', 'P', 'R', 'S', 'Z',
25
+ 'a', 'c', 'e', 'g', 'i', 'l', 'n', 'o', 'r', 's', 't', 'u',
25
26
  '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
26
- '+', '-', '@', '[', ']', '/', '\\', '#', '=']);
27
+ '+', '-', '.', , '/', '\\', '@', '[', ']', '(', ')', '#', '%', '=']);
27
28
 
28
29
  /** @param s {String} - string to check
29
30
  * @returns {boolean} */
@@ -75,7 +76,7 @@ class BioPackageDetectors extends DG.Package {
75
76
  const statsAsChars = BioPackageDetectors.getStats(col, 5, BioPackageDetectors.splitterAsChars);
76
77
  // if (Object.keys(statsAsChars.freq).length === 0) return;
77
78
 
78
- const decoy = BioPackageDetectors.detectAlphabet(statsAsChars.freq, decoyAlphabets, null, 0.35);
79
+ const decoy = BioPackageDetectors.detectAlphabet(statsAsChars.freq, decoyAlphabets, null, 0.30);
79
80
  if (decoy != 'UN') return null;
80
81
 
81
82
  if (statsAsChars.sameLength) {
@@ -215,7 +216,7 @@ class BioPackageDetectors extends DG.Package {
215
216
  const alphabetA = [];
216
217
  for (const m of keys) {
217
218
  freqA.push(m in freq ? freq[m] : 0);
218
- alphabetA.push(alphabet.has(m) ? 10 : -10 /* penalty for character outside alphabet set*/);
219
+ alphabetA.push(alphabet.has(m) ? 10 : -20 /* penalty for character outside alphabet set*/);
219
220
  }
220
221
  /* There were a few ideas: chi-squared, pearson correlation (variance?), scalar product */
221
222
  const cos = BioPackageDetectors.vectorDotProduct(freqA, alphabetA) / (BioPackageDetectors.vectorLength(freqA) * BioPackageDetectors.vectorLength(alphabetA));