Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building database failed #44

Open
stolltho opened this issue May 6, 2020 · 13 comments
Open

Building database failed #44

stolltho opened this issue May 6, 2020 · 13 comments

Comments

@stolltho
Copy link

stolltho commented May 6, 2020

Hi there.
Building a database returns the following error. Any idea what the problem is?
Cheers,
Thomas

[1] TRUE
Warning: replacing previous import ‘XML::xml’ by ‘rvest::xml’ when loading ‘MetaDBparse’
Warning: The 'plotly_click' event tied a source ID of 'A' is not registered. In order to obtain this event data, please add event_register(p, 'plotly_click') to the plot (p) that you wish to obtain event data from.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 162 100 162 0 0 162 0 0:00:01 --:--:-- 0:00:01 252
Warning in utils::unzip(zip.file, exdir = base.loc) :
error 1 in extracting from zip file
Warning in file(con, "r") :
cannot open file 'C:\Users\stoll\Documents\MetaboShiny\databases/hmdb_source/hmdb_metabolites.xml': No such file or directory
Warning: Error in file: cannot open the connection
80: file
79: readLines
78: build.HMDB
77: MetaDBparse::buildBaseDB
73: observeEventHandler [reactive/metabolitedbs.R#333]
2: shiny::runApp
1: start.metshi
[1] "Closing MetaboShiny ~ヾ(^∇^)"

@joannawolthuis
Copy link
Owner

Hi @stolltho ! Thanks for your patience - I've been off for the last while and am returning to work now. Can you check your /databases/hmdb_source folder if there is a zip file in there of approx. 700 MB? Then I can narrow down if it is due to the download failing or being blocked or something :)

@stolltho
Copy link
Author

stolltho commented May 23, 2020 via email

@joannawolthuis
Copy link
Owner

Hi! That is strange, it means the download failed.. Did you try multiple times? And are you working from the docker image or native R (in windows?)

@stolltho
Copy link
Author

stolltho commented May 24, 2020 via email

@joannawolthuis
Copy link
Owner

Hi there! Thanks for the log. It seems that some updates are needed on the database parsing area, which I'm working on now (on a Windows machine) :) Java in R seems to be really tough and requires seperate (non-MetaboShiny) debugging - I think if you go to the repo/help page for rcdklibs they should have something to help you set up. It's very system specific so I cannot help you on the java virtual machine error, unfortunately :( The rest I'm sure I can fix - except that I don't understand why HMDB is not downloading. Let's retry that once I push the next fix for the other databases.

@joannawolthuis
Copy link
Owner

Hi! I pushed an update that should fix all the bugs that I could reproduce (the ones you posted except the HMDB download failing), can you take a look? :)

@joannawolthuis
Copy link
Owner

Whoops, what I meant is please update the MetaDBparse package through
devtools::install_github("joannawolthuis/MetaDBparse")

@jrm5100
Copy link

jrm5100 commented Jun 30, 2020

I found the HMDB issue. The zip file is actually an html file because the download url changed:

<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

You need to validate that you got a good response code when downloading the database to prevent this. However, I did a search and couldn't find any code specifying the url. Is this done in one of the dependencies?

@RuiNascimento
Copy link

I manage to build the HMDB database by changing the build.HMDB function to use wget insted of default utils::download.file download method.
@stolltho and @jrm5100 you can try this temporary fix:

library(MetaDBparse)
trace(build.HMDB, edit = T)

and change line 12 to:
utils::download.file(file.url, zip.file, mode = "wb", cacheOK = TRUE, method = "wget")

then load MetaboShiny and try to build the HMDB database.

I'm using RStudio on Linux dont know if this method is valid for other OS

@joannawolthuis
Copy link
Owner

Hi all! Last time I checked indeed it was not the URL but something else. @RuiNascimento thanks for diving in and finding a fix! I will boot up my Windows PC and check if this works there too, my current is a Mac so I can test on all. :) @jrm5100 I will see if I can add in a response checker ASAP, good point!

@joannawolthuis
Copy link
Owner

Oh and yes the database building code is in a dependency (MetaDBparse) but that is also our package. I'm currently leaving issues for it here, maybe in the future I'll ask people to submit issues at joannawolthuis/MetaDBparse.

@joannawolthuis
Copy link
Owner

It seems I can't reproduce this - but nevertheless I tried setting method = "auto" in all download.file calls in the most recent MetaDBparse version :) If any of you could try updating to see if this works I'd be super grateful!

@RuiNascimento
Copy link

@joannawolthuis (At least on linux) Building the HMDB database works with the new commits on MetaDBparse

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants