Class GeneSet

java.lang.Object
org.snpeff.geneSets.GeneSet
All Implemented Interfaces:
Serializable, Comparable<GeneSet>, Iterable<String>

public class GeneSet extends Object implements Comparable<GeneSet>, Iterable<String>, Serializable
An set of genes (that belongs to a collection of gene-sets)
Author:
Pablo Cingolani
See Also:
  • Field Details

    • debug

      public static boolean debug
  • Constructor Details

    • GeneSet

      public GeneSet(List<GeneSet> geneSetList, GeneSets geneSets)
      Create a new GeneSet by joining all GeneSets in the list
      Parameters:
      geneSetList -
    • GeneSet

      public GeneSet(String name, String description, GeneSets geneSets)
      Create an empty gene set (that belongs to a collection of gene sets 'geneSets')
      Parameters:
      name -
      geneSets -
  • Method Details

    • addGene

      public void addGene(String gene)
      Add one gene to genesSet
      Parameters:
      gene -
    • compareTo

      public int compareTo(GeneSet geneSet)
      Comparable interface (to order terms)
      Specified by:
      compareTo in interface Comparable<GeneSet>
    • compareToNumbers

      public int compareToNumbers(double n1, double n2, String name1, String name2, boolean descending)
      Compare 2 numbers and 2 'names' (if both numbers are equal) - NaN sorted in a way that they remain at the end of a sorted list - When two numbers are equal, the sort is done alphabetically by name
      Parameters:
      n1 -
      n2 -
      name1 -
      name2 -
      Returns:
    • countOverlap

      public int countOverlap(GeneSet gs)
      COunt how many genes are in both GeneSets
      Parameters:
      gs -
      Returns:
    • genesSorted

      public List<String> genesSorted()
      Return a sorted list of genes
      Returns:
    • getDescription

      public String getDescription()
    • getGeneCount

      public int getGeneCount()
      Number of symbols in this node (total = interesting + not-interesting)
      Returns:
    • getGenes

      public HashSet<String> getGenes()
    • getGeneSets

      public GeneSets getGeneSets()
    • getInterestingGenes

      public HashSet<String> getInterestingGenes()
      Get 'interesting' genes
      Returns:
    • getInterestingGenesCount

      public int getInterestingGenesCount()
      Number of 'interesting' symbols
      Returns:
    • getMaxRank

      public int getMaxRank()
    • getName

      public String getName()
    • getRankedGenesCount

      public int getRankedGenesCount()
    • getRankSum

      public long getRankSum()
    • hasGene

      public boolean hasGene(String gene)
    • intersection

      public void intersection(GeneSet geneSet)
      Intersects this term with 'geneSet' (intersects 'geneSet' and 'interestingGeneSet').
      Parameters:
      geneSet - : GeneSet to intercept
    • iterator

      public Iterator<String> iterator()
      Specified by:
      iterator in interface Iterable<String>
    • rankSum

      public long rankSum()
      Calculate rankSum, rankedSymbols and maxRank
      Returns:
      rankSum
    • setDescription

      public void setDescription(String description)
    • setGeneSets

      public void setGeneSets(GeneSets geneSets)
    • setMaxRank

      public void setMaxRank(int maxRank)
    • setMinus

      public void setMinus(GeneSet geneSet)
      Perform a 'set minus' between this term and 'geneSet' (set minus for 'geneSet' and 'interestingGeneSet').
      Parameters:
      geneSet - : GeneSet to use for 'set minus' operation
    • setName

      public void setName(String geneSetName)
    • size

      public int size()
    • sizeEffective

      public int sizeEffective()
      Number of genes that have a value
      Returns:
    • toString

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

      public String toStringAll()
    • union

      public void union(GeneSet geneSet)
      Union this term with 'geneSet' (union for 'geneSet' and 'interestingGeneSet').
      Parameters:
      geneSet - : GeneSet to use for union