Constructor and Description |
---|
TaxonSQL()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static Taxon |
addName(Connection conn,
Taxon taxon,
String nameClass,
String newName)
Deprecated.
Adds a new name of the given
nameClass to the taxon. |
static void |
attemptClose(ResultSet resultset)
Deprecated.
Attempt to close the ResultSet.
|
static void |
attemptClose(Statement statement)
Deprecated.
Attempt to close the Statement.
|
static void |
automaticUpdate(Connection conn,
DBHelper helper,
TaxonFactory factory,
File delnodes,
File merged)
Deprecated.
This method tries to perform a complete update according to the given
TaxonFactory , which already contains the newes taxa and the files
available at the NCBI-FTP-Site. |
static String[] |
getAllScientificNames(Connection conn)
Deprecated.
Returns all the
scientific name s, which are currently stored in the
database. |
static Stack |
getChildrenOf(Connection conn,
String scientificName)
Deprecated.
Returns all children of the specified taxon.
|
static Stack |
getChildrenOf(Connection conn,
Taxon t)
Deprecated.
Returns the children as a
Stack of this given taxon. |
static Taxon |
getDBTaxon(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 String |
getRealScientificName(Taxon t)
Deprecated.
This returns the true scientific name of a given taxon, if there is one.
|
static Taxon |
getTaxon(Connection conn,
int ncbi_taxon_id)
Deprecated.
Attempts to get a Taxon object corresponding to the specified
NCBI taxon ID.
|
static Taxon |
getTaxon(Connection conn,
String name)
Deprecated.
Attempts to get a Taxon object corresponding to the specified
name.
|
static Set |
NCBIids(Connection conn)
Deprecated.
Returns a
Set of all NCBI-Taxon-IDs which are currently stored in
the database. |
static int |
putTaxon(Connection conn,
DBHelper helper,
Taxon taxon)
Deprecated.
Adds a
Taxon (along with its parents) to the
database. |
static void |
removeGeneticCodeID(Connection conn,
DBHelper helper,
Taxon tdb)
Deprecated.
Deletes the genetic code annotation from the taxon in the database.
|
static void |
removeLeftValue(Connection conn,
DBHelper helper,
Taxon tdb)
Deprecated.
Deletes the left value from the specified taxon in the database.
|
static void |
removeMitochondrialGeneticCodeID(Connection conn,
DBHelper helper,
Taxon tdb)
Deprecated.
Deletes the so called mitochondrial genetic code annotation from the given taxon.
|
static Taxon |
removeName(Connection conn,
DBHelper helper,
Taxon taxon,
String nameClass,
String oldName)
Deprecated.
Deletes the specified name from of the taxon from the database.
|
static void |
removeRank(Connection conn,
DBHelper helper,
Taxon tdb)
Deprecated.
Removes the rank persistently from the taxon in the database.
|
static void |
removeRightValue(Connection conn,
DBHelper helper,
Taxon tdb)
Deprecated.
Deletes the right value from the specified taxon in the database.
|
static Taxon |
removeTaxon(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 Taxon |
removeTaxon(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 Taxon |
setCommonName(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 void |
setGeneticCodeID(Connection conn,
Taxon tdb,
int id)
Deprecated.
Updates the taxon in the database and sets its genetic code id to the specified value.
|
static void |
setLeftValue(Connection conn,
Taxon tdb,
int left)
Deprecated.
Updates the taxon and sets the left value to the specified value.
|
static void |
setMitochondrialGeneticCodeID(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 void |
setParent(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 void |
setRank(Connection conn,
Taxon tdb,
String rank)
Deprecated.
Updates a taxon and sets it's rank to the specified
String . |
static void |
setRightValue(Connection conn,
Taxon tdb,
int right)
Deprecated.
Updates the taxon in the database and sets the right value to the specified value.
|
static Taxon |
setScientificName(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.
|
public TaxonSQL()
public static Taxon getTaxon(Connection conn, int ncbi_taxon_id)
conn
- the connection to the databasencbi_taxon_id
- the NCBI taxon ID.public static Taxon getDBTaxon(Connection conn, int taxon_id) throws SQLException, ChangeVetoException
conn
- the connection to the databasetaxon_id
- the database-specific id for the Taxon.SQLException
ChangeVetoException
public static int putTaxon(Connection conn, DBHelper helper, Taxon taxon) throws SQLException
Taxon
(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
specified Taxon
object.taxon
- a Taxon
. The Taxon
must
be annotated with the NCBI taxon id
(key=EbiFormat.PROPERTY_ORGANISM
).helper
- for the certain database system which is in use.int
that corresponds to the
Taxon
in the database.SQLException
public static void attemptClose(Statement statement)
public static void attemptClose(ResultSet resultset)
public static Taxon getTaxon(Connection conn, String name) throws BioRuntimeException
conn
- the connection to the databasename
- the species scientific nameBioRuntimeException
public static String[] getAllScientificNames(Connection conn) throws BioRuntimeException
scientific name
s, which are currently stored in the
database.conn
- connection to the databaseString
sBioRuntimeException
public static String getRealScientificName(Taxon t)
TaxonFactory
gives the scientific name 'ROOT' and the
real scientific name (if there is one) is only stored in the taxon's
EbiFormat
-annotation. This name 'ROOT' applies only for
in memory taxon objects. In the database the real name is stored.t
- the taxonpublic static Set NCBIids(Connection conn) throws BioRuntimeException
Set
of 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.conn
- database connectionSet
containing all NCBI-IDs.BioRuntimeException
public static Taxon removeTaxon(Connection conn, DBHelper helper, String name) throws SQLException, BioException
conn
- database connectionhelper
- the helper for the certain database system to be used.name
- one of the taxon's namesBioException
SQLException
public static Taxon removeTaxon(Connection conn, int ncbi_id, DBHelper helper) throws BioRuntimeException, SQLException, BioException
conn
- database connectionhelper
- the helper for the databasencbi_id
- the ncbi-idBioRuntimeException
BioException
SQLException
public static Taxon setScientificName(Connection conn, Taxon taxon, String newName) throws SQLException
conn
- database connectiontaxon
- the taxon to be changednewName
- the new scientific nameSQLException
public static Taxon setCommonName(Connection conn, Taxon taxon, String newName) throws BioException, SQLException
conn
- database connectiontaxon
- the taxon to be updatednewName
- the new common nameBioException
SQLException
public static Taxon addName(Connection conn, Taxon taxon, String nameClass, String newName) throws BioException, SQLException, BioRuntimeException
nameClass
to the taxon. However, there must
be exactly one scientific name
and maximal one common
name
. Otherwise an Exception
will be thrown.conn
- database connectiontaxon
- the taxon to be updatednameClass
- the name_class of the new name.newName
- the new name.BioException
SQLException
BioRuntimeException
public static Taxon removeName(Connection conn, DBHelper helper, Taxon taxon, String nameClass, String oldName) throws BioException, SQLException
scientific name
has to be uniqe, so this cannot be removed by
this method.conn
- the database connectionhelper
- the helper for the used database systemtaxon
- the taxon to be updatednameClass
- the name_class of the name to be removedoldName
- the old name, which is not needed anymore.BioException
SQLException
public static Stack getChildrenOf(Connection conn, String scientificName) throws BioException
conn
- database connectionscientificName
- name of the taxon which children should be searched.Stac
, which contains the children sorted by theire
scientific name
s from top to the bottom.BioException
SQLException
public static Stack getChildrenOf(Connection conn, Taxon t) throws BioException
Stack
of this given taxon.conn
- database connectiont
- the parent taxonStack
of the children, which might be empty,
but not null
.BioException
public static void setRank(Connection conn, Taxon tdb, String rank) throws BioRuntimeException
String
.conn
- database connection.tdb
- taxon to be updatedrank
- the new rank (like 'kingdom', 'genus' or what ever)BioRuntimeException
public static void removeRank(Connection conn, DBHelper helper, Taxon tdb) throws BioRuntimeException
conn
- helper
- tdb
- BioRuntimeException
public static void setGeneticCodeID(Connection conn, Taxon tdb, int id) throws BioRuntimeException
conn
- tdb
- id
- BioRuntimeException
public static void removeGeneticCodeID(Connection conn, DBHelper helper, Taxon tdb) throws BioRuntimeException
conn
- helper
- tdb
- BioRuntimeException
public static void setMitochondrialGeneticCodeID(Connection conn, Taxon tdb, int id) throws BioRuntimeException
conn
- tdb
- id
- BioRuntimeException
public static void removeMitochondrialGeneticCodeID(Connection conn, DBHelper helper, Taxon tdb) throws BioRuntimeException
conn
- helper
- tdb
- BioRuntimeException
public static void setLeftValue(Connection conn, Taxon tdb, int left) throws BioRuntimeException
conn
- tdb
- left
- BioRuntimeException
public static void removeLeftValue(Connection conn, DBHelper helper, Taxon tdb) throws BioRuntimeException
conn
- helper
- tdb
- BioRuntimeException
public static void setRightValue(Connection conn, Taxon tdb, int right) throws BioRuntimeException
conn
- tdb
- right
- BioRuntimeException
public static void removeRightValue(Connection conn, DBHelper helper, Taxon tdb) throws BioRuntimeException
conn
- helper
- tdb
- BioRuntimeException
public static void setParent(Connection conn, Taxon child, Taxon parent) throws BioRuntimeException
conn
- child
- parent
- BioRuntimeException
public static void automaticUpdate(Connection conn, DBHelper helper, TaxonFactory factory, File delnodes, File merged) throws IOException
TaxonFactory
, which already contains the newes taxa and the files
available at the NCBI-FTP-Site.conn
- database connectionhelper
- helper for the database system to be usedfactory
- the TaxonFactory containing all the new taxadelnodes
- file containing the ncbi taxon ids which don't exist anymoremerged
- file containing the ncbi taxon ids which were merged.IOException
Copyright © 2014 BioJava. All rights reserved.