Skip to content

Commit

Permalink
Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Nov 30, 2024
1 parent 56b2591 commit 47cbf3a
Show file tree
Hide file tree
Showing 8 changed files with 680 additions and 650 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Coverage Status](https://img.shields.io/codecov/c/github/GMOD/bgzf-filehandle/master.svg?style=flat-square)](https://codecov.io/gh/GMOD/bgzf-filehandle/branch/master)
[![Build Status](https://img.shields.io/github/actions/workflow/status/GMOD/bgzf-filehandle/push.yml?branch=master)](https://github.com/GMOD/bgzf-filehandle/actions)

Transparently read [indexed block-gzipped (BGZF)](http://www.htslib.org/doc/bgzip.html) files, such as those created by bgzip, using coordinates from the uncompressed file. The module is used in @gmod/indexedfasta to read bgzip-indexed fasta files (with gzi index, fai index, and fa).
Transparently read [indexed block-gzipped (BGZF)](http://www.htslib.org/doc/bgzip.html) files, such as those created by bgzip, using coordinates from the uncompressed file. The module is used in @gmod/indexedfasta to read bgzip-indexed fasta files (with gzi index, fai index, and fa).

Users can also use the `unzip` function to unzip bgzip files whole (which pako has trouble with natively)

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@
"@types/long": "^4.0.1",
"@types/node": "^18.11.16",
"@types/pako": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^5.59.9",
"@typescript-eslint/parser": "^5.59.9",
"@typescript-eslint/eslint-plugin": "^8.16.0",
"@typescript-eslint/parser": "^8.16.0",
"@vitest/coverage-v8": "^2.0.5",
"eslint": "^9.9.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-unicorn": "^56.0.1",
"prettier": "^2.8.8",
"rimraf": "^5.0.1",
"prettier": "^3.4.1",
"rimraf": "^6.0.1",
"typescript": "^5.1.3",
"typescript-eslint": "^8.1.0",
"vitest": "^2.1.6"
Expand Down
1 change: 0 additions & 1 deletion src/bgzFilehandle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export default class BgzFilehandle {
blockNum < blockPositions.length - 1;
blockNum += 1
) {

const uncompressedBuffer = await this._readAndUncompressBlock(
blockBuffer,
blockPositions[blockNum],
Expand Down
9 changes: 2 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@





export {default as BgzfFilehandle} from './bgzFilehandle'
export {unzip, unzipChunk, unzipChunkSlice} from './unzip'
export { default as BgzfFilehandle } from './bgzFilehandle'
export { unzip, unzipChunk, unzipChunkSlice } from './unzip'
1 change: 0 additions & 1 deletion src/unzip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ function nodeUnzip(input: Buffer): Promise<Buffer> {
export { nodeUnzip as unzip, nodeUnzip }

export { pakoUnzip, unzipChunk, unzipChunkSlice } from './unzip-pako'

2 changes: 1 addition & 1 deletion test/unzip.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('unzip', () => {
it('can unzip bgzip-1.txt.gz', async () => {
const testData = fs.readFileSync(require.resolve('./data/bgzip-1.txt.gz'))
const fromPako = await pakoUnzip(testData)
const fromNode = (await nodeUnzip(testData))
const fromNode = await nodeUnzip(testData)
expect(fromNode).toEqual(fromPako)
expect(fromNode.length).toEqual(65569)
expect(fromPako.length).toEqual(65569)
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"include": ["src"],
"compilerOptions": {
"target": "es2015",
"types": ["node"],
"lib": ["dom", "esnext"],
"outDir": "esm",
"declaration": true,
"moduleResolution": "node",
Expand Down
1,305 changes: 671 additions & 634 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 47cbf3a

Please sign in to comment.