Enum noodles_core::region::Region [−][src]
pub enum Region { Mapped(Mapped), Unmapped, All, }
Expand description
A genomic region.
Genomic regions can either be mapped to a reference sequence, unmapped (*), or an inclusion of all reads (.).
Variants
A mapped region.
Tuple Fields of Mapped
0: Mapped
An unmapped region.
All reads.
Implementations
pub fn from_str_reference_sequences(
s: &str,
reference_sequences: &ReferenceSequences
) -> Result<Self, ParseError>
pub fn from_str_reference_sequences(
s: &str,
reference_sequences: &ReferenceSequences
) -> Result<Self, ParseError>
Parses a string to a region.
A region string is specified as
<reference-sequence-name>[:<start-position>[-<end-position>]]
.
The reference sequence name can be “*” to represent unmapped records; or “.”, all records. Otherwise, the reference sequence name must exist in the reference sequence dictionary.
Creates a new mapped region.
Positions are assumed to be 1-based.
Examples
use noodles_core::Region; let region = Region::mapped("sq0", 1..=5); assert!(matches!(region, Region::Mapped(_)));
Returns the reference name of the region.
If the region is unmapped, this returns “*”. If the region represents all records, this returns “.”.
Examples
use noodles_core::Region; let region = Region::mapped("sq0", 1..=5); assert_eq!(region.name(), "sq0"); assert_eq!(Region::Unmapped.name(), "*"); assert_eq!(Region::All.name(), ".");
Returns whether the region is mapped.
Examples
use noodles_core::Region; assert!(Region::mapped("sq0", 5..=8).is_mapped()); assert!(!Region::Unmapped.is_mapped());
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Region
impl UnwindSafe for Region
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.