Struct rust_htslib::bcf::record::Record
[−]
[src]
pub struct Record {
pub inner: *mut bcf1_t,
// some fields omitted
}A BCF record.
New records can be created by the empty_record methods of bcf::Reader and bcf::Writer.
Fields
inner: *mut bcf1_t
Methods
impl Record[src]
pub fn header(&self) -> &HeaderView[src]
Return associated header.
pub fn inner(&self) -> &bcf1_t[src]
pub fn inner_mut(&mut self) -> &mut bcf1_t[src]
pub fn rid(&self) -> Option<u32>[src]
Get the reference id of the record. To look up the contig name,
use bcf::header::HeaderView::rid2name.
pub fn pos(&self) -> u32[src]
pub fn set_pos(&mut self, pos: i32)[src]
Set 0-based position.
pub fn set_id(&mut self, id: &[u8]) -> Result<(), IdWriteError>[src]
Update the ID string to the given value.
pub fn push_id(&mut self, id: &[u8]) -> Result<(), IdWriteError>[src]
Add the ID string (the ID field is semicolon-separated), checking for duplicates.
pub fn set_filters(&mut self, flt_ids: &[Id])[src]
Set the given filters IDs to the FILTER column.
Setting an empty slice removes all filters.
Args
val- The corresponding filter string value.
pub fn push_filter(&mut self, flt_id: Id)[src]
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.
Args
val- The corresponding filter ID value.
pub fn remove_filter(&mut self, flt_id: Id, pass_on_empty: bool)[src]
Remove the given filter from the FILTER column.
Args
val- The corresponding filter ID.pass_on_empty- Set to "PASS" when removing the last value.
pub fn alleles(&self) -> Vec<&[u8]>[src]
Get alleles. The first allele is the reference allele.
pub fn set_alleles(
&mut self,
alleles: &[Vec<u8>]
) -> Result<(), AlleleWriteError>[src]
&mut self,
alleles: &[Vec<u8>]
) -> Result<(), AlleleWriteError>
Set alleles.
pub fn qual(&self) -> f32[src]
Get variant quality.
pub fn set_qual(&mut self, qual: f32)[src]
Set variant quality.
pub fn info<'a>(&'a mut self, tag: &'a [u8]) -> Info[src]
Get the value of the given info tag.
pub fn sample_count(&self) -> u32[src]
Get the number of samples.
pub fn allele_count(&self) -> u32[src]
Get the number of alleles, including reference allele.
pub fn genotypes(&mut self) -> Result<Genotypes, FormatReadError>[src]
Get genotypes as vector of one Genotype per sample.
pub fn format<'a>(&'a mut self, tag: &'a [u8]) -> Format[src]
Get the value of the given format tag for each sample.
pub fn push_format_integer(
&mut self,
tag: &[u8],
data: &[i32]
) -> Result<(), TagWriteError>[src]
&mut self,
tag: &[u8],
data: &[i32]
) -> Result<(), TagWriteError>
Add an integer format tag. Data is a flattened two-dimensional array. The first dimension contains one array for each sample. Returns error if tag is not present in header.
pub fn push_format_float(
&mut self,
tag: &[u8],
data: &[f32]
) -> Result<(), TagWriteError>[src]
&mut self,
tag: &[u8],
data: &[f32]
) -> Result<(), TagWriteError>
Add a float format tag. Data is a flattened two-dimensional array. The first dimension contains one array for each sample. Returns error if tag is not present in header.
pub fn push_info_integer(
&mut self,
tag: &[u8],
data: &[i32]
) -> Result<(), TagWriteError>[src]
&mut self,
tag: &[u8],
data: &[i32]
) -> Result<(), TagWriteError>
Add an integer info tag.
pub fn push_info_float(
&mut self,
tag: &[u8],
data: &[f32]
) -> Result<(), TagWriteError>[src]
&mut self,
tag: &[u8],
data: &[f32]
) -> Result<(), TagWriteError>
Add a float info tag.
pub fn push_info<T>(
&mut self,
tag: &[u8],
data: &[T],
ht: u32
) -> Result<(), TagWriteError>[src]
&mut self,
tag: &[u8],
data: &[T],
ht: u32
) -> Result<(), TagWriteError>
Add an info tag.
pub fn trim_alleles(&mut self) -> Result<(), TrimAllelesError>[src]
Remove unused alleles.