# File lib/bio/io/sql.rb, line 73 def self.delete_entry_accession(accession) Bio::SQL::Bioentry.find_by_accession(accession.upcase).destroy! end
# File lib/bio/io/sql.rb, line 69 def self.delete_entry_id(id) Bio::SQL::Bioentry.delete(id) end
no check is made
# File lib/bio/io/biosql/biosql.rb, line 23 def self.establish_connection(configurations, env) # #configurations is an hash similar what YAML returns. #configurations.assert_valid_keys('development', 'production','test') #configurations[env].assert_valid_keys('hostname','database','adapter','username','password') DummyBase.configurations = configurations connection = DummyBase.establish_connection "#{env}" #Init of basis terms and ontologies Ontology.first(:conditions => ["name = ?", 'Annotation Tags']) || Ontology.create({:name => 'Annotation Tags'}) Ontology.first(:conditions => ["name = ?", 'SeqFeature Keys']) || Ontology.create({:name => 'SeqFeature Keys'}) Ontology.first(:conditions => ["name = ?", 'SeqFeature Sources']) ||Ontology.create({:name => 'SeqFeature Sources'}) Term.first(:conditions => ["name = ?", 'EMBLGenBankSwit']) || Term.create({:name => 'EMBLGenBankSwit', :ontology => Ontology.first(:conditions => ["name = ?", 'SeqFeature Sources'])}) connection end
# File lib/bio/io/sql.rb, line 47 def self.exists_accession(accession) # Bio::SQL::Bioentry.find_by_accession(accession.upcase).nil? ? false : true !Bio::SQL::Bioentry.find_by_accession(accession.upcase).nil? end
# File lib/bio/io/sql.rb, line 52 def self.exists_database(name) # Bio::SQL::Biodatabase.find_by_name(name).nil? ? false : true !Bio::SQL::Biodatabase.first(:name=>name).nil? end
# File lib/bio/io/sql.rb, line 42 def self.fetch_accession(accession) # Bio::SQL::Bioentry.exists?(:accession => accession) ? Bio::SQL::Sequence.new(:entry=>Bio::SQL::Bioentry.find_by_accession(accession)) : nil Bio::SQL::Sequence.new(:entry=>Bio::SQL::Bioentry.find_by_accession(accession.upcase)) end
# File lib/bio/io/sql.rb, line 38 def self.fetch_id(id) Bio::SQL::Bioentry.find(id) end
Generated with the Darkfish Rdoc Generator 2.