Expand description

Generate 2bit files from other file formats

Basic usage example:

use std::fs::File;
use std::io::BufWriter;
use twobit::convert::fasta::FastaReader;
use twobit::convert::to_2bit;

let file = File::create("/tmp/my_genome.2bit").expect("doc-test");
let mut writer = BufWriter::new(file);
let fasta_sequences = FastaReader::open("assets/foo.fasta").expect("doc-test");
to_2bit(&mut writer, &fasta_sequences).expect("doc-test");
// make sure that writer goes out of scope so that the file will be closed

The FastaReader in the above example implements the SequenceRead trait. If you want to convert other file formats to 2bit, you can use that trait to implement your own converters.

Modules

Convert twobit files to Fasta and vice-versa

Structs

A simple struct, combining name and length of a sequence

Traits

Trait for providers of nucleotide sequence data.

Trait for readers of other file formats

Functions

Convert and write data from a SequenceRead into a new 2bit file.