You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
String Formatter error when key or value of Qualifier has character "%" #886
feature.addQualifier("note", new Qualifier("note", "coding sequ%_ece", true));
GenbankWriterHelper.writeNucleotideSequence(......)
Exception in thread "main" java.util.UnknownFormatConversionException: Conversion = '_'
at java.util.Formatter.checkText(Formatter.java:2579)
at java.util.Formatter.parse(Formatter.java:2555)
at java.util.Formatter.format(Formatter.java:2501)
at java.io.PrintWriter.format(PrintWriter.java:905)
at org.biojava.nbio.core.sequence.io.GenbankWriter.process(GenbankWriter.java:95)
at org.biojava.nbio.core.sequence.io.GenbankWriterHelper.writeNucleotideSequence(GenbankWriterHelper.java:135)
at GenBank.main(GenBank.java:41)
I think it probably makes sense for BioJava to handle the escaping rather than forcing the user to do it.
Actually, I don't understand why format is getting called in GenbankWriter.java:95 as all. Does calling PrintWriter.format(s) have any effect without additional arguments? It seems like all the formatting (and escaping) should be done within GenericGenbankHeaderFormat.
@emckee2006 Is there any reason why those couldn't be moved inside the HeaderFormat? It would still require escaping some sequences, but at least it only has to happen once.
Activity
enilapb commentedon Sep 23, 2020
Have you tested doubling %% to scape % ?
sbliven commentedon Sep 25, 2020
I think it probably makes sense for BioJava to handle the escaping rather than forcing the user to do it.
Actually, I don't understand why format is getting called in GenbankWriter.java:95 as all. Does calling PrintWriter.format(s) have any effect without additional arguments? It seems like all the formatting (and escaping) should be done within GenericGenbankHeaderFormat.
emckee2006 commentedon Sep 25, 2020
sbliven commentedon Sep 25, 2020
@emckee2006 Is there any reason why those couldn't be moved inside the HeaderFormat? It would still require escaping some sequences, but at least it only has to happen once.
jamesmorris commentedon Jul 1, 2021
Hello, I have recently come across this issue myself. Is anybody currently working on a fix for this problem?
If not I am happy to have a go at proposing a solution
josemduarte commentedon Jul 1, 2021
Thanks @jamesmorris , I don't think anyone is working on it. We're always happy with pull requests :)
emckee2006 commentedon Jul 1, 2021
Merge pull request #1034 from jamesmorris/master
Fixed issue biojava#886 by escaping percent symbols when feature attr…
Added test for issue biojava#886
Merge pull request biojava#1034 from jamesmorris/master