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

Mapped(Mapped)

A mapped region.

Tuple Fields of Mapped

0: Mapped
Unmapped

An unmapped region.

All

All reads.

Implementations

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());

Returns the region as a mapped region if it is mapped.

Examples
use noodles_core::Region;
assert!(Region::mapped("sq0", 5..=8).as_mapped().is_some());
assert!(Region::Unmapped.as_mapped().is_none());

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Compare self to key and return true if they are equal.

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

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.