API Reference

Public

GenomicFeatures.GenomicIntervalType
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 Interval object.

Fields

  • groupname::String: the group name associated with the interval.
  • first::Int64: the leftmost position.
  • last::Int64: the rightmost position.
  • strand::Strand: the strand.
  • metadata::T
source
GenomicFeatures.GenomicIntervalMethod
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}.

source
GenomicFeatures.coverageFunction
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  .  1
source
GenomicFeatures.eachoverlapFunction
eachoverlap(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.

source
GenomicFeatures.hasintersectionMethod
hasintersection(interval::AbstractGenomicInterval, col::GenomicIntervalCollection)::Bool

Query whether an interval has an intersection with col.

source

Internal

Base.findfirstMethod

Find a the first interval with matching start and end points.

Returns that interval, or 'nothing' if no interval was found.

source
GenomicFeatures.isorderedFunction

Check if two intervals are well ordered.

AbstractGenomicInterval are considered well ordered if groupname(a) <= groupname(b) and leftposition(a) <= leftposition(b).

source