Class: GFA::Record::Jump
- Inherits:
-
GFA::Record
- Object
- GFA::Record
- GFA::Record::Jump
- Defined in:
- lib/gfa/record/jump.rb
Constant Summary collapse
- CODE =
:J- REQ_FIELDS =
%i[from from_orient to to_orient distance]
- OPT_FIELDS =
{ SC: :i # 1 indicates indirect shortcut connections. Only 0/1 allowed. }
Constants inherited from GFA::Record
Instance Attribute Summary
Attributes inherited from GFA::Record
Instance Method Summary collapse
- #from?(segment, orient = nil) ⇒ Boolean
-
#initialize(from, from_orient, to, to_orient, distance, *opt_fields) ⇒ Jump
constructor
A new instance of Jump.
- #to?(segment, orient = nil) ⇒ Boolean
Methods inherited from GFA::Record
#[], [], #code, code_class, #empty?, #eql?, #hash, name_class, #to_s, #type
Constructor Details
#initialize(from, from_orient, to, to_orient, distance, *opt_fields) ⇒ Jump
Returns a new instance of Jump.
13 14 15 16 17 18 19 20 21 |
# File 'lib/gfa/record/jump.rb', line 13 def initialize(from, from_orient, to, to_orient, distance, *opt_fields) @fields = {} add_field(2, :Z, from, /[!-)+-<>-~][!-~]*/) add_field(3, :Z, from_orient, /[+-]/) add_field(4, :Z, to, /[!-)+-<>-~][!-~]*/) add_field(5, :Z, to_orient, /[+-]/) add_field(6, :Z, distance, /\*|[-+]?[0-9]+/) opt_fields.each { |f| add_opt_field(f, OPT_FIELDS) } end |
Instance Method Details
#from?(segment, orient = nil) ⇒ Boolean
23 24 25 |
# File 'lib/gfa/record/jump.rb', line 23 def from?(segment, orient = nil) links_from_to?(segment, orient, true) end |
#to?(segment, orient = nil) ⇒ Boolean
27 28 29 |
# File 'lib/gfa/record/jump.rb', line 27 def to?(segment, orient = nil) links_from_to?(segment, orient, false) end |