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 Details

  • Constructor Details

  • Method Details

    • loadMappingsFromFile

      public void loadMappingsFromFile​(File file, WaitingHandler waitingHandler) throws IOException
      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 mapping
      waitingHandler - a waiting handler allowing canceling of the process.
      Throws:
      IOException - if an exception occurs while reading the file
    • getGoAccessions

      public HashSet<String> getGoAccessions​(String proteinAccession)
      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

      public HashSet<String> getProteinAccessions​(String goTermAccession)
      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

      public String getTermName​(String goAccession)
      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

      public String getTermAccession​(String goName)
      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

      public HashMap<String,​String> getGoNamesMap()
      Returns the GO accession to name map.
      Returns:
      the GO accession to name map
    • getProteinToGoMap

      public HashMap<String,​HashSet<String>> getProteinToGoMap()
      Returns the protein to GO accession map.
      Returns:
      the protein to GO accession map
    • getGoToProteinMap

      public HashMap<String,​HashSet<String>> getGoToProteinMap()
      Returns the GO to protein accession map.
      Returns:
      the GO to protein accession map
    • getSortedTermNames

      public ArrayList<String> 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