@rnacanvas/search 1.5.0 → 3.0.0
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/README.md +39 -31
- package/dist/SequenceCharacter.d.ts.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/Motif.d.ts +0 -6
- package/dist/Motif.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -12,37 +12,7 @@ All exports of this package can be accessed as named imports.
|
|
|
12
12
|
|
|
13
13
|
```javascript
|
|
14
14
|
// some example imports
|
|
15
|
-
import {
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## `class Motif`
|
|
19
|
-
|
|
20
|
-
Represents a motif.
|
|
21
|
-
|
|
22
|
-
```javascript
|
|
23
|
-
var CUGCCA = new Motif('CUGCCA');
|
|
24
|
-
|
|
25
|
-
CUGCCA.toString(); // "CUGCCA"
|
|
26
|
-
|
|
27
|
-
// a single character motif
|
|
28
|
-
var A = new Motif('A');
|
|
29
|
-
|
|
30
|
-
A.toString(); // "A"
|
|
31
|
-
|
|
32
|
-
// empty motifs are accepted
|
|
33
|
-
var emptyMotif = new Motif('');
|
|
34
|
-
|
|
35
|
-
emptyMotif.toString(); // ""
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### `toString()`
|
|
39
|
-
|
|
40
|
-
Returns the motif as a string.
|
|
41
|
-
|
|
42
|
-
```javascript
|
|
43
|
-
var CUGCCA = new Motif('CUGCCA');
|
|
44
|
-
|
|
45
|
-
CUGCCA.toString(); // "CUGCCA"
|
|
15
|
+
import { removeGapCharacters, SequenceCharacter } from '@rnacanvas/search';
|
|
46
16
|
```
|
|
47
17
|
|
|
48
18
|
## `function removeGapCharacters()`
|
|
@@ -229,3 +199,41 @@ A.complements(''); // throws
|
|
|
229
199
|
A.complements('AG'); // throws
|
|
230
200
|
A.complements('asdf'); // throws
|
|
231
201
|
```
|
|
202
|
+
|
|
203
|
+
## `function isWobblePair()`
|
|
204
|
+
|
|
205
|
+
Returns `true` if the two input characters form a `G:U` or `G:T` pair.
|
|
206
|
+
|
|
207
|
+
```javascript
|
|
208
|
+
isWobblePair('G', 'U'); // true
|
|
209
|
+
isWobblePair('G', 'T'); // true
|
|
210
|
+
|
|
211
|
+
isWobblePair('A', 'U'); // false
|
|
212
|
+
isWobblePair('G', 'C'); // false
|
|
213
|
+
|
|
214
|
+
// order doesn't matter
|
|
215
|
+
isWobblePair('U', 'G'); // true
|
|
216
|
+
|
|
217
|
+
// case doesn't matter
|
|
218
|
+
isWobblePair('g', 'u'); // true
|
|
219
|
+
|
|
220
|
+
var G = new SequenceCharacter('G');
|
|
221
|
+
var U = new SequenceCharacter('U');
|
|
222
|
+
|
|
223
|
+
// handles sequence character instances
|
|
224
|
+
isWobblePair(G, U); // true
|
|
225
|
+
|
|
226
|
+
var A = new SequenceCharacter('A');
|
|
227
|
+
|
|
228
|
+
isWobblePair(A, U); // false
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Returns `false` for empty strings
|
|
232
|
+
and strings containing more than one character.
|
|
233
|
+
|
|
234
|
+
```javascript
|
|
235
|
+
isWobblePair('G', ''); // false
|
|
236
|
+
|
|
237
|
+
// each string must be a single character
|
|
238
|
+
isWobblePair('G', 'UT'); // false
|
|
239
|
+
```
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SequenceCharacter.d.ts","sourceRoot":"","sources":["../src/SequenceCharacter.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,iBAAiB;;gBAGhB,SAAS,EAAE,MAAM;IAU7B,QAAQ,IAAI,MAAM;IAIlB,OAAO,CAAC,cAAc,EAAE,iBAAiB,GAAG,MAAM,GAAG,OAAO;
|
|
1
|
+
{"version":3,"file":"SequenceCharacter.d.ts","sourceRoot":"","sources":["../src/SequenceCharacter.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,iBAAiB;;gBAGhB,SAAS,EAAE,MAAM;IAU7B,QAAQ,IAAI,MAAM;IAIlB,OAAO,CAAC,cAAc,EAAE,iBAAiB,GAAG,MAAM,GAAG,OAAO;IAgC5D,WAAW,CAAC,cAAc,EAAE,iBAAiB,GAAG,MAAM,GAAG,OAAO;CA+BjE"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.search=t():e.search=t()}(this,()=>(()=>{"use strict";var e={d:(t,r)=>{for(var
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.search=t():e.search=t()}(this,()=>(()=>{"use strict";var e={d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function r(e){return e.replace(/[\.-]/g,"")}e.r(t),e.d(t,{SequenceCharacter:()=>i,removeGapCharacters:()=>r});var n,o=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};class i{constructor(e){if(n.set(this,void 0),0==e.length)throw new Error("Character cannot be an empty string.");if(e.length>1)throw new Error("Character must be a single character.");!function(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===n?o.call(e,r):o?o.value=r:t.set(e,r)}(this,n,e,"f")}toString(){return o(this,n,"f")}matches(e){var t,r;if("string"!=typeof e&&(e=e.toString()),1!=e.length)return!1;let i=o(this,n,"f").toUpperCase();return e=e.toUpperCase(),!(!a.includes(i)||!a.includes(e))||!a.includes(i)&&!a.includes(e)&&("N"===i&&!a.includes(e)||"N"===e&&!a.includes(i)||(i in s?null!==(r=null===(t=s[i])||void 0===t?void 0:t.includes(e))&&void 0!==r&&r:i===e))}complements(e){var t,r;if("string"!=typeof e&&(e=e.toString()),1!=e.length)return!1;let i=o(this,n,"f").toUpperCase();return e=e.toUpperCase(),!(!a.includes(i)||!a.includes(e))||!a.includes(i)&&!a.includes(e)&&("N"===i&&!a.includes(e)||"N"===e&&!a.includes(i)||i in c&&null!==(r=null===(t=c[i])||void 0===t?void 0:t.includes(e))&&void 0!==r&&r)}}n=new WeakMap;const a=[...".-"],s={A:[..."A"],C:[..."C"],G:[..."G"],U:[..."UT"],T:[..."TU"],R:[..."AG"],Y:[..."CUT"],S:[..."GC"],W:[..."AUT"],K:[..."GUT"],M:[..."AC"],B:[..."CGUTYSK"],D:[..."AGUTRWK"],H:[..."ACUTYWM"],V:[..."ACGRSM"]},c={A:[..."UT"],C:[..."G"],G:[..."CUTY"],U:[..."AGR"],T:[..."AGR"],R:[..."UT"],Y:[..."G"]};return t})());
|
package/package.json
CHANGED
package/dist/Motif.d.ts
DELETED
package/dist/Motif.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Motif.d.ts","sourceRoot":"","sources":["../src/Motif.ts"],"names":[],"mappings":"AAAA,qBAAa,KAAK;;gBAGJ,KAAK,EAAE,MAAM;IAIzB,QAAQ,IAAI,MAAM;CAGnB"}
|