|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.compomics.util.experiment.personalization.ExperimentObject
com.compomics.util.experiment.identification.Identification
public abstract class Identification
This class contains identification results.
Field Summary | |
---|---|
protected boolean |
automatedMemoryManagement
boolean indicating whether the memory management should be done automatically. |
protected int |
cacheSize
The cache size in number of matches. 20000 by default: should be enough to contain a velos file. |
static String |
EXTENTION
Deprecated. use the database methods instead |
protected boolean |
inMemory
boolean indicating whether the identification should be stored in memory or not. |
protected ArrayList<String> |
loadedMatches
List of the loaded matches with the most used matches in the end. |
protected HashMap<String,IdentificationMatch> |
loadedMatchesMap
Map of the loaded matches. |
protected ArrayList<String> |
longKeys
Map of long keys (>100 characters) which will be referenced by their index for file creation/database storage. |
protected int |
methodUsed
The method used. |
protected HashMap<String,Boolean> |
modifiedMatches
Map indicating whether a match is modified. |
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 |
serializationDirectory
the directory where matches will be serialized/the database stored |
protected ArrayList<String> |
spectrumIdentification
List of the keys of all imported psms. |
protected HashMap<String,HashMap<String,UrParameter>> |
urParameters
Deprecated. use the database instead |
Constructor Summary | |
---|---|
Identification()
|
Method Summary | |
---|---|
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)
Add a set of spectrumMatches to the model. |
void |
addSpectrumMatch(SpectrumMatch newMatch)
Adds a spectrum match to the identification |
void |
addSpectrumMatchParameter(String key,
UrParameter urParameter)
Adds a spectrum match parameter to the database |
void |
buildPeptidesAndProteins(JProgressBar progressBar)
Creates the peptides and protein instances based on the spectrum matches. |
void |
buildPeptidesAndProteins(String spectrumMatchKey)
Creates the peptides and protein instances based on the given spectrum match. |
void |
close()
Closes the database connection |
void |
convert(ProgressDialogX progressDialog,
String newDirectory)
Converts a serlialization based structure into a database based one |
void |
emptyCache(ProgressDialogX progressDialog)
Empties the cache and serializes everything in the specified serialization folder or in the database. |
void |
establishConnection()
Establishes a connection to the database |
int |
getCacheSize()
Returns the cache size in number of matches. |
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> |
getPeptideIdentification()
Returns a list of the keys of all encountered peptides. |
PeptideMatch |
getPeptideMatch(String peptideKey)
Returns a peptide match. |
UrParameter |
getPeptideMatchParameter(String key,
UrParameter urParameter)
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. |
UrParameter |
getProteinMatchPArameter(String key,
UrParameter urParameter)
Returns the desired protein match parameter |
String |
getSerializationDirectory()
Returns the serialization directory. |
ArrayList<String> |
getSpectrumIdentification()
Returns a list of the keys of all encountered psms. |
SpectrumMatch |
getSpectrumMatch(String spectrumKey)
Returns a spectrum match. |
UrParameter |
getSpectrumMatchParameter(String key,
UrParameter urParameter)
Returns the desired spectrum match parameter. |
boolean |
isAutomatedMemoryManagement()
Returns whether the memory management is automated. |
Boolean |
isDB()
Indicates whether the identification matches should be stored in a database (true, default value) or serialized files (false, deprecated default). |
boolean |
isInMemory()
Indicates whether matches will be stored in memory. |
boolean |
matchExists(String matchKey)
Indicates whether a match indexed by the given key exists. |
boolean |
memoryCheck()
Indicates whether the memory used by the application is lower than 99% of the heap size. |
void |
reduceMemoryConsumtion(JProgressBar progressBar)
Reduces the amount of identification saved in memory by 20%. |
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 |
setAutomatedMemoryManagement(boolean automatedMemoryManagement)
Sets whether the memory management should be automated. |
void |
setCacheSize(int cacheSize)
Sets the cache size. |
void |
setDirectory(String serializationDirectory)
sets the directory where matches will be stored in order to save memory. |
void |
setInMemory(boolean inMemory)
Sets whether matches shall be stored in memory. |
void |
setIsDB(Boolean isDB)
Sets whether the identification matches should be stored in a database or serialized files |
void |
setMatchChanged(IdentificationMatch match)
Indicates that a match was changed, it will thus be serialized again if needed. |
void |
updateCache()
Updates the cache according to the memory settings. |
void |
updatePeptideMatchParameter(String key,
UrParameter urParameter)
Updates a peptide match parameter in the database |
void |
updateProteinMatchParameter(String key,
UrParameter urParameter)
Updates a protein match parameter in the database |
void |
updateSpectrumMatchParameter(String key,
UrParameter urParameter)
Updates a spectrum match parameter in the database |
Methods inherited from class com.compomics.util.experiment.personalization.ExperimentObject |
---|
addUrParam, getParameterKey, getUrParam |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String EXTENTION
protected ArrayList<String> proteinIdentification
protected ArrayList<String> peptideIdentification
protected ArrayList<String> spectrumIdentification
protected HashMap<String,ArrayList<String>> proteinMap
protected int methodUsed
protected int cacheSize
protected String serializationDirectory
protected boolean inMemory
protected boolean automatedMemoryManagement
protected HashMap<String,IdentificationMatch> loadedMatchesMap
protected ArrayList<String> loadedMatches
protected HashMap<String,Boolean> modifiedMatches
protected HashMap<String,HashMap<String,UrParameter>> urParameters
protected ArrayList<String> longKeys
Constructor Detail |
---|
public Identification()
Method Detail |
---|
public void addMatchParameter(String key, UrParameter urParameter) throws SQLException, IOException
key
- the key of the parameterurParameter
- the additional parameter
SQLException
- exception thrown whenever an error occurred while
adding the object in the database
IOException
- exception thrown whenever an error occurred while
writing the objectpublic UrParameter getMatchParameter(String matchKey, UrParameter urParameter) throws SQLException, IOException, ClassNotFoundException
matchKey
- the match keyurParameter
- example of parameter to retrieve
SQLException
- exception thrown whenever an error occurred while
loading the object from the database
IOException
- exception thrown whenever an error occurred while
reading the object in the database
ClassNotFoundException
- exception thrown whenever an error
occurred while casting the database input in the desired match classpublic UrParameter getSpectrumMatchParameter(String key, UrParameter urParameter) throws SQLException, IOException, ClassNotFoundException
key
- the psm keyurParameter
- the match parameter
SQLException
- exception thrown whenever an error occurred while
loading the object from the database
IOException
- exception thrown whenever an error occurred while
reading the object in the database
ClassNotFoundException
- 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 parameter
SQLException
- exception thrown whenever an error occurred while
adding the object in the database
IOException
- 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 parameter
SQLException
- exception thrown whenever an error occurred while
loading the object from the database
IOException
- exception thrown whenever an error occurred while
reading the object in the database
ClassNotFoundException
- 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 parameter
SQLException
- exception thrown whenever an error occurred while
adding the object in the database
IOException
- 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 parameter
SQLException
- exception thrown whenever an error occurred while
loading the object from the database
IOException
- exception thrown whenever an error occurred while
reading the object in the database
ClassNotFoundException
- 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 parameter
SQLException
- exception thrown whenever an error occurred while
adding the object in the database
IOException
- exception thrown whenever an error occurred while
writing the objectpublic void updateProteinMatchParameter(String key, UrParameter urParameter) throws SQLException, IOException
key
- the protein keyurParameter
- the match parameter
SQLException
- exception thrown whenever an error occurred while
adding the object in the database
IOException
- 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 parameter
SQLException
- exception thrown whenever an error occurred while
adding the object in the database
IOException
- 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 parameter
SQLException
- exception thrown whenever an error occurred while
adding the object in the database
IOException
- exception thrown whenever an error occurred while
writing the objectpublic boolean isAutomatedMemoryManagement()
public void setAutomatedMemoryManagement(boolean automatedMemoryManagement)
automatedMemoryManagement
- a boolean indicating whether the memory
management should be automatedpublic int getCacheSize()
public void setCacheSize(int cacheSize)
cacheSize
- number of matches to allow in the cache sizepublic boolean isInMemory()
public void setInMemory(boolean inMemory)
inMemory
- a boolean indicating whether matches shall be stored in
memorypublic String getSerializationDirectory()
public void setDirectory(String serializationDirectory) throws SQLException
serializationDirectory
- the path of the directory
SQLException
public void removeMatch(String matchKey) throws IllegalArgumentException, SQLException
matchKey
- the key of the match to remove
IllegalArgumentException
SQLException
- exception thrown whenever an error occurred while
deleting the matchpublic void removeSpectrumMatch(String matchKey) throws IllegalArgumentException, SQLException
matchKey
- the key of the match to remove
IllegalArgumentException
SQLException
- exception thrown whenever an error occurred while
deleting the matchpublic void removePeptideMatch(String matchKey) throws IllegalArgumentException, SQLException
matchKey
- the key of the match to remove
IllegalArgumentException
SQLException
- exception thrown whenever an error occurred while
deleting the matchpublic void removeProteinMatch(String matchKey) throws IllegalArgumentException, SQLException
matchKey
- the key of the match to remove
IllegalArgumentException
SQLException
- exception thrown whenever an error occurred while
deleting the matchpublic boolean matchExists(String matchKey)
matchKey
- the key of the match looked for
public SpectrumMatch getSpectrumMatch(String spectrumKey) throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException
spectrumKey
- the key of the match
IllegalArgumentException
- exception thrown whenever an error
occurred while retrieving the match
SQLException
- exception thrown whenever an error occurred while
loading the object from the database
IOException
- exception thrown whenever an error occurred while
reading the object in the database
ClassNotFoundException
- exception thrown whenever an error
occurred while casting the database input in the desired match classpublic PeptideMatch getPeptideMatch(String peptideKey) throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException
peptideKey
- the key of the match
IllegalArgumentException
- exception thrown whenever an error
occurred while retrieving the match
SQLException
- exception thrown whenever an error occurred while
loading the object from the database
IOException
- exception thrown whenever an error occurred while
reading the object in the database
ClassNotFoundException
- exception thrown whenever an error
occurred while casting the database input in the desired match classpublic ProteinMatch getProteinMatch(String proteinKey) throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException
proteinKey
- the key of the match
IllegalArgumentException
- exception thrown whenever an error
occurred while retrieving the match
SQLException
- exception thrown whenever an error occurred while
loading the object from the database
IOException
- exception thrown whenever an error occurred while
reading the object in the database
ClassNotFoundException
- exception thrown whenever an error
occurred while casting the database input in the desired match classpublic ArrayList<String> getProteinIdentification()
public ArrayList<String> getPeptideIdentification()
public ArrayList<String> getSpectrumIdentification()
public void addSpectrumMatch(SpectrumMatch newMatch) throws FileNotFoundException, IOException, IllegalArgumentException, SQLException, ClassNotFoundException
newMatch
- the new match
FileNotFoundException
- exception thrown whenever an error occurred
while saving the file
IOException
- exception thrown whenever an error occurred while
saving the file
IllegalArgumentException
- exception thrown whenever an error
occurred while saving the file
SQLException
- exception thrown whenever an error occurred while
saving the file
ClassNotFoundException
- exception thrown whenever an error
occurred while saving the filepublic void updateCache() throws FileNotFoundException, IOException, SQLException, ClassNotFoundException
FileNotFoundException
- exception thrown whenever an error occurred
while serializing a match
IOException
- exception thrown whenever an error occurred while
serializing a match
SQLException
ClassNotFoundException
public boolean memoryCheck()
public void reduceMemoryConsumtion(JProgressBar progressBar) throws FileNotFoundException, IOException, SQLException
progressBar
- the progress bar
FileNotFoundException
- exception thrown whenever an error occurred
while serializing a match
IOException
- exception thrown whenever an error occurred while
serializing a match or reading the database
SQLException
- exception thrown whenever an error occurred while
adding the object in the databasepublic void buildPeptidesAndProteins(JProgressBar progressBar) throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException
progressBar
- the progress bar
IllegalArgumentException
SQLException
IOException
ClassNotFoundException
public void buildPeptidesAndProteins(String spectrumMatchKey) throws IllegalArgumentException, SQLException, IOException, ClassNotFoundException
spectrumMatchKey
- The key of the spectrum match to add
IllegalArgumentException
SQLException
IOException
ClassNotFoundException
public void emptyCache(ProgressDialogX progressDialog) throws FileNotFoundException, IOException, SQLException
progressDialog
- cancelProgress
- set this to true to cancel the progress
FileNotFoundException
- exception thrown whenever an error occurred
while serializing a match
IOException
- exception thrown whenever an error occurred while
serializing a match
SQLException
public void addSpectrumMatch(Set<SpectrumMatch> spectrumMatches) throws FileNotFoundException, IOException, IllegalArgumentException, SQLException, ClassNotFoundException
spectrumMatches
- The spectrum matches
FileNotFoundException
- exception thrown whenever an error occurred
while saving the file
IOException
- exception thrown whenever an error occurred while
saving the file
IllegalArgumentException
- exception thrown whenever an error
occurred while saving the file
SQLException
- exception thrown whenever an error occurred while
saving the file
ClassNotFoundException
- exception thrown whenever an error
occurred while saving the filepublic int getMethodUsed()
public HashMap<String,ArrayList<String>> getProteinMap()
public void setMatchChanged(IdentificationMatch match) throws IllegalArgumentException, IOException, SQLException
match
-
IllegalArgumentException
IOException
SQLException
public String getFileName(String key)
key
- the key of the match
public 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 key
public void establishConnection() throws SQLException
SQLException
- exception thrown whenever an error occurred while
establishing the connectionpublic void convert(ProgressDialogX progressDialog, String newDirectory) throws FileNotFoundException, IOException, ClassNotFoundException, SQLException
progressDialog
- a dialog to give progress feedback to the usercancelProgress
- boolean allowing canceling the process, this will
corrupt the project.newDirectory
- the new directory where to store the data
FileNotFoundException
- exception thrown whenever a file is not
found
IOException
- exception thrown whenever an error occurred while
reading/writing a file
ClassNotFoundException
- exception thrown whenever an error
occurred while deserializing a match
SQLException
- exception thrown whenever an error occurred while
interacting with the database
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |