Class SpeciesFactory

java.lang.Object
com.compomics.util.experiment.biology.taxonomy.SpeciesFactory

public class SpeciesFactory extends Object
Class related to the handling of species.
Author:
Marc Vaudel, Harald Barsnes
  • Field Details

    • UNKNOWN

      public static final String UNKNOWN
      Tag for unknown species.
      See Also:
    • UNIPROT_TAXONOMY_FILENAME

      public static final String UNIPROT_TAXONOMY_FILENAME
      The name of the UniProt taxonomy file.
      See Also:
    • ENSEMBL_SPECIES

      public static final String ENSEMBL_SPECIES
      The names of the Ensembl species files.
      See Also:
    • BIOMART_ENSEMBL_FILENAME

      public static final String BIOMART_ENSEMBL_FILENAME
      The name of the Ensembl BioMart datasets file.
      See Also:
  • Method Details

    • getInstance

      public static SpeciesFactory getInstance()
      Static method returning the instance of the factory.
      Returns:
      the instance of the factory
    • initiate

      public void initiate(File configFolder) throws IOException
      Initiates the factory using the files of the static fields.
      Parameters:
      configFolder - the config folder
      Throws:
      IOException - Exception thrown whenever an error occurred while reading a mapping file.
    • getSpeciesDescription

      public static String getSpeciesDescription(TreeMap<String,Integer> speciesOccurrence)
      Returns a listing of the species occurrence map provided.
      Parameters:
      speciesOccurrence - a map containing the occurrence of different species
      Returns:
      a listing of the species occurrence map provided
    • getEnsemblSpeciesFile

      public static File getEnsemblSpeciesFile(File configFolder)
      Returns the Ensembl species file.
      Parameters:
      configFolder - the config folder
      Returns:
      the Ensembl species file
    • getUniprotTaxonomyFile

      public static File getUniprotTaxonomyFile(File configFolder)
      Returns the UniProt taxonomy file.
      Parameters:
      configFolder - the config folder
      Returns:
      the UniProt taxonomy species file
    • getBiomartEnsemblMappingFile

      public static File getBiomartEnsemblMappingFile(File configFolder)
      Returns the Ensembl BioMart file.
      Parameters:
      configFolder - the config folder
      Returns:
      the Ensembl BioMart file
    • getLatinName

      public String getLatinName(Integer taxon)
      Returns the Latin name of the species corresponding to the given taxon according to the UniProt mapping. Null if not found.
      Parameters:
      taxon - the NCBI taxon ID
      Returns:
      the Latin name of the species
    • getEnsemblAssembly

      public String getEnsemblAssembly(String latinName)
      Returns the Ensembl assembly to use for the given Latin name.
      Parameters:
      latinName - the Latin name, e.g. 'homo_sapiens'.
      Returns:
      the Ensembl assembly to use
    • getEnsemblDataset

      public String getEnsemblDataset(String latinName)
      Returns the Ensembl dataset to use for the given Latin name.
      Parameters:
      latinName - the Latin name, e.g. 'homo_sapiens'.
      Returns:
      the Ensembl dataset to use
    • getEnsemblDatasetName

      public String getEnsemblDatasetName(String latinName, EnsemblSpecies.EnsemblDivision ensemblDivision)
      Returns the Ensemble dataset name. E.g. 'hsapiens_gene_ensembl'.
      Parameters:
      latinName - the Latin name
      ensemblDivision - the Ensembl division
      Returns:
      the Ensemble dataset name
    • getEnsemblSpecies

      public EnsemblSpecies getEnsemblSpecies()
      Returns the Ensembl species mapping.
      Returns:
      the Ensembl species mapping
    • getUniprotTaxonomy

      public UniprotTaxonomy getUniprotTaxonomy()
      Returns the UniProt taxonomy mapping.
      Returns:
      the UniProt taxonomy mapping
    • getBiomartMapping

      public BiomartMapping getBiomartMapping()
      Returns the BioMart mapping.
      Returns:
      the BioMart mapping
    • getEnsembleSpecies

      public HashMap<String,HashSet<String>> getEnsembleSpecies()
      Returns a map of the species in Ensembl.
      Returns:
      a map of the species in Ensembl