Skip to content

Commit c76da6b

Browse files
Merge pull request #21 from rust-bio/typed-constructors
Use properly typed parameters for constructing readers and writers.
2 parents 0f9fba9 + 2ab3ee7 commit c76da6b

File tree

8 files changed

+284
-120
lines changed

8 files changed

+284
-120
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ rust:
55
- nightly
66
env:
77
global:
8-
secure: ioWAhmR9VNa96Zn3UvY46bzys5LY6rHezT/nxsX6Wc0tZ3s/pk45wRKl9mU+oX+29EXMl2EXZZzsUlmY9AWNS34uQdBJ5HB68k2l2Cl44f/R4fQiFbkucCaCuTLDDshRsQInHTrsIjiB0tvjCG1tkNWQlgDIB4yeqPcL+YrmeMs=
8+
- secure: ioWAhmR9VNa96Zn3UvY46bzys5LY6rHezT/nxsX6Wc0tZ3s/pk45wRKl9mU+oX+29EXMl2EXZZzsUlmY9AWNS34uQdBJ5HB68k2l2Cl44f/R4fQiFbkucCaCuTLDDshRsQInHTrsIjiB0tvjCG1tkNWQlgDIB4yeqPcL+YrmeMs=
9+
- RUST_BACKTRACE=1

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [0.10.0] - 2016-11-10
6+
### Added
7+
- Prelude module to easily import all relevant traits.
8+
### Changed
9+
- fine-grained constructors for STDIN/STDOUT, paths and URLs
10+
- better template handling with bam files
11+
12+
513
## [0.9.0] - 2016-11-02
614
### Changed
715
- improved genotype handling

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rust-htslib"
3-
version = "0.9.0"
3+
version = "0.10.0"
44
authors = ["Christopher Schröder <[email protected]>", "Johannes Köster <[email protected]>"]
55
build = "build.rs"
66
description = "This library provides HTSlib bindings and a high level Rust API for reading and writing BAM files."
@@ -17,6 +17,7 @@ itertools = "=0.4.*"
1717
quick-error = "1.1.*"
1818
newtype_derive = "0.1.*"
1919
custom_derive = "0.1.*"
20+
url = "1.2.*"
2021
ieee754 = "0.1"
2122
lazy_static = "0.1.*"
2223

src/bam/header.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// This file may not be copied, modified, or distributed
44
// except according to those terms.
55

6+
use bam::HeaderView;
7+
68

79
/// A BAM header.
810
pub struct Header {
@@ -16,6 +18,10 @@ impl Header {
1618
Header { records: Vec::new() }
1719
}
1820

21+
pub fn from_template(header: &HeaderView) -> Self {
22+
Header { records: vec![header.as_bytes().to_owned()] }
23+
}
24+
1925
/// Add a record to the header.
2026
pub fn push_record(&mut self, record: &HeaderRecord) -> &mut Self {
2127
self.records.push(record.to_bytes());

0 commit comments

Comments
 (0)