# # = AUTOMATIC Table Definition of the Rhesus Jan. 2006 (MGSC Merged 1.0/rheMac2) assembly # Copyright:: Copyright (C) 2011-2017 # MISHIMA, Hiroyuki # # License:: The MIT licence # require "#{::File.dirname(__FILE__)}/table_class_detector" module Bio module Ucsc module RheMac2 CHROMS = %w(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 ||= 'mysql2' @@db_host ||= 'genome-mysql.cse.ucsc.edu' @@db_username ||= 'genome' @@db_password ||= '' @@db_name ||= 'rheMac2' cattr_accessor :db_adapter, :db_host, :db_username, :db_password self.abstract_class = true def self.default @@db_adapter = 'mysql2' @@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__)}/rhemac2" autoload :ChainMm9, "#{base}/chainmm9" autoload :ChainMm9Link, "#{base}/chainmm9link" autoload :ChainPonAbe2, "#{base}/chainponabe2" autoload :ChainPonAbe2Link, "#{base}/chainponabe2link" autoload :ChainRn4, "#{base}/chainrn4" autoload :ChainRn4Link, "#{base}/chainrn4link" end end end