Struct rust_htslib::bcf::header::Header

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

A BCF header.

Fields§

§inner: *mut bcf_hdr_t§subset: Option<SampleSubset>

Implementations§

Create a new (empty) Header.

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.

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.

Add a sample to the header.

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

Add a record to the header.

Arguments
  • record - String representation of the header line
Example
header.push_record(format!("##contig=<ID={},length={}>", "chrX", 155270560).as_bytes());

Remove a FILTER entry from the header.

Arguments
  • tag - Name of the FLT tag to remove.

Remove an INFO entry from the header.

Arguments
  • tag - Name of the INFO tag to remove.

Remove a FORMAT entry from the header.

Arguments
  • tag - Name of the FORMAT tag to remove.

Remove a contig entry from the header.

Arguments
  • tag - Name of the FORMAT tag to remove.

Remove a structured entry from the header.

Arguments
  • tag - Name of the structured tag to remove.

Remove a generic entry from the header.

Arguments
  • tag - Name of the generic tag to remove.

Trait Implementations§

Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.