Interface Gff3Feature

All Superinterfaces:
Feature, Locatable
All Known Implementing Classes:
Gff3FeatureImpl

public interface Gff3Feature extends Feature
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"
  • Method Details

    • getTopLevelFeatures

      Set<? extends Gff3Feature> getTopLevelFeatures()
      Get the set of top level features from which this feature is descended. Top level features are features with no linked parents
      Returns:
      set of top level feature from which this feature is descended
    • isTopLevelFeature

      boolean isTopLevelFeature()
    • getSource

      default String getSource()
    • getEnd

      default int getEnd()
      Specified by:
      getEnd in interface Locatable
      Returns:
      1-based closed-ended position, undefined if getContig() == null
    • getStrand

      default Strand getStrand()
    • getPhase

      default int getPhase()
    • getType

      default String getType()
    • getContig

      default String getContig()
      Description copied from interface: Locatable
      Gets the contig name for the contig this is mapped to. May return null if there is no unique mapping.
      Specified by:
      getContig in interface Locatable
      Returns:
      name of the contig this is mapped to, potentially null
    • getStart

      default int getStart()
      Specified by:
      getStart in interface Locatable
      Returns:
      1-based start position, undefined if getContig() == null
    • getAttribute

      default List<String> getAttribute(String key)
    • hasAttribute

      default boolean hasAttribute(String key)
      Returns true if this record contains an attribute for the specified key.
      Parameters:
      key - key whose presence in this map is to be tested
      Returns:
      true if this map contains an attribute for the specified key
    • getUniqueAttribute

      default Optional<String> getUniqueAttribute(String key)
      Most attributes in a GFF file are present just one time in a line, e.g. : gene_biotype, gene_name, etc ... This function returns an Optional.empty if the key is not present, an Optional.of(value) if there is only one value associated to the key, or it throws an IllegalArgumentException if there is more than one value.
      Parameters:
      key - key whose presence in the attributes is to be tested
      Returns:
      Optional<String> if this map contains zero or one attribute for the specified key
      Throws:
      IllegalArgumentException - if there is more than one value.
    • getAttributes

      default Map<String,List<String>> getAttributes()
    • getID

      default String getID()
    • getName

      default String getName()
    • getAliases

      default List<String> getAliases()
    • getScore

      default double getScore()
    • getBaseData

      Gff3BaseData getBaseData()
      Get BaseData object which contains all the basic information of the feature
      Returns:
    • getParents

      Set<? extends Gff3Feature> getParents()
      Gets set of parent features
      Returns:
      set of parent features
    • getChildren

      Set<? extends Gff3Feature> getChildren()
      Gets set of features for which this feature is a parent
      Returns:
      set of child features
    • getAncestors

      Set<? extends Gff3Feature> getAncestors()
      Get set of all features this feature descends from, through chains of Parent attributes. If Derives_From exists for this feature, then only features along the inheritance path specified by the Derives_From attribute should be included as ancestors of this feature
      Returns:
      set of ancestor features
    • getDescendents

      Set<? extends Gff3Feature> getDescendents()
      Get set of all features descended from this features, through chains of Parent attributes. If Derives_From attribute exists for a feature, it should only be included as a descendent of this feature if the inheritance path specified by its Derives_From attribute includes this feature
      Returns:
      set of descendents
    • getCoFeatures

      Set<? extends Gff3Feature> 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
      Returns:
      set of co-features
    • flatten

      Set<? extends Gff3Feature> flatten()
      Flatten this feature and all descendents into a set of features. The Derives_From attribute is respected if it exists for this feature
      Returns:
      set of this feature and all descendents
    • hasParents

      boolean hasParents()
    • hasChildren

      boolean hasChildren()
    • hasCoFeatures

      boolean hasCoFeatures()