Class: Bio::Assembly::Ace::Read::BaseSequence

Inherits:
Object
  • Object
show all
Defined in:
lib/bio-assembly/ace.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from, to, read_name) ⇒ BaseSequence

Returns a new instance of BaseSequence.



226
227
228
229
230
# File 'lib/bio-assembly/ace.rb', line 226

def initialize(from, to, read_name)
   @from = from
   @to = to
   @read_name = read_name
end

Instance Attribute Details

#fromObject

Returns the value of attribute from.



224
225
226
# File 'lib/bio-assembly/ace.rb', line 224

def from
  @from
end

#read_nameObject

Returns the value of attribute read_name.



224
225
226
# File 'lib/bio-assembly/ace.rb', line 224

def read_name
  @read_name
end

#toObject

Returns the value of attribute to.



224
225
226
# File 'lib/bio-assembly/ace.rb', line 224

def to
  @to
end

Instance Method Details

#<=>(other) ⇒ Object



232
233
234
235
236
237
238
239
240
241
242
# File 'lib/bio-assembly/ace.rb', line 232

def <=>(other)
   unless other.kind_of?(Bio::Assembly::Ace::Read::BaseSequence)
      raise "[Error] markers are not comparable"
   end
   if self.from == other.from
      # sort by to if froms are identical
      return self.to.<=>(other.to)
   else
      return self.from.<=>(other.from)
   end
end