Closed magagranados closed 1 year ago
This sounds like Shiny app problem. I transfer the issue there.
Hey @magagranados, thanks for letting us know about this. Can you share the spc file that is causing the issue? It is challenging for us to debug without the file that crashes the server.
Hi, here is an example SPC-2.zip
Thank you @magagranados. @zsteinmetz, this actually seems like a problem with the package read_any function, getting this error from the function:
Error in gsub(rawToChar(replace.nul), "\r\n", log.txt) :
'pattern' is invalid
In addition: Warning message:
In gsub(rawToChar(replace.nul), "\r\n", log.txt) :
unable to translate '<ff>' to a wide string
Unfortunately the issue is coming from the read.spc()
from hyperSpec. We will need to rewrite their source code to fix it which will likely take us some time because a lot of these unique file formats are tricky to convert. We should be handling the errors better though instead of letting the app crash and I can work on that for the shiny app sooner rather than later. @magagranados, for now I recommend converting your file into a different format using another software. We have some instructions about how you can use spectragryph to transform your files in our vignette towards the end: https://cran.r-project.org/web/packages/OpenSpecy/vignettes/sop.html
We should be handling the errors better though instead of letting the app crash and I can work on that for the shiny app sooner rather than later.
Agree, @wincowgerDEV. Should we keep the issue here until then?
Instead of trying to completely rewrite their code, I suggest to first approach the hyperSpec maintainers. They have discussed similar issues already; see for instance https://github.com/r-hyperspec/hyperSpec/issues/80 which might soon be fixed with this PR: https://github.com/r-hyperspec/hySpc.read.spc/pull/22
@magagranados would you mind open another issue at https://github.com/r-hyperspec/hySpc.read.spc/issues. If they can fix it, we can benefit from it downstream.
Agree, @wincowgerDEV. Should we keep the issue here until then?
Instead of trying to completely rewrite their code, I suggest to first approach the hyperSpec maintainers. They have discussed similar issues already; see for instance r-hyperspec/hyperSpec#80 which might soon be fixed with this PR: r-hyperspec/hySpc.read.spc#22
Yeah I think it is fine to keep the issue here and we will close it once we fix the bug in the app. Agreed, it seems like hyperSpec is putting in work right now, likely a ton of new features and bug fixes coming down the pipeline.
Now catching the incompatible file types with an error message instead of a crash https://github.com/wincowgerDEV/OpenSpecy-shiny/commit/311a1c4216aa66b0a5ffc86366d3e4056595800c
Guidelines
Project Version
No response
Platform and OS Version
No response
Existing Issues
No response
What happened?
After I upload a spectrum, I am disconnected from the server and the page requests me to reload. I cannot compare or analyze any spectrum in SPC format.
Steps to reproduce
Expected behavior
It is expected that after I upload the spectrum, I can preprocess and identify the particle spectrum
Attachments
No response
Screenshots or Videos
Additional Information
No response