SynBioHub / synbiohub3

Web application enabling users and software to browse, upload, and share synthetic biology designs. This repository is a redesign of the original SynBioHub using React and Spring Boot.
BSD 2-Clause "Simplified" License
11 stars 0 forks source link

Genbank export not working when annotation has “_0” at the end #630

Open ykho001 opened 6 months ago

ykho001 commented 6 months ago

For objects with an underscore and a number at the end of their displayIds, the genbank export outputs an error message:

Error: java.lang.NumberFormatException: For input string: "_0" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:580) at java.lang.Integer.parseInt(Integer.java:615) at org.sbolstandard.core2.ComponentDefinition$SADisplayIdComparator.compare(ComponentDefinition.java:1116) at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355) at java.util.TimSort.sort(TimSort.java:220) at java.util.Arrays.sort(Arrays.java:1512) at java.util.ArrayList.sort(ArrayList.java:1464) at java.util.Collections.sort(Collections.java:177) at org.sbolstandard.core2.ComponentDefinition.getSortedSequenceAnnotationsByDisplayId(ComponentDefinition.java:1127) at org.sbolstandard.core2.GenBank.recurseComponentDefinition(GenBank.java:796) at org.sbolstandard.core2.GenBank.recurseComponentDefinition(GenBank.java:823) at org.sbolstandard.core2.GenBank.writeComponentDefinition(GenBank.java:109) at org.sbolstandard.core2.GenBank.write(GenBank.java:124) at org.sbolstandard.core2.GenBank.write(GenBank.java:138) at org.sbolstandard.core2.SBOLWriter.write(SBOLWriter.java:231) at org.sbolstandard.core2.SBOLValidate.validate(SBOLValidate.java:2821) at org.sbolstandard.core2.SBOLValidate.validate(SBOLValidate.java:2702) at org.synbiohub.ConvertToGenBankJob.execute(ConvertToGenBankJob.java:27) at org.synbiohub.Main$1.run(Main.java:30) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) at responseCallbacks.(anonymous function) (/synbiohub/lib/java.js:69:16) at DestroyableTransform.javaProcess.stdout.pipe.on (/synbiohub/lib/java.js:40:3) at DestroyableTransform.emit (events.js:182:13) at addChunk (/synbiohub/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:291:12) at readableAddChunk (/synbiohub/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:278:11) at DestroyableTransform.Readable.push (/synbiohub/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:245:10) at DestroyableTransform.Transform.push (/synbiohub/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:148:32) at DestroyableTransform.write [as _transform] (/synbiohub/node_modules/binary-split/index.js:27:14) at DestroyableTransform.Transform._read (/synbiohub/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10) at DestroyableTransform.Transform._write (/synbiohub/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:83) at doWrite (/synbiohub/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:428:64) at writeOrBuffer (/synbiohub/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:417:5) at DestroyableTransform.Writable.write (/synbiohub/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:334:11) at Socket.ondata (_stream_readable.js:666:20) at Socket.emit (events.js:182:13) at addChunk (_stream_readable.js:283:12)

@fxbuson will link addition info on the error message and how it was generated.

fxbuson commented 6 months ago

I got this when making an sbol document with pysbol2 and was trying to mimic the genbank converter (with annotation1, 2, etc...), but with _0, 1, 2... instead of just numbers at the end. I can generate the error again later if needed.