noodles-bgzf 0.33.0

Blocked gzip format (BGZF) reader and writer
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
# Changelog

## 0.33.0 - 2024-09-04

### Changed

  * bgzf/reader/builder: Rename `Builder::build_with_reader` to
    `Builder::build_from_reader`.

  * bgzf/writer/builder: Rename `Builder::build_with_writer` to
    `Builder::build_from_writer`.

### Deprecated

  * bgzf/async/reader/builder: Deprecate `Builder::build_with_reader`.

    Use `Builder::build_from_reader` instead.

  * bgzf/writer/builder: Deprecate `Builder::build_with_writer`.

    Use `Builder::build_from_writer` instead.

## 0.32.0 - 2024-07-14

### Added

  * bgzf/async/reader: Add seeking to an uncompressed position
    (`Reader::seek_by_uncompressed_position`) ([#273]).

[#273]: https://github.com/zaeleus/noodles/issues/273

## 0.31.0 - 2024-06-17

### Added

  * bgzf/gzi/reader: Add common methods to access the underlying reader.

## 0.30.0 - 2024-05-16

### Added

  * bgzf/writer/compression_level: Add a `const` getter
    (`CompressionLevel::get`).

  * bgzf/writer/compression_level: Implement `Ord` + `PartialOrd`.

## 0.29.0 - 2024-05-02

### Added

  * bgzf/io: Add read-related traits (`Read`, `BufRead`, and `Seek`).

  * bgzf/multithreaded_reader: Add default constructor
    (`MultithreadedReader::new`) and accessor for the underlying reader
    (`MultithreadedReader::get_mut`).

  * bgzf/multithreaded_writer: Add default constructor
    (`MultithreadedWriter::new`).

  * bgzf/virtual_position: Add `const` constructor (`VirtualPosition::new`).

  * bgzf/writer/compression_level: Add associated constants for common
    compression levels (`CompressionLevel::NONE`, `CompressionLevel::FAST`, and
    `CompressionLevel::BEST`).

  * bgzf/writer/compression_level: Add `const` constructor
    (`CompressionLevel::new`).

### Changed

  * bgzf/multithreaded_writer: Return inner writer on shut down
    (`Multithreaded::finish`).

    This adds generic type parameter `W` to `MultithreadedWriter`.

  * bgzf/virtual_position: Make getters (`VirtualPosition::uncompressed` and
    `VirtualPosition::compressed`) `const`.

### Deprecated

  * bgzf/writer/compression_level: Deprecate named constructors
    (`CompressionLevel::none`, `CompressionLevel::fast`, and
    `CompressionLevel::best`).

    Use the compression level constants instead of the named constructors,
    e.g., `CompressionLevel::none()` => `CompressionLevel::NONE`.

### Removed

  * bgzf/reader/block: Remove blocking multithreaded reader.

    This block reader was used when the worker count was set to > 1. However,
    I/O was still performed on the current thread. In the case of sequential
    reading, use `bgzf::MultithreadedReader` instead, which moves I/O to its
    own thread.

## 0.28.0 - 2024-03-28

### Changed

  * bgzf/async/block_codec: Allow final frame to be incomplete ([#243]).

    The final frame of an input stream is now allowed to be incomplete,
    allowing for decoding up to a known end position in the stream. Frame size
    validation now occurs from the inflater.

[#243]: https://github.com/zaeleus/noodles/issues/243

## 0.27.0 - 2024-03-12

### Added

  * bgzf/multithreaded_writer: Add builder ([#238]).

    This also adds the ability to set the compression level.

[#238]: https://github.com/zaeleus/noodles/issues/238

## 0.26.0 - 2023-12-14

### Changed

  * bgzf: Raise minimum supported Rust version (MSRV) to 1.70.0.

## 0.25.0 - 2023-10-12

### Changed

  * bgzf: Update to libdeflater 1.19.0 (libdeflate 1.19).

  * bgzf/multithreaded_reader: Return inner reader from
    `bgzf::MultithreadedReader::finish`.

## 0.24.0 - 2023-08-31

### Added

  * bgzf: Add a multithreaded reader (`bgzf::MultithreadedReader`).

    This differs from a `bgzf::Reader` with > 1 worker by placing the inner
    reader on its own thread to read raw frames asynchronously.

## 0.23.0 - 2023-08-17

### Added

  * bgzf/async/reader: Add inner access delegates (`r#async::Reader::get_ref`,
    `r#async::Reader::get_mut`, `r#async::Reader::get_pin_mut`, and
    `r#async::Reader::into_inner`).

## 0.22.0 - 2023-06-01

### Changed

  * bgzf: Update to libdeflater 0.14.0 (libdeflate 1.18).

## 0.21.0 - 2023-04-27

### Added

  * bgzf/indexed_reader: Add getter for index (`IndexedReader::index`).

### Changed

  * bgzf: Update to libdeflater 0.13.0.

## 0.20.0 - 2023-03-03

### Added

  * bgzf/gzi/async: Add convenience `read` function.

### Changed

  * bgzf/gzi: Improve performance of reading entire GZ index ([#143]).

[#143]: https://github.com/zaeleus/noodles/issues/143

## 0.19.0 - 2023-02-03

### Changed

  * bgzf: Raise minimum supported Rust version (MSRV) to 1.64.0.

  * bgzf: Update to libdeflater 0.12.0 (libdeflate 1.17).

### Removed

  * bgzf/virtual_position: Remove `VirtualPosition::max`.

    This was deprecated in noodles-bgzf 0.18.0. Use
    `VirtualPosition::MAX` instead.

## 0.18.0 - 2022-11-18

### Added

  * bgzf: Add multithreaded writer (`bgzf::MultithreadedWriter`).

    This is an alternative writer that uses a thread pool to compress block
    data. It currently cannot be used as a drop-in replacement for
    `bgzf::Writer`; however, it does implement `std::io::Write`.

  * bgzf/virtual_position: Add `MIN` and `MAX` associated constants.

### Fixed

  * bgzf/async/reader: Skip empty blocks.

  * bgzf/reader: Skip empty blocks ([#133]).

[#133]: https://github.com/zaeleus/noodles/issues/133

### Deprecated

  * bgzf/virtual_position: Deprecate `VirtualPosition::max`.

    Use `VirtualPosition::MAX` instead.

## 0.17.0 - 2022-10-28

### Added

  * bgzf/async/reader/builder: Implement `Default`.

  * bgzf/async/writer/builder: Implement `Default`.

  * bgzf/writer/builder: Implement `Default`.

### Changed

  * bgzf/async/reader/builder: `Builder` no longer holds a reader.

  * bgzf/async/writer/builder: `Builder` no longer holds a reader.

  * bgzf/async/writer/builder: Change worker count to a `NonZeroUsize`.

    The worker count can never be 0.

  * bgzf/writer/builder: `Builder` no longer holds a writer.

### Removed

  * bgzf/async/reader: Remove `AsyncReader::builder`.

    Use `r#async::reader::Builder::default` instead.

  * bgzf/async/reader/builder: Remove `Builder::build`.

    Use `Builder::build_with_reader` instead.

  * bgzf/async/writer: Remove `AsyncWriter::builder`.

    Use `r#async::writer::Builder::default` instead.

  * bgzf/async/writer/builder: Remove `Builder::build`.

    Use `Builder::build_with_writer` instead.

  * bgzf/writer: Remove `Writer::builder`.

    Use `writer::Builder::default` instead.

  * bgzf/writer/builder: Remove `Builder::build`.

    Use `Builder::build_with_writer` instead.

## 0.16.0 - 2022-10-20

### Added

  * bgzf: Add an indexed reader (`IndexedReader`).

  * bgzf/reader/builder: Add build from path (`Builder::build_from_path`).

### Changed

  * bgzf: Update to libdeflater 0.11.0 (libdeflate 1.14).

## 0.15.0 - 2022-09-29

### Added

  * bgzf/gzi: Add convenience `read` function.

  * bgzf/reader: Add seeking to an uncompressed position
    (`Reader::seek_by_uncompressed_position`).

### Changed

  * bgzf: Raise minimum supported Rust version (MSRV) to 1.57.0.

  * bgzf/gzi: Start index with the initial block.

    The first block, i.e., (0, 0), is now included in the index.

### Fixed

  * bgzf/reader/block/multi: Reset block queue after possible inner reader
    mutation ([#112]).

[#112]: https://github.com/zaeleus/noodles/issues/112

## 0.14.0 - 2022-08-16

### Added

  * bgzf/gzi: Add async reader (`gzi::AsyncReader`).

  * bgzf/gzi: Add reader (`gzi::Reader`).

  * bgzf/reader: Add builder (`reader::Builder`).

  * bgzf/reader: Add multithreaded block reader.

    The multithreaded `bgzf::Reader` is enabled when the worker count is > 1.

### Changed

  * bgzf/async/reader/builder: Change worker count to a `NonZeroUsize`.

    The worker count can never be 0.

## 0.13.0 - 2022-07-05

### Changed

  * bgzf: Update to libdeflater 0.10.0 (libdeflate 1.10) ([#98]).

    This also fixes the usage of compression level 0 (e.g.,
    `CompressionLevel::none`) when the `libdeflate` feature is enabled.

  * bgzf/async/reader: Verify BGZF block header values ([#93]).

  * bgzf/reader: Verify BGZF block header values ([#93]).

[#93]: https://github.com/zaeleus/noodles/issues/93
[#98]: https://github.com/zaeleus/noodles/issues/98

### Fixed

  * bgzf/async/block_codec: Avoid truncating the header block size (`BSIZE`)
    ([#96]).

  * bgzf/async/writer: Compensate for gzip overhead ([#96]).

  * bgzf/writer: Avoid truncating the header block size (`BSIZE`) ([#96]).

  * bgzf/writer: Compensate for gzip overhead ([#96]).

    This reduces the max uncompressed data buffer to 65495 bytes and allows
    the use of compression level 0.

[#96]: https://github.com/zaeleus/noodles/issues/96

## 0.12.0 - 2022-06-08

### Changed

  * bgzf/async/reader: Verify the expected CRC32 checksum of the uncompressed
    data.

  * bgzf/reader: Verify the expected CRC32 checksum of the uncompressed data.

## 0.11.0 - 2022-03-29

### Added

  * bgzf/writer/compression_level: Enable compression level 0 (no compression)
    for libdeflate.

### Changed

  * bgzf: Update to libdeflater 0.8.0 (libdeflate 1.10).

## 0.10.0 - 2022-03-02

### Changed

  * bgzf/writer: Immediately flush block upon reaching the max block size.

  * bgzf/writer: Track position (`Writer::position`) and virtual position
    (`Writer::virtual_position`) ([#77]).

  * bgzf/writer: Add `into_inner` to return the underlying writer.

[#77]: https://github.com/zaeleus/noodles/issues/77

## 0.9.0 - 2022-02-17

### Added

  * bgzf: Set minimum supported Rust version (MSRV) to 1.56.0 in package
    manifest.

  * bgzf/writer: Add builder (`Writer::builder`).

    This allows setting a compression level.

### Changed

  * bgzf: Update to tokio-util 0.7.0.

## 0.8.0 - 2022-01-27

### Changed

  * bgzf/async/reader: Create future for inflating data.

## 0.7.0 - 2021-12-02

### Added

  * bgzf/reader: Read to given buffer when it is guaranteed to be larger than
    the next block.

## 0.6.0 - 2021-11-18

### Added

  * bgzf/reader: Add common methods to access the underlying reader: `get_ref`,
    `get_mut`, and `into_inner`.

## 0.5.0 - 2021-11-11

### Added

  * bgzf: Add `libdeflate` feature to use [libdeflate] for encoding and
    decoding DEFLATE streams (#51).

  * bgzf/writer: Add crate `CompressionLevel` type.

    This replaces the usage of `flate2::Compression` and
    `libdeflater::CompressionLvl`.

[#51]: https://github.com/zaeleus/noodles/issues/51
[libdeflate]: https://github.com/ebiggers/libdeflate

### Changed

  * bgzf: Update to Rust 2021.

  * bgzf/async/writer/builder: The compression level wrapper changed from
    `flate2::Compression` to `noodles_bgzf::writer::CompressionLevel`.

## 0.4.0 - 2021-08-19

### Changed

  * bgzf: Update to tokio 1.10.0.

  * bgzf/async: I/O builders are now owned/consuming builders.

    This fixes the terminal method not being able to move out of a mutable
    reference.

### Fixed

  * bgzf: Define features to enable for Docs.rs.

## 0.3.0 - 2021-08-11

### Added

  * bgzf/async: Add async reader (`bgzf::AsyncReader`).

  * bgzf/async: Add async writer (`bgzf::AsyncWriter`) ([#17]).

    Async I/O can be enabled with the `async` feature. 

    Async BGZF I/O is implemented using a queue of block buffers, which are
    encoded/decoded in parallel (depending on the async executor). This can
    significantly improve read/write performance.

[#17]: https://github.com/zaeleus/noodles/issues/17

## 0.2.0 - 2021-07-21

### Fixed

  * bgzf: Fixed documentation link in package manifest ([#31]).

[#31]: https://github.com/zaeleus/noodles/issues/31

### Removed

  * bgzf/index: Moved `Chunk` to noodles-csi.

    Replace usages of `noodles_bgzf::index::Chunk` with
    `noodles-csi::index::reference_sequence::bin::Chunk`.

  * bgzf/index: Moved `Metadata` to noodles-csi.

    Replace usages of `noodles_bgzf::index::Metadata` with
    `noodles-csi::index::reference_sequence::Metadata`.

  * bgzf/index: Moved chunk merging functions to noodles-csi.

    Replace usages of `noodles_bgzf::index::{merge_chunks, optimize_chunks}`
    with `noodles_csi::binning_index::{merge_chunks, optimize_chunks}`.

## 0.1.0 - 2021-07-14

  * bgzf: Initial release.