@gmod/bam 1.1.5 → 1.1.9

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.
Files changed (74) hide show
  1. package/CHANGELOG.md +28 -2
  2. package/README.md +3 -3
  3. package/dist/bai.d.ts +2 -0
  4. package/dist/bai.js +300 -548
  5. package/dist/bai.js.map +1 -0
  6. package/dist/bamFile.d.ts +6 -13
  7. package/dist/bamFile.js +675 -1197
  8. package/dist/bamFile.js.map +1 -0
  9. package/dist/chunk.js +34 -69
  10. package/dist/chunk.js.map +1 -0
  11. package/dist/constants.js +27 -35
  12. package/dist/constants.js.map +1 -0
  13. package/dist/csi.js +317 -515
  14. package/dist/csi.js.map +1 -0
  15. package/dist/errors.js +64 -120
  16. package/dist/errors.js.map +1 -0
  17. package/dist/htsget.js +275 -396
  18. package/dist/htsget.js.map +1 -0
  19. package/dist/index.js +16 -54
  20. package/dist/index.js.map +1 -0
  21. package/dist/indexFile.d.ts +1 -2
  22. package/dist/indexFile.js +77 -163
  23. package/dist/indexFile.js.map +1 -0
  24. package/dist/record.d.ts +2 -0
  25. package/dist/record.js +496 -701
  26. package/dist/record.js.map +1 -0
  27. package/dist/sam.js +16 -49
  28. package/dist/sam.js.map +1 -0
  29. package/dist/util.d.ts +0 -1
  30. package/dist/util.js +115 -126
  31. package/dist/util.js.map +1 -0
  32. package/dist/virtualOffset.js +44 -77
  33. package/dist/virtualOffset.js.map +1 -0
  34. package/esm/bai.d.ts +26 -0
  35. package/esm/bai.js +191 -0
  36. package/esm/bai.js.map +1 -0
  37. package/esm/bamFile.d.ts +77 -0
  38. package/esm/bamFile.js +388 -0
  39. package/esm/bamFile.js.map +1 -0
  40. package/esm/chunk.d.ts +18 -0
  41. package/esm/chunk.js +33 -0
  42. package/esm/chunk.js.map +1 -0
  43. package/esm/constants.d.ts +15 -0
  44. package/esm/constants.js +27 -0
  45. package/esm/constants.js.map +1 -0
  46. package/esm/csi.d.ts +35 -0
  47. package/esm/csi.js +209 -0
  48. package/esm/csi.js.map +1 -0
  49. package/esm/errors.d.ts +23 -0
  50. package/esm/errors.js +24 -0
  51. package/esm/errors.js.map +1 -0
  52. package/esm/htsget.d.ts +33 -0
  53. package/esm/htsget.js +100 -0
  54. package/esm/htsget.js.map +1 -0
  55. package/esm/index.d.ts +6 -0
  56. package/esm/index.js +7 -0
  57. package/esm/index.js.map +1 -0
  58. package/esm/indexFile.d.ts +27 -0
  59. package/esm/indexFile.js +27 -0
  60. package/esm/indexFile.js.map +1 -0
  61. package/esm/record.d.ts +88 -0
  62. package/esm/record.js +534 -0
  63. package/esm/record.js.map +1 -0
  64. package/esm/sam.d.ts +7 -0
  65. package/esm/sam.js +16 -0
  66. package/esm/sam.js.map +1 -0
  67. package/esm/util.d.ts +35 -0
  68. package/esm/util.js +92 -0
  69. package/esm/util.js.map +1 -0
  70. package/esm/virtualOffset.d.ts +10 -0
  71. package/esm/virtualOffset.js +37 -0
  72. package/esm/virtualOffset.js.map +1 -0
  73. package/package.json +22 -30
  74. package/dist/declare.d.js +0 -2
package/CHANGELOG.md CHANGED
@@ -1,7 +1,33 @@
1
- <a name="1.1.5"></a>
2
- ## [1.1.5](https://github.com/GMOD/bam-js/compare/v1.1.4...v1.1.5) (2020-12-11)
1
+ <a name="1.1.9"></a>
2
+ ## [1.1.9](https://github.com/GMOD/bam-js/compare/v1.1.8...v1.1.9) (2021-12-14)
3
+
4
+
5
+
6
+ - Add ESM module export in package.json (smaller bundle size for consumers)
7
+ - Cache BAI readFile result for compatibility with node.js native filehandles (which otherwise fail if re-reading the filehandle twice)
8
+
9
+ <a name="1.1.8"></a>
10
+ ## [1.1.8](https://github.com/GMOD/bam-js/compare/v1.1.7...v1.1.8) (2021-05-21)
11
+
12
+
13
+
14
+ - Fix types for yieldThreadTime
3
15
 
