Skip to content

Commit df591fd

Browse files
jamesmorrisjamesmorris
authored andcommitted
Set if a db_xref qualifier requires quotes
1 parent fc978f7 commit df591fd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

biojava-core/src/main/java/org/biojava/nbio/core/sequence/io/GenbankSequenceParser.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,10 @@ private void parseFeatureTag(List<String[]> section) {
203203
Boolean needsQuotes = false;
204204
key = key.substring(1); // strip leading slash
205205
val = val.replaceAll("\\s*[\\n\\r]+\\s*", " ").trim();
206+
206207
if (val.endsWith("\"")) {
207208
val = val.substring(1, val.length() - 1); // strip quotes
208-
needsQuotes = true; // as the value has quotes then set that it needs quotes when written back out
209+
needsQuotes = true; // as the value has quotes then set that it needs quotes when written back out
209210
}
210211
// parameter on old feature
211212
if (key.equals("db_xref")) {
@@ -214,6 +215,7 @@ private void parseFeatureTag(List<String[]> section) {
214215
String dbname = m.group(1);
215216
String raccession = m.group(2);
216217
DBReferenceInfo xref = new DBReferenceInfo(dbname, raccession);
218+
xref.setNeedsQuotes(needsQuotes);
217219
gbFeature.addQualifier(key, xref);
218220

219221
ArrayList<DBReferenceInfo> listDBEntry = new ArrayList<>();

0 commit comments

Comments
 (0)