Class: GFA::Record::Link

Inherits:
GFA::Record show all
Includes:
HasFromTo
Defined in:
lib/gfa/record/link.rb

Constant Summary collapse

CODE =
:L
REQ_FIELDS =
%i[from from_orient to to_orient overlap]
OPT_FIELDS =
{
  MQ: :i, # Mapping quality
  NM: :i, # Number of mismatches/gaps
  EC: :i, # Read count
  FC: :i, # Fragment count
  KC: :i, # k-mer count
  ID: :Z  # Edge identifier
}

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, overlap, *opt_fields) ⇒ Link

Returns a new instance of Link.



22
23
24
25
26
27
28
29
30
# File 'lib/gfa/record/link.rb', line 22

def initialize(from, from_orient, to, to_orient, overlap, *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, overlap,     /\*|([0-9]+[MIDNSHPX=])+/)
  opt_fields.each { |f| add_opt_field(f, OPT_FIELDS) }
end