- /*
- * e.g. jvmap_CSQ={ALLELE_NUM=1,CDS_position=249,Codons=caG/caT}
- */
- String trueKey = key
- .substring(FeaturesFile.MAP_ATTRIBUTE_PREFIX.length());
- if (trueKey.isEmpty() || value.isEmpty()
- || !value.get(0).startsWith("{")
- || !value.get(value.size() - 1).endsWith("}"))
- {
- System.err.println("Malformed GFF data '" + value.toString()
- + "' for " + key);
- continue;
- }
- Map<String, String> values = new HashMap<>();
- for (String entry : value)
- {
- if (entry.startsWith("{"))
- {
- entry = entry.substring(1);
- }
- if (entry.endsWith("}"))
- {
- entry = entry.substring(0, entry.length() - 1);
- }
- String[] fields = entry.split(",");
- for (String field : fields)
- {
- String[] keyValue = field.split("=");
- if (keyValue.length == 2)
- {
- String theKey = StringUtils.urlDecode(keyValue[0],
- GFF_ENCODABLE);
- String theValue = StringUtils.urlDecode(keyValue[1],
- GFF_ENCODABLE);
- values.put(theKey, theValue);
- }
- }
- }
- sf.setValue(trueKey, values);
+ key = key.substring(FeaturesFile.MAP_ATTRIBUTE_PREFIX.length());
+ Map<String, String> valueMap = parseAttributeMap(values);
+ sf.setValue(key, valueMap);