Closed DolapoA closed 5 years ago
How do I parse an argument from the initiation command into one of my process scripts that's in another language like Python.
Initiation cmd: nextflow run /Path/to/myscript.nf --in '/Path/to/MyData'
process dataDirectories {
""" #!/usr/bin/env python2.7 import os import getpass currentUser=getpass.getuser() dataPath="/home/" + currentUser + "/WGS_Data/" + MyData resultsPath="/home/" + currentUser + "/WGS_Results/" + MyData try: os.makedirs(dataPath, 0o777) os.makedirs(resultsPath, 0o777) except: pass """
}
I would like to get the string 'MyData' from the path (which is in my '--in' argument) into my python script. Can this be done?
It's just a matter of string interpolation e.g. "/WGS_Data/${params.in}"
"/WGS_Data/${params.in}"
Ah yes that works thanks bro.
Enjoy
How do I parse an argument from the initiation command into one of my process scripts that's in another language like Python.
Initiation cmd: nextflow run /Path/to/myscript.nf --in '/Path/to/MyData'
process dataDirectories {
}
I would like to get the string 'MyData' from the path (which is in my '--in' argument) into my python script. Can this be done?