# # = AUTOMATIC Table Definition of the Rat Nov. 2004 (Baylor 3.4/rn4) assembly # Copyright:: Copyright (C) 2011, 2012 # MISHIMA, Hiroyuki # # License:: The Ruby licence (Ryby's / GPLv2 dual) # require "#{::File.dirname(__FILE__)}/table_class_detector" module Bio module Ucsc module Rn4 CHROMS = %w(chrM chr1 chr2 chr3 chr4 chr5 chr6 chr7 chr8 chr9 chr10 chr11 chr12 chr13 chr14 chr15 chr16 chr17 chr18 chr19 chr20 chrX) extend TableClassDetector def self.default DBConnection.default end def self.connect(param = Hash.new) DBConnection.db_adapter = param[:db_adapter] if param[:db_adapter] DBConnection.db_host = param[:db_host] if param[:db_host] DBConnection.db_username = param[:db_username] if param[:db_username] DBConnection.password = param[:password] if param[:password] DBConnection.connect end class DBConnection < ActiveRecord::Base include SafeAttributes self.inheritance_column = 'dummy_not_to_use' @@db_adapter ||= 'mysql' @@db_host ||= 'genome-mysql.cse.ucsc.edu' @@db_username ||= 'genome' @@db_password ||= '' @@db_name ||= 'rn4' cattr_accessor :db_adapter, :db_host, :db_username, :db_password self.abstract_class = true def self.default @@db_adapter = 'mysql' @@db_host = 'genome-mysql.cse.ucsc.edu' @@db_username = 'genome' @@db_password = '' end def self.connect establish_connection({ :adapter => @@db_adapter, :host => @@db_host, :database => @@db_name, :username => @@db_username, :password => @@db_password, }) end end # class DBConnection base = "#{::File.dirname(__FILE__)}/rn4" autoload :ChainCanFam2, "#{base}/chaincanfam2" autoload :ChainCanFam2Link, "#{base}/chaincanfam2link" autoload :ChainCavPor3, "#{base}/chaincavpor3" autoload :ChainCavPor3Link, "#{base}/chaincavpor3link" autoload :ChainDanRer4, "#{base}/chaindanrer4" autoload :ChainDanRer4Link, "#{base}/chaindanrer4link" autoload :ChainEquCab1, "#{base}/chainequcab1" autoload :ChainEquCab1Link, "#{base}/chainequcab1link" autoload :ChainGalGal3, "#{base}/chaingalgal3" autoload :ChainGalGal3Link, "#{base}/chaingalgal3link" autoload :ChainMm9, "#{base}/chainmm9" autoload :ChainMm9Link, "#{base}/chainmm9link" autoload :ChainMonDom4, "#{base}/chainmondom4" autoload :ChainMonDom4Link, "#{base}/chainmondom4link" autoload :ChainPanTro2, "#{base}/chainpantro2" autoload :ChainPanTro2Link, "#{base}/chainpantro2link" autoload :ChainRheMac2, "#{base}/chainrhemac2" autoload :ChainRheMac2Link, "#{base}/chainrhemac2link" autoload :Est, "#{base}/est" autoload :Gap, "#{base}/gap" autoload :Gold, "#{base}/gold" autoload :IntronEst, "#{base}/intronest" autoload :Mrna, "#{base}/mrna" autoload :Rmsk, "#{base}/rmsk" end end end