@gmod/bbi 1.0.30 → 1.0.33
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/CHANGELOG.md +17 -57
- package/README.md +17 -27
- package/dist/bbi.js +354 -552
- package/dist/bigbed.d.ts +1 -1
- package/dist/bigbed.js +278 -470
- package/dist/bigwig.js +88 -112
- package/dist/blockView.js +403 -494
- package/dist/index.js +6 -41
- package/dist/range.js +115 -176
- package/dist/unzip-pako.d.ts +2 -0
- package/dist/unzip-pako.js +8 -0
- package/dist/unzip.d.ts +2 -0
- package/dist/unzip.js +5 -0
- package/dist/util.js +110 -116
- package/esm/bbi.d.ts +84 -0
- package/esm/bbi.js +259 -0
- package/esm/bigbed.d.ts +12 -0
- package/esm/bigbed.js +182 -0
- package/esm/bigwig.d.ts +13 -0
- package/esm/bigwig.js +35 -0
- package/esm/blockView.d.ts +42 -0
- package/esm/blockView.js +321 -0
- package/esm/index.d.ts +3 -0
- package/esm/index.js +7 -0
- package/esm/range.d.ts +18 -0
- package/esm/range.js +126 -0
- package/esm/unzip-pako.d.ts +2 -0
- package/esm/unzip-pako.js +8 -0
- package/esm/unzip.d.ts +2 -0
- package/esm/unzip.js +5 -0
- package/esm/util.d.ts +24 -0
- package/esm/util.js +74 -0
- package/package.json +29 -31
- package/dist/declares.d.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,28 +1,37 @@
|
|
|
1
|
-
## [1.0.
|
|
1
|
+
## [1.0.33](https://github.com/GMOD/bbi-js/compare/v1.0.32...v1.0.33) (2022-02-25)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
- Use
|
|
6
|
-
-
|
|
5
|
+
- Use subarray instead of slice since slice is deprecated under node xref
|
|
6
|
+
'https://nodejs.org/api/buffer.html#bufslicestart-end'"
|
|
7
7
|
|
|
8
|
-
## [1.0.
|
|
8
|
+
## [1.0.32](https://github.com/GMOD/bbi-js/compare/v1.0.31...v1.0.32) (2022-02-16)
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
-
|
|
12
|
+
- Use pako to decode on command line instead of using zlib to avoid need to
|
|
13
|
+
manually polyfill zlib
|
|
13
14
|
|
|
15
|
+
## [1.0.31](https://github.com/GMOD/bbi-js/compare/v1.0.30...v1.0.31) (2021-12-14)
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
- Add esm module builds with less babelification for smaller bundle sizes
|
|
16
18
|
|
|
19
|
+
## [1.0.30](https://github.com/GMOD/bbi-js/compare/v1.0.29...v1.0.30) (2020-06-25)
|
|
17
20
|
|
|
21
|
+
- Use abortable-promise-cache instead of abortable-memoize
|
|
22
|
+
- Allow opts parameter to getHeader instead of just abortsignal
|
|
23
|
+
|
|
24
|
+
## [1.0.29](https://github.com/GMOD/bbi-js/compare/v1.0.28...v1.0.29) (2020-01-28)
|
|
25
|
+
|
|
26
|
+
- Accidentally made the package include itself as dependency in 1.0.28, republish
|
|
27
|
+
|
|
28
|
+
## [1.0.28](https://github.com/GMOD/bbi-js/compare/v1.0.27...v1.0.28) (2020-01-28)
|
|
18
29
|
|
|
19
30
|
- Change typescript interface to use object keys instead of Map type for refsByName, refsById
|
|
20
31
|
- Typescript only release change
|
|
21
32
|
|
|
22
33
|
## [1.0.27](https://github.com/GMOD/bbi-js/compare/v1.0.26...v1.0.27) (2020-01-10)
|
|
23
34
|
|
|
24
|
-
|
|
25
|
-
|
|
26
35
|
- Reduce number of requests needed on initial header
|
|
27
36
|
- Add definedFieldCount to the returned Header
|
|
28
37
|
|
|
@@ -30,8 +39,6 @@ Thanks to @skinner for both of these contributions!
|
|
|
30
39
|
|
|
31
40
|
## [1.0.26](https://github.com/GMOD/bbi-js/compare/v1.0.25...v1.0.26) (2019-11-10)
|
|
32
41
|
|
|
33
|
-
|
|
34
|
-
|
|
35
42
|
- Fix important bug with fixed step bigwig files not using the proper start coordinate
|
|
36
43
|
|
|
37
44
|
## [1.0.25](https://github.com/GMOD/bbi-js/compare/v1.0.24...v1.0.25) (2019-11-03)
|
|
@@ -40,138 +47,97 @@ Thanks to @skinner for both of these contributions!
|
|
|
40
47
|
|
|
41
48
|
## [1.0.24](https://github.com/GMOD/bbi-js/compare/v1.0.23...v1.0.24) (2019-10-29)
|
|
42
49
|
|
|
43
|
-
|
|
44
|
-
|
|
45
50
|
- Fix the uniqueIds generated via the bigbed features
|
|
46
51
|
|
|
47
52
|
## [1.0.23](https://github.com/GMOD/bbi-js/compare/v1.0.22...v1.0.23) (2019-10-06)
|
|
48
53
|
|
|
49
|
-
|
|
50
54
|
- Small refactor of `filehandle.read()` to make it more robust
|
|
51
55
|
|
|
52
|
-
|
|
53
56
|
## [1.0.22](https://github.com/GMOD/bbi-js/compare/v1.0.21...v1.0.22) (2019-06-13)
|
|
54
57
|
|
|
55
|
-
|
|
56
|
-
|
|
57
58
|
- Bump generic-filehandle
|
|
58
59
|
- Add more checks for abort signal to allow early bailing
|
|
59
60
|
|
|
60
61
|
## [1.0.21](https://github.com/GMOD/bbi-js/compare/v1.0.20...v1.0.21) (2019-05-09)
|
|
61
62
|
|
|
62
|
-
|
|
63
|
-
|
|
64
63
|
- Add fix for reading files with greater than 256 contigs
|
|
65
64
|
|
|
66
65
|
## [1.0.20](https://github.com/GMOD/bbi-js/compare/v1.0.19...v1.0.20) (2019-05-06)
|
|
67
66
|
|
|
68
|
-
|
|
69
|
-
|
|
70
67
|
- Add fix that prevented accessing the lowest zoom/reduction level
|
|
71
68
|
|
|
72
69
|
## [1.0.19](https://github.com/GMOD/bbi-js/compare/v1.0.18...v1.0.19) (2019-05-02)
|
|
73
70
|
|
|
74
|
-
|
|
75
|
-
|
|
76
71
|
- Add regression fix since 1.0.16 for uncompressed files. Thanks to @lidaof for reporting!
|
|
77
72
|
|
|
78
73
|
## [1.0.18](https://github.com/GMOD/bbi-js/compare/v1.0.17...v1.0.18) (2019-05-02)
|
|
79
74
|
|
|
80
|
-
|
|
81
|
-
|
|
82
75
|
- Improve error handling of the observables (issue #20, pull #21)
|
|
83
76
|
- Bump generic-filehandle to 1.0.9 to fix compatibility with native browser fetch
|
|
84
77
|
|
|
85
78
|
## [1.0.17](https://github.com/GMOD/bbi-js/compare/v1.0.16...v1.0.17) (2019-04-30)
|
|
86
79
|
|
|
87
|
-
|
|
88
|
-
|
|
89
80
|
- Use some standard rxjs notions for combining operator results
|
|
90
81
|
- Add parsing of the extraIndex data in BigBed, allowing you to call bigbed.searchExtraIndex(name[,opts])
|
|
91
82
|
|
|
92
83
|
## [1.0.16](https://github.com/GMOD/bbi-js/compare/v1.0.15...v1.0.16) (2019-04-23)
|
|
93
84
|
|
|
94
|
-
|
|
95
|
-
|
|
96
85
|
- Pre-compile binary-parser instances for faster
|
|
97
86
|
- Important: fixed bug that caused bigwig summary blocks to not be returned in output
|
|
98
87
|
|
|
99
88
|
## [1.0.15](https://github.com/GMOD/bbi-js/compare/v1.0.14...v1.0.15) (2019-04-18)
|
|
100
89
|
|
|
101
|
-
|
|
102
|
-
|
|
103
90
|
- Make important performance improvement for BigWig data
|
|
104
91
|
|
|
105
92
|
## [1.0.14](https://github.com/GMOD/bbi-js/compare/v1.0.12...v1.0.14) (2019-04-17)
|
|
106
93
|
|
|
107
|
-
|
|
108
|
-
|
|
109
94
|
- Improve documentation for integration with @gmod/bed@2
|
|
110
95
|
- Fix some cases where abortSignal was passed incorrectly to filehandle
|
|
111
96
|
|
|
112
97
|
## [1.0.13](https://github.com/GMOD/bbi-js/compare/v1.0.12...v1.0.13) (2019-04-14)
|
|
113
98
|
|
|
114
|
-
|
|
115
|
-
|
|
116
99
|
- Added uniqueId to objects returned from BigBed to avoid issue with duplicates
|
|
117
100
|
|
|
118
101
|
## [1.0.12](https://github.com/GMOD/bbi-js/compare/v1.0.11...v1.0.12) (2019-04-12)
|
|
119
102
|
|
|
120
103
|
- Fix returning bigbed objects on empty regions
|
|
121
104
|
|
|
122
|
-
|
|
123
105
|
## [1.0.11](https://github.com/GMOD/bbi-js/compare/v1.0.10...v1.0.11) (2019-04-10)
|
|
124
106
|
|
|
125
|
-
|
|
126
|
-
|
|
127
107
|
- Removed polyfill of Array.prototype.flat which modifies global scope
|
|
128
108
|
|
|
129
109
|
## [1.0.10](https://github.com/GMOD/bbi-js/compare/v1.0.9...v1.0.10) (2019-04-09)
|
|
130
110
|
|
|
131
|
-
|
|
132
|
-
|
|
133
111
|
- Fix misinterpretation of variable step wig files in this module (the span is not variable in variable step files, only the step, use bedGraphToBigWig for variable span)
|
|
134
112
|
- Improved docs
|
|
135
113
|
|
|
136
114
|
## [1.0.9](https://github.com/GMOD/bbi-js/compare/v1.0.8...v1.0.9) (2019-04-05)
|
|
137
115
|
|
|
138
|
-
|
|
139
|
-
|
|
140
116
|
- Added caching of networking requests (thanks @rbuels for the abortable-promise-cache module!)
|
|
141
117
|
- Fix some type errors on the range class
|
|
142
118
|
- Correct using span on fixed size wiggle types
|
|
143
119
|
|
|
144
120
|
## [1.0.8](https://github.com/GMOD/bbi-js/compare/v1.0.7...v1.0.8) (2019-04-01)
|
|
145
121
|
|
|
146
|
-
|
|
147
|
-
|
|
148
122
|
- Fix @babel/runtime in deployed package
|
|
149
123
|
- Bugfix to the url argument to the BigWig/BigBed
|
|
150
124
|
|
|
151
125
|
## [1.0.7](https://github.com/GMOD/bbi-js/compare/v1.0.6...v1.0.7) (2019-04-01)
|
|
152
126
|
|
|
153
|
-
|
|
154
|
-
|
|
155
127
|
- Added getFeatureStream which returns an Observable from rxjs
|
|
156
128
|
- Added url option to BigWig and BigBed constructors to allow usage of RemoteFile filehandle
|
|
157
129
|
- Added typescript backend for better processing
|
|
158
130
|
|
|
159
131
|
## [1.0.6](https://github.com/GMOD/bbi-js/compare/v1.0.5...v1.0.6) (2019-03-15)
|
|
160
132
|
|
|
161
|
-
|
|
162
|
-
|
|
163
133
|
- Fix issue with fixed step and variable step bigwig files not working at all
|
|
164
134
|
|
|
165
135
|
## [1.0.5](https://github.com/GMOD/bbi-js/compare/v1.0.4...v1.0.5) (2019-03-07)
|
|
166
136
|
|
|
167
|
-
|
|
168
|
-
|
|
169
137
|
- Fix issue with jest being in deps instead of devDeps
|
|
170
138
|
|
|
171
139
|
## [1.0.4](https://github.com/GMOD/bbi-js/compare/v1.0.3...v1.0.4) (2019-01-28)
|
|
172
140
|
|
|
173
|
-
|
|
174
|
-
|
|
175
141
|
- Add renameRefSeqs functionality where you can apply a callback to the refseq names
|
|
176
142
|
- Consistently apply start/end coordinate filters at different zoom levels
|
|
177
143
|
|
|
@@ -181,19 +147,13 @@ Thanks to @skinner for both of these contributions!
|
|
|
181
147
|
|
|
182
148
|
## [1.0.2](https://github.com/GMOD/bbi-js/compare/v1.0.1...v1.0.2) (2019-01-24)
|
|
183
149
|
|
|
184
|
-
|
|
185
|
-
|
|
186
150
|
- Added regenerator-runtime to babel dist compilation
|
|
187
151
|
|
|
188
152
|
## [1.0.1](https://github.com/GMOD/bbi-js/compare/v1.0.0...v1.0.1) (2019-01-24)
|
|
189
153
|
|
|
190
|
-
|
|
191
|
-
|
|
192
154
|
- Added exports for BigWig and BigBed. const {BigWig, BigBed} = require('@gmod/bbi')
|
|
193
155
|
|
|
194
156
|
# 1.0.0 (2019-01-23)
|
|
195
157
|
|
|
196
|
-
|
|
197
|
-
|
|
198
158
|
- Initial version
|
|
199
159
|
- Has support for bigwig and bigbed files
|
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# bbi-js
|
|
2
2
|
|
|
3
3
|
[](https://npmjs.org/package/@gmod/bbi)
|
|
4
|
-
[](https://codecov.io/gh/GMOD/bbi-js/branch/master)
|
|
5
|
+
[](https://github.com/GMOD/bbi-js/actions?query=branch%3Amaster+workflow%3APush+)
|
|
6
6
|
|
|
7
7
|
A parser for bigwig and bigbed file formats
|
|
8
8
|
|
|
@@ -19,7 +19,6 @@ If using locally
|
|
|
19
19
|
const feats = await file.getFeatures('chr1', 0, 100, { scale: 1 });
|
|
20
20
|
})();
|
|
21
21
|
|
|
22
|
-
|
|
23
22
|
If using remotely, you can use it in combination with generic-filehandle or your own implementation of something like generic-filehandle
|
|
24
23
|
https://github.com/GMOD/generic-filehandle/
|
|
25
24
|
|
|
@@ -43,30 +42,26 @@ https://github.com/GMOD/generic-filehandle/
|
|
|
43
42
|
const feats = await file.getFeatures('chr1', 0, 100, { scale: 1 });
|
|
44
43
|
})();
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
48
45
|
## Documentation
|
|
49
46
|
|
|
50
47
|
### BigWig/BigBed constructors
|
|
51
48
|
|
|
52
49
|
Accepts an object containing either
|
|
53
50
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
- path - path to a local file
|
|
52
|
+
- url - path to a url
|
|
53
|
+
- filehandle - a filehandle instance that you can implement as a custom class yourself. path and url are based on https://www.npmjs.com/package/generic-filehandle but by implementing a class containing the Filehandle interface specified therein, you can pass it to this module
|
|
58
54
|
|
|
59
55
|
### BigWig
|
|
60
56
|
|
|
61
57
|
#### getFeatures(refName, start, end, opts)
|
|
62
58
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
59
|
+
- refName - a name of a chromosome in the file
|
|
60
|
+
- start - a 0-based half open start coordinate
|
|
61
|
+
- end - a 0-based half open end coordinate
|
|
62
|
+
- opts.scale - indicates zoom level to use, specified as pxPerBp, e.g. being zoomed out, you might have 100bp per pixel so opts.scale would be 1/100. the zoom level that is returned is the one which has reductionLevel<=2/opts.scale (reductionLevel is a property of the zoom level structure in the bigwig file data)
|
|
63
|
+
- opts.basesPerScale - optional, inverse of opts.scale e.g. bpPerPx
|
|
64
|
+
- opts.signal - optional, an AbortSignal to halt processing
|
|
70
65
|
|
|
71
66
|
Returns a promise to an array of features. If an incorrect refName or no features are found the result is an empty array.
|
|
72
67
|
|
|
@@ -78,10 +73,9 @@ Example:
|
|
|
78
73
|
// no conversion to 1-based as in wig is done)
|
|
79
74
|
// note refseq is not returned on the object, it is clearly chr1 from the query though
|
|
80
75
|
|
|
81
|
-
|
|
82
76
|
### Understanding scale and reductionLevel
|
|
83
77
|
|
|
84
|
-
Here is what the reductionLevel structure looks like in a file. The zoomLevel that is chosen is the first reductionLevel<2
|
|
78
|
+
Here is what the reductionLevel structure looks like in a file. The zoomLevel that is chosen is the first reductionLevel<2\*opts.basesPerScale (or reductionLevel<2/opts.scale) when scanning backwards through this list
|
|
85
79
|
|
|
86
80
|
[ { reductionLevel: 40, ... },
|
|
87
81
|
{ reductionLevel: 160, ... },
|
|
@@ -91,7 +85,6 @@ Here is what the reductionLevel structure looks like in a file. The zoomLevel th
|
|
|
91
85
|
{ reductionLevel: 40960, ... },
|
|
92
86
|
{ reductionLevel: 163840, ... } ]
|
|
93
87
|
|
|
94
|
-
|
|
95
88
|
#### getFeatureStream(refName, start, end, opts)
|
|
96
89
|
|
|
97
90
|
Same as getFeatures but returns an RxJS observable stream, useful for very large queries
|
|
@@ -109,10 +102,10 @@ Same as getFeatures but returns an RxJS observable stream, useful for very large
|
|
|
109
102
|
|
|
110
103
|
#### getFeatures(refName, start, end, opts)
|
|
111
104
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
105
|
+
- refName - a name of a chromosome in the file
|
|
106
|
+
- start - a 0-based half open start coordinate
|
|
107
|
+
- end - a 0-based half open end coordinate
|
|
108
|
+
- opts.signal - optional, an AbortSignal to halt processing
|
|
116
109
|
|
|
117
110
|
returns a promise to an array of features. no concept of zoom levels is used with bigwig data
|
|
118
111
|
|
|
@@ -133,8 +126,7 @@ Returns a Promise to an array of Features, with an extra field indicating the fi
|
|
|
133
126
|
|
|
134
127
|
### How to parse BigBed results
|
|
135
128
|
|
|
136
|
-
The BigBed line contents are returned as a raw text line e.g. {start: 0, end:100, rest: "ENST00000456328.2\t1000\t..."} where "rest" contains tab delimited text for the fields from 4 and on in the BED format.
|
|
137
|
-
|
|
129
|
+
The BigBed line contents are returned as a raw text line e.g. {start: 0, end:100, rest: "ENST00000456328.2\t1000\t..."} where "rest" contains tab delimited text for the fields from 4 and on in the BED format. Since BED files from BigBed format often come with autoSql (a description of all the columns) it can be useful to parse it with BED parser that can handle autoSql. The rest line can be parsed by the @gmod/bed module, which is not by default integrated with this module, but can be combined with it as follows
|
|
138
130
|
|
|
139
131
|
```js
|
|
140
132
|
import {BigBed} from '@gmod/bbi'
|
|
@@ -181,7 +173,6 @@ Features after parsing with @gmod/bed:
|
|
|
181
173
|
spID: 'AL137655' }
|
|
182
174
|
```
|
|
183
175
|
|
|
184
|
-
|
|
185
176
|
## Academic Use
|
|
186
177
|
|
|
187
178
|
This package was written with funding from the [NHGRI](http://genome.gov) as part of the [JBrowse](http://jbrowse.org) project. If you use it in an academic project that you publish, please cite the most recent JBrowse paper, which will be linked from [jbrowse.org](http://jbrowse.org).
|
|
@@ -189,4 +180,3 @@ This package was written with funding from the [NHGRI](http://genome.gov) as par
|
|
|
189
180
|
## License
|
|
190
181
|
|
|
191
182
|
MIT © [Colin Diesh](https://github.com/cmdcolin)
|
|
192
|
-
|