Can't upload data with gx_get() in Rstudio tool or install GalaxyConnect into desktop R Studio

Hello,

I’m trying to follow this tutorial that uses gx_get() to upload datafiles from my history (Galaxy) into the RStudio interactive tool. I’ve created multiple histories and restarted the Rstudio tool multiple times and keep getting the same debug error message pictured below.

Even thought the import 1 ect message will pop up, no data files are being imported as far as I can tell.
I tried to switch to using my desktop R studio and cannot get Galaxy Connector to install there to use gx_get(). I also get an error message that the package has a non zero exit.

I’ve seen others with this problem on the forum but a solution has not been posted.

Any idea why this is happening? I could not get the Rstudio tool to launch on the usegalaxy.org site at all. I’m not sure if that’s related.

-Thanks for your help!
Sarah

1 Like

Welcome, @sfer3175

I can reproduce the launching issue at UseGalaxy.org and opened a ticket for the fix here: Rstudio fails to launch at ORG · Issue #681 · galaxyproject/usegalaxy-tools · GitHub

For a local configuration, let’s get some help with the Galaxy Connector at the developers chat. They may reply here or there, and you are welcome to join the chat tool! You're invited to talk on Matrix

Updated: See solution reply instead. When I tried using Rstudio at UseGalaxy.eu directly, the gx_get() function failed the same way your query did, so the problem seems to be with Galaxy Connector. The developers can help us to confirm. Also going to ping a few of them here in case I missed something else: @wm75 @bernt-matthias

Thanks for reporting the problem!

Even thought the import 1 ect message will pop up, no data files are being imported as far as I can tell.

There isn’t anything wrong here, but you need to assign the return value to some variable to be able to work with it, e.g.,

my_data <- gx_get(2)

Note: gx_get() makes the specified data available inside RStudio, but what’s returned by it is just a path to the data, for example the string "/import/2".

With this path you can then read from the resource with R functions that you’d normally use to read your input, e.g., if your data is tabular you could do sth like:

read.table(my_data, header=T, sep="\t", row.names = 1)

which in this case is equivalent to:

read.table("/import/2", header=T, sep="\t", row.names = 1)

2 Likes

Thanks @wm75

For some reason I always forget that the data isn’t moved directly into the environment with gx_get()! I expect it to work like gx_put() in the reverse. Maybe we need another variable … something like gx_fetch(). I’ll propose an enhancement.

Thank you so much! I was totally stuck and was missing this info.

Rsutdio is available at UseGalaxy.org as of later yesterday. Thanks for all who reported the problem, and who fixed it up!