Start a new topic

Help with creating a CWL tool

From Slack, Jon Klono writes: 

 does someone know how to standard unix commands such as grep in a BDC-SV app? it doesnt seem like this suffices.... (attached, Screenshot 2024-07-24 at 4.27.00.png)

I responded:

That is zgrep, rather than grep, and it will work if the zgrep program is installed in the Docker image you give. zgrep is to grep compressed files, for example .gz files. It uses the same structure as grep, it's just that grep won't work on "zipped" files. Is that what you need?I'm adding a lot of extra stuff here for others, since this is the open PCGC fellows channel. For all:

I really recommend that you follow the Tool Editor tutorial here so that you know how to build your tools out: https://sb-biodatacatalyst.readme.io/docs/tool-editor-tutorial -- this tutorial walks you through all the steps of making a tool.


Here, your docker repository is left blank, and the tool can't run without a docker image. You need one that has zgrep installed. The basic Docker Hub "ubuntu" image does.


As a pro-tip, here's how I check Docker images to see if they have the software I need installed: I load Google Cloud Console, which gives you a web-based terminal that has Docker installed. You can't connect to your Seven Bridges files with this, but you can test out a Docker image and make sure it has the commands you need. I showed you this when I showed you how I was testing out the kbchoi/emase Docker image. 


Here is a step-by-step for how you would do this to see if zgrep is installed on a Docker Image I picked from Docker Hub--https://scribehow.com/shared/Run_Docker_Commands_Using_Google_Cloud_Shell__adDmYQUpQ_mmxU3keZNpTA


For your tool, to get it to run, you need to put this in the Docker repository field: ubuntu:24.10

 ---- 

Jon responded:


Do you need to put something in the Docker repository field to get base docker hub?

zgrep is not in the base image for docker ubuntu but it is in Ubuntu 20.04 base image. Is there a way to call this? I could not find a docker iamge made just for this base Ubuntu command :/

I want to use zgrep so I can create one app with zgrep, instead of making a zless app and then a zgrep app.

---

I responded:


you only have to put "ubuntu:24.10" into the Docker field, because Docker Hub is the default registry for Docker, and this is a Docker Official image. The Pull command is just "pull ubuntu:24.10" -- and the Docker field of the CWL just needs whatever comes after the pull command.

Login or Signup to post a comment