Struct noodles_bam::bai::Writer [−][src]
pub struct Writer<W> { /* fields omitted */ }
Expand description
A BAM index (BAI) writer.
Examples
use noodles_bam::bai;
let index = bai::Index::new(Vec::new(), None);
let mut writer = File::create("sample.bam.bai").map(bai::Writer::new)?;
writer.write_header()?;
writer.write_index(&index)?;
Implementations
Creates a BAI index writer.
Examples
use noodles_bam::bai;
let writer = bai::Writer::new(Vec::new());
Returns a reference to the underlying writer.
Examples
use noodles_bam::bai;
let writer = bai::Writer::new(Vec::new());
assert!(writer.get_ref().is_empty());
Writes a BAM index header.
This writes the magic number of the file format.
Examples
use noodles_bam::bai;
let mut writer = bai::Writer::new(Vec::new());
writer.write_header()?;
assert_eq!(writer.get_ref(), b"BAI\x01");