@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 CHANGED
@@ -1,3 +1,9 @@
1
+ ## [1.0.31](https://github.com/GMOD/bbi-js/compare/v1.0.30...v1.0.31) (2021-12-14)
2
+
3
+
4
+
5
+ - Add esm module builds with less babelification for smaller bundle sizes
6
+
1
7
  ## [1.0.30](https://github.com/GMOD/bbi-js/compare/v1.0.29...v1.0.30) (2020-06-25)
2
8
 
3
9
 
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # bbi-js
2
2
 
3
3
  [![NPM version](https://img.shields.io/npm/v/@gmod/bbi.svg?style=flat-square)](https://npmjs.org/package/@gmod/bbi)
4
- [![Build Status](https://img.shields.io/travis/GMOD/bbi-js/master.svg?style=flat-square)](https://travis-ci.org/GMOD/bbi-js) [![Coverage Status](https://img.shields.io/codecov/c/github/GMOD/bbi-js/master.svg?style=flat-square)](https://codecov.io/gh/GMOD/bbi-js/branch/master)
5
-
4
+ [![Coverage Status](https://img.shields.io/codecov/c/github/GMOD/bbi-js/master.svg?style=flat-square)](https://codecov.io/gh/GMOD/bbi-js/branch/master)
5
+ [![Build Status](https://img.shields.io/github/workflow/status/GMOD/bbi-js/Push/master?logo=github&style=flat-query)](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
- * path - path to a local file
55
- * url - path to a url
56
- * 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
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
- * refName - a name of a chromosome in the file
64
- * start - a 0-based half open start coordinate
65
- * end - a 0-based half open end coordinate
66
- * 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)
67
- * opts.basesPerScale - optional, inverse of opts.scale e.g. bpPerPx
68
- * opts.signal - optional, an AbortSignal to halt processing
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*opts.basesPerScale (or reductionLevel<2/opts.scale) when scanning backwards through this list
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
- * refName - a name of a chromosome in the file
113
- * start - a 0-based half open start coordinate
114
- * end - a 0-based half open end coordinate
115
- * opts.signal - optional, an AbortSignal to halt processing
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. 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
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
-