pepkit / looper

A job submitter for Portable Encapsulated Projects
http://looper.databio.org
BSD 2-Clause "Simplified" License
20 stars 7 forks source link

Is there an example dynamic_variables_command_template processor? #275

Closed nsheff closed 4 years ago

nsheff commented 4 years ago

Is there an example of a python script or something for the dynamic_variables_command_template ? I thought we wrote one but now I can't find it...

stolarczyk commented 4 years ago

I wrote a dummy example of such a script some time ago:

#!/usr/bin/env python3

import json
from argparse import ArgumentParser

parser = ArgumentParser(description="Test script")

parser.add_argument("-s", "--size", help="max size", required=True)
parser.add_argument("-g", "--genome", type=str, help="genome", required=True)
parser.add_argument("-m", "--log-file", type=str, help="log_file", required=True)
args = parser.parse_args()

y = json.dumps({
    "cores": "11",
    "mem": "11111",
    "time": "00-11:00:00",
    "logfile": args.log_file
})

print(y)
nsheff commented 4 years ago

yes, this is exactly what I wanted, thanks.