MCPcopy Create free account
hub / github.com/alignoth/alignoth / from_vcf_record

Method from_vcf_record

src/cli.rs:331–349  ·  view source on GitHub ↗
(vcf_record_index: u64, vcf: &PathBuf)

Source from the content-addressed store, hash-verified

329 }
330
331 pub(crate) fn from_vcf_record(vcf_record_index: u64, vcf: &PathBuf) -> Result<Self> {
332 let mut reader = Reader::from_path(vcf)?;
333 let header = reader.header().clone();
334 let record = reader
335 .records()
336 .nth(vcf_record_index as usize)
337 .context(format!(
338 "Given vcf record index {vcf_record_index} not found in {}",
339 vcf.display()
340 ))??;
341 let start = &record.pos();
342 let end = &record.end();
343 let target = String::from_utf8(header.rid2name(record.rid().unwrap())?.to_vec())?;
344 Ok(Region {
345 target,
346 start: *start - 500,
347 end: *end + 500,
348 })
349 }
350}
351
352#[derive(Debug, Clone, Serialize, PartialEq)]

Callers

nothing calls this directly

Calls 3

OkFunction · 0.85
cloneMethod · 0.45
contextMethod · 0.45

Tested by

no test coverage detected