[][src]Struct rust_htslib::bcf::header::Header

pub struct Header {
    pub inner: *mut bcf_hdr_t,
    pub subset: Option<SampleSubset>,
}

A BCF header.

Fields

inner: *mut bcf_hdr_tsubset: Option<SampleSubset>

Methods

impl Header[src]

pub fn new() -> Self[src]

Create a new (empty) Header.

pub fn from_template(header: &HeaderView) -> Self[src]

Create a new Header using the given HeaderView as the template.

After construction, you can modify the header independently from the template header.

Arguments

  • header - The HeaderView to use as the template.

pub fn from_template_subset(
    header: &HeaderView,
    samples: &[&[u8]]
) -> Result<Self>
[src]

Create a new Header using the given HeaderView as as template, but subsetting to the given samples.

Arguments

  • header - The HeaderView to use for the template.
  • samples - A slice of byte-encoded ([u8]) sample names.

pub fn push_sample(&mut self, sample: &[u8]) -> &mut Self[src]

Add a sample to the header.

Arguments

  • sample - Name of the sample to add (to the end of the sample list).

pub fn push_record(&mut self, record: &[u8]) -> &mut Self[src]

Add a record to the header.

Arguments

  • record - String representation of the header line

Example

This example is not tested
header.push_record(format!("##contig=<ID={},length={}>", "chrX", 155270560).as_bytes());

pub fn remove_filter(&mut self, tag: &[u8]) -> &mut Self[src]

Remove a FILTER entry from the header.

Arguments

  • tag - Name of the FLT tag to remove.

pub fn remove_info(&mut self, tag: &[u8]) -> &mut Self[src]

Remove an INFO entry from the header.

Arguments

  • tag - Name of the INFO tag to remove.

pub fn remove_format(&mut self, tag: &[u8]) -> &mut Self[src]

Remove a FORMAT entry from the header.

Arguments

  • tag - Name of the FORMAT tag to remove.

pub fn remove_contig(&mut self, tag: &[u8]) -> &mut Self[src]

Remove a contig entry from the header.

Arguments

  • tag - Name of the FORMAT tag to remove.

pub fn remove_structured(&mut self, tag: &[u8]) -> &mut Self[src]

Remove a structured entry from the header.

Arguments

  • tag - Name of the structured tag to remove.

pub fn remove_generic(&mut self, tag: &[u8]) -> &mut Self[src]

Remove a generic entry from the header.

Arguments

  • tag - Name of the generic tag to remove.

Trait Implementations

impl Debug for Header[src]

impl Default for Header[src]

impl Drop for Header[src]

Auto Trait Implementations

impl RefUnwindSafe for Header

impl !Send for Header

impl !Sync for Header

impl Unpin for Header

impl UnwindSafe for Header

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.