Class CountByType

java.lang.Object
org.snpeff.stats.CountByType
All Implemented Interfaces:
Serializable

public class CountByType extends Object implements Serializable
Counters indexed by 'type' (type is a generic string that can mean anything)
Author:
pcingola
See Also:
  • Field Details

  • Constructor Details

    • CountByType

      public CountByType()
  • Method Details

    • addScore

      public long addScore(String type, double score)
      Add score for a type
    • contains

      public boolean contains(String key)
    • get

      public long get(String type)
      How many counts of this type?
    • getColorHtml

      public String getColorHtml(String type)
      Background color used for table (heatmap)
      Returns:
      An html coded color
    • getCount

      public long getCount(String type)
      Count for this type
    • getScore

      public double getScore(String type)
      Score for this type
    • getTotalCount

      public long getTotalCount()
    • getTypeList

      public List<String> getTypeList()
      List all types (alphabetically sorted) We need it as a getter for summary page (freemarker)
    • hasCount

      public boolean hasCount(String type)
    • hasData

      public boolean hasData()
    • hasScore

      public boolean hasScore(String type)
    • inc

      public long inc(String type)
    • inc

      public long inc(String type, int increment)
      Increment counter for a given type
    • isEmpty

      public boolean isEmpty()
      Is this empty
    • keySet

      public Set<String> keySet()
    • keysRanked

      public List<String> keysRanked(boolean reverse)
      List all types (sorted by count)
    • keysSorted

      public List<String> keysSorted()
      List all types (alphabetically sorted)
    • max

      public long max()
      Maximum count
    • min

      public long min()
      Minimum count
    • percent

      public double percent(String type)
      Percentage by type
    • ranks

      public Map<String,Integer> ranks(boolean reverse)
      A map: key -> rank(counts)
    • remove

      public void remove(String type)
      Remove this entry type
    • setScore

      public void setScore(String type, double score)
    • sum

      public long sum()
      Sum all counts.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(boolean showScores)
    • toString

      public String toString(String type)
    • toStringLine

      public String toStringLine()
    • toStringSort

      public String toStringSort()
    • toStringTop

      public String toStringTop(int n)