API Reference
Public
GenomicFeatures.STRAND_BOTH — Constant
Both strand ('.')
GenomicFeatures.STRAND_NA — Constant
Unknown strand ('?')
GenomicFeatures.STRAND_NEG — Constant
Negative strand ('-')
GenomicFeatures.STRAND_POS — Constant
Positive strand ('+')
GenomicFeatures.GenomicInterval — Type
GenomicInterval{T} <: AbstractGenomicInterval{T}A genomic interval specifies interval with some associated metadata. The first three fields (groupname, first, and last) are mandatory arguments when constructing the GenomicInterval object.
Fields
groupname::String: the group name associated with the interval.first::Int64: the leftmost position.last::Int64: the rightmost position.strand::Strand: thestrand.metadata::T
GenomicFeatures.GenomicInterval — Method
GenomicInterval{T}(data)The returned data is converted to GenomicInterval{T} if there is an implemented Base.convert function for the type of data. This method provides a useful hook for converting custom types to GenomicInterval{T}.
GenomicFeatures.GenomicIntervalCollection — Type
GenomicIntervalCollection(data, sort::Bool=false)Constructor that guesses the metadata type, and offers conversion through collection.
GenomicFeatures.GenomicIntervalCollection — Type
A GenomicIntervalCollection is an efficiently stored and indexed set of annotated genomic intervals.
GenomicFeatures.GenomicIntervalCollection — Method
GenomicIntervalCollection(intervals::AbstractVector{I}, sort::Bool=false) where {I<:Interval}Shorthand constructor.
GenomicFeatures.GenomicIntervalCollection — Method
GenomicIntervalCollection{I}(data, sort::Bool=false) where {I<:Interval}Constructor that offers conversion through collection.
GenomicFeatures.GenomicIntervalCollection — Method
GenomicIntervalCollection{T}(data, sort::Bool=true) where {T}Shorthand for metadata type bulk insertion.
GenomicFeatures.GenomicPosition — Type
A genomic position is distinguished from an interval and only specifies a position with some associated metadata.
GenomicFeatures.Strand — Type
Outer constructors
Strand can take four kinds of values listed in the next table:
| Symbol | Constant | Meaning |
|---|---|---|
'?' | STRAND_NA | strand is unknown or inapplicable |
'+' | STRAND_POS | positive strand |
'-' | STRAND_NEG | negative strand |
'.' | STRAND_BOTH | non-strand-specific feature |
GenomicFeatures.Strand — Method
Strand(strand::Char)GenomicFeatures.Strand — Method
Strand(strand::UInt8)GenomicFeatures.coverage — Function
coverage(intervals)Compute the coverage of a collection of intervals and return an GenomicIntervalCollection that contains run-length encoded coverage data.
For example, given intervals like:
[------] [------------]
[---------------]This function would return a new set of disjoint intervals with annotated coverage like:
[1][-2-][-1-][--2--][--1--]Example
julia> intervals = [
GenomicInterval("chr1", 1, 8),
GenomicInterval("chr1", 4, 20),
GenomicInterval("chr1", 14, 27)];
julia> coverage(intervals)
GenomicIntervalCollection{GenomicInterval{UInt32}} with 5 intervals:
chr1:1-3 . 1
chr1:4-8 . 2
chr1:9-13 . 1
chr1:14-20 . 2
chr1:21-27 . 1GenomicFeatures.each_overlap — Function
each_overlap(intervals_a, intervals_b, [groupname_isless=Base.isless])Create an iterator of overlapping intervals between intervals_a and intervals_b.
This function assumes elements of intervals_a and intervals_b are sorted by its group name and left position. If the element type is not a subtype of GenomicFeatures.AbstractGenomicInterval, elements are converted to GenomicInterval objects.
The third optional argument is a function that defines the order of the group names. The default function is Base.isless, which is the lexicographical order.
GenomicFeatures.group_name — Function
group_name(x)Get the name of the group of x, such as the chromosome of an interval. It is BioGenerics' groupname, so a method defined through either name reaches callers of both, though GenomicFeatures deprecates the name groupname.
GenomicFeatures.has_group_name — Function
has_group_name(x)::BoolTest if x has a group name. It is BioGenerics' hasgroupname, whose name GenomicFeatures deprecates.
GenomicFeatures.has_intersection — Method
has_intersection(interval::AbstractGenomicInterval, col::GenomicIntervalCollection)::BoolQuery whether an interval has an intersection with col.
GenomicFeatures.has_left_position — Function
has_left_position(x)::BoolTest if x has a leftmost position. It is BioGenerics' hasleftposition, whose name GenomicFeatures deprecates.
GenomicFeatures.has_right_position — Function
has_right_position(x)::BoolTest if x has a rightmost position. It is BioGenerics' hasrightposition, whose name GenomicFeatures deprecates.
GenomicFeatures.is_filled — Function
is_filled(x)::BoolTest if x holds data, rather than being empty. It is BioGenerics' isfilled, whose name GenomicFeatures deprecates.
GenomicFeatures.is_overlapping — Function
is_overlapping(a, b)::BoolTest if a and b overlap. It is BioGenerics' isoverlapping, whose name GenomicFeatures deprecates.
GenomicFeatures.is_overlapping — Method
Return true if interval a overlaps interval b, with no consideration to strand
GenomicFeatures.left_position — Function
left_position(x)Get the leftmost position of x, 1-based. It is BioGenerics' leftposition, whose name GenomicFeatures deprecates.
GenomicFeatures.left_position — Method
left_position(i::AbstractGenomicInterval)Return the leftmost position of i.
GenomicFeatures.right_position — Function
right_position(x)Get the rightmost position of x, 1-based and inclusive. It is BioGenerics' rightposition, whose name GenomicFeatures deprecates.
GenomicFeatures.right_position — Method
right_position(i::AbstractGenomicInterval)Return the rightmost position of i.
GenomicFeatures.span — Method
span(interval::AbstractGenomicInterval)::IntGet the span of interval.
Internal
Base.findfirst — Method
Find a the first interval with matching start and end points.
Returns that interval, or 'nothing' if no interval was found.
Base.position — Method
position(p::AbstractGenomicPosition)Return the position of p.
GenomicFeatures.base_interval_type — Method
Get the interval type without metadata. This query is useful when converting an interval's metadata or when implementing promotion rules.
GenomicFeatures.interval_type — Method
Get the interval type. Overwrite to suggest stream element conversions during iteration.
GenomicFeatures.is_ordered — Function
Check if two intervals are well ordered.
AbstractGenomicInterval are considered well ordered if groupname(a) <= groupname(b) and leftposition(a) <= leftposition(b).
GenomicFeatures.metadata_type — Method
Get the interval's metadata type.
GenomicFeatures.precedes — Function
Return true if interval a entirely precedes b.
GenomicFeatures.volume — Method
volume(interval::AbstractGenomicInterval)Get the product of the interval's span and metadata.