[][src]Struct rust_htslib::bcf::Writer

pub struct Writer { /* fields omitted */ }

A VCF/BCF writer.

Methods

impl Writer[src]

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

Create a new writer that writes to the given path.

Arguments

  • path - the path
  • header - header definition to use
  • uncompressed - disable compression
  • vcf - write VCF instead of BCF

pub fn from_url(
    url: &Url,
    header: &Header,
    uncompressed: bool,
    format: Format
) -> Result<Self>
[src]

Create a new writer from a URL.

Arguments

  • url - the URL
  • header - header definition to use
  • uncompressed - disable compression
  • vcf - write VCF instead of BCF

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

Create a new writer to stdout.

Arguments

  • header - header definition to use
  • uncompressed - disable compression
  • vcf - write VCF instead of BCF

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

Obtain reference to the lightweight HeaderView of the BCF header.

pub fn empty_record(&self) -> Record[src]

Create empty record for writing to this writer.

This record can then be reused multiple times.

pub fn translate(&mut self, record: &mut Record)[src]

Translate record to header of this writer.

Arguments

  • record - The Record to translate.

pub fn subset(&mut self, record: &mut Record)[src]

Subset samples of record to match header of this writer.

Arguments

  • record - The Record to modify.

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

Write record to the Writer.

Arguments

  • record - The Record to write.

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

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

Arguments

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

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.