com.compomics.util.experiment.annotation.go
Class GOFactory

java.lang.Object
  extended by com.compomics.util.experiment.annotation.go.GOFactory

public class GOFactory
extends Object

The GOFactory annotates identification results based on Ensembl Gene Ontology terms.

Author:
Marc Vaudel

Field Summary
static String separator
          The separator used to separate line contents.
 
Method Summary
 void clearFactory()
          Clears the mappings.
 void closeFiles()
          Closes connections.
 ArrayList<String> getAccessions(String goAccession)
          Returns the protein accessions linked to a GO accession number.
 ArrayList<String> getGoAccessions(String proteinAccession)
          Returns the GO accession numbers linked to a given protein accession number.
static GOFactory getInstance()
          Static method returning the instance of the factory.
 int getNProteinsForTerm(String goAccession)
          Returns the total number of protein accessions mapping to a given GO term.
 int getNTermsForProtein(String accession)
          Returns the total number of GO terms mapping to a given protein.
 int getNumberOfProteins()
          Returns the total number of proteins in this mapping.
 int getNumberOfTerms()
          Returns the total number of GO terms in this mapping.
 ArrayList<String> getProteinGoAccessions(String matchKey)
          Returns a list of non redundant GO accession numbers corresponding to a protein match.
 ArrayList<String> getProteinGoDescriptions(String matchKey)
          Returns a list of non redundant GO term descriptions corresponding to a protein match.
 ArrayList<String> getProteinMapped()
          Returns a non redundant list of all the proteins mapped.
 String getTermAccession(String goTerm)
          Returns the accession number of a GO term.
 String getTermDescription(String goAccession)
          Returns the description of a GO term.
 ArrayList<String> getTermNamesMapped()
          Returns a non redundant list of all the GO term descriptions mapped.
 ArrayList<String> getTermsMapped()
          Returns a non redundant list of all the GO accession numbers mapped.
 void initialize(File file, WaitingHandler waitingHandler)
          Initializes the factory on the given file
 boolean isMappingFileOpen()
          Returns true of the mapping file is currently open.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

separator

public static final String separator
The separator used to separate line contents.

See Also:
Constant Field Values
Method Detail

getInstance

public static GOFactory getInstance()
Static method returning the instance of the factory.

Returns:
the instance of the factory

initialize

public void initialize(File file,
                       WaitingHandler waitingHandler)
                throws IOException
Initializes the factory on the given file

Parameters:
file - the file containing the GO mapping
waitingHandler - a waiting handler allowing display of the progress and canceling of the process.
Throws:
IOException

getGoAccessions

public ArrayList<String> getGoAccessions(String proteinAccession)
                                  throws IOException
Returns the GO accession numbers linked to a given protein accession number.

Parameters:
proteinAccession - the accession number of the protein of interest
Returns:
a list of GO accession numbers, an empty list if no mapping is found
Throws:
IOException

getProteinGoAccessions

public ArrayList<String> getProteinGoAccessions(String matchKey)
                                         throws IOException
Returns a list of non redundant GO accession numbers corresponding to a protein match.

Parameters:
matchKey - the key of the protein match
Returns:
a list of non redundant GO accession numbers corresponding to a protein match
Throws:
IOException

getProteinGoDescriptions

public ArrayList<String> getProteinGoDescriptions(String matchKey)
                                           throws IOException
Returns a list of non redundant GO term descriptions corresponding to a protein match.

Parameters:
matchKey - the key of the protein match
Returns:
a list of non redundant GO term descriptions corresponding to a protein match
Throws:
IOException

getAccessions

public ArrayList<String> getAccessions(String goAccession)
                                throws IOException
Returns the protein accessions linked to a GO accession number.

Parameters:
goAccession - the GO accession number
Returns:
a list of GO accessions numbers, an empty list if none found
Throws:
IOException

getTermDescription

public String getTermDescription(String goAccession)
                          throws IOException
Returns the description of a GO term.

Parameters:
goAccession - the accession number of the GO term of interest
Returns:
the first description found, null if not found
Throws:
IOException

getTermAccession

public String getTermAccession(String goTerm)
                        throws IOException
Returns the accession number of a GO term.

Parameters:
goTerm - the description of the GO term of interest
Returns:
the first GO accession number found, null if not found
Throws:
IOException

getNumberOfProteins

public int getNumberOfProteins()
Returns the total number of proteins in this mapping.

Returns:
the total number of proteins in this mapping

getNumberOfTerms

public int getNumberOfTerms()
Returns the total number of GO terms in this mapping.

Returns:
the total number of GO terms in this mapping

getNProteinsForTerm

public int getNProteinsForTerm(String goAccession)
Returns the total number of protein accessions mapping to a given GO term.

Parameters:
goAccession - the GO accession number of interest
Returns:
the total number of proteins mapping to a given GO accession number

getNTermsForProtein

public int getNTermsForProtein(String accession)
Returns the total number of GO terms mapping to a given protein.

Parameters:
accession - the accession of the protein
Returns:
the total number of GO terms mapping to a given protein

getProteinMapped

public ArrayList<String> getProteinMapped()
Returns a non redundant list of all the proteins mapped.

Returns:
a non redundant list of all the proteins mapped

getTermsMapped

public ArrayList<String> getTermsMapped()
Returns a non redundant list of all the GO accession numbers mapped.

Returns:
a non redundant list of all the GO accession numbers mapped

getTermNamesMapped

public ArrayList<String> getTermNamesMapped()
Returns a non redundant list of all the GO term descriptions mapped.

Returns:
a non redundant list of all the GO term descriptions mapped

closeFiles

public void closeFiles()
                throws IOException
Closes connections.

Throws:
IOException

clearFactory

public void clearFactory()
Clears the mappings.


isMappingFileOpen

public boolean isMappingFileOpen()
Returns true of the mapping file is currently open.

Returns:
true of the mapping file is currently open


Copyright © 2013. All Rights Reserved.