public class IdentificationDB extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
String |
dbName
The name which will be used for the database.
|
| Constructor and Description |
|---|
IdentificationDB(String folder,
String name,
boolean deleteOldDatabase,
ObjectsCache objectCache)
Constructor creating the database and the protein and protein parameters
tables.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMatch(IdentificationMatch match)
Adds an identification match to the database.
|
void |
addMatchParameter(String key,
UrParameter urParameter)
Deprecated.
use match specific mapping instead
|
void |
addPeptideMatch(PeptideMatch peptideMatch)
Adds a peptide match to the database.
|
void |
addPeptideMatchParameter(String key,
UrParameter urParameter)
Adds a peptide match parameter to the database.
|
void |
addProteinMatch(ProteinMatch proteinMatch)
Adds a protein match to the database.
|
void |
addProteinMatchParameter(String key,
UrParameter urParameter)
Adds a protein match parameter to the database.
|
void |
addSpectrumMatch(SpectrumMatch spectrumMatch)
Adds a spectrum match to the database.
|
void |
addSpectrumMatchParameter(String key,
UrParameter urParameter)
Adds a spectrum match parameter to the database.
|
void |
close()
Closes the db connection.
|
UrParameter |
getMatchPArameter(String key,
UrParameter urParameter,
boolean useDB)
Deprecated.
use match specific mapping instead
|
String |
getParameterTable(UrParameter urParameter)
Deprecated.
use match specific mapping instead
|
PeptideMatch |
getPeptideMatch(String key,
boolean useDB)
Returns the desired peptide match.
|
UrParameter |
getPeptideMatchParameter(String key,
UrParameter urParameter,
boolean useDB)
Returns the desired peptide match parameter.
|
String |
getPeptideParameterTable(UrParameter urParameter)
Returns the table name associated with the given peptide parameter.
|
ProteinMatch |
getProteinMatch(String key,
boolean useDB)
Returns the desired protein match.
|
UrParameter |
getProteinMatchParameter(String key,
UrParameter urParameter,
boolean useDB)
Returns the desired protein match parameter.
|
String |
getProteinParameterTable(UrParameter urParameter)
Returns the table name associated with the given protein parameter.
|
SpectrumMatch |
getSpectrumMatch(String key,
boolean useDB)
Returns the desired spectrum match.
|
UrParameter |
getSpectrumMatchParameter(String key,
UrParameter urParameter,
boolean useDB)
Returns the desired spectrum match parameter.
|
String |
getSpectrumMatchTable(String spectrumKey)
Returns the table name associated with the given spectrum key.
|
String |
getSpectrumParameterTable(String spectrumKey,
UrParameter urParameter)
Returns the table name associated with the given spectrum parameter.
|
void |
loadPeptideMatches(ArrayList<String> peptideKeys,
WaitingHandler waitingHandler)
Loads the desired peptide matches of the given type in the cache of the
database.
|
void |
loadPeptideMatches(WaitingHandler waitingHandler)
Loads all peptide matches in the cache of the database.
|
void |
loadPeptideMatchParameters(ArrayList<String> peptideKeys,
UrParameter urParameter,
WaitingHandler waitingHandler)
Loads the desired peptide match parameters of the given type in the cache
of the database.
|
void |
loadPeptideMatchParameters(UrParameter urParameter,
WaitingHandler waitingHandler)
Loads all peptide match parameters of the given type in the cache of the
database.
|
void |
loadProteinMatches(ArrayList<String> proteinKeys,
WaitingHandler waitingHandler)
Loads the desired protein matches of the given type in the cache of the
database.
|
void |
loadProteinMatches(WaitingHandler waitingHandler)
Loads all protein matches in the cache of the database.
|
void |
loadProteinMatchParameters(ArrayList<String> proteinKeys,
UrParameter urParameter,
WaitingHandler waitingHandler)
Loads the desired protein match parameters of the given type in the cache
of the database.
|
void |
loadProteinMatchParameters(UrParameter urParameter,
WaitingHandler waitingHandler)
Loads all protein match parameters of the given type in the cache of the
database.
|
void |
loadSpectrumMatches(ArrayList<String> spectrumKeys,
WaitingHandler waitingHandler)
Loads all given spectrum matches in the cache of the database.
|
void |
loadSpectrumMatches(String fileName,
WaitingHandler waitingHandler)
Loads all spectrum matches of the given file in the cache of the
database.
|
void |
loadSpectrumMatchParameters(ArrayList<String> spectrumKeys,
UrParameter urParameter,
WaitingHandler waitingHandler)
Loads all desired spectrum match parameters in the cache of the database.
|
void |
loadSpectrumMatchParameters(String fileName,
UrParameter urParameter,
WaitingHandler waitingHandler)
Loads all spectrum match parameters of the given type in the cache of the
database.
|
boolean |
peptideMatchLoaded(String peptideKey)
Indicates whether a peptide match is loaded.
|
boolean |
proteinMatchLoaded(String proteinKey)
Indicates whether a protein match is loaded.
|
void |
removeMatch(String key)
Deprecated.
it is advised to use the specific psm/peptide/protein method
instead
|
void |
removePeptideMatch(String key)
Deletes a peptide match from the database.
|
void |
removeProteinMatch(String key)
Deletes a protein match from the database.
|
void |
removeSpectrumMatch(String key)
Deletes a spectrum match from the database.
|
boolean |
spectrumMatchLoaded(String spectrumKey)
Indicates whether a spectrum match is loaded.
|
void |
updateMatch(IdentificationMatch match)
Updates a match.
|
void |
updatePeptideMatch(PeptideMatch peptideMatch)
Updates a peptide match.
|
void |
updatePeptideParameter(String key,
UrParameter urParameter)
Updates a peptide match parameter.
|
void |
updateProteinMatch(ProteinMatch proteinMatch)
Updates a protein match.
|
void |
updateProteinParameter(String key,
UrParameter urParameter)
Updates a protein match parameter.
|
void |
updateSpectrumMatch(SpectrumMatch spectrumMatch)
Updates a spectrum match.
|
void |
updateSpectrumParameter(String key,
UrParameter urParameter)
Updates a spectrum match parameter.
|
public String dbName
public IdentificationDB(String folder, String name, boolean deleteOldDatabase, ObjectsCache objectCache) throws SQLException
folder - the folder where to put the databasename - deleteOldDatabase - if true, tries to delete the old databaseobjectCache - SQLException - an exception thrown whenever an error occurred while
creating the databasepublic boolean spectrumMatchLoaded(String spectrumKey) throws SQLException
spectrumKey - the spectrumMatch keySQLException - exception thrown whenever an exception occurred
while interrogating the databasepublic boolean peptideMatchLoaded(String peptideKey) throws SQLException
peptideKey - the peptide keySQLException - exception thrown whenever an exception occurred
while interrogating the databasepublic boolean proteinMatchLoaded(String proteinKey) throws SQLException
proteinKey - the protein keySQLException - exception thrown whenever an exception occurred
while interrogating the databasepublic void updateProteinMatch(ProteinMatch proteinMatch) throws SQLException, IOException
proteinMatch - the protein matchSQLException - exception thrown whenever an error occurred while
updating a match in the tableIOException - exception thrown whenever an error occurred while
writing in the databasepublic void updatePeptideMatch(PeptideMatch peptideMatch) throws SQLException, IOException
peptideMatch - the peptide matchSQLException - exception thrown whenever an error occurred while
updating a match in the tableIOException - exception thrown whenever an error occurred while
writing in the databasepublic void updateSpectrumMatch(SpectrumMatch spectrumMatch) throws SQLException, IOException
spectrumMatch - the spectrum matchSQLException - exception thrown whenever an error occurred while
updating a match in the tableIOException - exception thrown whenever an error occurred while
writing in the databasepublic void updateMatch(IdentificationMatch match) throws SQLException, IOException
match - the match to updateSQLException - exception thrown whenever an error occurred while
updating a match in the tableIOException - exception thrown whenever an error occurred while
writing in the databasepublic void updateProteinParameter(String key, UrParameter urParameter) throws SQLException, IOException
key - the key of the protein matchurParameter - the parameterSQLException - exception thrown whenever an error occurred while
updating the parameter in the tableIOException - exception thrown whenever an error occurred while
writing in the databasepublic void updatePeptideParameter(String key, UrParameter urParameter) throws SQLException, IOException
key - the key of the peptide matchurParameter - the parameterSQLException - exception thrown whenever an error occurred while
updating the parameter in the tableIOException - exception thrown whenever an error occurred while
writing in the databasepublic void updateSpectrumParameter(String key, UrParameter urParameter) throws SQLException, IOException
key - the key of the spectrum matchurParameter - the parameterSQLException - exception thrown whenever an error occurred while
updating the parameter in the tableIOException - exception thrown whenever an error occurred while
writing in the databasepublic void removeProteinMatch(String key) throws SQLException, IOException
key - the key of the matchSQLException - exception thrown whenever an error occurred while
deleting the matchIOExceptionpublic void removePeptideMatch(String key) throws SQLException, IOException
key - the key of the matchSQLException - exception thrown whenever an error occurred while
deleting the matchIOExceptionpublic void removeSpectrumMatch(String key) throws SQLException, IOException
key - the key of the matchSQLException - exception thrown whenever an error occurred while
deleting the matchIOExceptionpublic void removeMatch(String key) throws SQLException, IOException
key - the key of the matchSQLException - exception thrown whenever an error occurred while
deleting the matchIOExceptionpublic SpectrumMatch getSpectrumMatch(String key, boolean useDB) throws SQLException, IOException, ClassNotFoundException, InterruptedException
useDB - if useDB is false, null will be returned if the object is not in the cachekey - the PSM keySQLException - exception thrown whenever an error occurred while
loading the object from the databaseIOException - exception thrown whenever an error occurred while
reading the object in the databaseClassNotFoundException - exception thrown whenever an error
occurred while casting the database input in the desired match classInterruptedExceptionpublic void addSpectrumMatch(SpectrumMatch spectrumMatch) throws SQLException, IOException, InterruptedException
spectrumMatch - the spectrum match to be addedSQLException - exception thrown whenever an error occurred while
adding the object in the databaseIOException - exception thrown whenever an error occurred while
writing the objectInterruptedExceptionpublic PeptideMatch getPeptideMatch(String key, boolean useDB) throws SQLException, IOException, ClassNotFoundException, InterruptedException
key - the peptide keyuseDB - if useDB is false, null will be returned if the object is not in the cacheSQLException - exception thrown whenever an error occurred while
loading the object from the databaseIOException - exception thrown whenever an error occurred while
reading the object in the databaseClassNotFoundException - exception thrown whenever an error
occurred while casting the database input in the desired match classInterruptedExceptionpublic void addPeptideMatch(PeptideMatch peptideMatch) throws SQLException, IOException, InterruptedException
peptideMatch - the peptide match to be addedSQLException - exception thrown whenever an error occurred while
adding the object in the databaseIOException - exception thrown whenever an error occurred while
writing the objectInterruptedExceptionpublic ProteinMatch getProteinMatch(String key, boolean useDB) throws SQLException, IOException, ClassNotFoundException, InterruptedException
key - the protein keyuseDB - if useDB is false, null will be returned if the object is not in the cacheSQLException - exception thrown whenever an error occurred while
loading the object from the databaseIOException - exception thrown whenever an error occurred while
reading the object in the databaseClassNotFoundException - exception thrown whenever an error
occurred while casting the database input in the desired match classInterruptedExceptionpublic void addProteinMatch(ProteinMatch proteinMatch) throws SQLException, IOException, InterruptedException
proteinMatch - the protein match to be addedSQLException - exception thrown whenever an error occurred while
adding the object in the databaseIOException - exception thrown whenever an error occurred while
writing the objectInterruptedExceptionpublic void addMatch(IdentificationMatch match) throws SQLException, IOException, InterruptedException
match - the match to be addedSQLException - exception thrown whenever an error occurred while
adding the object in the databaseIOException - exception thrown whenever an error occurred while
writing the objectInterruptedExceptionpublic void loadPeptideMatchParameters(UrParameter urParameter, WaitingHandler waitingHandler) throws SQLException, IOException, ClassNotFoundException, InterruptedException
urParameter - the parameter typewaitingHandler - the waiting handlerSQLException - exception thrown whenever an error occurred while
interrogating the databaseIOException - exception thrown whenever an error occurred while
reading the databaseClassNotFoundException - exception thrown whenever the class of the
object is not found when deserializing it.InterruptedExceptionpublic void loadPeptideMatchParameters(ArrayList<String> peptideKeys, UrParameter urParameter, WaitingHandler waitingHandler) throws SQLException, IOException, ClassNotFoundException, InterruptedException
peptideKeys - the list of peptide keys of the parameters to loadurParameter - the parameter typewaitingHandler - the waiting handlerSQLException - exception thrown whenever an error occurred while
interrogating the databaseIOException - exception thrown whenever an error occurred while
reading the databaseClassNotFoundException - exception thrown whenever the class of the
object is not found when deserializing it.InterruptedExceptionpublic void loadPeptideMatches(ArrayList<String> peptideKeys, WaitingHandler waitingHandler) throws SQLException, IOException, ClassNotFoundException, InterruptedException
peptideKeys - the list of peptide keys to loadwaitingHandler - the waiting handlerSQLException - exception thrown whenever an error occurred while
interrogating the databaseIOException - exception thrown whenever an error occurred while
reading the databaseClassNotFoundException - exception thrown whenever the class of the
object is not found when deserializing it.InterruptedExceptionpublic void loadProteinMatchParameters(UrParameter urParameter, WaitingHandler waitingHandler) throws SQLException, IOException, ClassNotFoundException, InterruptedException
urParameter - the parameter typewaitingHandler - the waiting handlerSQLException - exception thrown whenever an error occurred while
interrogating the databaseIOException - exception thrown whenever an error occurred while
reading the databaseClassNotFoundException - exception thrown whenever the class of the
object is not found when deserializing it.InterruptedExceptionpublic void loadProteinMatchParameters(ArrayList<String> proteinKeys, UrParameter urParameter, WaitingHandler waitingHandler) throws SQLException, IOException, ClassNotFoundException, InterruptedException
proteinKeys - the list of protein keys of the parameters to loadurParameter - the parameter typewaitingHandler - the waiting handlerSQLException - exception thrown whenever an error occurred while
interrogating the databaseIOException - exception thrown whenever an error occurred while
reading the databaseClassNotFoundException - exception thrown whenever the class of the
object is not found when deserializing it.InterruptedExceptionpublic void loadProteinMatches(WaitingHandler waitingHandler) throws SQLException, IOException, ClassNotFoundException, InterruptedException
waitingHandler - the waiting handlerSQLException - exception thrown whenever an error occurred while
interrogating the databaseIOException - exception thrown whenever an error occurred while
reading the databaseClassNotFoundException - exception thrown whenever the class of the
object is not found when deserializing it.InterruptedExceptionpublic void loadProteinMatches(ArrayList<String> proteinKeys, WaitingHandler waitingHandler) throws SQLException, IOException, ClassNotFoundException, InterruptedException, InterruptedException
proteinKeys - the list of protein keys to loadwaitingHandler - the waiting handlerSQLException - exception thrown whenever an error occurred while
interrogating the databaseIOException - exception thrown whenever an error occurred while
reading the databaseClassNotFoundException - exception thrown whenever the class of the
object is not found when deserializing it.InterruptedExceptionpublic void loadPeptideMatches(WaitingHandler waitingHandler) throws SQLException, IOException, ClassNotFoundException, InterruptedException, InterruptedException
waitingHandler - the waiting handlerSQLException - exception thrown whenever an error occurred while
interrogating the databaseIOException - exception thrown whenever an error occurred while
reading the databaseClassNotFoundException - exception thrown whenever the class of the
object is not found when deserializing it.InterruptedExceptionpublic void loadSpectrumMatches(String fileName, WaitingHandler waitingHandler) throws SQLException, IOException, ClassNotFoundException, InterruptedException
fileName - the file namewaitingHandler - the waiting handlerSQLException - exception thrown whenever an error occurred while
interrogating the databaseIOException - exception thrown whenever an error occurred while
reading the databaseClassNotFoundException - exception thrown whenever the class of the
object is not found when deserializing it.InterruptedExceptionpublic void loadSpectrumMatches(ArrayList<String> spectrumKeys, WaitingHandler waitingHandler) throws SQLException, IOException, ClassNotFoundException, InterruptedException
spectrumKeys - the key of the spectrum matches to be loadedwaitingHandler - the waiting handlerSQLException - exception thrown whenever an error occurred while
interrogating the databaseIOException - exception thrown whenever an error occurred while
reading the databaseClassNotFoundException - exception thrown whenever the class of the
object is not found when deserializing it.InterruptedExceptionpublic void loadSpectrumMatchParameters(String fileName, UrParameter urParameter, WaitingHandler waitingHandler) throws SQLException, IOException, ClassNotFoundException, InterruptedException
fileName - the file nameurParameter - the parameter typewaitingHandler - the waiting handlerSQLException - exception thrown whenever an error occurred while
interrogating the databaseIOException - exception thrown whenever an error occurred while
reading the databaseClassNotFoundException - exception thrown whenever the class of the
object is not found when deserializing it.InterruptedExceptionpublic void loadSpectrumMatchParameters(ArrayList<String> spectrumKeys, UrParameter urParameter, WaitingHandler waitingHandler) throws SQLException, IOException, ClassNotFoundException, InterruptedException
spectrumKeys - the key of the spectrum match of the parameters to be
loadedurParameter - the parameter typewaitingHandler - the waiting handlerSQLException - exception thrown whenever an error occurred while
interrogating the databaseIOException - exception thrown whenever an error occurred while
reading the databaseClassNotFoundException - exception thrown whenever the class of the
object is not found when deserializing it.InterruptedExceptionpublic UrParameter getSpectrumMatchParameter(String key, UrParameter urParameter, boolean useDB) throws SQLException, IOException, ClassNotFoundException, InterruptedException
key - the PSM keyurParameter - the match parameteruseDB - if useDB is false, null will be returned if the object is not in the cacheSQLException - exception thrown whenever an error occurred while
loading the object from the databaseIOException - exception thrown whenever an error occurred while
reading the object in the databaseClassNotFoundException - exception thrown whenever an error
occurred while casting the database input in the desired match classInterruptedExceptionpublic void addSpectrumMatchParameter(String key, UrParameter urParameter) throws SQLException, IOException, InterruptedException
key - the PSM keyurParameter - the match parameterSQLException - exception thrown whenever an error occurred while
adding the object in the databaseIOException - exception thrown whenever an error occurred while
writing the objectInterruptedExceptionpublic UrParameter getPeptideMatchParameter(String key, UrParameter urParameter, boolean useDB) throws SQLException, IOException, ClassNotFoundException, InterruptedException
key - the peptide keyurParameter - the match parameteruseDB - if useDB is false, null will be returned if the object is not in the cacheSQLException - exception thrown whenever an error occurred while
loading the object from the databaseIOException - exception thrown whenever an error occurred while
reading the object in the databaseClassNotFoundException - exception thrown whenever an error
occurred while casting the database input in the desired match classInterruptedExceptionpublic void addPeptideMatchParameter(String key, UrParameter urParameter) throws SQLException, IOException, InterruptedException
key - the peptide keyurParameter - the match parameterSQLException - exception thrown whenever an error occurred while
adding the object in the databaseIOException - exception thrown whenever an error occurred while
writing the objectInterruptedExceptionpublic UrParameter getProteinMatchParameter(String key, UrParameter urParameter, boolean useDB) throws SQLException, IOException, ClassNotFoundException, InterruptedException
key - the protein keyurParameter - the match parameteruseDB - if useDB is false, null will be returned if the object is not in the cacheSQLException - exception thrown whenever an error occurred while
loading the object from the databaseIOException - exception thrown whenever an error occurred while
reading the object in the databaseClassNotFoundException - exception thrown whenever an error
occurred while casting the database input in the desired match classInterruptedExceptionpublic void addProteinMatchParameter(String key, UrParameter urParameter) throws SQLException, IOException, InterruptedException
key - the protein keyurParameter - the match parameterSQLException - exception thrown whenever an error occurred while
adding the object in the databaseIOException - exception thrown whenever an error occurred while
writing the objectInterruptedExceptionpublic UrParameter getMatchPArameter(String key, UrParameter urParameter, boolean useDB) throws SQLException, IOException, ClassNotFoundException, InterruptedException
key - the match keyuseDB - if useDB is false, null will be returned if the object is not in the cacheurParameter - the match parameterInterruptedExceptionSQLException - exception thrown whenever an error occurred while
loading the object from the databaseIOException - exception thrown whenever an error occurred while
reading the object in the databaseClassNotFoundException - exception thrown whenever an error
occurred while casting the database input in the desired match classpublic void addMatchParameter(String key, UrParameter urParameter) throws SQLException, IOException, InterruptedException
key - the protein keyurParameter - the match parameterInterruptedExceptionSQLException - exception thrown whenever an error occurred while
adding the object in the databaseIOException - exception thrown whenever an error occurred while
writing the objectpublic String getSpectrumMatchTable(String spectrumKey)
spectrumKey - the given spectrum keypublic String getSpectrumParameterTable(String spectrumKey, UrParameter urParameter)
spectrumKey - the given spectrum keyurParameter - the parameterpublic String getPeptideParameterTable(UrParameter urParameter)
urParameter - the parameterpublic String getProteinParameterTable(UrParameter urParameter)
urParameter - the parameterpublic String getParameterTable(UrParameter urParameter)
urParameter - the parameterpublic void close()
throws SQLException
SQLException - exception thrown whenever an error occurred while
closing the database connectionCopyright © 2014. All rights reserved.