Class Gff3Record


  • @Immutable
    public final class Gff3Record
    extends Object
    GFF3 record.
    Author:
    Michael Heuer
    • Constructor Detail

      • Gff3Record

        public Gff3Record​(String seqid,
                          String source,
                          String featureType,
                          long start,
                          long end,
                          Double score,
                          String strand,
                          Integer phase,
                          com.google.common.collect.ListMultimap<String,​String> attributes)
        Create a new GFF3 record.
        Parameters:
        seqid - seqid, must not be null
        source - source, must not be null
        featureType - feature type, must not be null
        start - start, must be at least 0L
        end - end, must be at least zero, and greater than or equal to start
        score - score
        strand - strand, if present must be -, +, or ?
        phase - phase, if present must be 0, 1, or 2
        attributes - attributes, must not be null
    • Method Detail

      • getSeqid

        public String getSeqid()
        Return the seqid for this GFF3 record.
        Returns:
        the seqid for this GFF3 record
      • getSource

        public String getSource()
        Return the source for this GFF3 record.
        Returns:
        the source for this GFF3 record
      • getFeatureType

        public String getFeatureType()
        Return the feature type for this GFF3 record.
        Returns:
        the feature type for this GFF3 record
      • getStart

        public long getStart()
        Return the start for this GFF3 record in 0-based coordinate system, closed open range.
        Returns:
        the start for this GFF3 record in 0-based coordinate system, closed open range
      • getEnd

        public long getEnd()
        Return the end for this GFF3 record in 0-based coordinate system, closed open range.
        Returns:
        the end for this GFF3 record in 0-based coordinate system, closed open range
      • getScore

        public Double getScore()
        Return the score for this GFF3 record, if any.
        Returns:
        the score for this GFF3 record, if any
      • getStrand

        public String getStrand()
        Return the strand for this GFF3 record.
        Returns:
        the strand for this GFF3 record
      • getPhase

        public Integer getPhase()
        Return the phase for this GFF3 record, if any.
        Returns:
        the phase for this GFF3 record, if any
      • getAttributes

        public com.google.common.collect.ListMultimap<String,​String> getAttributes()
        Return the attributes for this GFF3 record.
        Returns:
        the attributes for this GFF3 record
      • toRange

        public com.google.common.collect.Range<Long> toRange()
        Return this GFF3 record as a 0-based coordinate system, closed open range.
        Returns:
        this GFF3 record as a 0-based coordinate system, closed open range
      • hashCode

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

        static com.google.common.collect.ListMultimap<String,​String> parseAttributes​(String attributes)
        Parse the GFF3 attributes column into a list multimap of <String, String> entries.
        Parameters:
        attributes - attributes to parse, must not be null
        Returns:
        the GFF3 attributes column parsed into a list multimap of <String, String> entries
      • writeAttributes

        static String writeAttributes​(com.google.common.collect.ListMultimap<String,​String> attributes)
        Write the list multimap of <String, String> entries as GFF3 attributes column format.
        Parameters:
        attributes - attributes to write, must not be null
        Returns:
        the list multimap of <String, String> entries written as GFF3 attributes column format
      • isMissingValue

        static boolean isMissingValue​(String value)
        Return true if the specified value is the missing value (".").
        Parameters:
        value - value
        Returns:
        true if the specified value is the missing value (".")
      • valueOf

        public static Gff3Record valueOf​(String value)
        Return a new GFF3 record parsed from the specified value.
        Parameters:
        value - value to parse
        Returns:
        a new GFF3 record parsed from the specified value
        Throws:
        IllegalArgumentException - if the value is not valid GFF3 format
        NumberFormatException - if a number valued field cannot be parsed as a number