com.compomics.util.preferences
Class GenePreferences

java.lang.Object
  extended by com.compomics.util.preferences.GenePreferences
All Implemented Interfaces:
Serializable

public class GenePreferences
extends Object
implements Serializable

Contains methods for downloading gene and GO mappings.

Author:
Harald Barsnes
See Also:
Serialized Form

Field Summary
 String GENE_MAPPING_FILE_SUFFIX
          The suffix to use for files containing gene mappings.
static String GENE_MAPPING_FOLDER
          The folder where gene mapping related info is stored.
 String GO_MAPPING_FILE_SUFFIX
          The suffix to use for files containing GO mappings.
 String NO_SPECIES_TAG
          The text to use for no species selected.
 String SELECT_SPECIES_TAG
          The text to use to tell the user to please select a species in the list.
 String SPECIES_SEPARATOR
          The species separator used in the species comboboxes.
 
Constructor Summary
GenePreferences()
          Create a new GenePreferences object.
 
Method Summary
 void createDefaultGeneMappingFiles(File aEnsemblVersionsFile, File aGoDomainsFile, File aSpeciesFile, File aDefaultSpeciesGoMappingsFile, File aDefaultSpeciesGeneMappingFile)
          Insert the default gene mappings files.
 boolean downloadGeneMappings(String selectedSpecies, WaitingHandler waitingHandler)
          Download the gene mappings.
 boolean downloadGoMappings(String selectedSpecies, String ensemblVersion, WaitingHandler waitingHandler)
          Download the GO mappings.
 String getCurrentSpecies()
          Returns the current species.
 HashMap<String,String> getEnsemblVersionsMap()
          Returns the Ensembl versions map.
 File getGeneMappingFolder()
          Returns the path to the folder containing the gene mapping files.
 HashMap<String,String> getGoDomainMap()
          Returns the GO domain map, e.g., key: GO term: GO:0007568, element: biological_process.
 Vector<String> getSpecies()
          Return the species list.
 HashMap<String,String> getSpeciesMap()
          Returns the species map.
 void loadSpeciesAndGoDomains()
          Load the mapping files.
 void setCurrentSpecies(String currentSpecies)
          Set the current species.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GENE_MAPPING_FOLDER

public static final String GENE_MAPPING_FOLDER
The folder where gene mapping related info is stored.


SPECIES_SEPARATOR

public final String SPECIES_SEPARATOR
The species separator used in the species comboboxes.

See Also:
Constant Field Values

SELECT_SPECIES_TAG

public final String SELECT_SPECIES_TAG
The text to use to tell the user to please select a species in the list.

See Also:
Constant Field Values

NO_SPECIES_TAG

public final String NO_SPECIES_TAG
The text to use for no species selected.

See Also:
Constant Field Values

GENE_MAPPING_FILE_SUFFIX

public final String GENE_MAPPING_FILE_SUFFIX
The suffix to use for files containing gene mappings.

See Also:
Constant Field Values

GO_MAPPING_FILE_SUFFIX

public final String GO_MAPPING_FILE_SUFFIX
The suffix to use for files containing GO mappings.

See Also:
Constant Field Values
Constructor Detail

GenePreferences

public GenePreferences()
Create a new GenePreferences object.

Method Detail

downloadGoMappings

public boolean downloadGoMappings(String selectedSpecies,
                                  String ensemblVersion,
                                  WaitingHandler waitingHandler)
                           throws MalformedURLException,
                                  IOException
Download the GO mappings.

Parameters:
selectedSpecies -
ensemblVersion -
waitingHandler -
Returns:
true if the download was ok
Throws:
MalformedURLException
IOException

downloadGeneMappings

public boolean downloadGeneMappings(String selectedSpecies,
                                    WaitingHandler waitingHandler)
                             throws MalformedURLException,
                                    IOException,
                                    IllegalArgumentException
Download the gene mappings.

Parameters:
selectedSpecies -
waitingHandler -
Returns:
true if the download was ok
Throws:
MalformedURLException
IOException
IllegalArgumentException

getGeneMappingFolder

public File getGeneMappingFolder()
Returns the path to the folder containing the gene mapping files.

Returns:
the gene mapping folder

getCurrentSpecies

public String getCurrentSpecies()
Returns the current species.

Returns:
the currentSpecies

setCurrentSpecies

public void setCurrentSpecies(String currentSpecies)
Set the current species.

Parameters:
currentSpecies - the currentSpecies to set

createDefaultGeneMappingFiles

public void createDefaultGeneMappingFiles(File aEnsemblVersionsFile,
                                          File aGoDomainsFile,
                                          File aSpeciesFile,
                                          File aDefaultSpeciesGoMappingsFile,
                                          File aDefaultSpeciesGeneMappingFile)
Insert the default gene mappings files. If the files already exists these will be kept and not overwritten.

Parameters:
aEnsemblVersionsFile -
aGoDomainsFile -
aSpeciesFile -
aDefaultSpeciesGoMappingsFile -
aDefaultSpeciesGeneMappingFile -

loadSpeciesAndGoDomains

public void loadSpeciesAndGoDomains()
                             throws IOException,
                                    IllegalArgumentException
Load the mapping files.

Throws:
IOException
IllegalArgumentException

getGoDomainMap

public HashMap<String,String> getGoDomainMap()
Returns the GO domain map, e.g., key: GO term: GO:0007568, element: biological_process.

Returns:
the goDomainMap

getSpeciesMap

public HashMap<String,String> getSpeciesMap()
Returns the species map. Key: latin name, element: ensembl database name, e.g., key: Homo sapiens, element: hsapiens.

Returns:
the speciesMap

getEnsemblVersionsMap

public HashMap<String,String> getEnsemblVersionsMap()
Returns the Ensembl versions map.

Returns:
the ensemblVersionsMap

getSpecies

public Vector<String> getSpecies()
Return the species list. NB: also contains species separators.

Returns:
the species


Copyright © 2013. All Rights Reserved.