Package htsjdk.tribble.gff
Interface Gff3Feature
- All Known Implementing Classes:
Gff3FeatureImpl
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 Summary
Modifier and TypeMethodDescriptionSet<? extends Gff3Feature> flatten()Flatten this feature and all descendents into a set of features.Set<? extends Gff3Feature> Get set of all features this feature descends from, through chains of Parent attributes.getAttribute(String key) Get BaseData object which contains all the basic information of the featureSet<? extends Gff3Feature> Gets set of features for which this feature is a parentSet<? extends Gff3Feature> Get set of co-features.default StringGets the contig name for the contig this is mapped to.Set<? extends Gff3Feature> Get set of all features descended from this features, through chains of Parent attributes.default intgetEnd()default StringgetID()default StringgetName()Set<? extends Gff3Feature> Gets set of parent featuresdefault intgetPhase()default doublegetScore()default Stringdefault intgetStart()default StrandSet<? extends Gff3Feature> Get the set of top level features from which this feature is descended.default StringgetType()getUniqueAttribute(String key) Most attributes in a GFF file are present just one time in a line, e.g.default booleanhasAttribute(String key) Returns true if this record contains an attribute for the specified key.booleanbooleanbooleanbooleanMethods inherited from interface htsjdk.samtools.util.Locatable
contains, contigsMatch, getLengthOnReference, overlaps, withinDistanceOf
-
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
-
getEnd
default int getEnd() -
getStrand
-
getPhase
default int getPhase() -
getType
-
getContig
Description copied from interface:LocatableGets the contig name for the contig this is mapped to. May return null if there is no unique mapping. -
getStart
default int getStart() -
getAttribute
-
hasAttribute
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
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
-
getID
-
getName
-
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()
-