noodles-vcf 0.25.0

Variant Call Format (VCF) 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
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
# Changelog

## 0.25.0 - 2023-03-03

### Added

  * vcf: Add a variant reader trait (`VariantReader`) ([#149]).

    This is a generalization for reading VCF-like variant formats.

  * vcf/header: Add header parser (`header::Parser`).

    This can be used to customize how to parse the header.

  * vcf/header/format/key: Implement `Borrow<str>`.

  * vcf/header/format/key: Add VCF 4.4 reserved keys.

  * vcf/header/info/key: Implement `Borrow<str>`.

  * vcf/header/info/key: Add VCF 4.4 reserved keys.

  * vcf/reader: Implement `VariantReader` ([#149]).

  * vcf/record/info/field/value: Implement `TryFrom<(Number, Type, &str)>`.

  * vcf/record/genotypes/genotype/field/value: Implement `TryFrom<(Number,
    Type, &str)>`.

[#149]: https://github.com/zaeleus/noodles/pull/149

### Changed

  * vcf/header: Move `header::format::Type` to record map value.

    Use `header::record::value::map::format::Type` instead.

  * vcf/header: Move `header::info::Type` to record map value.

    Use `header::record::value::map::info::Type` instead.

  * vcf/header/format/key: Split standard (reserved) and other (non-reserved)
    keys.

    Change usages of, e.g, `Key::Genotype` to `key::GENOTYPE`.

  * vcf/header/info/key: Split standard (reserved) and other (non-reserved)
    keys.

    Change usages of, e.g, `Key::TotalDepth` to `key::TOTAL_DEPTH`.

  * vcf/header/record/parser: Disallow empty values for unstructured lines.

  * vcf/record/genotypes/genotype/field/value/genotype: Infer phasing of first
    allele.

  * vcf/record/genotypes/genotype/field/value/genotype/allele: The phasing is
    now required.

  * vcf/record/ids: Move missing field value parsing to record parser.

    `Ids` no longer handles "." as missing.

  * vcf/record/ids/id: Disallow `.` as a valid identifier.

### Fixed

  * vcf/reader: Fix infinite loop when an input is only a header with no final
    newline.

    This makes the header line reader consistent with the record line reader.

  * vcf/record/genotypes/genotype: Fail parsing when there are more values than
    keys.

    This previously would silently drop values after the last key.

## 0.24.0 - 2023-02-03

### Added

  * vcf: Implement `std::error::Error::source` for errors.

  * vcf/record/genotypes/genotype: Implement `Extend<(Key, Option<Value>)>`.

  * vcf/record/genotypes/genotype: Implement `FromIterator<(Key,
    Option<Value>)>`.

  * vcf/record/info: Implement `Extend<(Key, Option<Value>)>`.

  * vcf/record/info: Implement `FromIterator<(Key, Option<Value>)>`.

### Changed

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

  * vcf/header: Change inserting `OtherRecords` as an `Key::Other`-`Value`
    pair.

  * vcf/header: Change `Header::get` to accept keys that implement
    `Equivalent<Other>`.

  * vcf/header/builder: Change inserting ALT, contig, FILTER, FORMAT, INFO, and
    META records as an ID-map pair.

  * vcf/header/record/value/map: Move records IDs from record to map key.

    `Map<I>` no longer holds the record ID. Use the collection key instead.

  * vcf/header/record/value/map/format: Change conversion from key value to a
    reference (`&format::Key`).

  * vcf/header/record/value/map/info: Change conversion from key value to a
    reference (`&info::Key`).

  * vcf/record/info: Change underlying map to `Key`-`Option<Value>` rather than
    `Key`-`Field`.

  * vcf/record/genotypes/genotype: Change underlying map to
    `Key`-`Option<Value>` rather than `Key`-`Field`.

  * vcf/record/genotypes/genotype: Change `TryFrom<Vec<Field>>` to
    `TryFrom<Vec<(Key, Option<Value>)>>`.

### Removed

  * vcf/header: Remove `Records`.

    This was deprecated in noodles-vcf 0.18.0. Use `OtherRecords`
    instead.

  * vcf/header: Remove `Header::records` and `Header::records_mut`.

    These were deprecated in noodles-vcf 0.18.0. Use
    `Header::other_records` and `Header::other_records_mut`,
    respectively, instead.

  * vcf/record: Remove re-exports of `record::genotypes::genotype`,
    `record::genotypes::Genotype`, and `record::genotypes::Keys as
    Format`.

    These were deprecated in 0.11.0.

  * vcf/record/info: Remove `TryFrom<Vec<Field>>` for `Info`.

    Insert fields into the map using `Info::insert` instead.

  * vcf/record/info/field: Remove `Field`.

    Use `(Key, Option<Value>)` instead.

  * vcf/record/genotypes/genotype/field: Remove `Field`.

    Use `(Key, Option<Value>)` instead.


## 0.23.0 - 2022-11-29

### Added

  * vcf/header/record/key: Implement `Borrow<str>` for `Other`.

## 0.22.0 - 2022-11-18

### Added

  * vcf/header/parser: Add map value parse errors.

### Changed

  * vcf/header/record/value/map: Add actual and expected values for
    `ParseError::NumberMismatch` and `ParseError::TypeMismatch`.

### Fixed

  * vcf/header/parser: Parse record using file format ([#128]).

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

## 0.21.0 - 2022-10-28

### Changed

  * vcf: Sync dependencies.

## 0.20.0 - 2022-10-20

### Changed

  * vcf: Sync dependencies.

## 0.19.0 - 2022-09-29

### Added

  * vcf/header/record/value/map/tag: Implement `AsRef<str>` for `Tag`.

## 0.18.0 - 2022-08-16

### Added

  * vcf/header/record/value/map: Add builder (`Builder<I>`).

  * vcf/header/record/value/map/contig: Add mutable getter for length
    (`Contig::length_mut`) ([#99]).

  * vcf/header/contig/value/map/contig: Add name wrapper (`Name`).

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

### Changed

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

  * vcf/header: VCF header records parsed from structured lines are now map
    values (`noodles_vcf::header::record::value::Map`).

    This moves record types (`AlternativeAllele`, `Contig`, `Filter`, `Format`,
    `Info`, and `Meta`) to map values `Map<I>`, where `I` is a specialized map
    type. A map is required to have an `ID` field; an inner `I` type that can
    have required standard fields; and can include optional fields, where the
    key is a nonstandard tag (`tag::Other`).

  * vcf/header: Change the key of `Contigs` to `contig::Name`.

  * vcf/header/record: Record holds a parsed record variant instead a key-value
    pair.

  * vcf/header/record/key: Split standard (`Standard`) and nonstandard
    (`Other`) keys.

  * vcf/header/record/value/map: Structured lines can no longer have duplicate
    field tags.

  * vcf/header/contig/value/map/contig: Change length to `usize`.

  * vcf/header/record/value/map/contig: Rename `Contig::len` to
    `Contig::length`.

### Deprecated

  * vcf/header: Deprecate `Header::records`, `Header::records_mut`,
    `header::Records`.

    Use `Header::other_records`, `Header::other_records_mut`,
    `header::OtherRecords`, respectively, instead.

### Fixed

  * vcf/header/record/value: Write surrounding angle brackets for structs.

### Removed

  * vcf/header: Remove `Pedigree`, and `Sample`.

    Use `Map<Other>` instead.

## 0.17.0 - 2022-07-05

### Changed

  * vcf: Sync dependencies.

## 0.16.1 - 2022-06-09

### Fixed

  * vcf: Sync dependencies.

## 0.16.0 - 2022-06-08

### Changed

  * vcf/record/position: Change underlying type to `usize`.

### Removed

  * vcf/record/position: Remove conversion to `i32` (`From<Position> for i32`).

    Use conversion to `usize` (`From<Position> for usize`) instead.

  * vcf/record/position: Remove fallible conversion from `i32` (`TryFrom<i32>
    for Position`).

    Use conversion from `usize` instead (`From<usize> for Position`).

  * vcf/record/position: Remove `TryFromIntError`.

    This is no longer used.

## 0.15.0 - 2022-03-29

### Changed

  * vcf: Move INFO and FORMAT keys from record field to header record.

  * vcf/record/genotypes: Add `parse` method.

    This uses FORMAT header records for type information.

  * vcf/record/genotypes/genotype: Rename `from_str_keys` to `parse`.

    `Genotype` now uses FORMAT header records for type information.

  * vcf/record/genotypes/genotype/field: Rename `from_str_key` to
    `from_str_format`.

    `Field` now uses FORMAT header records for type information.

  * vcf/record/genotypes/genotype/field/value: Rename `from_str_key` to
    `from_str_format`.

    `Value` now uses FORMAT header records for type information.

  * vcf/record/info/field/value: Rename `from_str_key` to `from_str_info`.

    `Value` now uses INFO header records for type information.

  * vcf/record/parser: Use VCF header when parsing genotypes.

### Removed

  * vcf/header: Remove record field keys.

  * vcf/record/genotypes/genotype: Remove deprecated `from_str_format`.

    Use `Genotype::parse` instead.

## 0.14.1 - 2022-03-02

### Fixed

  * vcf: Sync dependencies.

## 0.14.0 - 2022-02-17

### Added

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

## 0.13.0 - 2022-01-27

### Added

  * vcf/record/info: Add `clear` method to remove all fields from the info
    map.

  * vcf/record/position: Implement `Display`.

### Changed

  * vcf/record/info/field/value: Allow missing values in arrays.

    Array values (`Value::IntegerArray`, `Value::FloatArray`,
    `Value::CharacterArray`, and `Value::StringArray`) now wrap a vector of
    optional values, rather than values, e.g., `Vec<Option<i32>>` rather than
    `Vec<i32>`.

### Deprecated

  * vcf/record/genotypes/genotype: Deprecate `Genotype::from_str_format`.

    Use `Genotype::from_str_keys` instead.

### Fixed

  * vcf/record: Handle missing INFO END field value as no field.

    When a record has an INFO END field with a missing a value, i.e., `END=.`,
    it is treated as missing rather than invalid.

## 0.12.0 - 2022-01-13

### Added

  * vcf/header: Add mutable getters for `vcf::Header` fields ([#65]).

  * vcf/header: Add immutable and mutable getters for unstructured
    `vcf::Header` fields ([#69]).

  * vcf/header: Add `Records` type alias for records (`IndexMap<String,
    Vec<Record>`).

  * vcf/header/parser: Add `ParseError::StringMapPositionMismatch(actual,
    expected)`.

    This is returned when the IDX field value of a record does not match its
    relative position in a string map. It is primarily used in BCF.

  * vcf/record: Add mutable getters for genotypes, reference bases, and
    alternate bases ([#67]).

  * vcf/record/alternate_bases: Implement `DerefMut` ([#67]).

  * vcf/record/genotypes: Add mutable getter for keys ([#67]).

  * vcf/record/genotypes: Add method to return whether there are any samples
    (`Genotypes::is_empty`).

  * vcf/record/genotypes/genotype: Implement `DerefMut` ([#67]).

  * vcf/record/genotypes/keys: Implement `DerefMut` ([#67]).

  * vcf/record/position: Derive `PartialOrd` and `Ord` ([#70]).

  * vcf/record/quality_score: Derive `PartialOrd` ([#70]).

  * vcf/record/reference_bases: Implement `DerefMut` ([#67]).

[#65]: https://github.com/zaeleus/noodles/issues/65
[#67]: https://github.com/zaeleus/noodles/pull/67
[#69]: https://github.com/zaeleus/noodles/pull/69
[#70]: https://github.com/zaeleus/noodles/pull/70

### Changed

  * vcf/header/contig: Parse `IDX` field from a raw record ([#64]).

    This was previously added to the other fields map but is now a field on
    `Contig`.

### Fixed

  * vcf/header/contig: Write the IDX field value as an integer rather than a
    string ([#64]).

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

## 0.11.1 - 2021-12-09

### Fixed

  * vcf: Sync dependencies.

## 0.11.0 - 2021-12-02

### Added

  * vcf/header/format: Add conversion from `vcf::header::Record` to
    `vcf::header::Format` with a file format constraint.

  * vcf/header/info: Add conversion from `vcf::header::Record` to
    `vcf::header::Info` with a file format constraint.

  * vcf/record/genotypes: Add parser.

  * vcf/record/genotypes/keys: Implement `Default`.

### Changed

  * vcf/async/reader: `Reader::{records, query}` now parse records with the
    header.

  * vcf/reader: `Reader::{records, query}` now parse records with the header.

  * vcf/record: Move `Format` under genotypes module as `Keys`.

  * vcf/record/genotypes: Print keys on display.

  * vcf/record/genotypes/keys: Prefer key from header.

  * vcf/record/genotypes/keys: Allow empty genotypes keys.

  * vcf/record/info/field: Prefer key from header.

  * vcf/record/info/field: Allow value to be optional.

### Deprecated

  * vcf/record: Deprecate `vcf::record::Format`.

    Use `vcf::record::genotypes::Keys` instead.

### Removed

  * vcf/record/builder: Remove `Builder::{add_genotype,set_format}`.

    Use `Builder::set_genotypes` instead.

  * vcf/record: Remove `ParseError::{InvalidFormat,InvalidGenotype}`.

    These are now wrapped by `ParseError::InvalidGenotypes`.

  * vcf/record/genotypes/keys: Remove `TryFromKeyVectorError::Empty`.

    Empty genotype keys are now allowed.

  * vcf/record/genotypes: Remove `From<Vec<Genotype>>`.

    Use `Genotypes::new` instead.

## 0.10.0 - 2021-11-18

### Added

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

  * vcf/record/genotypes/genotype/field: Add mutable getter for value
    (`Field::value_mut`).

### Changed

  * vcf/header/format: Disable type checking when the file format is < VCF 4.3
    (#41).

  * vcf/header/info: Disable type checking when the file format is < VCF 4.3
    (#41).

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

## 0.9.0 - 2021-11-11

### Added

  * vcf/record: Add mutable getters for chromosome (`Record::chromosome_mut`),
    filters (`Record::filters_mut`), IDs (`Record::ids_mut`), info
    (`Record::info_mut`; [#52]), position (`Record::position_mut`), and quality
    score (`Record::quality_score_mut`).

  * vcf/record/ids: Add ID wrapper.

  * vcf/record/info/field: Add mutable getter for value (`Field::value_mut`;
    [#52]).

  * vcf/writer: Add common methods to access the underlying writer: `get_mut`
    and `into_inner`.

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

### Changed

  * vcf: Update to Rust 2021.

  * vcf/header/record/parser: Remove alphanumeric constraint on field keys.

  * vcf/record/info: `Info` no longer implements `Deref`.

    Use `AsRef<IndexMap<field::Key, Field>>` to access the lower level ordered
    map.

  * vcf/record/quality_score: Wrap only non-missing values.

    The missing quality score state is moved to `vcf::Record` as an `Option`.

### Removed

  * vcf/record/filters: Remove missing variant.

    `Filters::Missing` is removed in favor of using an `Option` in
    `vcf::Record`.

## 0.8.0 - 2021-10-16

### Added

  * vcf/record: Wrap `Genotype` field (`vcf::record::Genotypes`) ([#42]).

    This creates a new type for `Vec<vcf::record::genotypes::Genotype>`.

  * vcf/record/genotypes: Add convenience method to return a list of parsed
    genotype (`GT`) fields (`Genotypes::genotypes`) ([#42]).

  * vcf/record/genotypes/genotype: Add convenience method to parse the genotype
    (`GT`) field (`Genotype::genotype`) ([#42]).

  * vcf/record/genotypes/genotype/field/value/genotype: Add conversion from
    `Vec<Allele>` to `Genotype` ([#43]).

  * vcf/record/genotypes/genotype/field/value/genotype/allele: Add accessors
    for `position` and `phasing` ([#43]).

[#42]: https://github.com/zaeleus/noodles/issues/42
[#43]: https://github.com/zaeleus/noodles/pull/43

### Changed

  * vcf/record: Move `genotype` under `genotypes` module.

### Deprecated

  * vcf/record: Deprecated `genotype` and `Genotype` public exports.

    Use `noodles_vcf::record::genotypes::{genotype, Genotype}` instead.

## 0.7.0 - 2021-10-01

### Added

  * vcf: Increase visibility of `reader` module ([#37]).

    This allows public access to the reader iterators `Records` and `Query`.

[#37]: https://github.com/zaeleus/noodles/pull/37

## 0.6.2 - 2021-09-23

### Fixed

  * vcf: Sync dependencies.

## 0.6.1 - 2021-09-19

### Fixed

  * vcf: Sync dependencies.

## 0.6.0 - 2021-09-01

### Changed

  * vcf: Update to nom 7.0.0.

## 0.5.0 - 2021-08-19

### Changed

  * vcf: Update to tokio 1.10.0.

### Fixed

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

## 0.4.0 - 2021-08-11

### Added

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

  * vcf/async: Add async writer (`vcf::AsyncWriter`).

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

## 0.3.0 - 2021-08-04

### Added

  * vcf/header/alternative_allele: Accept `Into<String>` for description in
    constructor.

## 0.2.0 - 2021-07-30

### Added

  * vcf/header/contig: Accept `Into<String>` arguments in constructor.

  * vcf/header/filter: Accept `Into<String>` arguments in constructor.

## 0.1.1 - 2021-07-21

### Fixed

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

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

## 0.1.0 - 2021-07-14

  * vcf: Initial release.