Hey,
I wrote a nice self-containing python in the cwl. How can I include python’s pip requirements: “pip install” before running the script?
I want to keep everything in one script, see below.
Thank you for your help.
Steffen
cwlVersion: v1.0
class: CommandLineTool
baseCommand: ["python", "convert.py"]
inputs:
in_file:
type: File
out_file:
type: string
requirements:
InitialWorkDirRequirement:
listing:
- entryname: convert.py
entry: |-
import numpy as np
data = np.loadtxt('$(inputs.in_file.path)')
with open('$(inputs.out_file)','w') as fOut:
fOut.write("Sum is: "+str(np.sum(data)))
outputs:
outfile:
type: File
outputBinding:
glob: $(inputs.out_file)
The other option is to add a DockerRequirement either pointing to an image with the dependencies installed, or a dockerFile with an inline recipe using the packages you need.
I want to have the cwl applicable for all runners
I don’t know of an image that would fit and I am not too much into docker-recipes that I know how to solve it that way. I am a scipt-kid who hopes the sh-commands does work.