MutableFeature

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 override val genome: MutableGenome
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 override var name: String?
Link copied to clipboard
abstract override var names: List<String>
Link copied to clipboard
open override val parent: MutableParent

Alias for parent[0]

Link copied to clipboard
abstract override val parents: List<MutableParent>
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 override var score: Double?
Link copied to clipboard
abstract override var seqid: String
Link copied to clipboard
abstract override var 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 override var strand: Strand
Link copied to clipboard
abstract val type: String

Functions

Link copied to clipboard
abstract fun addAttribute(tag: String, value: String)

Associates value with tag in the attributes of this feature.

Link copied to clipboard
abstract fun addAttributes(tag: String, values: Iterable<String>)

Associates all elements of values with tag in the attributes of this feature.

Link copied to clipboard
abstract fun addDiscontinuity(range: IntRange, phase: Phase)

Adds a discontinuous region of this feature, with range and phase.

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

All attributes as tag-values pairs.

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

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 clearAttribute(tag: String)

Clears all associations with tag in the attributes of this feature.

Link copied to clipboard
abstract fun delete()

Deletes this MutableFeature from its MutableGenome. Subsequent calls to read or write to this or any descendants that become orphaned as a result of this deletion will throw DeletedAccessException.

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
abstract fun insert(seqid: String, source: String, type: String, ranges: Iterable<IntRange>, score: Double?, strand: Strand, phases: Iterable<Phase>, attributes: Map<String, Iterable<String>>? = null): MutableFeature

Inserts a feature with the specified properties as the child of this feature. If this MutableParent is not a MutableGenome, the inserted type must have a part-of relationship with this feature's type. This means that either the part-of relationship was explicitly defined by the user or exists in the Sequence Ontology.

abstract fun insert(seqid: String, source: String, type: String, range: IntRange, score: Double?, strand: Strand, phase: Phase, attributes: Map<String, Iterable<String>>? = null): MutableFeature

Alias for insert for features without discontinuous regions. Behaves analogously.

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 setAttribute(tag: String, value: String)

Associates tag with value in the attributes of this feature. Removes all other associations with tag that may have existed prior.

Link copied to clipboard
abstract fun setAttributes(tag: String, values: Iterable<String>)

Associates tag with the elements of values in the attributes of this feature. Removes all other associations with tag that may have existed prior.

Link copied to clipboard
abstract fun setDiscontinuities(discontinuities: Iterable<Pair<IntRange, Phase>>)

Sets the discontinuous regions of this feature to be those specified in discontinuities.

Link copied to clipboard
abstract fun setDiscontinuity(index: Int, range: IntRange, phase: Phase)

Sets the discontinuous region of the feature at index to be of range and phase.

Link copied to clipboard
abstract fun setID(new: String?)

Sets the id to new.

Link copied to clipboard
abstract fun setPhase(phase: Phase, range: IntRange? = null)

Make this feature continuous with a phase phase.

Link copied to clipboard
abstract fun setRange(range: IntRange, phase: Phase? = null)

Makes this feature continuous with a range range.

Link copied to clipboard
abstract fun sort(comparator: (Feature, Feature) -> Int)

Sorts the children by comparator.

Link copied to clipboard
abstract override fun subtree(): Sequence<MutableFeature>

Prepends this feature to MutableParent.descendants.