Class: Bio::SRA::Connection
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Bio::SRA::Connection
- Defined in:
- lib/bio/sra/connect.rb
Direct Known Subclasses
Tables::ColDesc, Tables::Experiment, Tables::MetaInfo, Tables::Run, Tables::SRA, Tables::SRAFt, Tables::SRAFtContent, Tables::SRAFtSegDir, Tables::SRAFtSegments, Tables::Sample, Tables::Study, Tables::Submission
Class Method Summary collapse
-
.connect(sra_metadb_path = File.join(File.dirname(__FILE__),'..','..','..','db','SRAmetadb.sqlite')) ⇒ Object
Connect to a metadata database.
Class Method Details
.connect(sra_metadb_path = File.join(File.dirname(__FILE__),'..','..','..','db','SRAmetadb.sqlite')) ⇒ Object
Connect to a metadata database.
-
sra_metadb_path: a path to the gunzipped SRAmetadb.sqlite file which is the database. By default this is in the db/ directory of this gem, but that probably isn’t where the db file is.
You can download the file like so:
$ wget http://watson.nci.nih.gov/~zhujack/SRAmetadb.sqlite.gz
# gunzip SRAmetadb.sqlite.gz
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/bio/sra/connect.rb', line 18 def self.connect(=File.join(File.dirname(__FILE__),'..','..','..','db','SRAmetadb.sqlite')) log = Bio::Log::LoggerPlus['bio-sra'] log.info "Attempting to connect to database #{}" # default: # adapter: sqlite3 # database: db/SRAmetadb.sqlite # pool: 5 # timeout: 5000 = { :adapter => 'sqlite3', :database => , :pool => 5, :timeout => 5000, } establish_connection() end |