Class: Bio::Assembly::Read::BaseSequence
- Inherits:
-
Object
- Object
- Bio::Assembly::Read::BaseSequence
- Defined in:
- lib/bio-assembly/ace.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#read_name ⇒ Object
Returns the value of attribute read_name.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(from, to, read_name) ⇒ BaseSequence
constructor
A new instance of BaseSequence.
Constructor Details
#initialize(from, to, read_name) ⇒ BaseSequence
Returns a new instance of BaseSequence.
234 235 236 237 238 |
# File 'lib/bio-assembly/ace.rb', line 234 def initialize(from, to, read_name) @from = from @to = to @read_name = read_name end |
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
232 233 234 |
# File 'lib/bio-assembly/ace.rb', line 232 def from @from end |
#read_name ⇒ Object
Returns the value of attribute read_name.
232 233 234 |
# File 'lib/bio-assembly/ace.rb', line 232 def read_name @read_name end |
#to ⇒ Object
Returns the value of attribute to.
232 233 234 |
# File 'lib/bio-assembly/ace.rb', line 232 def to @to end |
Instance Method Details
#<=>(other) ⇒ Object
240 241 242 243 244 245 246 247 248 249 250 |
# File 'lib/bio-assembly/ace.rb', line 240 def <=>(other) unless other.kind_of?(Bio::Assembly::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 |