Class: Bio::Assembly::Ace::Read::BaseSequence
- Inherits:
-
Object
- Object
- Bio::Assembly::Ace::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.
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
#from ⇒ Object
Returns the value of attribute from.
224 225 226 |
# File 'lib/bio-assembly/ace.rb', line 224 def from @from end |
#read_name ⇒ Object
Returns the value of attribute read_name.
224 225 226 |
# File 'lib/bio-assembly/ace.rb', line 224 def read_name @read_name end |
#to ⇒ Object
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 |