16
+ <a name="1.1.7"></a>
4
17
 
18
+ ## [1.1.7](https://github.com/GMOD/bam-js/compare/v1.1.6...v1.1.7) (2021-05-21)
19
+
20
+ - New param yieldThreadTime to constructor to yield while processing
21
+
22
+ <a name="1.1.6"></a>
23
+
24
+ ## [1.1.6](https://github.com/GMOD/bam-js/compare/v1.1.5...v1.1.6) (2021-02-20)
25
+
26
+ - Add qualRaw function on records for getting raw qual score array instead of string
27
+
28
+ <a name="1.1.5"></a>
29
+
30
+ ## [1.1.5](https://github.com/GMOD/bam-js/compare/v1.1.4...v1.1.5) (2020-12-11)
5
31
 
6
32
  - Allow getHeaderText to accept cancellation options
7
33
 
package/README.md CHANGED
@@ -1,7 +1,6 @@
1
- [![Generated with nod](https://img.shields.io/badge/generator-nod-2196F3.svg?style=flat-square)](https://github.com/diegohaz/nod)
2
1
  [![NPM version](https://img.shields.io/npm/v/@gmod/bam.svg?style=flat-square)](https://npmjs.org/package/@gmod/bam)
3
- [![Build Status](https://img.shields.io/travis/GMOD/bam-js/master.svg?style=flat-square)](https://travis-ci.org/GMOD/bam-js)
4
2
  [![Coverage Status](https://img.shields.io/codecov/c/github/GMOD/bam-js/master.svg?style=flat-square)](https://codecov.io/gh/GMOD/bam-js/branch/master)
3
+ [![Build Status](https://img.shields.io/github/workflow/status/GMOD/bam-js/Push/master?logo=github&style=flat-query)](https://github.com/GMOD/bam-js/actions?query=branch%3Amaster+workflow%3APush+)
5
4
 
6
5
  ## Install
7
6
 
@@ -47,12 +46,13 @@ const records = await ti.getRecordsForRange(1, 2000000, 2000001)
47
46
 
48
47
  The BAM class constructor accepts arguments
49
48
 
50
- - bamPath/baiUrl/bamFilehandle - a string file path to a local file or a class object with a read method
49
+ - bamPath/bamUrl/bamFilehandle - a string file path to a local file or a class object with a read method
51
50
  - csiPath/csiUrl/csiFilehandle - a CSI index for the BAM file, required for long chromosomes greater than 2^29 in length
52
51
  - baiPath/baiUrl/baiFilehandle - a BAI index for the BAM file
53
52
  - fetchSizeLimit - total size of the number of chunks being fetched at once. default: ~50MB
54
53
  - chunkSizeLimit - size limit on any individual chunk. default: ~10MB
55
54
  - cacheSize - limit on number of chunks to cache. default: 50
55
+ - yieldThreadTime - the interval at which the code yields to the main thread when it is parsing a lot of data. default: 100ms. Set to 0 to performed no yielding
56
56
 
57
57
  Note: filehandles implement the Filehandle interface from https://www.npmjs.com/package/generic-filehandle. This module offers the path and url arguments as convenience methods for supplying the LocalFile and RemoteFile
58
58
 
package/dist/bai.d.ts CHANGED
@@ -3,10 +3,12 @@ import Chunk from './chunk';
3
3
  import IndexFile from './indexFile';
4
4
  import { BaseOpts } from './util';
5
5
  export default class BAI extends IndexFile {
6
+ baiP?: Promise<Buffer>;
6
7
  parsePseudoBin(bytes: Buffer, offset: number): {
7
8
  lineCount: number;
8
9
  };
9
10
  lineCount(refId: number, opts?: BaseOpts): Promise<any>;
11
+ fetchBai(opts?: BaseOpts): Promise<Buffer>;
10
12
  _parse(opts?: BaseOpts): Promise<{
11
13
  [key: string]: any;
12
14
  }>;