Skip to content

Use of LazyRecord with queried IndexedReader (VCF), is it possible? #232

Answered by zaeleus
davidmasp asked this question in Q&A
Discussion options

You must be logged in to vote

There's currently no way to use the VCF query iterator with lazy records. You can, however, copy and modify the existing implementation to work with them, e.g.,

vcf_232.rs
// cargo add [email protected] --features bgzf,csi,core,vcf

use std::{
    env,
    io::{self, Read, Seek},
    str,
};

use noodles::{
    bgzf,
    core::{region::Interval, Position, Region},
    csi::{self, binning_index::index::reference_sequence::bin::Chunk, BinningIndex},
    vcf,
};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut args = env::args().skip(1);
    let src = args.next().expect("missing src");
    let region = args.next().expect("missing region").parse()?;

    let mut reader = vcf::i…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@davidmasp
Comment options

@zaeleus
Comment options

@davidmasp
Comment options

Answer selected by davidmasp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants