java.lang.Object
com.compomics.util.experiment.biology.taxonomy.mappings.UniprotTaxonomy

public class UniprotTaxonomy extends Object
Mapping of the UniProt species taken from https://ftp.uniprot.org/pub/databases/uniprot/current_release/knowledgebase/complete/docs/speclist.txt.
Author:
Marc Vaudel, Harald Barsnes
  • Field Details

  • Constructor Details

    • UniprotTaxonomy

      public UniprotTaxonomy()
      Constructor.
  • Method Details

    • loadMapping

      public void loadMapping(File speciesFile) throws IOException
      Loads the species mapping from a file. Previous mapping will be overwritten.
      Parameters:
      speciesFile - the species file
      Throws:
      IOException - exception thrown whenever an error occurred while reading the file.
    • getId

      public Integer getId(String name) throws MalformedURLException, org.apache.commons.httpclient.URIException, IOException
      Returns the NCBI taxon corresponding to the given species name. Null if not found.
      Parameters:
      name - the species name
      Returns:
      the taxon
      Throws:
      MalformedURLException - exception thrown whenever the query URL is malformed
      org.apache.commons.httpclient.URIException - exception thrown whenever an error occurred while downloading the mapping
      IOException - exception thrown whenever an error occurred while downloading the mapping
    • getLatinName

      public String getLatinName(Integer id)
      Returns the Latin name corresponding to the given NCBI taxon.
      Parameters:
      id - the NCBI taxon
      Returns:
      the Latin name
    • getCommonName

      public String getCommonName(Integer id)
      Returns the common name corresponding to the given NCBI taxon.
      Parameters:
      id - the NCBI taxon
      Returns:
      the common name
    • getSynonym

      public String getSynonym(String scientificName)
      Returns the synonym corresponding to the scientific name. E.g. 'Ajellomyces capsulatus (strain H143)' returns 'Histoplasma capsulatum'.
      Parameters:
      scientificName - the scientific name
      Returns:
      the synonym