Package org.snpeff.geneSets
Class GeneSets
java.lang.Object
org.snpeff.geneSets.GeneSets
- All Implemented Interfaces:
Serializable
,Iterable<GeneSet>
- Direct Known Subclasses:
GeneSetsRanked
A collection of GeneSets
Genes have associated "experimental values"
- Author:
- Pablo Cingolani
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic boolean
static double
static long
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Add a gene and aliasesboolean
Add a gene and it's corresponding gene setvoid
Add a gene setboolean
addInteresting
(String gene) Add a symbol as 'interesting' gene (to every corresponding GeneSet in this collection)void
checkInterestingGenes
(Set<String> intGenes) Checks that every symboolID is in the set (as 'interesting' genes)protected void
Copy all data from geneSetsdisjointSet
(List<GeneSet> geneSetList, int activeSets) Produce a GeneSet based on a list of GeneSets and a 'mask'static GeneSets
Create gene sets form GoTermsIterate through each GeneSet in this GeneSetsgeneSetsSortedSize
(boolean reverse) Gene sets sorted by size (if same size, sort by name).int
How many genes do we have?getGenes()
Get all genes in this setgetGeneSet
(String geneSetName) Get a gene set named 'geneSetName'int
Get number of gene setsgetGeneSetsByGene
(String gene) All gene sets that this gene belongs toint
getLabel()
double
Get experimental valueboolean
boolean
boolean
isInteresting
(String geneName) boolean
isRanked()
protected boolean
protected boolean
Is this gene set used? I.e.iterator()
Iterate through each GeneSet in this GeneSetsIterate through each GeneSet in this GeneSetskeySet()
listTopTerms
(int numberToSelect) Select a number of GeneSetsloadExperimentalValues
(String fileName, boolean maskException) Reads a file with a list of genes and experimental values.boolean
loadMSigDb
(String gmtFile, boolean maskException) Read an MSigDBfile and add every Gene set (do not add relationships between nodes in DAG)void
void
removeGeneSet
(String geneSetName) Remove a GeneSetvoid
Remove unused gene setsvoid
reset()
Reset every 'interesting' gene or ranked gene (on every single GeneSet in this GeneSets)void
saveGseaGeneSets
(String fileName) Save gene sets file for GSEA analysis Format specification: http://www.broad.mit.edu/cancer/software/gsea/wiki/index.php/Data_formats#GMT:_Gene_Matrix_Transposed_file_format_.28.2A.gmt.29void
setDoNotAddIfNotInGeneSet
(boolean doNotAddIfNotInGeneSet) void
setGeneSetByName
(HashMap<String, GeneSet> geneSets) void
setInterestingGenes
(HashSet<String> interestingGenesIdSet) void
Set experimental value for this genevoid
setVerbose
(boolean verbose) toString()
values()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
debug
public static boolean debug -
LOG2
public static double LOG2 -
PRINT_SOMETHING_TIME
public static long PRINT_SOMETHING_TIME
-
-
Constructor Details
-
GeneSets
public GeneSets()Default constructor -
GeneSets
-
GeneSets
-
-
Method Details
-
factory
Create gene sets form GoTerms- Parameters:
goTerms
- : GoTerms to use
-
add
Add a gene set- Parameters:
geneSetName
-geneSet
-
-
add
Add a gene and aliases -
add
Add a gene and it's corresponding gene set- Parameters:
gene
-geneSet
-- Returns:
-
addInteresting
Add a symbol as 'interesting' gene (to every corresponding GeneSet in this collection) -
checkInterestingGenes
Checks that every symboolID is in the set (as 'interesting' genes)- Parameters:
intGenes
- : A set of interesting genes Throws an exception on error
-
copy
Copy all data from geneSets- Parameters:
geneSets
-
-
disjointSet
Produce a GeneSet based on a list of GeneSets and a 'mask'- Parameters:
geneSetList
- : A list of GeneSetsactiveSets
- : An integer (binary mask) that specifies weather a set in the list should be taken into account or not. The operation performed is: Intersection{ GeneSets where mask_bit == 1 } - Union{ GeneSets where mask_bit == 0 } ) where the minus sign '-' is actually a 'set minus' operation. This operation is done for both sets in GeneSet (i.e. genes and interestingGenes)- Returns:
- A GeneSet
-
geneSetsSorted
Iterate through each GeneSet in this GeneSets -
geneSetsSortedSize
Gene sets sorted by size (if same size, sort by name).- Parameters:
reverse
- : Reverse size sorting (does not affect name sorting)- Returns:
-
getGeneCount
public int getGeneCount()How many genes do we have?- Returns:
-
getGenes
Get all genes in this set- Returns:
-
getGeneSet
Get a gene set named 'geneSetName'- Parameters:
geneSetName
-- Returns:
-
getGeneSetCount
public int getGeneSetCount()Get number of gene sets- Returns:
-
getGeneSetsByGene
All gene sets that this gene belongs to- Parameters:
gene
-- Returns:
-
getGeneSetsByName
-
getInterestingGenes
-
getInterestingGenesCount
public int getInterestingGenesCount() -
getLabel
-
getValue
Get experimental value- Parameters:
gene
-- Returns:
-
getValueByGene
-
hasGene
-
hasValue
-
isInteresting
-
isRanked
public boolean isRanked() -
isUsed
Is this gene set used? I.e. is there at least one gene 'used'? (e.g. interesting or ranked)- Parameters:
gs
-- Returns:
-
isUsed
-
iterator
Iterate through each GeneSet in this GeneSets -
iteratorSorted
Iterate through each GeneSet in this GeneSets -
keySet
-
listTopTerms
Select a number of GeneSets- Parameters:
numberToSelect
-- Returns:
-
loadExperimentalValues
Reads a file with a list of genes and experimental values. Format: "gene \t value \n"- Parameters:
fileName
-- Returns:
- A list of genes not found
-
loadMSigDb
Read an MSigDBfile and add every Gene set (do not add relationships between nodes in DAG)- Parameters:
gmtFile
-geneSetType
-
-
remove
-
removeGeneSet
Remove a GeneSet -
removeUnusedSets
public void removeUnusedSets()Remove unused gene sets -
reset
public void reset()Reset every 'interesting' gene or ranked gene (on every single GeneSet in this GeneSets) -
saveGseaGeneSets
Save gene sets file for GSEA analysis Format specification: http://www.broad.mit.edu/cancer/software/gsea/wiki/index.php/Data_formats#GMT:_Gene_Matrix_Transposed_file_format_.28.2A.gmt.29- Parameters:
fileName
-
-
setDoNotAddIfNotInGeneSet
public void setDoNotAddIfNotInGeneSet(boolean doNotAddIfNotInGeneSet) -
setGeneSetByName
-
setInterestingGenes
-
setValue
Set experimental value for this gene- Parameters:
geneId
-value
-
-
setVerbose
public void setVerbose(boolean verbose) -
toString
-
values
-