pub enum Location {
    Range((i64, Before)(i64, After)),
    Between(i64i64),
    Complement(Box<Location>),
    Join(Vec<Location>),
    Order(Vec<Location>),
    Bond(Vec<Location>),
    OneOf(Vec<Location>),
    External(StringOption<Box<Location>>),
    Gap(GapLength),
}
Expand description

Represents a Genbank “location”, used to specify the location of features and in the CONTIG line. See http://www.insdc.org/files/feature_table.html for a detailed description of what they mean.

Note that locations specified here must always refer to a nucleotide within the sequence. Ranges are inclusive in Genbank format, but represented as exclusive ranges, using 0-based indexing in this library. For example, 1..3 will be represented as Range((0, Before(false)), (4, After(false))).

To specify a range that wraps around on a circular sequence, Genbank files use join(x..last,1..y).

Variants

Range((i64, Before)(i64, After))

Represents a range of positions, indicated with [<]x..[>]y in the Genbank file. If < or > are present, then Before or After will be true, respectively. This means that the feature starts before/extends beyond the end point. Genbank files represent locations consisting of a single position with a single number. In this library this is represented using Range, i.e. 1 becomes Range((0, Before(false)), (1, After(false))).

Between(i64i64)

Represented as n^n+1: This means that the location is between the two adjacent positions specified. On a circular sequence the last and first positions are also allowed.

Complement(Box<Location>)

INSDC: “Find the complement of the presented sequence in the span specified by “location” (i.e., read the complement of the presented strand in its 5’-to-3’ direction)“

Join(Vec<Location>)

INSDC: “The indicated elements should be joined (placed end-to-end) to form one contiguous sequence”

Order(Vec<Location>)

INSDC: “The elements can be found in the specified order (5’ to 3’ direction), but nothing is implied about the reasonableness about joining them”

Bond(Vec<Location>)

OneOf(Vec<Location>)

External(StringOption<Box<Location>>)

Gap(GapLength)

Implementations

Convenience constructor for this commonly used variant

Try to get the start and end of a location. Returns the starting and finishing locations, as an exclusive range.

Truncates this location, limiting it to the given bounds. Note: higher is exclusive. None is returned if no part of the location lies within the bounds.

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

Deserialize this value from the given Serde deserializer. Read more

Formats the value using the given formatter. Read more

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

This method tests for !=.

Serialize this value into the given Serde serializer. 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 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)

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.