Skip to content

Commit

Permalink
explicitly set large_file on all files and update zip module. #30
Browse files Browse the repository at this point in the history
  • Loading branch information
brentp committed Sep 13, 2023
1 parent 331815d commit e20827a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "echtvar"
version = "0.1.8"
version = "0.1.9"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand All @@ -17,17 +17,17 @@ path = "src/main.rs"
[dependencies]
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"] }
stream-vbyte = { version = "0.4.0", features = ["x86_ssse3", "x86_sse41"] }
clap = { version = "~2.27.0", features = ["suggestions"] }
c2rust-bitfields = "0.3.0"
libc = "*"
# TODO: try deflate-miniz, deflate-zlib, deflate
zip = { version = "0.6", default-features = false, features=["deflate"] }
zip = { version = "0.6.4", default-features = false, features = ["deflate"] }
byteorder = "1"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

fasteval = { version = "0.2.4", features= ["unsafe-vars"]}
fasteval = { version = "0.2.4", features = ["unsafe-vars"] }

bincode = { version = "1.3.3" }
json5 = "0.4.1"
Expand Down
13 changes: 9 additions & 4 deletions src/commands/encoder_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ use stream_vbyte::{encode::encode, x86::Sse41};
use std::borrow::{Borrow, BorrowMut};
use std::collections::HashMap;
use std::fs::File;
use std::io::Read;
use std::io::Write;
use std::io::{Read, Write};

use byteorder::{LittleEndian, WriteBytesExt};
use std::str;
Expand Down Expand Up @@ -229,6 +228,7 @@ pub fn encoder_main(vpaths: Vec<&str>, opath: &str, jpath: &str) {

let options = FileOptions::default()
.compression_method(zip::CompressionMethod::Deflated)
.large_file(true)
.unix_permissions(0o755);

zipf.start_file("echtvar/config.json", options)
Expand Down Expand Up @@ -264,7 +264,7 @@ pub fn encoder_main(vpaths: Vec<&str>, opath: &str, jpath: &str) {
vcf.set_threads(2).ok();
}
eprintln!("[echtvar] adding VCF:{}", vpath);
let mut warn = 0;
let mut warn = 0;

for r in vcf.records() {
let rec = r.expect("error getting record");
Expand Down Expand Up @@ -394,7 +394,12 @@ pub fn encoder_main(vpaths: Vec<&str>, opath: &str, jpath: &str) {
.collect::<Vec<_>>()
);
}
var32s.push(var32::encode(rec.pos() as u32, alleles[0], alleles[1], &mut warn));
var32s.push(var32::encode(
rec.pos() as u32,
alleles[0],
alleles[1],
&mut warn,
));

if alleles[0].len() + alleles[1].len() > var32::MAX_COMBINED_LEN {
long_vars.push(var32::LongVariant {
Expand Down
1 change: 1 addition & 0 deletions src/lib/fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ mod tests {
field: "AN",
alias: "gnomad_AN",
missing_value: -2147483648,
missing: -2,
multiplier: 1, // this is useful for float fields as internally, everythign is stored as integer.
zigzag: true, // set this to true if the field can contain negative numbers.
ftype: "Integer", // this is discovered by echtvar and should not be set.
Expand Down

0 comments on commit e20827a

Please sign in to comment.