[][src]Struct rust_htslib::bam::Writer

pub struct Writer { /* fields omitted */ }

A BAM writer.

Methods

impl Writer[src]

pub fn from_path<P: AsRef<Path>>(
    path: P,
    header: &Header,
    format: Format
) -> Result<Self>
[src]

Create a new SAM/BAM/CRAM file.

Arguments

  • path - the path.
  • header - header definition to use
  • format - the format to use (SAM/BAM/CRAM)

pub fn from_stdout(header: &Header, format: Format) -> Result<Self>[src]

Create a new SAM/BAM/CRAM file at STDOUT.

Arguments

  • header - header definition to use
  • format - the format to use (SAM/BAM/CRAM)

pub fn set_threads(&mut self, n_threads: usize) -> Result<()>[src]

Activate multi-threaded BAM write support in htslib. This should permit faster writing of large BAM files.

Arguments

  • n_threads - number of extra background writer threads to use, must be > 0.

pub fn write(&mut self, record: &Record) -> Result<()>[src]

Write record to BAM.

Arguments

  • record - the record to write

pub fn header(&self) -> &HeaderView[src]

Return the header.

pub fn set_reference<P: AsRef<Path>>(&mut self, path: P) -> Result<()>[src]

Set the reference path for reading CRAM files.

Arguments

  • path - path to the FASTA reference

pub fn set_compression_level(
    &mut self,
    compression_level: CompressionLevel
) -> Result<()>
[src]

Set the compression level for writing BAM/CRAM files.

Arguments

  • compression_level - CompressionLevel enum variant

Trait Implementations

impl Debug for Writer[src]

impl Drop for Writer[src]

impl Send for Writer[src]

Auto Trait Implementations

impl RefUnwindSafe for Writer

impl !Sync for Writer

impl Unpin for Writer

impl UnwindSafe for Writer

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.