module Bio::GFF::GFF3::Escape

Private methods for escaping characters. Internal only. Users should not use this module directly.

Constants

UNSAFE

unsafe characters to be escaped for normal columns

UNSAFE_ATTRIBUTE

unsafe characters to be escaped for attribute columns

UNSAFE_SEQID

unsafe characters to be escaped for seqid columns and target_id of the “Target” attribute

URI_PARSER

(private) URI::Parser object for escape/unescape GFF3 columns

Private Instance Methods

_escape(str, unsafe) click to toggle source

(private) the same as URI::Parser#escape(str, unsafe)

     # File lib/bio/db/gff.rb
1007 def _escape(str, unsafe)
1008   URI_PARSER.escape(str, unsafe)
1009 end
_unescape(str) click to toggle source

(private) the same as URI::Parser#unescape(str)

     # File lib/bio/db/gff.rb
1012 def _unescape(str)
1013   URI_PARSER.unescape(str)
1014 end
column_to_s(str) click to toggle source

If str is empty, returns '.'. Otherwise, returns str.

     # File lib/bio/db/gff.rb
 997 def column_to_s(str)
 998   str = str.to_s
 999   str.empty? ? '.' : str
1000 end
escape(string) click to toggle source

Escape a column according to the specification at song.sourceforge.net/gff3.shtml.

     # File lib/bio/db/gff.rb
1034 def escape(string)
1035   _escape(string, UNSAFE)
1036 end
escape_attribute(string) click to toggle source

Escape attribute according to the specification at song.sourceforge.net/gff3.shtml. In addition to the normal escape rule, the following characters are escaped: “,=;”. Returns the string corresponding to these characters escaped.

     # File lib/bio/db/gff.rb
1049 def escape_attribute(string)
1050   _escape(string, UNSAFE_ATTRIBUTE)
1051 end
escape_seqid(string) click to toggle source

Escape seqid column according to the specification at song.sourceforge.net/gff3.shtml.

     # File lib/bio/db/gff.rb
1040 def escape_seqid(string)
1041   _escape(string, UNSAFE_SEQID)
1042 end
unescape(string) click to toggle source

Return the string corresponding to these characters unescaped

     # File lib/bio/db/gff.rb
1028 def unescape(string)
1029   _unescape(string)
1030 end