Class: SequenceServer::Sequence::Retriever

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/sequenceserver/sequence.rb

Overview

Retrieve sequences from BLAST databases.

Defined Under Namespace

Modules: IO

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sequence_ids, database_ids, in_file = false) ⇒ Retriever

Returns a new instance of Retriever


167
168
169
170
171
172
173
# File 'lib/sequenceserver/sequence.rb', line 167

def initialize(sequence_ids, database_ids, in_file = false)
  @sequence_ids = Array sequence_ids
  @database_ids = Array database_ids
  @in_file = in_file

  validate && run
end

Instance Attribute Details

#database_idsObject (readonly)

Returns the value of attribute database_ids


175
176
177
# File 'lib/sequenceserver/sequence.rb', line 175

def database_ids
  @database_ids
end

#in_fileObject (readonly)

Returns the value of attribute in_file


175
176
177
# File 'lib/sequenceserver/sequence.rb', line 175

def in_file
  @in_file
end

#sequence_idsObject (readonly)

Returns the value of attribute sequence_ids


175
176
177
# File 'lib/sequenceserver/sequence.rb', line 175

def sequence_ids
  @sequence_ids
end

#sequencesObject (readonly)

Returns the value of attribute sequences


177
178
179
# File 'lib/sequenceserver/sequence.rb', line 177

def sequences
  @sequences
end

Instance Method Details

#to_jsonObject


179
180
181
182
183
184
# File 'lib/sequenceserver/sequence.rb', line 179

def to_json
  {
    :error_msgs => error_msgs,
    :sequences  => sequences.map(&:info)
  }.to_json
end