MutableGenome

sealed interface MutableGenome : Genome, MutableParent

Types

Link copied to clipboard
object Companion

Properties

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

All children of this parent

Link copied to clipboard

If true, then a Feature within the Genome may have multiple parents. If false, no Feature in the Genome may have multiple parents. Recommended to be false as multiple parentage can lead to unintuitive results.

Link copied to clipboard

This number increases with the number of topological modifications (adding, removing, and sorting) applied to the Genome. Useful for preventing concurrent modification.

Functions

Link copied to clipboard
abstract fun addIsA(subType: String, superType: String)

Makes subType a subtype of superType.

Link copied to clipboard
abstract fun addPartOf(child: String, parent: String)

Makes child have a part-of relationship with parent.

Link copied to clipboard
abstract fun addRoughSynonym(existing: String, vararg synonym: String)

Makes all synonym rough synonyms of existing.

Link copied to clipboard
abstract fun addSynonym(existing: String, vararg synonym: String)

Makes all synonym synonyms of existing.

Link copied to clipboard
abstract override fun byID(id: String): MutableFeature?

PLANNED

Link copied to clipboard
abstract override fun byName(name: String): List<MutableFeature>
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 containsID(id: String): Boolean

True iff a feature with id property id exists in this genome.

Link copied to clipboard
abstract fun containsName(name: String): Boolean

True iff a feature with name property name exists in this genome.

Link copied to clipboard
abstract fun containsType(type: String): Boolean

True iff type is in the type schema.

Link copied to clipboard
abstract override fun copy(): MutableGenome

Creates a deep copy of this Genome. If this is MutableGenome, the copy will be mutable. It will be immutable otherwise.

Link copied to clipboard
abstract fun defineType(id: String, exactSynonyms: Set<String>, roughSynonyms: Set<String>, isA: Set<String>, partOf: Set<String>)

Defines a type with the specified properties.

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 immutable(): Genome

Creates an immutable deep copy of this genome

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
abstract fun isA(subType: String, superType: String): Boolean

True any type associated with the name subType is transitively a subtype of any type associated with the name superType

Link copied to clipboard
abstract fun isRoughSynonym(name: String, vararg other: String): Boolean

True iff all elements of other are rough synonyms of name. Always false if name is not in the schema.

Link copied to clipboard
abstract fun isSynonym(name: String, vararg other: String): Boolean

True iff all elements of other are exact synonyms of name. Always false if name is not in the schema.

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

Iterates over children

Link copied to clipboard
abstract fun mutable(): MutableGenome

Creates mutable deep copy of this genome

Link copied to clipboard
abstract fun parentString(): String
Link copied to clipboard
abstract fun partOf(child: String, parent: String): Boolean

True iff child has a part-of relationship to parent, either from the Sequence Ontology or due to manual definition of PLANNED: Implementation of TypeSchema the type (MutableGenome.defineType or MutableGenome.addPartOf).

Link copied to clipboard
abstract fun roughSynonyms(type: String): Set<String>

All rough and exact synonyms of type

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

Sorts the children by comparator.

Link copied to clipboard
abstract fun synonyms(type: String): Set<String>

All exact synonyms of type.

Link copied to clipboard
abstract fun visualizeSchema(): String

DOT format representation of the type schema where nodes represent a type and edges represent a part-Of relationship. Can be visualized with DOT visualization tools, such as Graphviz.