Skip to content

Commit

Permalink
commit broken
Browse files Browse the repository at this point in the history
  • Loading branch information
brentp committed Sep 14, 2023
1 parent 8980eea commit 07156f6
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@ use detect::{Compression, Format};
use std::io::{self, Seek};
use std::io::{BufRead, BufReader};

trait BufReadSeek: BufRead + Seek {}

pub enum XCF {
/*
Vcf(vcf::Reader<BufReader<Box<dyn BufRead>>>),
Bcf(bcf::Reader<BufReader<Box<dyn BufRead>>>),
IndexedVcf(vcf::indexed_reader::IndexedReader<BufReader<Box<dyn BufRead>>>),
IndexedBcf(bcf::indexed_reader::IndexedReader<BufReader<Box<dyn BufRead>>>),
*/
Vcf(vcf::Reader<BufReader<Box<dyn BufRead>>>),
Bcf(bcf::Reader<BufReader<Box<dyn BufRead>>>),
IndexedVcf(vcf::indexed_reader::IndexedReader<bgzf::Reader<BufReader<Box<dyn BufRead>>>>),
IndexedBcf(bcf::indexed_reader::IndexedReader<bgzf::Reader<BufReader<Box<dyn BufRead>>>>),
IndexedVcf(vcf::indexed_reader::IndexedReader<bgzf::Reader<BufReader<Box<dyn BufReadSeek>>>>),
IndexedBcf(bcf::indexed_reader::IndexedReader<bgzf::Reader<BufReader<Box<dyn BufReadSeek>>>>),
CompressedBcf(bcf::Reader<bgzf::Reader<BufReader<Box<dyn BufRead>>>>),
CompressedVcf(vcf::Reader<bgzf::Reader<BufReader<Box<dyn BufRead>>>>),
}
Expand Down Expand Up @@ -56,7 +52,7 @@ impl Reader {
Reader::new(XCF::Vcf(reader), header)
}
(Format::Vcf, Some(Compression::Bgzf)) => {
let mut bgzf_reader = noodles::bgzf::Reader::new(reader);
let mut bgzf_reader = bgzf::Reader::new(reader);
if let Some(csi) = csi {
let mut reader = IndexedReader::new(bgzf_reader, csi);
let header = reader.read_header()?;
Expand All @@ -78,7 +74,7 @@ impl Reader {
let header = reader.read_header()?;
Reader::new(XCF::IndexedBcf(reader), header)
} else {
let mut bgzf_reader = noodles::bgzf::Reader::new(reader);
let mut bgzf_reader = bgzf::Reader::new(reader);
let mut reader = bcf::Reader::from(bgzf_reader);
let header = reader.read_header()?;
Reader::new(XCF::CompressedBcf(reader), header)
Expand Down Expand Up @@ -108,7 +104,6 @@ impl Reader {
}
}

/*
#[inline]
fn chrom_equals(c: &Chromosome, name: &str) -> bool {
match c {
Expand Down Expand Up @@ -146,10 +141,7 @@ where
}
}

impl<R> Reader<R>
where
R: BufRead + Seek,
{
impl Reader {
// skip_to simply sets the file pointer to the start of region.
// internally, it consumes the first variant, but that will be returned on the
// first call to read_record.
Expand Down Expand Up @@ -182,7 +174,6 @@ where
}
}
}
*/

fn find_index(path: Option<String>) -> Option<csi::Index> {
if let Some(path) = path {
Expand Down

0 comments on commit 07156f6

Please sign in to comment.