java.lang.Object
com.compomics.util.experiment.biology.genes.go.GoDomains

public class GoDomains extends Object
Class parsing GO domains and storing them in a map.
Author:
Marc Vaudel, Harald Barsnes
  • Field Details

  • Constructor Details

    • GoDomains

      public GoDomains()
      Constructor.
  • Method Details

    • loadMappingFromFile

      public void loadMappingFromFile(File file, WaitingHandler waitingHandler) throws IOException
      Reads GO mappings from a file. The structure of the file should be accession\tGO 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
    • getTermDomain

      public String getTermDomain(String goAccession)
      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
    • addDomain

      public void addDomain(String goAccession, String goDomain)
      Adds a go domain to the mapping.
      Parameters:
      goAccession - the accession of the GO term
      goDomain - the domain of the GO term
    • saveMapping

      public void saveMapping(File destinationFile) throws IOException
      Saves the mapping to the given file.
      Parameters:
      destinationFile - the destination file
      Throws:
      IOException - exception thrown whenever an error occurred while writing the file