pub struct Record(/* private fields */);
Expand description
A BCF record.
Implementations§
Source§impl Record
impl Record
Sourcepub fn reference_sequence_id(&self) -> Result<usize>
pub fn reference_sequence_id(&self) -> Result<usize>
Returns the reference sequence ID of the record.
The reference sequence ID represents an index in the contig string map, which associates an ID (by position) with a contig record in the VCF header (by name). That is, to get the associated contig record in the VCF header, the contig string map must first be queried by position to find the chromosome name, and then the contigs in the VCF header can be queried by name.
§Examples
use noodles_bcf as bcf;
let record = bcf::Record::default();
assert_eq!(record.reference_sequence_id()?, 0);
Sourcepub fn reference_sequence_name<'h>(
&self,
string_maps: &'h StringMaps,
) -> Result<&'h str>
pub fn reference_sequence_name<'h>( &self, string_maps: &'h StringMaps, ) -> Result<&'h str>
Returns the reference sequence name.
§Examples
use noodles_bcf as bcf;
use noodles_vcf::{
self as vcf,
header::{record::value::{map::Contig, Map}, StringMaps},
};
let header = vcf::Header::builder()
.add_contig("sq0", Map::<Contig>::new())
.build();
let string_maps = StringMaps::try_from(&header)?;
let record = bcf::Record::default();
assert_eq!(record.reference_sequence_name(&string_maps)?, "sq0");
Sourcepub fn variant_start(&self) -> Option<Result<Position>>
pub fn variant_start(&self) -> Option<Result<Position>>
Returns the variant start position.
This position is 1-based, inclusive.
§Examples
use noodles_bcf as bcf;
use noodles_core::Position;
let record = bcf::Record::default();
assert_eq!(record.variant_start().transpose()?, Some(Position::MIN));
Sourcepub fn end(&self) -> Result<Position>
pub fn end(&self) -> Result<Position>
Returns the end position of this record.
This position is 1-based, inclusive.
§Examples
use noodles_bcf as bcf;
use noodles_core::Position;
let record = bcf::Record::default();
assert_eq!(record.end()?, Position::MIN);
Sourcepub fn quality_score(&self) -> Result<Option<f32>>
pub fn quality_score(&self) -> Result<Option<f32>>
Returns the quality score.
§Examples
use noodles_bcf as bcf;
let record = bcf::Record::default();
assert!(record.quality_score()?.is_none());
Sourcepub fn ids(&self) -> Ids<'_>
pub fn ids(&self) -> Ids<'_>
Returns the IDs.
§Examples
use noodles_bcf as bcf;
use noodles_vcf::variant::record::Ids;
let record = bcf::Record::default();
assert!(record.ids().is_empty());
Sourcepub fn reference_bases(&self) -> ReferenceBases<'_>
pub fn reference_bases(&self) -> ReferenceBases<'_>
Returns the reference bases.
§Examples
use noodles_bcf as bcf;
let record = bcf::Record::default();
assert_eq!(record.reference_bases().as_ref(), b"N");
Sourcepub fn alternate_bases(&self) -> AlternateBases<'_>
pub fn alternate_bases(&self) -> AlternateBases<'_>
Returns the alternate bases.
§Examples
use noodles_bcf as bcf;
use noodles_vcf::variant::record::AlternateBases;
let record = bcf::Record::default();
assert!(record.alternate_bases().is_empty());
Sourcepub fn filters(&self) -> Filters<'_>
pub fn filters(&self) -> Filters<'_>
Returns the filters.
§Examples
use noodles_bcf as bcf;
use noodles_vcf::variant::record::Filters;
let record = bcf::Record::default();
assert!(record.filters().is_empty());
Trait Implementations§
Source§impl Record for Record
impl Record for Record
Source§fn reference_sequence_name<'a, 'h: 'a>(
&'a self,
header: &'h Header,
) -> Result<&'a str>
fn reference_sequence_name<'a, 'h: 'a>( &'a self, header: &'h Header, ) -> Result<&'a str>
Returns the reference sequence name.
Source§fn variant_start(&self) -> Option<Result<Position>>
fn variant_start(&self) -> Option<Result<Position>>
Returns the variant start position. Read more
Source§fn reference_bases(&self) -> Box<dyn ReferenceBases + '_>
fn reference_bases(&self) -> Box<dyn ReferenceBases + '_>
Returns the reference bases.
Source§fn alternate_bases(&self) -> Box<dyn AlternateBases + '_>
fn alternate_bases(&self) -> Box<dyn AlternateBases + '_>
Returns the alternate bases.
impl StructuralPartialEq for Record
Auto Trait Implementations§
impl Freeze for Record
impl RefUnwindSafe for Record
impl Send for Record
impl Sync for Record
impl Unpin for Record
impl UnwindSafe for Record
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)