Package org.biojava.bio.seq.db.biosql
Class TaxonSQL
- java.lang.Object
- 
- org.biojava.bio.seq.db.biosql.TaxonSQL
 
- 
- 
Constructor SummaryConstructors Constructor Description TaxonSQL()Deprecated.
 - 
Method SummaryAll Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static TaxonaddName(Connection conn, Taxon taxon, String nameClass, String newName)Deprecated.Adds a new name of the givennameClassto the taxon.static voidattemptClose(ResultSet resultset)Deprecated.Attempt to close the ResultSet.static voidattemptClose(Statement statement)Deprecated.Attempt to close the Statement.static voidautomaticUpdate(Connection conn, DBHelper helper, TaxonFactory factory, File delnodes, File merged)Deprecated.This method tries to perform a complete update according to the givenTaxonFactory, which already contains the newes taxa and the files available at the NCBI-FTP-Site.static String[]getAllScientificNames(Connection conn)Deprecated.Returns all thescientific names, which are currently stored in the database.static StackgetChildrenOf(Connection conn, String scientificName)Deprecated.Returns all children of the specified taxon.static StackgetChildrenOf(Connection conn, Taxon t)Deprecated.Returns the children as aStackof this given taxon.static TaxongetDBTaxon(Connection conn, int taxon_id)Deprecated.Attempts to get a Taxon object corresponding to the specified taxon_id (i.e. the database's internal id for the taxon).static StringgetRealScientificName(Taxon t)Deprecated.This returns the true scientific name of a given taxon, if there is one.static TaxongetTaxon(Connection conn, int ncbi_taxon_id)Deprecated.Attempts to get a Taxon object corresponding to the specified NCBI taxon ID.static TaxongetTaxon(Connection conn, String name)Deprecated.Attempts to get a Taxon object corresponding to the specified name.static SetNCBIids(Connection conn)Deprecated.Returns aSetof all NCBI-Taxon-IDs which are currently stored in the database.static intputTaxon(Connection conn, DBHelper helper, Taxon taxon)Deprecated.Adds aTaxon(along with its parents) to the database.static voidremoveGeneticCodeID(Connection conn, DBHelper helper, Taxon tdb)Deprecated.Deletes the genetic code annotation from the taxon in the database.static voidremoveLeftValue(Connection conn, DBHelper helper, Taxon tdb)Deprecated.Deletes the left value from the specified taxon in the database.static voidremoveMitochondrialGeneticCodeID(Connection conn, DBHelper helper, Taxon tdb)Deprecated.Deletes the so called mitochondrial genetic code annotation from the given taxon.static TaxonremoveName(Connection conn, DBHelper helper, Taxon taxon, String nameClass, String oldName)Deprecated.Deletes the specified name from of the taxon from the database.static voidremoveRank(Connection conn, DBHelper helper, Taxon tdb)Deprecated.Removes the rank persistently from the taxon in the database.static voidremoveRightValue(Connection conn, DBHelper helper, Taxon tdb)Deprecated.Deletes the right value from the specified taxon in the database.static TaxonremoveTaxon(Connection conn, int ncbi_id, DBHelper helper)Deprecated.Deletes the taxon given by it's NCBI-Taxon-ID from the database and returns the removed taxon.static TaxonremoveTaxon(Connection conn, DBHelper helper, String name)Deprecated.Deletes a taxon specified by one of it's names with all it's different names, annotations and sequences from the database.static TaxonsetCommonName(Connection conn, Taxon taxon, String newName)Deprecated.With this method the common name of the given taxon can be changed or created, if there was none before.static voidsetGeneticCodeID(Connection conn, Taxon tdb, int id)Deprecated.Updates the taxon in the database and sets its genetic code id to the specified value.static voidsetLeftValue(Connection conn, Taxon tdb, int left)Deprecated.Updates the taxon and sets the left value to the specified value.static voidsetMitochondrialGeneticCodeID(Connection conn, Taxon tdb, int id)Deprecated.Updates the given taxon and sets it's so called mitochondrial genetic code id to the specified value.static voidsetParent(Connection conn, Taxon child, Taxon parent)Deprecated.This updates the taxonomic tree in the database and sets the parent of the given child taxon to the parent taxon.static voidsetRank(Connection conn, Taxon tdb, String rank)Deprecated.Updates a taxon and sets it's rank to the specifiedString.static voidsetRightValue(Connection conn, Taxon tdb, int right)Deprecated.Updates the taxon in the database and sets the right value to the specified value.static TaxonsetScientificName(Connection conn, Taxon taxon, String newName)Deprecated.This changes the scientific name of the given taxon and stores the new name persistent in the database.
 
- 
- 
- 
Constructor Detail- 
TaxonSQLpublic TaxonSQL() Deprecated.
 
- 
 - 
Method Detail- 
getTaxonpublic static Taxon getTaxon(Connection conn, int ncbi_taxon_id) Deprecated.Attempts to get a Taxon object corresponding to the specified NCBI taxon ID.- Parameters:
- conn- the connection to the database
- ncbi_taxon_id- the NCBI taxon ID.
- Returns:
- the corresponding Taxon (which may have already been present in memory after an earlier retrieval), or null if the Taxon could not be found in the database.
 
 - 
getDBTaxonpublic static Taxon getDBTaxon(Connection conn, int taxon_id) throws SQLException, ChangeVetoException Deprecated.Attempts to get a Taxon object corresponding to the specified taxon_id (i.e. the database's internal id for the taxon).- Parameters:
- conn- the connection to the database
- taxon_id- the database-specific id for the Taxon.
- Returns:
- the corresponding Taxon (which may have already been present in memory after an earlier retrieval).
- Throws:
- SQLException
- ChangeVetoException
 
 - 
putTaxonpublic static int putTaxon(Connection conn, DBHelper helper, Taxon taxon) throws SQLException Deprecated.Adds aTaxon(along with its parents) to the database. If it is already present in the database, no action is taken. Returns the id by which the database refers to the specifiedTaxonobject.- Parameters:
- taxon- a- Taxon. The- Taxonmust be annotated with the NCBI taxon id (- key=EbiFormat.PROPERTY_ORGANISM).
- helper- for the certain database system which is in use.
- Returns:
- an intthat corresponds to theTaxonin the database.
- Throws:
- SQLException
 
 - 
attemptClosepublic static void attemptClose(Statement statement) Deprecated.Attempt to close the Statement. Continue on if there is a problem during the close.
 - 
attemptClosepublic static void attemptClose(ResultSet resultset) Deprecated.Attempt to close the ResultSet. Continue on if there is a problem during the close.
 - 
getTaxonpublic static Taxon getTaxon(Connection conn, String name) throws BioRuntimeException Deprecated.Attempts to get a Taxon object corresponding to the specified name.- Parameters:
- conn- the connection to the database
- name- the species scientific name
- Returns:
- the corresponding Taxon (which may have already been present in memory after an earlier retrieval), or null if the Taxon could not be found in the database.
- Throws:
- BioRuntimeException
 
 - 
getAllScientificNamespublic static String[] getAllScientificNames(Connection conn) throws BioRuntimeException Deprecated.Returns all thescientific names, which are currently stored in the database.- Parameters:
- conn- connection to the database
- Returns:
- array of lexicographically sorted Strings
- Throws:
- BioRuntimeException
 
 - 
getRealScientificNamepublic static String getRealScientificName(Taxon t) Deprecated.This returns the true scientific name of a given taxon, if there is one. This is necessary because if a taxon does not have a parent node, aTaxonFactorygives the scientific name 'ROOT' and the real scientific name (if there is one) is only stored in the taxon'sEbiFormat-annotation. This name 'ROOT' applies only for in memory taxon objects. In the database the real name is stored.- Parameters:
- t- the taxon
- Returns:
- Name of the taxon.
 
 - 
NCBIidspublic static Set NCBIids(Connection conn) throws BioRuntimeException Deprecated.Returns aSetof all NCBI-Taxon-IDs which are currently stored in the database. So it is easy to proove if a taxon is stored in the database or perform other operations.- Parameters:
- conn- database connection
- Returns:
- a Setcontaining all NCBI-IDs.
- Throws:
- BioRuntimeException
 
 - 
removeTaxonpublic static Taxon removeTaxon(Connection conn, DBHelper helper, String name) throws SQLException, BioException Deprecated.Deletes a taxon specified by one of it's names with all it's different names, annotations and sequences from the database. This cannot be undone. The removed taxon will be returned.- Parameters:
- conn- database connection
- helper- the helper for the certain database system to be used.
- name- one of the taxon's names
- Returns:
- the taxon, which was successfully removed and which is not longer stored in the database.
- Throws:
- BioException
- SQLException
 
 - 
removeTaxonpublic static Taxon removeTaxon(Connection conn, int ncbi_id, DBHelper helper) throws BioRuntimeException, SQLException, BioException Deprecated.Deletes the taxon given by it's NCBI-Taxon-ID from the database and returns the removed taxon.- Parameters:
- conn- database connection
- helper- the helper for the database
- ncbi_id- the ncbi-id
- Returns:
- the taxon wich is not stored in the database anymore.
- Throws:
- BioRuntimeException
- BioException
- SQLException
 
 - 
setScientificNamepublic static Taxon setScientificName(Connection conn, Taxon taxon, String newName) throws SQLException Deprecated.This changes the scientific name of the given taxon and stores the new name persistent in the database.- Parameters:
- conn- database connection
- taxon- the taxon to be changed
- newName- the new scientific name
- Returns:
- the changed taxon with the new scientific name.
- Throws:
- SQLException
 
 - 
setCommonNamepublic static Taxon setCommonName(Connection conn, Taxon taxon, String newName) throws BioException, SQLException Deprecated.With this method the common name of the given taxon can be changed or created, if there was none before. The new common name will be stored persitently.- Parameters:
- conn- database connection
- taxon- the taxon to be updated
- newName- the new common name
- Returns:
- the updated taxon.
- Throws:
- BioException
- SQLException
 
 - 
addNamepublic static Taxon addName(Connection conn, Taxon taxon, String nameClass, String newName) throws BioException, SQLException, BioRuntimeException Deprecated.Adds a new name of the givennameClassto the taxon. However, there must be exactly onescientific nameand maximal onecommon name. Otherwise anExceptionwill be thrown.- Parameters:
- conn- database connection
- taxon- the taxon to be updated
- nameClass- the name_class of the new name.
- newName- the new name.
- Returns:
- the persistently updated taxon.
- Throws:
- BioException
- SQLException
- BioRuntimeException
 
 - 
removeNamepublic static Taxon removeName(Connection conn, DBHelper helper, Taxon taxon, String nameClass, String oldName) throws BioException, SQLException Deprecated.Deletes the specified name from of the taxon from the database. Thescientific namehas to be uniqe, so this cannot be removed by this method.- Parameters:
- conn- the database connection
- helper- the helper for the used database system
- taxon- the taxon to be updated
- nameClass- the name_class of the name to be removed
- oldName- the old name, which is not needed anymore.
- Returns:
- the updated taxon.
- Throws:
- BioException
- SQLException
 
 - 
getChildrenOfpublic static Stack getChildrenOf(Connection conn, String scientificName) throws BioException Deprecated.Returns all children of the specified taxon.- Parameters:
- conn- database connection
- scientificName- name of the taxon which children should be searched.
- Returns:
- a Stac, which contains the children sorted by theirescientific names from top to the bottom.
- Throws:
- BioException
- SQLException
 
 - 
getChildrenOfpublic static Stack getChildrenOf(Connection conn, Taxon t) throws BioException Deprecated.Returns the children as aStackof this given taxon.- Parameters:
- conn- database connection
- t- the parent taxon
- Returns:
- a sorted Stackof the children, which might be empty, but notnull.
- Throws:
- BioException
 
 - 
setRankpublic static void setRank(Connection conn, Taxon tdb, String rank) throws BioRuntimeException Deprecated.Updates a taxon and sets it's rank to the specifiedString.- Parameters:
- conn- database connection.
- tdb- taxon to be updated
- rank- the new rank (like 'kingdom', 'genus' or what ever)
- Throws:
- BioRuntimeException
 
 - 
removeRankpublic static void removeRank(Connection conn, DBHelper helper, Taxon tdb) throws BioRuntimeException Deprecated.Removes the rank persistently from the taxon in the database.- Parameters:
- conn-
- helper-
- tdb-
- Throws:
- BioRuntimeException
 
 - 
setGeneticCodeIDpublic static void setGeneticCodeID(Connection conn, Taxon tdb, int id) throws BioRuntimeException Deprecated.Updates the taxon in the database and sets its genetic code id to the specified value.- Parameters:
- conn-
- tdb-
- id-
- Throws:
- BioRuntimeException
 
 - 
removeGeneticCodeIDpublic static void removeGeneticCodeID(Connection conn, DBHelper helper, Taxon tdb) throws BioRuntimeException Deprecated.Deletes the genetic code annotation from the taxon in the database.- Parameters:
- conn-
- helper-
- tdb-
- Throws:
- BioRuntimeException
 
 - 
setMitochondrialGeneticCodeIDpublic static void setMitochondrialGeneticCodeID(Connection conn, Taxon tdb, int id) throws BioRuntimeException Deprecated.Updates the given taxon and sets it's so called mitochondrial genetic code id to the specified value.- Parameters:
- conn-
- tdb-
- id-
- Throws:
- BioRuntimeException
 
 - 
removeMitochondrialGeneticCodeIDpublic static void removeMitochondrialGeneticCodeID(Connection conn, DBHelper helper, Taxon tdb) throws BioRuntimeException Deprecated.Deletes the so called mitochondrial genetic code annotation from the given taxon.- Parameters:
- conn-
- helper-
- tdb-
- Throws:
- BioRuntimeException
 
 - 
setLeftValuepublic static void setLeftValue(Connection conn, Taxon tdb, int left) throws BioRuntimeException Deprecated.Updates the taxon and sets the left value to the specified value.- Parameters:
- conn-
- tdb-
- left-
- Throws:
- BioRuntimeException
 
 - 
removeLeftValuepublic static void removeLeftValue(Connection conn, DBHelper helper, Taxon tdb) throws BioRuntimeException Deprecated.Deletes the left value from the specified taxon in the database.- Parameters:
- conn-
- helper-
- tdb-
- Throws:
- BioRuntimeException
 
 - 
setRightValuepublic static void setRightValue(Connection conn, Taxon tdb, int right) throws BioRuntimeException Deprecated.Updates the taxon in the database and sets the right value to the specified value.- Parameters:
- conn-
- tdb-
- right-
- Throws:
- BioRuntimeException
 
 - 
removeRightValuepublic static void removeRightValue(Connection conn, DBHelper helper, Taxon tdb) throws BioRuntimeException Deprecated.Deletes the right value from the specified taxon in the database.- Parameters:
- conn-
- helper-
- tdb-
- Throws:
- BioRuntimeException
 
 - 
setParentpublic static void setParent(Connection conn, Taxon child, Taxon parent) throws BioRuntimeException Deprecated.This updates the taxonomic tree in the database and sets the parent of the given child taxon to the parent taxon.- Parameters:
- conn-
- child-
- parent-
- Throws:
- BioRuntimeException
 
 - 
automaticUpdatepublic static void automaticUpdate(Connection conn, DBHelper helper, TaxonFactory factory, File delnodes, File merged) throws IOException Deprecated.This method tries to perform a complete update according to the givenTaxonFactory, which already contains the newes taxa and the files available at the NCBI-FTP-Site.- Parameters:
- conn- database connection
- helper- helper for the database system to be used
- factory- the TaxonFactory containing all the new taxa
- delnodes- file containing the ncbi taxon ids which don't exist anymore
- merged- file containing the ncbi taxon ids which were merged.
- Throws:
- IOException
 
 
- 
 
-