public class QuantificationDB extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
String |
dbName
The name which will be used for the database.
|
Constructor and Description |
---|
QuantificationDB(String folder,
String name,
boolean deleteOldDatabase,
ObjectsCache objectsCache)
Constructor creating the database and the protein and protein parameters
tables.
|
Modifier and Type | Method and Description |
---|---|
void |
addMatch(QuantificationMatch match)
Adds an quantification match to the database.
|
void |
addPeptideMatch(PeptideQuantification peptideMatch)
Adds a peptide match to the database.
|
void |
addPeptideMatchParameter(String key,
UrParameter urParameter)
Adds a peptide match parameter to the database.
|
void |
addProteinMatch(ProteinQuantification proteinMatch)
Adds a protein match to the database.
|
void |
addProteinMatchParameter(String key,
UrParameter urParameter)
Adds a protein match parameter to the database.
|
void |
addSpectrumMatch(PsmQuantification 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.
|
void |
establishConnection(String dbFolder,
boolean deleteOldDatabase,
ObjectsCache objectsCache)
Establishes connection to the database.
|
PeptideQuantification |
getPeptideMatch(String key)
Returns the desired peptide match.
|
UrParameter |
getPeptideMatchParameter(String key,
UrParameter urParameter)
Returns the desired peptide match parameter.
|
String |
getPeptideParameterTable(UrParameter urParameter)
Returns the table name associated to the given peptide parameter.
|
ProteinQuantification |
getProteinMatch(String key)
Returns the desired protein match.
|
UrParameter |
getProteinMatchPArameter(String key,
UrParameter urParameter)
Returns the desired protein match parameter.
|
String |
getProteinParameterTable(UrParameter urParameter)
Returns the table name associated to the given protein parameter.
|
PsmQuantification |
getSpectrumMatch(String key)
Returns the desired spectrum match.
|
UrParameter |
getSpectrumMatchParameter(String key,
UrParameter urParameter)
Returns the desired spectrum match parameter.
|
String |
getSpectrumMatchTable(String spectrumKey)
Returns the table name associated to the given spectrum key.
|
String |
getSpectrumParameterTable(String spectrumKey,
UrParameter urParameter)
Returns the table name associated to the given spectrum parameter.
|
boolean |
peptideMatchLoaded(String peptideKey)
Indicates whether a peptide match is loaded.
|
boolean |
proteinMatchLoaded(String proteinKey)
Indicates whether a protein match is loaded.
|
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(QuantificationMatch match)
Updates a match.
|
void |
updatePeptideMatch(PeptideQuantification peptideMatch)
Updates a peptide match.
|
void |
updatePeptideParameter(String key,
UrParameter urParameter)
Updates a peptide match parameter.
|
void |
updateProteinMatch(ProteinQuantification proteinMatch)
Updates a protein match.
|
void |
updateProteinParameter(String key,
UrParameter urParameter)
Updates a protein match parameter.
|
void |
updateSpectrumMatch(PsmQuantification spectrumMatch)
Updates a spectrum match.
|
void |
updateSpectrumParameter(String key,
UrParameter urParameter)
Updates a spectrum match parameter.
|
public String dbName
public QuantificationDB(String folder, String name, boolean deleteOldDatabase, ObjectsCache objectsCache) throws SQLException
folder
- the folder where to put the databasename
- the database namedeleteOldDatabase
- if true, tries to delete the old databaseobjectsCache
- the object cacheSQLException
- 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(ProteinQuantification 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(PeptideQuantification 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(PsmQuantification 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(QuantificationMatch 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
public void removePeptideMatch(String key) throws SQLException, IOException
key
- the key of the matchSQLException
- exception thrown whenever an error occurred while
deleting the matchIOException
public void removeSpectrumMatch(String key) throws SQLException, IOException
key
- the key of the matchSQLException
- exception thrown whenever an error occurred while
deleting the matchIOException
public PsmQuantification getSpectrumMatch(String key) throws SQLException, IOException, ClassNotFoundException
key
- 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 classpublic void addSpectrumMatch(PsmQuantification spectrumMatch) throws SQLException, IOException
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 objectpublic PeptideQuantification getPeptideMatch(String key) throws SQLException, IOException, ClassNotFoundException
key
- the peptide 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 classpublic void addPeptideMatch(PeptideQuantification peptideMatch) throws SQLException, IOException
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 objectpublic ProteinQuantification getProteinMatch(String key) throws SQLException, IOException, ClassNotFoundException
key
- the protein 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 classpublic void addProteinMatch(ProteinQuantification proteinMatch) throws SQLException, IOException
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 objectpublic UrParameter getSpectrumMatchParameter(String key, UrParameter urParameter) throws SQLException, IOException, ClassNotFoundException
key
- the psm keyurParameter
- the match parameterSQLException
- 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 addSpectrumMatchParameter(String key, UrParameter urParameter) throws SQLException, IOException
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 objectpublic UrParameter getPeptideMatchParameter(String key, UrParameter urParameter) throws SQLException, IOException, ClassNotFoundException
key
- the peptide keyurParameter
- the match parameterSQLException
- 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 addPeptideMatchParameter(String key, UrParameter urParameter) throws SQLException, IOException
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 objectpublic UrParameter getProteinMatchPArameter(String key, UrParameter urParameter) throws SQLException, IOException, ClassNotFoundException
key
- the protein keyurParameter
- the match parameterSQLException
- 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 addProteinMatchParameter(String key, UrParameter urParameter) throws SQLException, IOException
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 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 void close() throws SQLException
SQLException
- exception thrown whenever an error occurred while
closing the database connectionpublic void establishConnection(String dbFolder, boolean deleteOldDatabase, ObjectsCache objectsCache) throws SQLException
dbFolder
- the absolute path to the folder where the database is
locateddeleteOldDatabase
- if true, tries to delete the old databaseobjectsCache
- SQLException
- exception thrown whenever an error occurred while
establishing the connectionpublic void addMatch(QuantificationMatch match) throws SQLException, IOException
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 objectCopyright © 2013. All Rights Reserved.