Crates.io | gtftools |
lib.rs | gtftools |
version | 0.1.9 |
source | src |
created_at | 2022-09-27 18:29:15.988158 |
updated_at | 2023-07-19 18:58:27.396345 |
description | A barebones GTF toolkit with fast nom-based IO |
homepage | |
repository | https://github.com/noamteyssier/gtftools |
max_upload_size | |
id | 675114 |
size | 47,915 |
a crate for parsing and querying Ensembl-GTF formatted files.
Parser achieves near wc -l
throughput.
This is meant to be used as an iterator and receives any item implementing BufRead
.
use std::{fs::File, io::BufReader};
use gtftools::GtfReader;
let handle = File::open("data/example.gtf")
.map(BufReader::new)
.unwrap();
let num_records = GtfReader::from_bufread(handle)
.filter_map(|x| x.ok())
.count();
assert_eq!(num_records, 10);
use std::{fs::File, io::BufReader};
use flate2::read::MultiGzDecoder;
use gtftools::GtfReader;
let handle = File::open("data/example.gtf.gz")
.map(MultiGzDecoder::new)
.map(BufReader::new)
.unwrap();
let num_records = GtfReader::from_bufread(handle)
.filter_map(|x| x.ok())
.count();
assert_eq!(num_records, 10);