Class Gff3FeatureImpl

java.lang.Object
htsjdk.tribble.gff.Gff3FeatureImpl
All Implemented Interfaces:
Locatable, Feature, Gff3Feature

public class Gff3FeatureImpl extends Object implements Gff3Feature
Gff3 format spec is defined at https://github.com/The-Sequence-Ontology/Specifications/blob/31f62ad469b31769b43af42e0903448db1826925/gff3.md Discontinuous features which are split between multiple lines in the gff files are implemented as separate features linked as "co-features"
  • Constructor Details

  • Method Details

    • getTopLevelFeatures

      public Set<Gff3FeatureImpl> getTopLevelFeatures()
      Get the set of top level features from which this feature is descended
      Specified by:
      getTopLevelFeatures in interface Gff3Feature
      Returns:
      set of top level feature from which this feature is descended
    • isTopLevelFeature

      public boolean isTopLevelFeature()
      Specified by:
      isTopLevelFeature in interface Gff3Feature
    • getParents

      public Set<Gff3FeatureImpl> getParents()
      Gets set of parent features
      Specified by:
      getParents in interface Gff3Feature
      Returns:
      set of parent features
    • getChildren

      public Set<Gff3FeatureImpl> getChildren()
      Gets set of features for which this feature is a parent
      Specified by:
      getChildren in interface Gff3Feature
      Returns:
      set of child features
    • getBaseData

      public Gff3BaseData getBaseData()
      Description copied from interface: Gff3Feature
      Get BaseData object which contains all the basic information of the feature
      Specified by:
      getBaseData in interface Gff3Feature
      Returns:
    • getAncestors

      public Set<Gff3FeatureImpl> getAncestors()
      Get set of all features this feature descends from, through chains of Parent attributes. Derives_From can be used to specify a particular inheritance path for this feature when multiple paths are available
      Specified by:
      getAncestors in interface Gff3Feature
      Returns:
      set of ancestor features
    • getDescendents

      public Set<Gff3FeatureImpl> getDescendents()
      Get set of all features descended from this features, through chains of Parent attributes. Derives_From can be used to specify a particular inheritance path for this feature when multiple paths are available
      Specified by:
      getDescendents in interface Gff3Feature
      Returns:
      set of descendents
    • getCoFeatures

      public Set<Gff3FeatureImpl> getCoFeatures()
      Get set of co-features. Co-features correspond to the other lines in the gff file that together make up a single discontinuous feature
      Specified by:
      getCoFeatures in interface Gff3Feature
      Returns:
      set of co-features
    • hasParents

      public boolean hasParents()
      Specified by:
      hasParents in interface Gff3Feature
    • hasChildren

      public boolean hasChildren()
      Specified by:
      hasChildren in interface Gff3Feature
    • hasCoFeatures

      public boolean hasCoFeatures()
      Specified by:
      hasCoFeatures in interface Gff3Feature
    • addParent

      public void addParent(Gff3FeatureImpl parent)
    • addCoFeature

      public void addCoFeature(Gff3FeatureImpl coFeature)
      Add a feature as a coFeature of this feature. When this method is called, the input coFeature will also be added as a coFeature of all the other coFeatures of this object, and this feature and all coFeatures will be added as coFeatures of the input coFeature. All coFeatures must have equal IDs and parents.
      Parameters:
      coFeature - feature to add as this features coFeature
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • flatten

      public Set<Gff3FeatureImpl> flatten()
      flatten this feature and all descendents into a set of features
      Specified by:
      flatten in interface Gff3Feature
      Returns:
      set of this feature and all descendents