@gmod/bam 1.1.8 → 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 (73) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -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 +4 -6
  7. package/dist/bamFile.js +675 -1203
  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.js +496 -707
  25. package/dist/record.js.map +1 -0
  26. package/dist/sam.js +16 -49
  27. package/dist/sam.js.map +1 -0
  28. package/dist/util.d.ts +0 -1
  29. package/dist/util.js +115 -126
  30. package/dist/util.js.map +1 -0
  31. package/dist/virtualOffset.js +44 -77
  32. package/dist/virtualOffset.js.map +1 -0
  33. package/esm/bai.d.ts +26 -0
  34. package/esm/bai.js +191 -0
  35. package/esm/bai.js.map +1 -0
  36. package/esm/bamFile.d.ts +77 -0
  37. package/esm/bamFile.js +388 -0
  38. package/esm/bamFile.js.map +1 -0
  39. package/esm/chunk.d.ts +18 -0
  40. package/esm/chunk.js +33 -0
  41. package/esm/chunk.js.map +1 -0
  42. package/esm/constants.d.ts +15 -0
  43. package/esm/constants.js +27 -0
  44. package/esm/constants.js.map +1 -0
  45. package/esm/csi.d.ts +35 -0
  46. package/esm/csi.js +209 -0
  47. package/esm/csi.js.map +1 -0
  48. package/esm/errors.d.ts +23 -0
  49. package/esm/errors.js +24 -0
  50. package/esm/errors.js.map +1 -0
  51. package/esm/htsget.d.ts +33 -0
  52. package/esm/htsget.js +100 -0
  53. package/esm/htsget.js.map +1 -0
  54. package/esm/index.d.ts +6 -0
  55. package/esm/index.js +7 -0
  56. package/esm/index.js.map +1 -0
  57. package/esm/indexFile.d.ts +27 -0
  58. package/esm/indexFile.js +27 -0
  59. package/esm/indexFile.js.map +1 -0
  60. package/esm/record.d.ts +88 -0
  61. package/esm/record.js +534 -0
  62. package/esm/record.js.map +1 -0
  63. package/esm/sam.d.ts +7 -0
  64. package/esm/sam.js +16 -0
  65. package/esm/sam.js.map +1 -0
  66. package/esm/util.d.ts +35 -0
  67. package/esm/util.js +92 -0
  68. package/esm/util.js.map +1 -0
  69. package/esm/virtualOffset.d.ts +10 -0
  70. package/esm/virtualOffset.js +37 -0
  71. package/esm/virtualOffset.js.map +1 -0
  72. package/package.json +21 -29
  73. package/dist/declare.d.js +0 -2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,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
+
1
9
  <a name="1.1.8"></a>
2
10
  ## [1.1.8](https://github.com/GMOD/bam-js/compare/v1.1.7...v1.1.8) (2021-05-21)
3
11
 
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,7 +46,7 @@ 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
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
  }>;