Unable to extract results/outputs of the tool

Posted in Add your tools by Aleš Papič Mon Jul 30 2018 09:10:53 GMT+0000 (UTC)·1·Viewed 36 times

Hi, I've built a simple tool using R, pushed it to the CGC repository and ran it. However, I have an issue with retrieving the outputs. It seems as the system cannot find them. For now, the tool produces two files: one called model.pdf and another model.txt. I set the glob values (outputs tab in the tool editor) to model.pdf and model.txt since their names are static. My initial thought of the issue was a wrong working directory. I couldn't find more details in the documentation. - How do I know, what is the working directory of the tool for the current analysis? Can I extract this information from the job or self variable? - Should provide information to mount specific directory? - What else could be wrong? For instance, I can successfully retrieve the stdout.txt (caught standard output) file. Also, the job.tree.log file shows stdout.txt available but no model.pdf nor model.txt. Thank you for the help.
Natasa Bezmarevic
Aug 1, 2018

Hi Ales,

I am Natasa from Seven Bridges Genomics Support team.

Regarding your questions I've consulted our bioinformaticians and when creating an app you could add your R script by going to the general page and create files ( bottom left). Click on a plus sign and then you will get two fields to introduce your script name and file content (click on A and an editor will appear where you could write or paste your script). That way, when you write Rscript your_script_name.R on the command line, the script will be executed from the current working directory(CWD). Unless you provide a path where you save model.pdf it will be saved in the CWD.

If your R script is coded to save files in a given directory or it is already in your docker image so it saves files in that directory you could do the following: Save the app's CWD as a bash variable and then copy your files to that folder once your script is done. (Base Command Example for unix docker images: dir=$(pwd) && Rscript yourScript.R inputs && cp outputs $dir). This solution is not recommended and we suggest that use it unless it is too complicated to change the output paths.

Hope this information helps, if you need anything else, let me know.

Best regards,

Markdown is allowed