Struct rust_htslib::bcf::record::Record

source ·
pub struct Record {
    pub inner: *mut bcf1_t,
    /* private fields */
}
Expand description

A BCF record. New records can be created by the empty_record methods of bcf::Reader and bcf::Writer.

Fields§

§inner: *mut bcf1_t

Implementations§

Force unpacking of internal record values.

Return associated header.

Return reference to the inner C struct.

Remarks

Note that this function is only required as long as Rust-Htslib does not provide full access to all aspects of Htslib.

Return mutable reference to inner C struct.

Remarks

Note that this function is only required as long as Rust-Htslib does not provide full access to all aspects of Htslib.

Get the reference id of the record.

To look up the contig name, use bcf::header::HeaderView::rid2name.

Returns
  • Some(rid) if the internal rid is set to a value that is not -1
  • None if the internal rid is set to -1

Set 0-based position.

Return the value of the ID column.

When empty, returns b".".to_vec().

Update the ID string to the given value.

Clear the ID column (set it to ".").

Add the ID string (the ID field is semicolon-separated), checking for duplicates.

Return Filters iterator for enumerating all filters that have been set.

A record having the PASS filter will return an empty Filter here.

Query whether the filter with the given ID has been set.

Arguments
  • flt_id - The filter ID to query for.

Set the given filters IDs to the FILTER column.

Setting an empty slice removes all filters.

Arguments
  • flt_ids - The identifiers of the filter values to set.

Add the given filter to the FILTER column.

If val corresponds to "PASS" then all existing filters are removed first. If other than "PASS", then existing "PASS" is removed.

Arguments
  • flt_id - The corresponding filter ID value to add.

Remove the given filter from the FILTER column.

Arguments
  • val - The corresponding filter ID to remove.
  • pass_on_empty - Set to “PASS” when removing the last value.

Get alleles strings.

The first allele is the reference allele.

Set alleles.

Get variant quality.

Set variant quality.

Get the value of the given info tag.

Get the number of samples.

Get the number of alleles, including reference allele.

Get genotypes as vector of one Genotype per sample.

Get the value of the given format tag for each sample.

Add an integer-typed FORMAT tag.

Arguments
  • tag - The tag’s string.
  • data - a flattened, two-dimensional array, the first dimension contains one array for each sample.
Errors

Returns error if tag is not present in header.

Add a float-typed FORMAT tag.

Arguments
  • tag - The tag’s string.
  • data - a flattened, two-dimensional array, the first dimension contains one array for each sample.
Errors

Returns error if tag is not present in header.

Add a char-typed FORMAT tag.

Arguments
  • tag - The tag’s string.
  • data - a flattened, two-dimensional array, the first dimension contains one array for each sample.
Errors

Returns error if tag is not present in header.

Add a string-typed FORMAT tag.

Arguments
  • tag - The tag’s string.
  • data - a flattened, two-dimensional array, the first dimension contains one array for each sample.
Errors

Returns error if tag is not present in header.

Add an integer-typed INFO entry.

Remove the integer-typed INFO entry.

Add a float-typed INFO entry.

Remove the float-typed INFO entry.

Set flag into the INFO column.

Remove the flag from the INFO column.

Add a string-typed INFO entry.

Remove the string field from the INFO column.

Remove unused alleles.

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.