Class: Bio::FinishM::ConnectionInterpreter::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/assembly/connection_interpreter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#distanceObject

Returns the value of attribute distance.



250
251
252
# File 'lib/assembly/connection_interpreter.rb', line 250

def distance
  @distance
end

#probe1Object

Probe objects



248
249
250
# File 'lib/assembly/connection_interpreter.rb', line 248

def probe1
  @probe1
end

#probe2Object

Probe objects



248
249
250
# File 'lib/assembly/connection_interpreter.rb', line 248

def probe2
  @probe2
end

Instance Method Details

#to_sObject



252
253
254
# File 'lib/assembly/connection_interpreter.rb', line 252

def to_s
  [@probe1, @probe2].join('/')+":#{@distance}"
end

#to_settableObject



256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/assembly/connection_interpreter.rb', line 256

def to_settable
  if @probe1.sequence_index < @probe2.sequence_index
    return [@probe1.to_settable, @probe2.to_settable].flatten
  elsif @probe1.sequence_index == @probe2.sequence_index
    if @probe1.side < @probe2.side
      return [@probe1.to_settable, @probe2.to_settable].flatten
    else
      return [@probe2.to_settable, @probe1.to_settable].flatten
    end
  else
    return [@probe2.to_settable, @probe1.to_settable].flatten
  end
end