public class GeneAnnotations extends Object
This is initialized by providing a set of 'probes' with 'gene' and 'geneset' associations. When ErmineJ is started, the annotation file provided determines the set of probes/genes that are available.
At later stages, when the user's analysis results are read in, they might not have all the probes/genes used. A copy of the GeneAnnotations should be made that references just the subset of probes/genes that are relevant.
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_FILTER_NONSPECIFIC
Whether to filter out probes that hit more than one gene
|
Constructor and Description |
---|
GeneAnnotations(Collection<Gene> genes,
GeneSetTerms geneSetTerms,
SettingsHolder settings,
StatusViewer messenger) |
GeneAnnotations(GeneAnnotations start,
Collection<Probe> probes)
Create a read-only new annotation set based on an existing one, for selected probes, removing
probes with no annotations.
|
GeneAnnotations(GeneAnnotations start,
Collection<Probe> probes,
boolean pruneUnannotated)
Create a read-only new annotation set based on an existing one, for selected probes, optionally
removing unannotated probes.
|
GeneAnnotations(List<Gene> geneSymbols,
List<Collection<GeneSetTerm>> goTerms,
StatusViewer m)
Constructor designed for use when a file is not the immediate input of the data.
|
GeneAnnotations(List<String> probes,
List<String> genes,
List<Collection<String>> goTerms) |
Modifier and Type | Method and Description |
---|---|
int |
addAnnotation(Gene gene,
Collection<GeneSetTerm> terms) |
void |
addGeneSet(GeneSet set) |
void |
addGeneSet(GeneSetTerm geneSetId,
Collection<Gene> gs) |
GeneSet |
addGeneSet(GeneSetTerm geneSetId,
Collection<Gene> gs,
String sourceFile)
Add a user-defined gene set.
|
void |
deleteGeneSet(GeneSetTerm id)
Remove a gene set (class) from all the maps that reference it.
|
void |
deleteSubClone(GeneAnnotations a)
Remove a no-longer-needed subclone.
|
boolean |
deleteUserGeneSet(GeneSetTerm classID) |
Gene |
findGene(String symbol)
Case insensitive
|
GeneSet |
findGeneSet(GeneSetTerm term) |
GeneSet |
findGeneSet(String name) |
Probe |
findProbe(String probe)
Case insensitive
|
Set<Probe> |
findProbes(String searchOn)
Create a selected probes list based on a search string.
|
Set<GeneSetTerm> |
findSetsByGene(String searchOn)
Identify gene sets that contain a particular gene or probe.
|
Set<GeneSetTerm> |
findSetsByName(String searchOn) |
GeneSetTerm |
findTerm(String id) |
boolean |
geneSetExists(String id)
Returns true if the class is in the classToProbe map
|
Set<GeneSetTerm> |
getAllTerms()
Get all gene sets, including ones that might be empty or redundant.
|
Set<GeneSetTerm> |
getChildren(GeneSetTerm id) |
Collection<Gene> |
getGenes()
Return all genes, including those that are 'inactive'.
|
GeneSet |
getGeneSet(GeneSetTerm classid) |
Set<Gene> |
getGeneSetGenes(GeneSetTerm goset) |
DirectedGraph<String,GeneSetTerm> |
getGeneSetGraph() |
Set<Probe> |
getGeneSetProbes(GeneSetTerm geneSetId) |
Set<GeneSet> |
getGeneSets() |
Collection<GeneSet> |
getGeneSets(Collection<GeneSetTerm> terms) |
Set<GeneSetTerm> |
getGeneSetTerms() |
GeneSetTerms |
getGeneSetTermsHolder() |
int |
getMinimumGeneSetSize() |
Multifunctionality |
getMultifunctionality() |
Set<Probe> |
getProbes() |
SettingsHolder |
getSettings() |
Set<GeneSet> |
getUserDefinedGeneSets() |
Set<GeneSetTerm> |
getUserDefinedTerms()
Get the gene sets that are user-defined.
|
boolean |
hasGene(Gene g) |
boolean |
hasGeneSet(GeneSetTerm id) |
boolean |
hasProbe(Probe probeId) |
boolean |
hasRedundancy(GeneSetTerm id)
Check if a group has any redundancies.
|
boolean |
hasUsableAspect(GeneSetTerm geneSetTerm,
boolean missingAspectTreatedAsUsable) |
boolean |
isReadOnly()
Test whether this was constructed 'subcloning' style.
|
Collection<Gene> |
loadPlainGeneList(String loadFile) |
int |
numActiveGeneSets()
Count how many gene sets will be analyzed given the user's current settings (min and max size and aspects)
|
int |
numActiveGeneSets(int minSize,
int maxSize)
Count how many gene sets will be analyzed given the user's current selected aspects and the provided minimum and
maximum sizes.
|
int |
numAnnotatedGenes()
Compute how many genes have Gene set annotations.
|
int |
numGenes()
How many genes are currently available
|
int |
numGeneSets()
Get the number of gene sets currently available.
|
int |
numGenesInGeneSet(GeneSetTerm id)
Get the number of genes in a gene set, identified by id.
|
int |
numProbes() |
int |
numProbesForGene(Gene g)
Get how many probes point to the same gene.
|
int |
numProbesInGeneSet(GeneSetTerm id)
Get the number of probes in a gene set, identified by id.
|
void |
print(Writer out)
Print out the gene annotations in the same format we got them in, but if the gene sets have been modified, this
will be reflected.
|
void |
saveGeneSet(GeneSet toSave)
Save changes to a user-defined gene set.
|
Collection<GeneSetTerm> |
selectUserDefined()
Make the selection the user-defined sets only.
|
void |
setMessenger(StatusViewer m) |
GeneAnnotations |
subClone(Collection<Probe> probesToRetain)
Create a new annotation set based on an existing one, for selected probes, removing probes with no annotations.
|
TableModel |
toTableModel() |
public static final boolean DEFAULT_FILTER_NONSPECIFIC
public GeneAnnotations(Collection<Gene> genes, GeneSetTerms geneSetTerms, SettingsHolder settings, StatusViewer messenger)
genes
- geneSetTerms
- messenger
- public GeneAnnotations(GeneAnnotations start, Collection<Probe> probes)
start
- probes
- GeneAnnotations(start, probes, pruneUnannotated)
public GeneAnnotations(GeneAnnotations start, Collection<Probe> probes, boolean pruneUnannotated)
start
- probes
- which must be a subset of those in start (others will be ignored)pruneUnannotated
- if true (normally!), probes lacking annotations are removed. This then becomes unmutable
in the sense that adding annotations is not allowed.public GeneAnnotations(List<Gene> geneSymbols, List<Collection<GeneSetTerm>> goTerms, StatusViewer m)
probes
- A List of probesgeneSymbols
- A List of gene symbols (e.g., ACTB), corresponding to the probes (in the same order)geneNames
- A List of gene names (e.g., "Actin"), corresponding to the probes (in the same order). This can
be null.goTerms
- A List of Collections of Strings corresponding to the GO terms for each probe.IllegaArgumentException
- if any of the required arguments are null, don't have sizes that match, etc.public int addAnnotation(Gene gene, Collection<GeneSetTerm> terms)
gene
- terms
- public void addGeneSet(GeneSet set)
set
- public void addGeneSet(GeneSetTerm geneSetId, Collection<Gene> gs)
geneSetId
- gs
- public GeneSet addGeneSet(GeneSetTerm geneSetId, Collection<Gene> gs, String sourceFile)
geneSetId
- gs
- -- these should already be checked for compatibility (don't add new genes here, might be okay but
considered undefined)sourceFile
- used for tracking sources and later modification/persistence.public void deleteGeneSet(GeneSetTerm id)
id
- public void deleteSubClone(GeneAnnotations a)
a
- public boolean deleteUserGeneSet(GeneSetTerm classID)
classID
- public GeneSet findGeneSet(GeneSetTerm term)
term
- public Set<Probe> findProbes(String searchOn)
searchOn
- A string to be searched.public Set<GeneSetTerm> findSetsByGene(String searchOn)
searchOn
- public Set<GeneSetTerm> findSetsByName(String searchOn)
searchOn
- public GeneSetTerm findTerm(String id)
id
- public boolean geneSetExists(String id)
id
- String a class idpublic Set<GeneSetTerm> getAllTerms()
public Set<GeneSetTerm> getChildren(GeneSetTerm id)
id
- public Collection<Gene> getGenes()
public GeneSet getGeneSet(GeneSetTerm classid)
public Set<Gene> getGeneSetGenes(GeneSetTerm goset)
goset
- public DirectedGraph<String,GeneSetTerm> getGeneSetGraph()
public Set<Probe> getGeneSetProbes(GeneSetTerm geneSetId)
geneSetId
- public Set<GeneSet> getGeneSets()
public Collection<GeneSet> getGeneSets(Collection<GeneSetTerm> terms)
terms
- public Set<GeneSetTerm> getGeneSetTerms()
public GeneSetTerms getGeneSetTermsHolder()
public int getMinimumGeneSetSize()
public Multifunctionality getMultifunctionality()
public SettingsHolder getSettings()
public Set<GeneSetTerm> getUserDefinedTerms()
public boolean hasGene(Gene g)
public boolean hasGeneSet(GeneSetTerm id)
id
- public boolean hasProbe(Probe probeId)
probeId
- public boolean hasRedundancy(GeneSetTerm id)
id
- public boolean hasUsableAspect(GeneSetTerm geneSetTerm, boolean missingAspectTreatedAsUsable)
geneSetTerm
- missingAspectTreatedAsUsable
- What to do if the aspect is missing. User-defined groups (which don't have an
aspect) aren't affected by thispublic boolean isReadOnly()
public Collection<Gene> loadPlainGeneList(String loadFile) throws IOException
IOException
public int numActiveGeneSets()
public int numActiveGeneSets(int minSize, int maxSize)
minSize
- maxSize
- public int numAnnotatedGenes()
public int numGenes()
public int numGeneSets()
public int numGenesInGeneSet(GeneSetTerm id)
id
- String a class idpublic int numProbes()
public int numProbesForGene(Gene g)
g
- public int numProbesInGeneSet(GeneSetTerm id)
id
- String a class idpublic void print(Writer out) throws IOException
out
- IOException
public void saveGeneSet(GeneSet toSave) throws IOException
toSave
- IOException
public Collection<GeneSetTerm> selectUserDefined()
public void setMessenger(StatusViewer m)
m
- public GeneAnnotations subClone(Collection<Probe> probesToRetain)
Note that this could be changed in the future to consider the annotation aspect (BP, MF etc) not just the probes to retain. See comment in the Multifunctionality javadoc.
probesToRetain
- public TableModel toTableModel()
Copyright © 2002-2013 UBC Centre for High-Throughput Biology. All Rights Reserved.