public class GenePreferences extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
static String |
GENE_MAPPING_FILE_SUFFIX
The suffix to use for files containing gene mappings.
|
static String |
GO_MAPPING_FILE_SUFFIX
The suffix to use for files containing GO mappings.
|
| Constructor and Description |
|---|
GenePreferences()
Create a new GenePreferences object.
|
GenePreferences(GenePreferences genePreferences)
Creates new gene preferences based on a GenePreferences object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
clearOldMappings(String currentEnsemblSpeciesType,
String selectedSpecies,
boolean commandLine)
Clears the gene and GO mappings for the currently selected species.
|
void |
createDefaultGeneMappingFiles(File aEnsemblVersionsFile,
File aGoDomainsFile,
File aSpeciesFile,
File aDefaultSpeciesGoMappingsFile,
File aDefaultSpeciesGeneMappingFile)
Insert the default gene mappings files.
|
void |
downloadGeneMappings(String ensemblType,
String ensemblSchemaName,
String selectedSpecies,
String ensemblVersion,
WaitingHandler waitingHandler)
Download the gene mappings.
|
boolean |
downloadGoMappings(String ensemblType,
String ensemblSchemaName,
String selectedSpecies,
boolean swissProtMapping,
WaitingHandler waitingHandler)
Download the GO mappings.
|
boolean |
downloadMappings(WaitingHandler waitingHandler,
String currentEnsemblSpeciesType,
String selectedSpecies,
boolean commandLine)
Try to download the gene and GO mappings for the currently selected
species.
|
HashMap<String,ArrayList<String>> |
getAllSpecies()
Return the species lists.
|
HashMap<String,HashMap<String,String>> |
getAllSpeciesMap()
Returns the species map.
|
String |
getCurrentSpecies()
Returns the current species.
|
String |
getCurrentSpeciesType()
Returns the current species type.
|
String |
getEnsemblDatabaseName(String speciesName)
Deprecated.
use the one with the Ensembl type parameter instead
|
String |
getEnsemblDatabaseName(String ensemblType,
String speciesName)
Returns the Ensembl database name corresponding to a species name
according to the speciesMap.
|
String |
getEnsemblSpeciesVersion(String speciesName)
Deprecated.
use getEnsemblSpeciesVersion(String ensemblType, String
speciesName) instead
|
String |
getEnsemblSpeciesVersion(String ensemblType,
String speciesName)
Returns the Ensembl version for the given species name.
|
String |
getEnsemblVersion(String ensemblDatabase)
Returns the Ensembl version corresponding to the given Ensembl database
according to the ensemblVersionsMap.
|
HashMap<String,String> |
getEnsemblVersionsMap()
Returns the Ensembl versions map.
|
static 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.
|
static String |
getProteinEvidencAsString(Integer type)
Return the protein evidence type as text.
|
ArrayList<String> |
getSpecies()
Deprecated.
use getAllSpecies instead
|
HashMap<String,String> |
getSpeciesMap()
Deprecated.
use getAllSpeciesMap instead
|
void |
loadEnsemblSpeciesVersions(File ensemblVersionsFile)
Loads the given Ensembl species file.
|
boolean |
loadGeneMappings(String jarFilePath,
WaitingHandler waitingHandler)
Imports the gene mappings.
|
void |
loadSpeciesAndGoDomains()
Load the mapping files.
|
void |
setCurrentSpecies(String currentSpecies)
Set the current species.
|
void |
setCurrentSpeciesType(String currentSpeciesType)
Set the current species type.
|
static void |
setGeneMappingFolder(String geneMappingFolder)
Sets the folder where gene mappings are saved.
|
void |
updateEnsemblVersion(String selectedSpecies,
String ensemblVersion)
Update the Ensembl version for the given species.
|
public static final String GENE_MAPPING_FILE_SUFFIX
public static final String GO_MAPPING_FILE_SUFFIX
public GenePreferences()
public GenePreferences(GenePreferences genePreferences)
genePreferences - public static String getProteinEvidencAsString(Integer type)
type - the type of evidencepublic boolean downloadGoMappings(String ensemblType, String ensemblSchemaName, String selectedSpecies, boolean swissProtMapping, WaitingHandler waitingHandler) throws MalformedURLException, IOException
ensemblType - the Ensembl type, e.g., default or plantsensemblSchemaName - the Ensembl schema name, e.g., default or
plants_mart_18selectedSpecies - swissProtMapping - if true, use the uniprot_swissprot_accession
parameter, if false use the uniprot_sptrembl parameterwaitingHandler - MalformedURLExceptionIOExceptionpublic void downloadGeneMappings(String ensemblType, String ensemblSchemaName, String selectedSpecies, String ensemblVersion, WaitingHandler waitingHandler) throws MalformedURLException, IOException, IllegalArgumentException
ensemblType - the Ensembl type, e.g., default or plantsensemblSchemaName - the Ensembl schema name, e.g., default or
plants_mart_18selectedSpecies - ensemblVersion - waitingHandler - MalformedURLExceptionIOExceptionIllegalArgumentExceptionpublic static File getGeneMappingFolder()
public static void setGeneMappingFolder(String geneMappingFolder)
geneMappingFolder - the folder where gene mappings are savedpublic String getCurrentSpecies()
public void setCurrentSpecies(String currentSpecies)
currentSpecies - the currentSpecies to setpublic String getCurrentSpeciesType()
public void setCurrentSpeciesType(String currentSpeciesType)
currentSpeciesType - the currentSpeciesType to setpublic void createDefaultGeneMappingFiles(File aEnsemblVersionsFile, File aGoDomainsFile, File aSpeciesFile, File aDefaultSpeciesGoMappingsFile, File aDefaultSpeciesGeneMappingFile)
aEnsemblVersionsFile - aGoDomainsFile - aSpeciesFile - aDefaultSpeciesGoMappingsFile - aDefaultSpeciesGeneMappingFile - public void loadSpeciesAndGoDomains()
throws IOException,
IllegalArgumentException
IOExceptionIllegalArgumentExceptionpublic HashMap<String,String> getGoDomainMap()
public HashMap<String,String> getSpeciesMap()
public HashMap<String,HashMap<String,String>> getAllSpeciesMap()
public String getEnsemblDatabaseName(String speciesName)
speciesName - the species name as available in the species listpublic String getEnsemblDatabaseName(String ensemblType, String speciesName)
ensemblType - the Ensembl type, e.g., Vertebrates or PlantsspeciesName - the species name as available in the species listpublic HashMap<String,String> getEnsemblVersionsMap()
public String getEnsemblVersion(String ensemblDatabase)
ensemblDatabase - the Ensembl databasepublic String getEnsemblSpeciesVersion(String speciesName)
speciesName - the species name as available in the species listpublic String getEnsemblSpeciesVersion(String ensemblType, String speciesName)
ensemblType - the Ensembl type, e.g., Vertebrates or PlantsspeciesName - the species name as available in the species listpublic ArrayList<String> getSpecies()
public HashMap<String,ArrayList<String>> getAllSpecies()
public void updateEnsemblVersion(String selectedSpecies, String ensemblVersion) throws IOException
selectedSpecies - the database name of the species to update, e.g.,
hsapiens_gene_ensemblensemblVersion - the new Ensembl versionIOExceptionpublic void loadEnsemblSpeciesVersions(File ensemblVersionsFile) throws FileNotFoundException, IOException
ensemblVersionsFile - the Ensembl species file to loadFileNotFoundExceptionIOExceptionpublic boolean loadGeneMappings(String jarFilePath, WaitingHandler waitingHandler)
jarFilePath - the jar file pathwaitingHandler - the waiting handlerpublic boolean clearOldMappings(String currentEnsemblSpeciesType, String selectedSpecies, boolean commandLine)
currentEnsemblSpeciesType - the species typeselectedSpecies - the speciescommandLine - if command line of notpublic boolean downloadMappings(WaitingHandler waitingHandler, String currentEnsemblSpeciesType, String selectedSpecies, boolean commandLine)
waitingHandler - the waiting handlercurrentEnsemblSpeciesType - the species typeselectedSpecies - the speciescommandLine - command line or GUI?Copyright © 2014. All rights reserved.