Package model
Record Class Feature.SubFeature
java.lang.Object
java.lang.Record
model.Feature.SubFeature
- Record Components:
type- The type of the sub-feature (e.g., "exon", "CDS").start- The 1-based start position of the sub-feature.end- The 1-based end position of the sub-feature.
- Enclosing class:
Feature
Represents a sub-feature of a genomic feature.
This record encapsulates the type and genomic location of a sub-feature, such as an exon or CDS, within a parent genomic feature. It includes:
- The type of the sub-feature (e.g., "exon", "CDS").
- The 1-based start position of the sub-feature on the reference genome.
- The 1-based end position of the sub-feature on the reference genome.
-
Constructor Summary
ConstructorsConstructorDescriptionSubFeature(String type, int start, int end) Creates an instance of aSubFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptionintend()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Generates a GFF3 conform identifier (ID) for a sub-feature based on its type and a parent identifier.intstart()Returns the value of thestartrecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
Method Details
-
ID
Generates a GFF3 conform identifier (ID) for a sub-feature based on its type and a parent identifier.This method constructs an ID string for the sub-feature using its type and the provided parent identifier. The format of the ID depends on the type of the sub-feature:
- If the type is "CDS", the ID is formatted as "ID=cds-{parentIdentifier};Parent=transcript-{parentIdentifier}".
- If the type is "exon", the ID is formatted as "ID=exon-{parentIdentifier};Parent=transcript-{parentIdentifier}".
- If the type contains "RNA", the ID is formatted as "ID=transcript-{parentIdentifier};Parent={parentIdentifier}".
- For other types, the ID is formatted as "ID={type}-{parentIdentifier};Parent={parentIdentifier}".
- Parameters:
parentIdentifier- The identifier of the parent feature.- Returns:
- A formatted string representing the GFF3 ID value of the sub-feature.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
start
public int start()Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
end
public int end()Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-