Ruffus drmaa issue with Python 3

24 views
Skip to first unread message

Chris Rands

unread,
Dec 1, 2016, 5:35:13 AM12/1/16
to ruffus_discuss
I have been following these instructions, with the eventual aim of getting ruffus to work with LSF. However, I've hit a problem, which I suspect is a Python 3 issue, but I don't know how to solve it. I would be very grateful for any help, thank you.

My script:

import glob
from ruffus import *
from ruffus.drmaa_wrapper import run_job, error_drmaa_job
import drmaa
my_drmaa_session
= drmaa.Session()
my_drmaa_session
.initialize()

input_files
= glob.glob('*.txt')
@transform(input_files,suffix('.txt'),'.out')
def test_func(in_file,out_file):
    run_job
('cp {} {}'.format(in_file,out_file),
        job_name
= 'test',
        job_other_options
= '',
        job_script_directory
= ".",
        job_environment
={ 'BASH_ENV' : '~/.bashrc' },
        retain_job_scripts
= True, drmaa_session=my_drmaa_session)

pipeline_run
(test_func, multiprocess = 2, verbose = 6)


The output with error:

________________________________________
Tasks which will be run:


Task enters queue = test_func
    Job  = [1.txt -> 1.out] Missing file
        [1.out]
    Job  = [2.txt -> 2.out] Missing file
        [2.out]
Traceback (most recent call last):
  File "t.py", line 18, in <module>
    pipeline_run(test_func, multiprocess = 2, verbose = 6)
  File "/software/lib/python3.4/site-packages/ruffus/task.py", line 4124, in pipeline_run
    raise job_errors
ruffus.ruffus_exceptions.RethrownJobError:
   
   
   
Original exceptions:

    Exception #1
      'builtins.TypeError('str' does not support the buffer interface)' raised in ...
       Task = def test_func(...):
       Job  = [1.txt -> 1.out]
   
    Traceback (most recent call last):
      File "/software/lib/python3.4/site-packages/ruffus/task.py", line 743, in run_pooled_job_without_exceptions
        return_value =  job_wrapper(param, user_defined_work_func, register_cleanup, touch_files_only)
      File "/software/lib/python3.4/site-packages/ruffus/task.py", line 541, in job_wrapper_io_files
        ret_val = user_defined_work_func(*param)
      File "t.py", line 16, in test_func
        retain_job_scripts = True, drmaa_session=my_drmaa_session)
      File "/software/lib/python3.4/site-packages/ruffus/drmaa_wrapper.py", line 462, in run_job
        return run_job_using_drmaa (cmd_str, job_name, job_other_options, job_script_directory, job_environment, working_directory, retain_job_scripts, logger, drmaa_session, verbose)
      File "/software/lib/python3.4/site-packages/ruffus/drmaa_wrapper.py", line 242, in run_job_using_drmaa
        job_script_path, stdout_path, stderr_path = write_job_script_to_temp_file( cmd_str, job_script_directory, job_name, job_other_options, job_environment, working_directory)
      File "/software/lib/python3.4/site-packages/ruffus/drmaa_wrapper.py", line 189, in write_job_script_to_temp_file
        tmpfile.write( "#!/bin/sh\n" )
      File "/software/lib64/python3.4/tempfile.py", line 399, in func_wrapper
        return func(*args, **kwargs)
    TypeError: 'str' does not support the buffer interface

Reply all
Reply to author
Forward
0 new messages