@datagrok/sequence-translator 1.0.3 → 1.0.6

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
@@ -1,2 +1,28 @@
1
1
  class SequenceTranslatorPackageDetectors extends DG.Package {
2
+ isDnaNucleotides(sequence) {return /(\(invabasic\)|\(GalNAc-2-JNJ\)|A|T|G|C){6,}$/.test(sequence);}
3
+ isRnaNucleotides(sequence) {return /(\(invabasic\)|\(GalNAc-2-JNJ\)|A|U|G|C){6,}$/.test(sequence);}
4
+ isAsoGapmerBioSpring(sequence) {return /(\(invabasic\)|\(GalNAc-2-JNJ\)|\*|5|6|7|8|9|A|T|G|C){6,}$/.test(sequence);}
5
+ isAsoGapmerGcrs(sequence) {return /^(?=.*moe)(?=.*5mC)(?=.*ps){6,}/.test(sequence);}
6
+ isSiRnaBioSpring(sequence) {return /(\(invabasic\)|\(GalNAc-2-JNJ\)|\*|1|2|3|4|5|6|7|8){6,}$/.test(sequence);}
7
+ isSiRnaAxolabs(sequence) {return /(\(invabasic\)|\(GalNAc-2-JNJ\)|f|s|A|C|G|U|a|c|g|u){6,}$/.test(sequence);}
8
+ isSiRnaGcrs(sequence) {return /(\(invabasic\)|\(GalNAc-2-JNJ\)|f|m|p|s|A|C|G|U){6,}$/.test(sequence);}
9
+ isGcrs(sequence) {return /(\(invabasic\)|\(GalNAc-2-JNJ\)|f|m|p|s|A|C|G|U){6,}$/.test(sequence);}
10
+ isMermade12(sequence) {
11
+ return /(\(invabasic\)|\(GalNAc-2-JNJ\)|I|i|J|j|K|k|L|l|E|e|F|f|G|g|H|h|Q|q){6,}$/.test(sequence);
12
+ }
13
+ //tags: semTypeDetector
14
+ //input: column col
15
+ //output: string semType
16
+ detectNucleotides(col) {
17
+ if (col.type === DG.TYPE.STRING) {
18
+ if (DG.Detector.sampleCategories(col, (s) => this.isDnaNucleotides(s))) return 'DNA nucleotides';
19
+ if (DG.Detector.sampleCategories(col, (s) => this.isRnaNucleotides(s))) return 'RNA nucleotides';
20
+ if (DG.Detector.sampleCategories(col, (s) => this.isAsoGapmerBioSpring(s))) return 'BioSpring / Gapmers';
21
+ if (DG.Detector.sampleCategories(col, (s) => this.isAsoGapmerGcrs(s))) return 'GCRS / Gapmers';
22
+ if (DG.Detector.sampleCategories(col, (s) => this.isSiRnaBioSpring(s))) return 'BioSpring / siRNA';
23
+ if (DG.Detector.sampleCategories(col, (s) => this.isSiRnaAxolabs(s))) return 'Axolabs / siRNA';
24
+ if (DG.Detector.sampleCategories(col, (s) => this.isGcrs(s))) return 'GCRS';
25
+ if (DG.Detector.sampleCategories(col, (s) => this.isMermade12(s))) return 'Mermade 12 / siRNA';
26
+ }
27
+ }
2
28
  }