Package org.snpeff.geneSets
Class GeneSet
- java.lang.Object
-
- org.snpeff.geneSets.GeneSet
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<GeneSet>
,java.lang.Iterable<java.lang.String>
public class GeneSet extends java.lang.Object implements java.lang.Comparable<GeneSet>, java.lang.Iterable<java.lang.String>, java.io.Serializable
An set of genes (that belongs to a collection of gene-sets)- Author:
- Pablo Cingolani
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
debug
-
Constructor Summary
Constructors Constructor Description GeneSet(java.lang.String name, java.lang.String description, GeneSets geneSets)
Create an empty gene set (that belongs to a collection of gene sets 'geneSets')GeneSet(java.util.List<GeneSet> geneSetList, GeneSets geneSets)
Create a new GeneSet by joining all GeneSets in the list
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGene(java.lang.String gene)
Add one gene to genesSetint
compareTo(GeneSet geneSet)
Comparable interface (to order terms)int
compareToNumbers(double n1, double n2, java.lang.String name1, java.lang.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 nameint
countOverlap(GeneSet gs)
COunt how many genes are in both GeneSetsjava.util.List<java.lang.String>
genesSorted()
Return a sorted list of genesjava.lang.String
getDescription()
int
getGeneCount()
Number of symbols in this node (total = interesting + not-interesting)java.util.HashSet<java.lang.String>
getGenes()
GeneSets
getGeneSets()
java.util.HashSet<java.lang.String>
getInterestingGenes()
Get 'interesting' genesint
getInterestingGenesCount()
Number of 'interesting' symbolsint
getMaxRank()
java.lang.String
getName()
int
getRankedGenesCount()
long
getRankSum()
boolean
hasGene(java.lang.String gene)
void
intersection(GeneSet geneSet)
Intersects this term with 'geneSet' (intersects 'geneSet' and 'interestingGeneSet').java.util.Iterator<java.lang.String>
iterator()
long
rankSum()
Calculate rankSum, rankedSymbols and maxRankvoid
setDescription(java.lang.String description)
void
setGeneSets(GeneSets geneSets)
void
setMaxRank(int maxRank)
void
setMinus(GeneSet geneSet)
Perform a 'set minus' between this term and 'geneSet' (set minus for 'geneSet' and 'interestingGeneSet').void
setName(java.lang.String geneSetName)
int
size()
int
sizeEffective()
Number of genes that have a valuejava.lang.String
toString()
java.lang.String
toStringAll()
void
union(GeneSet geneSet)
Union this term with 'geneSet' (union for 'geneSet' and 'interestingGeneSet').
-
-
-
Constructor Detail
-
GeneSet
public GeneSet(java.util.List<GeneSet> geneSetList, GeneSets geneSets)
Create a new GeneSet by joining all GeneSets in the list- Parameters:
geneSetList
-
-
GeneSet
public GeneSet(java.lang.String name, java.lang.String description, GeneSets geneSets)
Create an empty gene set (that belongs to a collection of gene sets 'geneSets')- Parameters:
name
-geneSets
-
-
-
Method Detail
-
addGene
public void addGene(java.lang.String gene)
Add one gene to genesSet- Parameters:
gene
-
-
compareTo
public int compareTo(GeneSet geneSet)
Comparable interface (to order terms)- Specified by:
compareTo
in interfacejava.lang.Comparable<GeneSet>
-
compareToNumbers
public int compareToNumbers(double n1, double n2, java.lang.String name1, java.lang.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 java.util.List<java.lang.String> genesSorted()
Return a sorted list of genes- Returns:
-
getDescription
public java.lang.String getDescription()
-
getGeneCount
public int getGeneCount()
Number of symbols in this node (total = interesting + not-interesting)- Returns:
-
getGenes
public java.util.HashSet<java.lang.String> getGenes()
-
getGeneSets
public GeneSets getGeneSets()
-
getInterestingGenes
public java.util.HashSet<java.lang.String> getInterestingGenes()
Get 'interesting' genes- Returns:
-
getInterestingGenesCount
public int getInterestingGenesCount()
Number of 'interesting' symbols- Returns:
-
getMaxRank
public int getMaxRank()
-
getName
public java.lang.String getName()
-
getRankedGenesCount
public int getRankedGenesCount()
-
getRankSum
public long getRankSum()
-
hasGene
public boolean hasGene(java.lang.String gene)
-
intersection
public void intersection(GeneSet geneSet)
Intersects this term with 'geneSet' (intersects 'geneSet' and 'interestingGeneSet').- Parameters:
geneSet
- : GeneSet to intercept
-
iterator
public java.util.Iterator<java.lang.String> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<java.lang.String>
-
rankSum
public long rankSum()
Calculate rankSum, rankedSymbols and maxRank- Returns:
- rankSum
-
setDescription
public void setDescription(java.lang.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(java.lang.String geneSetName)
-
size
public int size()
-
sizeEffective
public int sizeEffective()
Number of genes that have a value- Returns:
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toStringAll
public java.lang.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
-
-