module RGFA::FieldWriter

Methods to convert ruby objects to the GFA string representations @api private

The default conversion is implemented in this module, which is included in Object; single classes may overwrite the following methods, if necessary:

Public Instance Methods

default_gfa_datatype() click to toggle source

@!macro [new] gfa_datatype

Optional field GFA datatype to use, if none is provided
@return [RGFA::Line::FIELD_DATATYPE]
@api private
# File lib/rgfa/field_writer.rb, line 43
def default_gfa_datatype; :Z; end
to_gfa_field(datatype: nil) click to toggle source

@!macro [new] to_gfa_field

Representation of the data for GFA fields; this method
does not (in general) validate the string. The method
can be overwritten for a given class, and may take
the {#default_gfa_datatype} into consideration.
@return [String]
@api private
# File lib/rgfa/field_writer.rb, line 28
def to_gfa_field(datatype: nil); to_s; end
to_gfa_optfield(fieldname, datatype: default_gfa_datatype) click to toggle source

Representation of the data as an optional field @param fieldname [Symbol] the tag name @param datatype [RGFA::Line::OPTFIELD_DATATYPE] (<i>defaults to: the value

returned by {#default_gfa_datatype}</i>)

@api private

# File lib/rgfa/field_writer.rb, line 35
def to_gfa_optfield(fieldname, datatype: default_gfa_datatype)
  return "#{fieldname}:#{datatype}:#{to_gfa_field(datatype: datatype)}"
end