My collection displays as a python object, not files paths

Hello,

I’m testing a tool I’m developing using Planemo. This tool tries to access files of a collection but when trying to do that I get this error:

Error in file(file, "rt") : cannot open the connection
Calls: read.table -> file
In addition: Warning message:
In file(file, "rt") :
  cannot open file '<galaxy.tools.wrappers.DatasetCollectionWrapper object at 0x7c6f187a6070>': No such file or directory

It seems to be a python object. Here is the piece of code where it occurs:

preds_path <- args[2]
data_split = str_split(preds_path, ",")
preds.data = NULL
for (i in 1:length(data_split[[1]])) {
  df <- read.table(data_split[[1]][i], dec=".", sep="\t", header=T, na.strings="NA")
  preds.data <- rbind(preds.data, df)
}

and the xml input:
<param name="preds" type="data_collection" collection_type="list" format="tabular" multiple="true" label="BRT prediction files (collection of tabular)"/>

I fixed it by changing the type from ‘data_collection’ to just ‘data’ and removing collection_type.

1 Like

Great, thanks for posting back what worked!

1 Like