Struct rust_htslib::bcf::header::Header
[−]
[src]
pub struct Header {
pub inner: *mut bcf_hdr_t,
pub subset: Option<SampleSubset>,
}A BCF header.
Fields
inner: *mut bcf_hdr_t
subset: 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- TheHeaderViewto use as the template.
pub fn from_template_subset(
header: &HeaderView,
samples: &[&[u8]]
) -> Result<Self, SubsetError>[src]
header: &HeaderView,
samples: &[&[u8]]
) -> Result<Self, SubsetError>
Create a new Header using the given HeaderView as as template, but subsetting to the
given samples.
Arguments
header- TheHeaderViewto use for the template.samples- A slice of byte-encoded ([u8]) sample names.
ⓘImportant traits for &'a mut Wpub fn push_sample(&mut self, sample: &[u8]) -> &mut Self[src]
ⓘImportant traits for &'a mut W
Add a sample to the header.
Arguments
sample- Name of the sample to add (to the end of the sample list).
ⓘImportant traits for &'a mut Wpub fn push_record(&mut self, record: &[u8]) -> &mut Self[src]
ⓘImportant traits for &'a mut W
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());
ⓘImportant traits for &'a mut Wpub fn remove_filter(&mut self, tag: &[u8]) -> &mut Self[src]
ⓘImportant traits for &'a mut W
ⓘImportant traits for &'a mut Wpub fn remove_info(&mut self, tag: &[u8]) -> &mut Self[src]
ⓘImportant traits for &'a mut W
ⓘImportant traits for &'a mut Wpub fn remove_format(&mut self, tag: &[u8]) -> &mut Self[src]
ⓘImportant traits for &'a mut W
ⓘImportant traits for &'a mut Wpub fn remove_contig(&mut self, tag: &[u8]) -> &mut Self[src]
ⓘImportant traits for &'a mut W
ⓘImportant traits for &'a mut Wpub fn remove_structured(&mut self, tag: &[u8]) -> &mut Self[src]
ⓘImportant traits for &'a mut W
ⓘImportant traits for &'a mut Wpub fn remove_generic(&mut self, tag: &[u8]) -> &mut Self[src]
ⓘImportant traits for &'a mut W
Trait Implementations
impl Debug for Header[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more