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
(private) the same as URI::Parser#escape(str, unsafe)
# File lib/bio/db/gff.rb, line 1005 def _escape(str, unsafe) URI_PARSER.escape(str, unsafe) end
(private) the same as URI::Parser#unescape(str)
# File lib/bio/db/gff.rb, line 1010 def _unescape(str) URI_PARSER.unescape(str) end
If str is empty, returns '.'. Otherwise, returns str.
# File lib/bio/db/gff.rb, line 995 def column_to_s(str) str = str.to_s str.empty? ? '.' : str end
Escape a column according to the specification at song.sourceforge.net/gff3.shtml.
# File lib/bio/db/gff.rb, line 1032 def escape(string) _escape(string, UNSAFE) end
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, line 1047 def escape_attribute(string) _escape(string, UNSAFE_ATTRIBUTE) end
Escape seqid column according to the specification at song.sourceforge.net/gff3.shtml.
# File lib/bio/db/gff.rb, line 1038 def escape_seqid(string) _escape(string, UNSAFE_SEQID) end
Return the string corresponding to these characters unescaped
# File lib/bio/db/gff.rb, line 1026 def unescape(string) _unescape(string) end