pub fn query<I, RS>(
        &mut self,
        contigs: &Contigs,
        index: &I,
        region: &Region,
    ) -> io::Result<Query<'_, R>>
    where
        I: BinningIndex<RS>,
        RS: ReferenceSequenceExt,
    {
        let (reference_sequence_id, interval) = resolve_region(contigs, region)?;
        let chunks = index.query(reference_sequence_id, interval)?;
        Ok(Query::new(self, chunks, reference_sequence_id, interval))
    }
/// Returns an iterator over records that intersects the given region.
///
/// # Examples
///
/// ```no_run
/// # use std::fs::File;
/// use noodles_bcf as bcf;
/// use noodles_core::Region;
/// use noodles_csi as csi;
/// use noodles_vcf as vcf;
///
/// let mut reader = File::open("sample.bcf").map(bcf::Reader::new)?;
///
/// let header: vcf::Header = reader.read_header()?.parse()?;
/// let contigs = header.contigs();
///
/// let index = csi::read("sample.bcf.csi")?;
/// let region = Region::mapped("sq0", 8..=13);
/// let query = reader.query(&contigs, &index, &region)?;
///
/// for result in query {
///     let record = result?;
///     // ...
/// }
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
Returns an iterator over records that intersects the given region.
Returns an iterator over records that intersects the given region .
pub fn query<I, RS>(
        &mut self,
        contigs: &Contigs,
        index: &I,
        region: &Region,
    ) -> io::Result<Query<'_, R>>
    where
        I: BinningIndex<RS>,
        RS: ReferenceSequenceExt,
    {
        let (reference_sequence_id, interval) = resolve_region(contigs, region)?;
        let chunks = index.query(reference_sequence_id, interval)?;
        Ok(Query::new(self, chunks, reference_sequence_id, interval))
    }
pub fn query < I , RS > ( & mut self , contigs : & Contigs , index : & I , region : & Region , ) -> io :: Result < Query < ' _ , R > > where I : BinningIndex < RS > , RS : ReferenceSequenceExt , { let ( reference_sequence_id , interval ) = resolve_region ( contigs , region ) ? ; let chunks = index . query ( reference_sequence_id , interval ) ? ; Ok ( Query :: new ( self , chunks , reference_sequence_id , interval ) ) }
Returns an iterator over records that intersects the given region.
Returns an iterator over records that intersects the given region .
&mut self
contigs
&Contigs
index
&I
region
&Region
&mut self
contigs
&Contigs
index
&I
region
&Region
examples
None
use std::fs::file;


let mut reader = File::open("sample.bcf").map(bcf::Reader::new)?.

let header: vcf::Header = reader.read_header()?.parse()?;
let contigs = header.contigs().

let index = csi::read("sample.bcf.csi")?;
let region = Region::mapped("sq0", 8..=13);
let query = reader.query(&contigs, &index, &region)?.

for result in query {
let record = result?;

}
let mut reader = File :: open ( " sample . bcf " ) . map ( bcf :: Reader :: new ) ? . let header : vcf :: Header = reader . read_header () ? . parse () ? ; let contigs = header . contigs () . let index = csi :: read ( " sample . bcf . csi " ) ? ; let region = Region :: mapped ( " sq0 " 8 .. = 13 ) ; let query = reader . query ( &contigs &index &region ) ? . for result in query { let record = result? ; }
ok::<(), box<dyn std::error::error>>(())
None