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 1007 def _escape(str, unsafe) 1008 URI_PARSER.escape(str, unsafe) 1009 end
(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
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
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 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 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
Return the string corresponding to these characters unescaped
# File lib/bio/db/gff.rb 1028 def unescape(string) 1029 _unescape(string) 1030 end