Class: GFA::Record::Jump

Inherits:
GFA::Record show all
Includes:
HasFromTo
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

CODES, TYPES

Instance Attribute Summary

Attributes inherited from GFA::Record

#fields

Instance Method Summary collapse

Methods included from HasFromTo

#from?, #include?, #segment_names_a, #segments, #to?

Methods inherited from GFA::Record

#[], [], #code, code_class, #dup, #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.



17
18
19
20
21
22
23
24
25
# File 'lib/gfa/record/jump.rb', line 17

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