Class GoMapping
java.lang.Object
com.compomics.util.experiment.biology.genes.go.GoMapping
public class GoMapping extends Object
Class parsing BioMart protein go mappings and storing them in maps.
- Author:
- Marc Vaudel, Harald Barsnes
-
Field Summary
-
Constructor Summary
Constructors Constructor Description GoMapping()
Constructor. -
Method Summary
Modifier and Type Method Description HashSet<String>
getGoAccessions(String proteinAccession)
Returns the GO accessions linked to a given protein accession.HashMap<String,String>
getGoNamesMap()
Returns the GO accession to name map.HashMap<String,HashSet<String>>
getGoToProteinMap()
Returns the GO to protein accession map.HashSet<String>
getProteinAccessions(String goTermAccession)
Returns the protein accessions linked to a given GO term.HashMap<String,HashSet<String>>
getProteinToGoMap()
Returns the protein to GO accession map.ArrayList<String>
getSortedTermNames()
Returns a sorted list of all GO Terms names linked to proteins in the proteinToGoMap.String
getTermAccession(String goName)
Returns the accession of a GO term.String
getTermName(String goAccession)
Returns the name of a GO term.void
loadMappingsFromFile(File file, WaitingHandler waitingHandler)
Reads go mappings from a BioMart file.
-
Field Details
-
SEPARATOR
The separator used to separate line contents.- See Also:
- Constant Field Values
-
-
Constructor Details
-
GoMapping
public GoMapping()Constructor.
-
-
Method Details
-
loadMappingsFromFile
Reads go mappings from a BioMart file. The structure of the file should be protein accession go accession go name. Previous mappings are silently overwritten.- Parameters:
file
- the file containing the GO mappingwaitingHandler
- a waiting handler allowing canceling of the process.- Throws:
IOException
- if an exception occurs while reading the file
-
getGoAccessions
Returns the GO accessions linked to a given protein accession. Null if not found.- Parameters:
proteinAccession
- the accession of the protein of interest- Returns:
- a list of GO accession numbers, an empty list if no mapping is found
-
getProteinAccessions
Returns the protein accessions linked to a given GO term. Null if not found.- Parameters:
goTermAccession
- the accession of the GO term- Returns:
- a list of GO accession numbers, an empty list if no mapping is found
-
getTermName
Returns the name of a GO term.- Parameters:
goAccession
- the accession number of the GO term of interest- Returns:
- the name, null if not found
-
getTermAccession
Returns the accession of a GO term.- Parameters:
goName
- the name of the GO term of interest- Returns:
- the accession, null if not found
-
getGoNamesMap
Returns the GO accession to name map.- Returns:
- the GO accession to name map
-
getProteinToGoMap
Returns the protein to GO accession map.- Returns:
- the protein to GO accession map
-
getGoToProteinMap
Returns the GO to protein accession map.- Returns:
- the GO to protein accession map
-
getSortedTermNames
Returns a sorted list of all GO Terms names linked to proteins in the proteinToGoMap.- Returns:
- a sorted list of all GO Terms names
-