rust_htslib::bcf

Struct Writer

Source
pub struct Writer { /* private fields */ }
Expand description

A VCF/BCF writer.

Implementations§

Source§

impl Writer

Source

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

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
Source

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

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
Source

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

Create a new writer to stdout.

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

pub fn header(&self) -> &HeaderView

Obtain reference to the lightweight HeaderView of the BCF header.

Source

pub fn empty_record(&self) -> Record

Create empty record for writing to this writer.

This record can then be reused multiple times.

Source

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

Translate record to header of this writer.

§Arguments
  • record - The Record to translate.
Source

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

Subset samples of record to match header of this writer.

§Arguments
  • record - The Record to modify.
Source

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

Write record to the Writer.

§Arguments
  • record - The Record to write.
Source

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

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§

Source§

impl Debug for Writer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Writer

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for Writer

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T