@rnacanvas/search 2.0.0 → 3.0.1
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
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()`
|
|
@@ -150,17 +120,17 @@ N.matches('.'); // false
|
|
|
150
120
|
N.matches('-'); // false
|
|
151
121
|
```
|
|
152
122
|
|
|
153
|
-
|
|
123
|
+
Returns `false` for empty strings and strings containing more than one character.
|
|
154
124
|
|
|
155
125
|
```javascript
|
|
156
126
|
var A = new SequenceCharacter('A');
|
|
157
127
|
|
|
158
128
|
// empty string
|
|
159
|
-
A.matches(''); //
|
|
129
|
+
A.matches(''); // false
|
|
160
130
|
|
|
161
131
|
// strings containing more than one character
|
|
162
|
-
A.matches('AG'); //
|
|
163
|
-
A.matches('asdf'); //
|
|
132
|
+
A.matches('AG'); // false
|
|
133
|
+
A.matches('asdf'); // false
|
|
164
134
|
```
|
|
165
135
|
|
|
166
136
|
### `complements()`
|
|
@@ -217,17 +187,18 @@ Note that the special IUPAC codes
|
|
|
217
187
|
`S`, `W`, `K`, `M`, `B`, `D`, `H` and `V`
|
|
218
188
|
have no complements.
|
|
219
189
|
|
|
220
|
-
This method
|
|
190
|
+
This method returns `false` for empty strings
|
|
191
|
+
and strings containing more than one character.
|
|
221
192
|
|
|
222
193
|
```javascript
|
|
223
194
|
var A = new SequenceCharacter('A');
|
|
224
195
|
|
|
225
196
|
// empty string
|
|
226
|
-
A.complements(''); //
|
|
197
|
+
A.complements(''); // false
|
|
227
198
|
|
|
228
199
|
// strings containing more than one character
|
|
229
|
-
A.complements('AG'); //
|
|
230
|
-
A.complements('asdf'); //
|
|
200
|
+
A.complements('AG'); // false
|
|
201
|
+
A.complements('asdf'); // false
|
|
231
202
|
```
|
|
232
203
|
|
|
233
204
|
## `function isWobblePair()`
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A cell in an alignment matrix.
|
|
3
|
+
*/
|
|
4
|
+
export declare class AlignmentCell {
|
|
5
|
+
readonly score: number;
|
|
6
|
+
/**
|
|
7
|
+
* The change in I index to get to this cell (from the previous cell).
|
|
8
|
+
*/
|
|
9
|
+
readonly deltaI: number;
|
|
10
|
+
/**
|
|
11
|
+
* The change in J index to get to this cell (from the previous cell).
|
|
12
|
+
*/
|
|
13
|
+
readonly deltaJ: number;
|
|
14
|
+
constructor(score: number, deltaI: number, deltaJ: number);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=AlignmentCell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlignmentCell.d.ts","sourceRoot":"","sources":["../src/AlignmentCell.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,aAAa;IACxB,QAAQ,CAAC,KAAK,SAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,MAAM,SAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,MAAM,SAAC;gBAEJ,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAM1D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlignmentMatrix.d.ts","sourceRoot":"","sources":["../src/AlignmentMatrix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,qBAAa,eAAe;;IAG1B,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,aAAa,GAAG,KAAK;IAsBhD,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI;CAarD"}
|
|
@@ -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.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 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:()=>
|
|
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})());
|