INNER CODE UNIT · Rust
read_vcf_impl
abdenlab/oxbow · r-oxbow/src/rust/src/lib.rs:333
pub fn read_vcf_impl(
path: &str,
region: Option<String>,
index: Option<String>,
fields: Option<Vec<String>>,
info_fields: Option<Vec<String>>,
genotype_fields: Option<Vec<String>>,
genotype_by: Option<String>,
samples: Option<Vec<String>>,
samples_nested: bool,
) -> Vec<u8> {
let compressed = path.ends_with(".gz");
let reader = std::fs::File::open(path)
.map(|f| BufReader::with_capacity(BUFFER_SIZE_BYTES, f))
.unwrap();
let genotype_by = match genotype_by.unwrap().as_str() {
"sample" => GenotypeBy::Sample,
"field" => GenotypeBy::Field,