#sequence #gb #manipulating #annotations #reading #features #genbank

gb-io

A library for parsing, writing and manipulating Genbank sequence files

8 releases (breaking)

0.7.1 Mar 12, 2022
0.7.0 Feb 19, 2022
0.6.0 Mar 9, 2020
0.5.0 Apr 21, 2019
0.1.0 Mar 1, 2019

#1368 in Parser implementations

Download history 109/week @ 2023-12-17 128/week @ 2023-12-24 128/week @ 2023-12-31 258/week @ 2024-01-07 41/week @ 2024-01-14 347/week @ 2024-01-21 288/week @ 2024-01-28 371/week @ 2024-02-04 16/week @ 2024-02-11 152/week @ 2024-02-18 388/week @ 2024-02-25 339/week @ 2024-03-03 417/week @ 2024-03-10 260/week @ 2024-03-17 805/week @ 2024-03-24 431/week @ 2024-03-31

1,933 downloads per month
Used in 3 crates (2 directly)

MIT license

125KB
3K SLoC

gb-io

crates.io link docs.rs link

This is a library for parsing and working with Genbank (.gb) files written in Rust. It supports reading, writing, and extracting parts of a sequence while retaining feature annotations.

It should be able to handle most files out there. Feedback, improvements, and details of any .gb files it chokes on are welcome!

Example

Reverse complement a sequence, retaining feature annotations.

extern crate gb_io;

use std::fs::File;
use std::io;

use gb_io::reader::SeqReader;

fn main() {
    let file = File::open("mg1655.gb").unwrap();
    let stdout = io::stdout();
    for seq in SeqReader::new(file) {
        let seq = seq.unwrap();
        let rc = seq.revcomp();
        rc.write(stdout.lock()).unwrap();
    }
}

Python bindings

Martin Larralde has written Python bindings for gb-io's parser.

Dependencies

~2.3–9.5MB
~67K SLoC