Package htsjdk.tribble.gff

# 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 Summary

Constructors
Constructor
Description
`Gff3FeatureImpl(Gff3BaseData baseData)`
`Gff3FeatureImpl(String contig, String source, String type, int start, int end, Double score, Strand strand, int phase, Map<String,List<String>> attributes)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addCoFeature(Gff3FeatureImpl coFeature)`
Add a feature as a coFeature of this feature.
`void`
`addParent(Gff3FeatureImpl parent)`
`boolean`
`equals(Object other)`
`Set<Gff3FeatureImpl>`
`flatten()`
flatten this feature and all descendents into a set of features
`Set<Gff3FeatureImpl>`
`getAncestors()`
Get set of all features this feature descends from, through chains of Parent attributes.
`Gff3BaseData`
`getBaseData()`
Get BaseData object which contains all the basic information of the feature
`Set<Gff3FeatureImpl>`
`getChildren()`
Gets set of features for which this feature is a parent
`Set<Gff3FeatureImpl>`
`getCoFeatures()`
Get set of co-features.
`Set<Gff3FeatureImpl>`
`getDescendents()`
Get set of all features descended from this features, through chains of Parent attributes.
`Set<Gff3FeatureImpl>`
`getParents()`
Gets set of parent features
`Set<Gff3FeatureImpl>`
`getTopLevelFeatures()`
Get the set of top level features from which this feature is descended
`boolean`
`hasChildren()`
`boolean`
`hasCoFeatures()`
`int`
`hashCode()`
`boolean`
`hasParents()`
`boolean`
`isTopLevelFeature()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface htsjdk.tribble.Feature

`getChr`

### Methods inherited from interface htsjdk.tribble.gff.Gff3Feature

`getAliases, getAttribute, getAttributes, getContig, getEnd, getID, getName, getPhase, getScore, getSource, getStart, getStrand, getType, getUniqueAttribute, hasAttribute`

### Methods inherited from interface htsjdk.samtools.util.Locatable

`contains, contigsMatch, getLengthOnReference, overlaps, withinDistanceOf`

## Constructor Details

### Gff3FeatureImpl

public Gff3FeatureImpl(String contig, String source, String type, int start, int end, Double score, Strand strand, int phase, Map<String,List<String>> attributes)

### Gff3FeatureImpl

public Gff3FeatureImpl(Gff3BaseData baseData)

## 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