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 |
addAssumptions(String spectrumKey,
HashMap<Integer,HashMap<Double,ArrayList<SpectrumIdentificationAssumption>>> assumptions)
Adds assumptions for a given match to the database.
|
void |
addMatch(IdentificationMatch match)
Adds an identification match to the database.
|
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 |
addRawAssumptions(String spectrumKey,
HashMap<Integer,HashMap<Double,ArrayList<SpectrumIdentificationAssumption>>> assumptions)
Adds raw assumptions for a given match 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 |
checkTable(Collection<String> tableList,
String tableName)
Verifies that a table exists and creates it if not.
|
void |
close()
Closes the db connection.
|
HashMap<Integer,HashMap<Double,ArrayList<SpectrumIdentificationAssumption>>> |
getAssumptions(String key,
boolean useDB)
Returns the assumptions of the given spectrum in a map: advocate id →
score → list of assumptions.
|
String |
getAssumptionTable(String spectrumKey)
Returns the assumptions table name associated with the given spectrum
key.
|
Object |
getObject(String table,
String objectKey,
boolean useDB)
Returns an object from the database.
|
ObjectsDB |
getObjectsDB()
Returns the database used to store matches.
|
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.
|
ArrayList<String> |
getPeptideParametersTables()
Returns the names of the tables containing peptide parameters.
|
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.
|
HashMap<Integer,HashMap<Double,ArrayList<SpectrumIdentificationAssumption>>> |
getRawAssumptions(String key,
boolean useDB)
Returns the raw assumptions of the given spectrum in a map: advocate id →
score → list of assumptions.
|
String |
getRawAssumptionTable(String spectrumKey)
Returns the raw assumptions table name associated with the given spectrum
key.
|
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 PSM table name associated with the given spectrum key.
|
String |
getSpectrumParameterTable(String spectrumKey,
UrParameter urParameter)
Returns the table name associated with the given spectrum parameter.
|
boolean |
isConnectionActive()
Indicates whether the connection to the DB is active.
|
void |
loadAssumptions(ArrayList<String> spectrumKeys,
WaitingHandler waitingHandler,
boolean displayProgress)
Loads all assumptions of the given spectra in the cache of the database.
|
void |
loadAssumptions(String fileName,
WaitingHandler waitingHandler,
boolean displayProgress)
Loads all assumptions of the given file in the cache of the database.
|
void |
loadPeptideMatches(ArrayList<String> peptideKeys,
WaitingHandler waitingHandler,
boolean displayProgress)
Loads the desired peptide matches of the given type in the cache of the
database.
|
void |
loadPeptideMatches(WaitingHandler waitingHandler,
boolean displayProgress)
Loads all peptide matches in the cache of the database.
|
void |
loadPeptideMatchParameters(ArrayList<String> peptideKeys,
UrParameter urParameter,
WaitingHandler waitingHandler,
boolean displayProgress)
Loads the desired peptide match parameters of the given type in the cache
of the database.
|
void |
loadPeptideMatchParameters(UrParameter urParameter,
WaitingHandler waitingHandler,
boolean displayProgress)
Loads all peptide match parameters of the given type in the cache of the
database.
|
void |
loadProteinMatches(ArrayList<String> proteinKeys,
WaitingHandler waitingHandler,
boolean displayProgress)
Loads the desired protein matches of the given type in the cache of the
database.
|
void |
loadProteinMatches(WaitingHandler waitingHandler,
boolean displayProgress)
Loads all protein matches in the cache of the database.
|
void |
loadProteinMatchParameters(ArrayList<String> proteinKeys,
UrParameter urParameter,
WaitingHandler waitingHandler,
boolean displayProgress)
Loads the desired protein match parameters of the given type in the cache
of the database.
|
void |
loadProteinMatchParameters(UrParameter urParameter,
WaitingHandler waitingHandler,
boolean displayProgress)
Loads all protein match parameters of the given type in the cache of the
database.
|
void |
loadRawAssumptions(ArrayList<String> spectrumKeys,
WaitingHandler waitingHandler,
boolean displayProgress)
Loads all raw assumptions of the given spectra in the cache of the database.
|
void |
loadRawAssumptions(String fileName,
WaitingHandler waitingHandler,
boolean displayProgress)
Loads all raw assumptions of the given file in the cache of the database.
|
void |
loadSpectrumMatches(ArrayList<String> spectrumKeys,
WaitingHandler waitingHandler,
boolean displayProgress)
Loads all given spectrum matches in the cache of the database.
|
void |
loadSpectrumMatches(String fileName,
WaitingHandler waitingHandler,
boolean displayProgress)
Loads all spectrum matches of the given file in the cache of the
database.
|
void |
loadSpectrumMatchParameters(ArrayList<String> spectrumKeys,
UrParameter urParameter,
WaitingHandler waitingHandler,
boolean displayProgress)
Loads all desired spectrum match parameters in the cache of the database.
|
void |
loadSpectrumMatchParameters(String fileName,
UrParameter urParameter,
WaitingHandler waitingHandler,
boolean displayProgress)
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 |
removeAssumptions(String key)
Deletes the assumptions corresponding to a given psm from the database.
|
void |
removePeptideMatch(String key)
Deletes a peptide match from the database.
|
void |
removeProteinMatch(String key)
Deletes a protein match from the database.
|
void |
removeRawAssumptions(String key)
Deletes the raw assumptions corresponding to a given psm from the database.
|
void |
removeSpectrumMatch(String key)
Deletes a spectrum match from the database.
|
void |
restoreConnection(String dbFolder,
boolean deleteOldDatabase,
ObjectsCache objectsCache)
Restores the connection to the database.
|
boolean |
spectrumMatchLoaded(String spectrumKey)
Indicates whether a spectrum match is loaded.
|
boolean |
spectrumMatchTableCreated(String spectrumMatchKey)
Indicates whether the table for the given spectrum match key has been
created.
|
void |
updateAssumptions(String spectrumKey,
HashMap<Integer,HashMap<Double,ArrayList<SpectrumIdentificationAssumption>>> assumptionsMap)
Updates the map of assumptions for a given spectrum.
|
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 |
updateRawAssumptions(String spectrumKey,
HashMap<Integer,HashMap<Double,ArrayList<SpectrumIdentificationAssumption>>> rawAssumptionsMap)
Updates the map of raw assumptions for a given spectrum.
|
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, IOException, ClassNotFoundException, InterruptedException
folder - the folder where to put the databasename - the database namedeleteOldDatabase - if true, tries to delete the old databaseobjectCache - the objects cacheSQLException - exception thrown whenever an error occurs while
interacting with the databaseIOException - exception thrown whenever an error occurs while
reading or writing a fileClassNotFoundException - exception thrown whenever an error
occurred while deserializing a file from the databaseInterruptedException - exception thrown if a threading error occurs
while interacting with 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 updateAssumptions(String spectrumKey, HashMap<Integer,HashMap<Double,ArrayList<SpectrumIdentificationAssumption>>> assumptionsMap) throws SQLException, IOException
spectrumKey - the key of the spectrumassumptionsMap - map of assumptionsSQLException - 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 updateRawAssumptions(String spectrumKey, HashMap<Integer,HashMap<Double,ArrayList<SpectrumIdentificationAssumption>>> rawAssumptionsMap) throws SQLException, IOException
spectrumKey - the key of the spectrumrawAssumptionsMap - map of assumptionsSQLException - 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 matchIOException - exception thrown whenever an error occurred while
reading or writing in the databasepublic void removePeptideMatch(String key) throws SQLException, IOException
key - the key of the matchSQLException - exception thrown whenever an error occurred while
deleting the matchIOException - exception thrown whenever an error occurred while
reading or writing in the databasepublic void removeSpectrumMatch(String key) throws SQLException, IOException
key - the key of the matchSQLException - exception thrown whenever an error occurred while
deleting the matchIOException - exception thrown whenever an error occurred while
reading or writing in the databasepublic void removeAssumptions(String key) throws SQLException, IOException
key - the key of the psmSQLException - exception thrown whenever an error occurred while
deleting the matchIOException - exception thrown whenever an error occurred while
reading or writing in the databasepublic void removeRawAssumptions(String key) throws SQLException, IOException
key - the key of the psmSQLException - exception thrown whenever an error occurred while
deleting the matchIOException - exception thrown whenever an error occurred while
reading or writing in the databasepublic ArrayList<String> getPeptideParametersTables()
public HashMap<Integer,HashMap<Double,ArrayList<SpectrumIdentificationAssumption>>> getAssumptions(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 key of the spectrumSQLException - 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 classInterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic void addAssumptions(String spectrumKey, HashMap<Integer,HashMap<Double,ArrayList<SpectrumIdentificationAssumption>>> assumptions) throws SQLException, IOException, InterruptedException
spectrumKey - the key of the spectrumassumptions - map of all assumptionsSQLException - exception thrown whenever an error occurred while
adding the object in the databaseIOException - exception thrown whenever an error occurred while
writing the objectInterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic HashMap<Integer,HashMap<Double,ArrayList<SpectrumIdentificationAssumption>>> getRawAssumptions(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 key of the spectrumSQLException - 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 classInterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic void addRawAssumptions(String spectrumKey, HashMap<Integer,HashMap<Double,ArrayList<SpectrumIdentificationAssumption>>> assumptions) throws SQLException, IOException, InterruptedException
spectrumKey - the key of the spectrumassumptions - map of all assumptionsSQLException - exception thrown whenever an error occurred while
adding the object in the databaseIOException - exception thrown whenever an error occurred while
writing the objectInterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic 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 classInterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic 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 objectInterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic boolean spectrumMatchTableCreated(String spectrumMatchKey)
spectrumMatchKey - the key of the spectrum match of interestpublic 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 classInterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic 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 objectInterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic 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 classInterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic 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 objectInterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic 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 objectInterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic void loadAssumptions(String fileName, WaitingHandler waitingHandler, boolean displayProgress) throws SQLException, IOException, ClassNotFoundException, InterruptedException
fileName - the file namewaitingHandler - the waiting handler allowing displaying progress
and cancelling the processdisplayProgress - boolean indicating whether the progress of this
method should be displayed on 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.InterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic void loadAssumptions(ArrayList<String> spectrumKeys, WaitingHandler waitingHandler, boolean displayProgress) throws SQLException, IOException, ClassNotFoundException, InterruptedException
spectrumKeys - the key of the spectrawaitingHandler - the waiting handler allowing displaying progress
and cancelling the processdisplayProgress - boolean indicating whether the progress of this
method should be displayed on 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.InterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic void loadRawAssumptions(String fileName, WaitingHandler waitingHandler, boolean displayProgress) throws SQLException, IOException, ClassNotFoundException, InterruptedException
fileName - the file namewaitingHandler - the waiting handler allowing displaying progress
and cancelling the processdisplayProgress - boolean indicating whether the progress of this
method should be displayed on 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.InterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic void loadRawAssumptions(ArrayList<String> spectrumKeys, WaitingHandler waitingHandler, boolean displayProgress) throws SQLException, IOException, ClassNotFoundException, InterruptedException
spectrumKeys - the key of the spectrawaitingHandler - the waiting handler allowing displaying progress
and cancelling the processdisplayProgress - boolean indicating whether the progress of this
method should be displayed on 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.InterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic void loadSpectrumMatches(String fileName, WaitingHandler waitingHandler, boolean displayProgress) throws SQLException, IOException, ClassNotFoundException, InterruptedException
fileName - the file namewaitingHandler - the waiting handler allowing displaying progress
and cancelling the processdisplayProgress - boolean indicating whether the progress of this
method should be displayed on 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.InterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic void loadSpectrumMatches(ArrayList<String> spectrumKeys, WaitingHandler waitingHandler, boolean displayProgress) throws SQLException, IOException, ClassNotFoundException, InterruptedException
spectrumKeys - the key of the spectrum matches to be loadedwaitingHandler - the waiting handler allowing displaying progress
and cancelling the processdisplayProgress - boolean indicating whether the progress of this
method should be displayed on 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.InterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic void loadSpectrumMatchParameters(String fileName, UrParameter urParameter, WaitingHandler waitingHandler, boolean displayProgress) throws SQLException, IOException, ClassNotFoundException, InterruptedException
fileName - the file nameurParameter - the parameter typewaitingHandler - the waiting handler allowing displaying progress
and cancelling the processdisplayProgress - boolean indicating whether the progress of this
method should be displayed on 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.InterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic void loadSpectrumMatchParameters(ArrayList<String> spectrumKeys, UrParameter urParameter, WaitingHandler waitingHandler, boolean displayProgress) throws SQLException, IOException, ClassNotFoundException, InterruptedException
spectrumKeys - the key of the spectrum match of the parameters to be
loadedurParameter - the parameter typewaitingHandler - the waiting handler allowing displaying progress
and cancelling the processdisplayProgress - boolean indicating whether the progress of this
method should be displayed on 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.InterruptedException - if an InterruptedException is thrownpublic void loadPeptideMatches(WaitingHandler waitingHandler, boolean displayProgress) throws SQLException, IOException, ClassNotFoundException, InterruptedException, InterruptedException
waitingHandler - the waiting handler allowing displaying progress
and cancelling the processdisplayProgress - boolean indicating whether the progress of this
method should be displayed on 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.InterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic void loadPeptideMatches(ArrayList<String> peptideKeys, WaitingHandler waitingHandler, boolean displayProgress) throws SQLException, IOException, ClassNotFoundException, InterruptedException
peptideKeys - the list of peptide keys to loadwaitingHandler - the waiting handler allowing displaying progress
and cancelling the processdisplayProgress - boolean indicating whether the progress of this
method should be displayed on 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.InterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic void loadPeptideMatchParameters(UrParameter urParameter, WaitingHandler waitingHandler, boolean displayProgress) throws SQLException, IOException, ClassNotFoundException, InterruptedException
urParameter - the parameter typewaitingHandler - the waiting handler allowing displaying progress
and cancelling the processdisplayProgress - boolean indicating whether the progress of this
method should be displayed on 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.InterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic void loadPeptideMatchParameters(ArrayList<String> peptideKeys, UrParameter urParameter, WaitingHandler waitingHandler, boolean displayProgress) throws SQLException, IOException, ClassNotFoundException, InterruptedException
peptideKeys - the list of peptide keys of the parameters to loadurParameter - the parameter typewaitingHandler - the waiting handler allowing displaying progress
and cancelling the processdisplayProgress - boolean indicating whether the progress of this
method should be displayed on 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.InterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic void loadProteinMatches(WaitingHandler waitingHandler, boolean displayProgress) throws SQLException, IOException, ClassNotFoundException, InterruptedException
waitingHandler - the waiting handler allowing displaying progress
and cancelling the processdisplayProgress - boolean indicating whether the progress of this
method should be displayed on 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.InterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic void loadProteinMatches(ArrayList<String> proteinKeys, WaitingHandler waitingHandler, boolean displayProgress) throws SQLException, IOException, ClassNotFoundException, InterruptedException, InterruptedException
proteinKeys - the list of protein keys to loadwaitingHandler - the waiting handler allowing displaying progress
and cancelling the processdisplayProgress - boolean indicating whether the progress of this
method should be displayed on 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.InterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic void loadProteinMatchParameters(UrParameter urParameter, WaitingHandler waitingHandler, boolean displayProgress) throws SQLException, IOException, ClassNotFoundException, InterruptedException
urParameter - the parameter typewaitingHandler - the waiting handler allowing displaying progress
and cancelling the processdisplayProgress - boolean indicating whether the progress of this
method should be displayed on 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.InterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic void loadProteinMatchParameters(ArrayList<String> proteinKeys, UrParameter urParameter, WaitingHandler waitingHandler, boolean displayProgress) throws SQLException, IOException, ClassNotFoundException, InterruptedException
proteinKeys - the list of protein keys of the parameters to loadurParameter - the parameter typewaitingHandler - the waiting handler allowing displaying progress
and cancelling the processdisplayProgress - boolean indicating whether the progress of this
method should be displayed on 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.InterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic 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 classInterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic 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 objectInterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic 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 classInterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic 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 objectInterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic 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 classInterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic 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 objectInterruptedException - exception thrown whenever a
threading issue occurred when interacting with the databasepublic void checkTable(Collection<String> tableList, String tableName) throws SQLException, IOException, InterruptedException
tableList - the list containing the created tablestableName - the name of the tableSQLException - if an SQLException occursIOException - if an IOException occursInterruptedException - if an InterruptedException occurspublic Object getObject(String table, String objectKey, boolean useDB) throws SQLException, IOException, ClassNotFoundException, InterruptedException
table - the name of the tableobjectKey - the key of the objectuseDB - if useDB is false, null will be returned if the object is
not in the cacheSQLException - if an SQLException occursIOException - if an IOException occursInterruptedException - if an InterruptedException occursClassNotFoundException - if an ClassNotFoundException occurspublic String getAssumptionTable(String spectrumKey)
spectrumKey - the given spectrum keypublic String getRawAssumptionTable(String spectrumKey)
spectrumKey - the given spectrum keypublic 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 void restoreConnection(String dbFolder, boolean deleteOldDatabase, ObjectsCache objectsCache) throws SQLException, IOException, ClassNotFoundException, InterruptedException
dbFolder - the folder where the database is locateddeleteOldDatabase - if true, tries to delete the old databaseobjectsCache - the objects cacheSQLException - exception thrown whenever an error occurs while
interacting with the databaseIOException - exception thrown whenever an error occurs while
reading or writing a fileClassNotFoundException - exception thrown whenever an error
occurred while deserializing a file from the databaseInterruptedException - exception thrown if a threading error occurs
while interacting with the databasepublic boolean isConnectionActive()
public ObjectsDB getObjectsDB()
public void close()
throws SQLException
SQLException - exception thrown whenever an error occurred while
closing the database connectionCopyright © 2016. All rights reserved.