Hi all, trying to run a python code (not mine) that used a function generate_index(arg). The arg function is actually meant to have 5 parts (host, graft, index, memory, and threads) and these components are called later in the function as arg.host, arg.graft...etc.
Probably a dumb question, but how can i input these five variables into the function? when I separate by commas, i get an error saying only expected one variable. I tried adding a double asterisk to before the variable arg, but this did not help either...
Relevant introduction to the Code as below and is from the xenocell repository:
Probably a dumb question, but how can i input these five variables into the function? when I separate by commas, i get an error saying only expected one variable. I tried adding a double asterisk to before the variable arg, but this did not help either...
Relevant introduction to the Code as below and is from the xenocell repository:
def generate_index(**args): print_header(args) print_log('Generate index...') create_directory(args.output) run_xenome(args) print_log('Generation of Xenome index finished!') # def print_header(args): header = '''##----------------------------------------------------------------------------## ## XenoCell: Generate Xenome index of reference genomes. ##----------------------------------------------------------------------------## ## FASTA of host reference genome: {host} ## FASTA of graft reference genome: {graft} ## Output directory: {output} ## Number of threads: {threads} ## Memory in GB: {memory} ##----------------------------------------------------------------------------##'''.format( host = args.host, graft = args.graft, output = args.output, threads = args.threads, memory = args.memory
Larz60+ write Oct-19-2023, 10:37 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Modified for you this time. Please use BBCode tags on future posts.
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Modified for you this time. Please use BBCode tags on future posts.