Skip to content

Commit

Permalink
don't use set_threads after reading header
Browse files Browse the repository at this point in the history
found with test-file from #12
  • Loading branch information
brentp committed Feb 26, 2022
1 parent 8f7596f commit 7a74193
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ v0.1.3
+ exit with error on multi-allelics (previously, only first allele was used) ( #11)
+ more docs on conf file (thanks @m-pauper)
+ fix compression error for very dense regions (#12)
+ fix error when using hts_set_threads more than once and after reading header (#12)

v0.1.2
======
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ path = "src/main.rs"

flate2 = { version = "1.0", features = ["zlib-ng-compat"]}

rust-htslib = { version = "*", features = ["libdeflate", "static"] }
rust-htslib = { version = "0.38.2", features = ["libdeflate", "static"] }
#bitpacking = "0.8.4"
stream-vbyte = {version = "0.4.0", features=["x86_ssse3", "x86_sse41"]}
clap = {version = "~2.27.0", features=["suggestions"] }
Expand Down
4 changes: 2 additions & 2 deletions src/commands/encoder_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,9 @@ pub fn encoder_main(vpaths: Vec<&str>, opath: &str, jpath: &str) {
Err(error) => panic!("problem opening from stdin: {:?}", error),
}
};
vcf.set_threads(2).ok();
}
eprintln!("[echtvar] adding VCF:{}", vpath);
vcf.set_threads(2).ok();

for r in vcf.records() {
let rec = r.expect("error getting record");
Expand Down Expand Up @@ -377,7 +377,7 @@ pub fn encoder_main(vpaths: Vec<&str>, opath: &str, jpath: &str) {
}

let alleles = rec.alleles();
if alleles.len() > 2 {
if alleles.len() != 2 {
panic!(
"[echtvar] variants must be decomposed before running {:?}",
rec
Expand Down
2 changes: 1 addition & 1 deletion src/lib/echtvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ impl EchtVars {
}

let alleles = variant.alleles();
if alleles.len() > 2 {
if alleles.len() != 2 {
panic!(
"[echtvar] variants must be decomposed before running. got variant with {} alleles at {}:{}",
alleles.len() - 1,
Expand Down

0 comments on commit 7a74193

Please sign in to comment.