public abstract class Identification extends ExperimentObject
Modifier and Type | Field and Description |
---|---|
static String |
EXTENTION
Deprecated.
use the database methods instead
|
protected ArrayList<String> |
longKeys
Deprecated.
use the database instead
|
protected int |
methodUsed
The method used.
|
protected ArrayList<String> |
peptideIdentification
List of the keys of all imported peptides.
|
protected ArrayList<String> |
proteinIdentification
List of the keys of all imported proteins.
|
protected HashMap<String,ArrayList<String>> |
proteinMap
A map linking protein accessions to all their protein matches keys.
|
protected String |
reference
The reference of the identification.
|
protected String |
serializationDirectory
The directory where matches will be serialized/the database stored.
|
protected ArrayList<String> |
spectrumIdentification
Deprecated.
use file specific mapping instead
|
protected HashMap<String,ArrayList<String>> |
spectrumIdentificationMap
List of all imported PSMs indexed by mgf file name.
|
protected HashMap<String,HashMap<String,UrParameter>> |
urParameters
Deprecated.
use the database instead
|
Constructor and Description |
---|
Identification() |
Modifier and Type | Method and Description |
---|---|
void |
addMatchParameter(String key,
UrParameter urParameter)
Deprecated.
use the database match specific methods instead
|
void |
addPeptideMatchParameter(String key,
UrParameter urParameter)
Adds a peptide match parameter to the database.
|
void |
addProteinMatchParameter(String key,
UrParameter urParameter)
Adds a protein match parameter to the database.
|
void |
addSpectrumMatch(Set<SpectrumMatch> spectrumMatches,
boolean ascendingScore)
Add a set of spectrumMatches to the model.
|
void |
addSpectrumMatch(SpectrumMatch newMatch,
boolean ascendingScore)
Adds a spectrum match to the identification.
|
void |
addSpectrumMatchParameter(String key,
UrParameter urParameter)
Adds a spectrum match parameter to the database.
|
void |
buildPeptidesAndProteins(String spectrumMatchKey,
AminoAcidPattern.MatchingType matchingType,
Double massTolerance)
Creates the peptides and protein instances based on the given spectrum
match.
|
void |
buildPeptidesAndProteins(WaitingHandler waitingHandler,
AminoAcidPattern.MatchingType matchingType,
Double massTolerance)
Creates the peptides and protein instances based on the spectrum matches.
|
void |
close()
Closes the database connection.
|
void |
convert(WaitingHandler waitingHandler,
String newDirectory,
String newName,
ObjectsCache objectsCache,
File directory)
Converts a serialization based structure into a database based one.
|
void |
establishConnection(String dbFolder,
boolean deleteOldDatabase,
ObjectsCache objectsCache)
Establishes a connection to the database.
|
static String |
getDefaultReference(String experimentReference,
String sampleReference,
int replicateNumber)
Returns the default reference for an identification.
|
String |
getFileName(String key)
Deprecated.
use the database methods instead
|
UrParameter |
getMatchParameter(String matchKey,
UrParameter urParameter)
Deprecated.
use the database match specific methods instead
|
IdentificationMatch.MatchType |
getMatchType(String matchKey)
Returns the kind of match pointed by the given key in the identification
mappings.
|
int |
getMethodUsed()
Getter for the identification method used.
|
ArrayList<String> |
getOrderedSpectrumFileNames()
Returns the ordered list of spectrum file names.
|
ArrayList<String> |
getPeptideIdentification()
Returns a list of the keys of all encountered peptides.
|
PeptideMatch |
getPeptideMatch(String peptideKey)
Returns a peptide match.
|
PeptideMatch |
getPeptideMatch(String peptideKey,
boolean useDB)
Returns a peptide match.
|
UrParameter |
getPeptideMatchParameter(String key,
UrParameter urParameter)
Returns the desired peptide match parameter.
|
UrParameter |
getPeptideMatchParameter(String key,
UrParameter urParameter,
boolean useDB)
Returns the desired peptide match parameter.
|
ArrayList<String> |
getProteinIdentification()
Returns a list of the keys of all encountered proteins.
|
HashMap<String,ArrayList<String>> |
getProteinMap()
Returns a map of all the protein matches which can be ascribed to a
protein indexed by its accession.
|
ProteinMatch |
getProteinMatch(String proteinKey)
Returns a protein match.
|
ProteinMatch |
getProteinMatch(String proteinKey,
boolean useDB)
Returns a protein match.
|
ArrayList<String> |
getProteinMatches(Peptide peptide)
Returns the keys of the protein matches where a peptide can be found.
|
UrParameter |
getProteinMatchParameter(String key,
UrParameter urParameter)
Returns the desired protein match parameter.
|
UrParameter |
getProteinMatchParameter(String key,
UrParameter urParameter,
boolean useDB)
Returns the desired protein match parameter.
|
String |
getSerializationDirectory()
Returns the serialization directory.
|
ArrayList<String> |
getSpectrumFiles()
Returns the names of the mgf files used in the spectrum identification
map as a list.
|
ArrayList<String> |
getSpectrumIdentification()
Deprecated.
use file specific names instead
|
ArrayList<String> |
getSpectrumIdentification(String spectrumFile)
Returns the keys of the spectrum identifications for a given spectrum
file name.
|
HashMap<String,ArrayList<String>> |
getSpectrumIdentificationMap()
Returns the keys of all identified spectra indexed by the spectrum file.
|
int |
getSpectrumIdentificationSize()
Returns the number of spectrum identifications.
|
SpectrumMatch |
getSpectrumMatch(String spectrumKey)
Returns a spectrum match.
|
SpectrumMatch |
getSpectrumMatch(String spectrumKey,
boolean useDB)
Returns a spectrum match.
|
UrParameter |
getSpectrumMatchParameter(String key,
UrParameter urParameter)
Returns the desired spectrum match parameter.
|
UrParameter |
getSpectrumMatchParameter(String key,
UrParameter urParameter,
boolean useDB)
Returns the desired spectrum match parameter.
|
Boolean |
isDB()
Indicates whether the identification matches should be stored in a
database (true, default value) or serialized files (false, deprecated
default).
|
boolean |
isUnique(Peptide peptide)
Indicates whether a peptide is found in a single protein match.
|
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 the given spectrum matches in the cache of the database.
|
void |
loadSpectrumMatches(String fileName,
WaitingHandler waitingHandler)
Loads all spectrum matches of the 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 |
matchExists(String matchKey)
Indicates whether a match indexed by the given key exists.
|
boolean |
peptideDetailsInCache(String peptideKey)
Indicates whether the peptide and spectrum matches corresponding to a
peptide match key are loaded in the cache.
|
boolean |
proteinDetailsInCache(String proteinKey)
Indicates whether the protein, peptide and spectrum matches corresponding
to a protein match key are loaded in the cache.
|
void |
removeMatch(String matchKey)
Deprecated.
it is advised to use the specific psm/peptide/protein method
instead
|
void |
removePeptideMatch(String matchKey)
Removes a peptide match from the model.
|
void |
removeProteinMatch(String matchKey)
Removes a protein match from the model.
|
void |
removeSpectrumMatch(String matchKey)
Removes a spectrum match from the model.
|
void |
setDirectory(String serializationDirectory,
boolean deleteOldDatabase)
Deprecated.
use establishConnection(String dbFolder) instead
|
void |
setIsDB(Boolean isDB)
Sets whether the identification matches should be stored in a database or
serialized files.
|
void |
setOrderedListOfSpectrumFileNames(ArrayList<String> orderedSpectrumFileNames)
Set the ordered list of spectrum file names.
|
void |
updatePeptideMatch(PeptideMatch peptideMatch)
Updates a peptide match in the database.
|
void |
updatePeptideMatchParameter(String key,
UrParameter urParameter)
Updates a peptide match parameter in the database.
|
void |
updateProteinMatch(ProteinMatch proteinMatch)
Updates a protein match in the database.
|
void |
updateProteinMatchParameter(String key,
UrParameter urParameter)
Updates a protein match parameter in the database.
|
void |
updateSpectrumMapping()
Converts the old spectrum keys structure into the mapped version.
|
void |
updateSpectrumMatch(SpectrumMatch spectrumMatch)
Updates a spectrum match in the database.
|
void |
updateSpectrumMatchParameter(String key,
UrParameter urParameter)
Updates a spectrum match parameter in the database.
|
addUrParam, getParameterKey, getUrParam
public static final String EXTENTION
protected ArrayList<String> proteinIdentification
protected ArrayList<String> peptideIdentification
protected HashMap<String,ArrayList<String>> spectrumIdentificationMap
protected ArrayList<String> spectrumIdentification
protected HashMap<String,ArrayList<String>> proteinMap
protected int methodUsed
protected String serializationDirectory
protected HashMap<String,HashMap<String,UrParameter>> urParameters
protected ArrayList<String> longKeys
protected String reference
public ArrayList<String> getOrderedSpectrumFileNames()
public void setOrderedListOfSpectrumFileNames(ArrayList<String> orderedSpectrumFileNames) throws IllegalArgumentException
orderedSpectrumFileNames
- the ordered list of spectrum file namesIllegalArgumentException
- thrown if the length of the ordered file
names as to be the same as the number of spectrum filespublic ArrayList<String> getSpectrumFiles()
public int getSpectrumIdentificationSize()
public void addMatchParameter(String key, UrParameter urParameter) throws SQLException, IOException, InterruptedException
key
- the key of the parameterurParameter
- the additional parameterInterruptedException
SQLException
- exception thrown whenever an error occurred while
adding the object in the databaseIOException
- exception thrown whenever an error occurred while
writing the objectpublic UrParameter getMatchParameter(String matchKey, UrParameter urParameter) throws SQLException, IOException, ClassNotFoundException, InterruptedException
matchKey
- the match keyurParameter
- example of parameter to retrieveInterruptedException
SQLException
- 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 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.InterruptedException
public 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.InterruptedException
public 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.InterruptedException
public 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.InterruptedException
public 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.InterruptedException
public 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.InterruptedException
public 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.InterruptedException
public 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.InterruptedException
public void loadProteinMatches(ArrayList<String> proteinKeys, WaitingHandler waitingHandler) throws SQLException, IOException, ClassNotFoundException, 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.InterruptedException
public void loadPeptideMatches(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.InterruptedException
public 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.InterruptedException
public void loadSpectrumMatches(ArrayList<String> spectrumKeys, WaitingHandler waitingHandler) throws SQLException, IOException, ClassNotFoundException, InterruptedException
spectrumKeys
- the spectrum keyswaitingHandler
- 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
public UrParameter getSpectrumMatchParameter(String key, UrParameter urParameter) throws SQLException, IOException, ClassNotFoundException, InterruptedException
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 classInterruptedException
public 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
public 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
public UrParameter getPeptideMatchParameter(String key, UrParameter urParameter) throws SQLException, IOException, ClassNotFoundException, InterruptedException
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 classInterruptedException
public 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
public 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
public UrParameter getProteinMatchParameter(String key, UrParameter urParameter) throws SQLException, IOException, ClassNotFoundException, InterruptedException
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 classInterruptedException
public 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
public 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
public void updateProteinMatchParameter(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 void updatePeptideMatchParameter(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 void updateSpectrumMatchParameter(String key, UrParameter urParameter) throws SQLException, IOException
key
- the spectrum 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 void updateSpectrumMatch(SpectrumMatch spectrumMatch) throws SQLException, IOException
spectrumMatch
- the matchSQLException
- exception thrown whenever an error occurred while
adding the object in the databaseIOException
- exception thrown whenever an error occurred while
writing the objectpublic void updatePeptideMatch(PeptideMatch peptideMatch) throws SQLException, IOException
peptideMatch
- the matchSQLException
- exception thrown whenever an error occurred while
adding the object in the databaseIOException
- exception thrown whenever an error occurred while
writing the objectpublic void updateProteinMatch(ProteinMatch proteinMatch) throws SQLException, IOException
proteinMatch
- the matchSQLException
- exception thrown whenever an error occurred while
adding the object in the databaseIOException
- exception thrown whenever an error occurred while
writing the objectpublic String getSerializationDirectory()
public void setDirectory(String serializationDirectory, boolean deleteOldDatabase) throws SQLException
serializationDirectory
- the path of the directorydeleteOldDatabase
- if true, tries to delete the old databaseSQLException
public void removeMatch(String matchKey) throws IllegalArgumentException, SQLException, IOException
matchKey
- the key of the match to removeIllegalArgumentException
SQLException
- exception thrown whenever an error occurred while
deleting the matchIOException
public void removeSpectrumMatch(String matchKey) throws IllegalArgumentException, SQLException, IOException
matchKey
- the key of the match to removeIllegalArgumentException
SQLException
- exception thrown whenever an error occurred while
deleting the matchIOException
public void removePeptideMatch(String matchKey) throws IllegalArgumentException, SQLException, IOException
matchKey
- the key of the match to removeIllegalArgumentException
SQLException
- exception thrown whenever an error occurred while
deleting the matchIOException
public void removeProteinMatch(String matchKey) throws IllegalArgumentException, SQLException, IOException
matchKey
- the key of the match to removeIllegalArgumentException
SQLException
- exception thrown whenever an error occurred while
deleting the matchIOException
public boolean matchExists(String matchKey)
matchKey
- the key of the match looked forpublic SpectrumMatch getSpectrumMatch(String spectrumKey) throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException, InterruptedException
spectrumKey
- the key of the matchIllegalArgumentException
- exception thrown whenever an error
occurred while retrieving the matchSQLException
- 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
public SpectrumMatch getSpectrumMatch(String spectrumKey, boolean useDB) throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException, InterruptedException
spectrumKey
- the key of the matchuseDB
- if useDB is false, null will be returned if the object is
not in the cacheIllegalArgumentException
- exception thrown whenever an error
occurred while retrieving the matchSQLException
- 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
public PeptideMatch getPeptideMatch(String peptideKey) throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException, InterruptedException
peptideKey
- the key of the matchIllegalArgumentException
- exception thrown whenever an error
occurred while retrieving the matchSQLException
- 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
public PeptideMatch getPeptideMatch(String peptideKey, boolean useDB) throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException, InterruptedException
peptideKey
- the key of the matchuseDB
- if useDB is false, null will be returned if the object is
not in the cacheIllegalArgumentException
- exception thrown whenever an error
occurred while retrieving the matchSQLException
- 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
public ProteinMatch getProteinMatch(String proteinKey) throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException, InterruptedException
proteinKey
- the key of the matchIllegalArgumentException
- exception thrown whenever an error
occurred while retrieving the matchSQLException
- 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
public ProteinMatch getProteinMatch(String proteinKey, boolean useDB) throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException, InterruptedException
proteinKey
- the key of the matchuseDB
- if useDB is false, null will be returned if the object is
not in the cacheIllegalArgumentException
- exception thrown whenever an error
occurred while retrieving the matchSQLException
- 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
public boolean proteinDetailsInCache(String proteinKey) throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException, InterruptedException
proteinKey
- the key of the protein matchIllegalArgumentException
SQLException
IOException
ClassNotFoundException
InterruptedException
public boolean peptideDetailsInCache(String peptideKey) throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException, InterruptedException
peptideKey
- the peptide keyIllegalArgumentException
SQLException
IOException
ClassNotFoundException
InterruptedException
public ArrayList<String> getProteinIdentification()
public ArrayList<String> getPeptideIdentification()
public ArrayList<String> getSpectrumIdentification()
public ArrayList<String> getSpectrumIdentification(String spectrumFile)
spectrumFile
- the name of the spectrum filepublic HashMap<String,ArrayList<String>> getSpectrumIdentificationMap()
public void addSpectrumMatch(SpectrumMatch newMatch, boolean ascendingScore) throws FileNotFoundException, IOException, IllegalArgumentException, SQLException, ClassNotFoundException, InterruptedException
newMatch
- the new matchascendingScore
- indicates whether the score is ascending when hits get betterFileNotFoundException
- exception thrown whenever an error occurred
while saving the fileIOException
- exception thrown whenever an error occurred while
saving the fileIllegalArgumentException
- exception thrown whenever an error
occurred while saving the fileSQLException
- exception thrown whenever an error occurred while
saving the fileClassNotFoundException
- exception thrown whenever an error
occurred while saving the fileInterruptedException
public void buildPeptidesAndProteins(WaitingHandler waitingHandler, AminoAcidPattern.MatchingType matchingType, Double massTolerance) throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException, InterruptedException
waitingHandler
- the waiting handler displaying the progress. Can be
null. The progress will be displayed as secondary.matchingType
- the amino acid matching type to use to create peptide
matchesmassTolerance
- the mass toleranceIllegalArgumentException
SQLException
IOException
ClassNotFoundException
InterruptedException
public void buildPeptidesAndProteins(String spectrumMatchKey, AminoAcidPattern.MatchingType matchingType, Double massTolerance) throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException, InterruptedException
spectrumMatchKey
- The key of the spectrum match to addmatchingType
- the amino acid matching type to use to create peptide
matchesmassTolerance
- the mass toleranceIllegalArgumentException
SQLException
ClassNotFoundException
IOException
InterruptedException
public void addSpectrumMatch(Set<SpectrumMatch> spectrumMatches, boolean ascendingScore) throws FileNotFoundException, IOException, IllegalArgumentException, SQLException, ClassNotFoundException, InterruptedException
spectrumMatches
- The spectrum matchesascendingScore
- indicates whether the score is ascending when hits get betterFileNotFoundException
- exception thrown whenever an error occurred
while saving the fileIOException
- exception thrown whenever an error occurred while
saving the fileIllegalArgumentException
- exception thrown whenever an error
occurred while saving the fileSQLException
- exception thrown whenever an error occurred while
saving the fileClassNotFoundException
- exception thrown whenever an error
occurred while saving the fileInterruptedException
public int getMethodUsed()
public HashMap<String,ArrayList<String>> getProteinMap()
public String getFileName(String key)
key
- the key of the matchpublic Boolean isDB()
public void setIsDB(Boolean isDB)
isDB
- a boolean indicating whether the identification matches
should be stored in a database or serialized filespublic void close() throws SQLException
SQLException
- exception thrown whenever an error occurred while
closing the database connectionpublic IdentificationMatch.MatchType getMatchType(String matchKey)
matchKey
- the match keypublic 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 convert(WaitingHandler waitingHandler, String newDirectory, String newName, ObjectsCache objectsCache, File directory) throws FileNotFoundException, IOException, ClassNotFoundException, SQLException, InterruptedException
waitingHandler
- the waiting handlernewDirectory
- the new directory where to store the datanewName
- objectsCache
- directory
- the directory where the data is currently storedFileNotFoundException
- exception thrown whenever a file is not
foundIOException
- exception thrown whenever an error occurred while
reading/writing a fileClassNotFoundException
- exception thrown whenever an error
occurred while deserializing a matchSQLException
- exception thrown whenever an error occurred while
interacting with the databaseInterruptedException
public void updateSpectrumMapping()
public static String getDefaultReference(String experimentReference, String sampleReference, int replicateNumber)
experimentReference
- the experiment referencesampleReference
- the sample referencereplicateNumber
- the replicate numberpublic ArrayList<String> getProteinMatches(Peptide peptide) throws IOException, SQLException, ClassNotFoundException, InterruptedException
peptide
- the peptide of interestIOException
SQLException
InterruptedException
ClassNotFoundException
public boolean isUnique(Peptide peptide) throws IOException, SQLException, ClassNotFoundException, InterruptedException
peptide
- the peptide of interestIOException
SQLException
ClassNotFoundException
InterruptedException
Copyright © 2014. All Rights Reserved.