@gmod/bbi 1.0.30 → 1.0.31
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 +6 -0
- 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 +405 -494
- package/dist/index.js +6 -41
- package/dist/range.js +115 -176
- 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 +323 -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/util.d.ts +24 -0
- package/esm/util.js +74 -0
- package/package.json +17 -27
- package/dist/declares.d.js +0 -2
package/CHANGELOG.md
CHANGED
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
|
-
|