skbio.metadata.
Interval
(interval_metadata, bounds, fuzzy=None, metadata=None)[source]¶Stores the bounds and metadata of an interval feature.
This class stores an interval feature. An interval feature is defined as a sub-region of a biological sequence or sequence alignment that is a functional entity, e.g., a gene, a riboswitch, an exon, etc. It can span a single contiguous region or multiple non-contiguous regions (e.g. multiple exons in a transcript, or multiple genes in an operon).
Parameters: |
|
---|
See also
Notes
While the construction of an Interval
object automatically add
itself to its associated IntervalMetadata
object,
IntervalMetadata.add
is the typical/easier way to
create and add it to IntervalMetadata
.
References
[1] | ftp://ftp.ebi.ac.uk/pub/databases/embl/doc/FT_current.html#3.4.3 |
Examples
Hypothetically, let’s say we have a gene called “genA” with 10 nt as shown in the following diagram. The second row represents the two exons (indicated by “=”) on this gene:
TGGATTCTGC
-====--==-
0123456789
We can create an Interval
object to represent the exons of the gene:
>>> from skbio.metadata import Interval, IntervalMetadata
>>> interval_metadata = IntervalMetadata(10)
Remember the coordinates are inclusive in lower bound and exclusive on upper bound:
>>> gene = Interval(interval_metadata,
... bounds=[(1, 5), (7, 9)],
... metadata={'name': 'genA'})
>>> gene # doctest: +ELLIPSIS
Interval(interval_metadata=..., bounds=[(1, 5), (7, 9)], fuzzy=[(False, False), (False, False)], metadata={'name': 'genA'})
Attributes
bounds |
The coordinates of the interval feature. |
dropped |
Boolean value indicating if the Interval object is dropped. |
fuzzy |
The openness of each coordinate. |
metadata |
The metadata of the interval feature. |
Built-ins
interval1 == interval2 |
Test if this Interval object is equal to another. |
__init_subclass__ |
This method is called when a class is subclassed. |
interval1 != interval2 |
Test if this Interval object is not equal to another. |
Methods
drop () |
Drop this Interval object from the interval metadata it links to. |