+ /**
+ * Escape the given value to VCF standard.
+ *
+ * @param value
+ * the value to escape
+ *
+ * @return the escaped value
+ */
+ protected String escape(String value) {
+ if (value == null)
+ return null;
+
+ return value.replaceAll(",", "\\\\,").replaceAll(";", "\\\\;")
+ .replaceAll("\n", "\\\\n");
+ }
+
+ /**
+ * Escape the given value to VCF standard.
+ *
+ * @param value
+ * the value to escape
+ *
+ * @return the escaped value
+ */
+ protected String unescape(String value) {
+ if (value == null)
+ return null;
+
+ return value.replaceAll("\\\\,", ",").replaceAll("\\\\;", ";")
+
+ .replaceAll("\\\\n", "\n");
+ }
+