Skip to main content

Crate sbol_genbank

Crate sbol_genbank 

Source
Expand description

Convert GenBank flat-file records to SBOL 3 documents.

GenBank is the de facto exchange format for plasmids, genes, and parts in molecular biology — SnapGene, ApE, Benchling, the NCBI Nucleotide database, and SynBioHub all speak it natively. This crate lets sbol-rs ingest that data without leaving Rust.

Parsing is delegated to gb_io, a mature MIT-licensed nom-based GenBank parser. The mapping layer in this crate translates each gb_io::seq::Seq record into an SBOL 3 Component + Sequence pair, with annotated features becoming SequenceFeatures with Range locations. Common GenBank feature keys (CDS, promoter, terminator, RBS, …) are mapped to their canonical Sequence Ontology IRIs; unrecognized keys pass through under http://sboltools.org/backport#genbank_feature_kind so the information survives round-trips.

use sbol_genbank::GenbankImporter;

let (document, report) =
    GenbankImporter::new("https://example.org/lab")?.read_path("plasmid.gb")?;
document.check()?;
println!("{} components, {} sequences", report.components, report.sequences);

Structs§

GenbankImporter
Imports one or more GenBank records and emits SBOL 3 Document objects.
ImportReport
Tally of what an GenbankImporter run produced. Useful for summarizing CLI output and writing structural tests.

Enums§

ImportError
Fatal errors from GenbankImporter.
ImportWarning
Non-fatal issues encountered while importing GenBank.