Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Improve bcf Record filter interface and improve docs #306

Merged
merged 10 commits into from Jul 6, 2021
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Added
- `bcf::Record` methods `end`, `clear`, and `rlen` (@mbhall88)

### Changes
- `bcf::Record` methods `has_filter`, `remove_filter`, `push_filter`, and `set_filter`
all now take a byte slice (`&[u8]`) instead of an `Id`.

[Unreleased]: https://github.com/rust-bio/rust-htslib/compare/v0.36.0...HEAD

## [0.36.0] - 2020-11-23
Expand Down
9 changes: 4 additions & 5 deletions src/bcf/mod.rs
Expand Up @@ -1230,7 +1230,6 @@ mod tests {
Format::VCF,
)
.expect("Error opening file.");
let header = writer.header().clone();

// Setup empty record, filled below.
let mut record = writer.empty_record();
Expand All @@ -1254,10 +1253,10 @@ mod tests {
record.push_id(b"first_id").unwrap();

assert!(record.filters().next().is_none());
record.set_filters(&[header.name_to_id(b"q10").unwrap()]);
record.push_filter(header.name_to_id(b"s50").unwrap());
record.remove_filter(header.name_to_id(b"q10").unwrap(), true);
record.push_filter(header.name_to_id(b"q10").unwrap());
record.set_filters(&["q10".as_bytes()]).unwrap();
record.push_filter("s50".as_bytes()).unwrap();
record.remove_filter("q10".as_bytes(), true).unwrap();
record.push_filter("q10".as_bytes()).unwrap();

record.set_alleles(&[b"C", b"T", b"G"]).unwrap();

Expand Down