Feature

sealed interface Feature : Parent

Represents a single annotation (feature) in a GFF (general feature format) file. Generally, these features correspond to a row in a gff file and have all the same properties.

Inheritors

Properties

Link copied to clipboard
open val children: List<Feature>

All children of this parent

Link copied to clipboard
Link copied to clipboard
open val end: Int

Positive, always greater than or equal to start. For discontinuous features, equivalent to maximum ending position among all ranges.

Link copied to clipboard
abstract val genome: Genome
Link copied to clipboard
abstract val id: String?

The ID attribute of this feature, or null if no such attribute

Link copied to clipboard
open val length: Int

The length of the feature, equivalent to end - start + 1

Link copied to clipboard
open val lengths: List<Int>
Link copied to clipboard
open val multiplicity: Int

Discontinuous annotations are represented in featureTree as a single Feature object with a multiplicity equal to the number of discontinuous segments of the annotation. ranges represents all the start-end ranges of this discontinuous feature while phases represents all the phases.

Link copied to clipboard
abstract val name: String?

A name associated with this feature, as defined by the Name attribute. Null if no names are associated.

Link copied to clipboard
abstract val names: List<String>

All names associated with this feature, as defined by the Name attribute. Empty list if no names are associated.

Link copied to clipboard
open val parent: Parent

Alias for parent[0]

Link copied to clipboard
abstract val parents: List<Parent>
Link copied to clipboard
open val phase: Phase

Alias for phases[0]

Link copied to clipboard
abstract val phases: List<Phase>

All phases for this feature. Continuous features will only have one, while discontinuous features will have several. Size is equal to ranges.size. A feature of type "CDS" (or synonym) may not have any Phase.UNSPECIFIED in its phases property.

Link copied to clipboard
open val range: IntRange

Alias for ranges[0]

Link copied to clipboard
abstract val ranges: List<IntRange>

All start-end IntRanges that define this feature. Continuous features will only have one, while discontinuous features will have several. Size is equal to phases.size. All ranges are positive.

Link copied to clipboard
abstract val score: Double?
Link copied to clipboard
abstract val seqid: String
Link copied to clipboard
abstract val source: String
Link copied to clipboard
open val start: Int

Positive, always less than or equal to end. For discontinuous features, equivalent to the minimum starting position among all ranges.

Link copied to clipboard
abstract val strand: Strand
Link copied to clipboard
abstract val type: String

Functions

Link copied to clipboard
abstract fun allAttributes(): Map<String, List<String>>

All attributes as tag-values pairs.

Link copied to clipboard
abstract fun ancestors(): List<Parent>

Return all ancestors of this feature in a depth-first order. Multiple parentage will result in duplicate values.

Link copied to clipboard
abstract fun asRow(): String

The String representation of this Feature as it appears as a row in a GFF file.

Link copied to clipboard
abstract fun attribute(tag: String): List<String>

All attribute values for tag.

Link copied to clipboard
abstract fun byID(id: String): Feature?
Link copied to clipboard
abstract fun byName(name: String): List<Feature>
Link copied to clipboard
abstract fun children(type: String? = null): List<Feature>

All children of this parent of type type (including its synonyms), or all children if type is null.

Link copied to clipboard
abstract fun descendants(type: String? = null): Sequence<Feature>

All descendants of this parent of type type (including its synonyms) in depth-first order, or all descendants if type is null. Iterating over the descendants while modifying the topology of the tree will produce a ConcurrentModificationException (non-topological modifications are permissible). Multiple parentage will result in duplicate values

Link copied to clipboard
open operator fun iterator(): Iterator<Feature>

Iterates over children

Link copied to clipboard
abstract fun parentString(): String
Link copied to clipboard
abstract fun subtree(): Sequence<Feature>

Prepends this feature to Parent.descendants.