lib/kingdom_db.rb in bio-phyta-0.9.0 vs lib/kingdom_db.rb in bio-phyta-0.9.1
- old
+ new
@@ -2,10 +2,16 @@
class KingdomDB
ROOT_ID = "1"
SCIENTIFIC_NAME = "scientific name"
+ DEFAULT_FILTER = [
+ "Bacteria",
+ "Archaea",
+ "Viruses",
+ "NONE"
+ ]
def initialize(server, user, password, database)
connect_string = 'mysql://'+ server + '/' + database + '?user=' + user
@@ -24,10 +30,10 @@
@database = Sequel.connect(connect_string)
@filter_hit_cache = {}
end
-
+
def id_from_name(taxon_name)
db_results = @database[:names].select(:taxonid, :class).filter(:name => taxon_name).all
if db_results.size > 1
#If we get more than one result, check if we got a scientific name