|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.compomics.util.experiment.identification.protein_inference.proteintree.ProteinTreeComponentsFactory
public class ProteinTreeComponentsFactory
This factory stores and returns protein trees components from databases.
Field Summary | |
---|---|
static String |
dbFolderPath
The folder containing the databases. |
static String |
dbName
The name of the db to use. |
static String |
folderSeparator
The splitter in the key between database name and database version. |
Method Summary | |
---|---|
void |
close()
Closes the factory, closes all connection and deletes the file. |
boolean |
delete()
Sets the currently loaded database as corrupted and tries to delete it. |
ArrayList<String> |
getAddedTags()
Returns arraylist of added tags |
File |
getDbFolder()
Returns the folder where the db in the sequence factory is stored. |
String |
getDbFolderName()
Returns the folder name where to store information about the protein sequence database loaded in the sequence factory. |
Integer |
getInitialSize()
Retrieves the initial tag size from the db. |
static ProteinTreeComponentsFactory |
getInstance()
Static method returning the instance of the factory. |
Node |
getNode(String tag)
Retrieves the node of the given tag. |
Integer |
getProteinLength(String accession)
Retrieves the length of a protein. |
String |
getVersion()
Returns the version. |
boolean |
importComplete()
Returns a boolean indicating whether the import was complete. |
boolean |
initiate()
Initiates the connection to the database and indicates whether the corresponding folder is already created. |
boolean |
isCorrupted()
Returns a boolean indicating whether the database is corrupted. |
void |
loadParameters()
Loads all tree parameters. |
void |
loadProteinLenths()
Loads all protein lengths in cache. |
void |
saveInitialSize(int size)
Saves the initial tag size in the parameters table of the DB. |
void |
saveNode(String tag,
Node node)
Adds a node to the database. |
void |
saveNodes(HashMap<String,Object> nodes)
Adds nodes to the database. |
void |
saveProteinLength(String accession,
int length)
Adds a protein length to the database. |
void |
setCorrupted(boolean corrupted)
Sets whether the database is corrupted. |
void |
setImportComplete(boolean completed)
Sets whether the import was completed. |
void |
setVersion(String version)
Sets the version. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String dbFolderPath
public static final String folderSeparator
public static final String dbName
Method Detail |
---|
public static ProteinTreeComponentsFactory getInstance() throws IOException
IOException
public boolean initiate() throws SQLException, IOException
SQLException
- exception thrown whenever an error occurred while
attempting to connect to the database
IOException
- exception thrown whenever an error occurred while
attempting to connect to the databasepublic boolean delete()
public void close() throws IOException, SQLException
IOException
SQLException
- exception thrown if closing the db failedpublic String getDbFolderName()
public File getDbFolder()
public ArrayList<String> getAddedTags()
public void saveNode(String tag, Node node) throws SQLException, IOException
tag
- the tag referring to the node of interestnode
- the node
SQLException
- exception thrown whenever an error occurred while
loading data in the database
IOException
- exception thrown whenever an error occurred while
loading data in the databasepublic void saveNodes(HashMap<String,Object> nodes) throws SQLException, IOException
nodes
- map of the nodes
SQLException
- exception thrown whenever an error occurred while
loading data in the database
IOException
- exception thrown whenever an error occurred while
loading data in the databasepublic Node getNode(String tag) throws SQLException, ClassNotFoundException, IOException
tag
- the tag of interest
SQLException
ClassNotFoundException
IOException
public void saveProteinLength(String accession, int length) throws SQLException, IOException
accession
- the protein accessionlength
- the length
SQLException
- exception thrown whenever an error occurred while
loading data in the database
IOException
- exception thrown whenever an error occurred while
loading data in the databasepublic Integer getProteinLength(String accession) throws SQLException, ClassNotFoundException, IOException
accession
- the accession of the protein of interest
SQLException
ClassNotFoundException
IOException
public void saveInitialSize(int size) throws SQLException, IOException
size
- the initial tag size
SQLException
IOException
public Integer getInitialSize() throws SQLException, IOException, ClassNotFoundException
SQLException
IOException
ClassNotFoundException
public void loadProteinLenths() throws SQLException, ClassNotFoundException, IOException, InterruptedException
SQLException
ClassNotFoundException
IOException
InterruptedException
public void loadParameters() throws SQLException, ClassNotFoundException, IOException, InterruptedException
SQLException
ClassNotFoundException
IOException
InterruptedException
public void setImportComplete(boolean completed) throws SQLException, IOException
completed
-
SQLException
IOException
public boolean importComplete() throws SQLException, IOException, ClassNotFoundException
SQLException
IOException
ClassNotFoundException
public void setCorrupted(boolean corrupted) throws SQLException, IOException
corrupted
-
SQLException
IOException
public boolean isCorrupted() throws SQLException, IOException, ClassNotFoundException
SQLException
IOException
ClassNotFoundException
public void setVersion(String version) throws SQLException, IOException
version
- the version
SQLException
IOException
public String getVersion() throws SQLException, IOException, ClassNotFoundException
SQLException
IOException
ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |