brittneybrinsfield / pysam

Automatically exported from code.google.com/p/pysam
0 stars 0 forks source link

Problems using pysam in combination with python-pp #105

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use the python-pp package for parallelization
2. try to run pysam.sort in parallel on different bam files

What is the expected output? What do you see instead?
The expected output are the bam files in sorted state
Instead there is the following error message:
An error has occured during the function execution
Traceback (most recent call last):
  File "/home/<user>/.local/lib/python2.6/site-packages/ppworker.py", line 90, in run
    __result = __f(*__args)
  File "<string>", line 2, in sortBam
  File "/home/<user>/project/tools/python_packages/lib/python2.6/site-packages/pysam-0.6-py2.6-linux-x86_64.egg/pysam/__init__.py", line 50, in __call__
    retval, stderr, stdout = csamtools._samtools_dispatch( self.dispatch, args )
  File "csamtools.pyx", line 2860, in csamtools._samtools_dispatch (pysam/csamtools.c:26160)
AttributeError: StringIO instance has no attribute 'fileno'

What version of the product are you using? On what operating system?
I'm using samtools Version: 0.1.18 (r982:295), and
pysam version 0.6

Please provide any additional information below.
The code i implemented is the following:
import pp
import pysam

def sortBam(bam_filepath, out_prefix):
  pysam.sort(bam_filepath, out_prefix)

job_server = pp.Server(ncpus=2, ppservers = (), secret='secret')

job1 = job_server.submit(sortBam, ('<in1.bam>', '<out_prefix1>'), 
modules=('pysam',))
job2 = job_server.submit(sortBam, ('<in2.bam>', '<out_prefix2>'), 
modules=('pysam',))

result1 = job1()
result2 = job2()

Original issue reported on code.google.com by matthias...@googlemail.com on 18 Oct 2012 at 4:58

GoogleCodeExporter commented 9 years ago
Thanks!

Fixed in a sense that it now runs, but I haven't tested if any output on stdout 
would be communicated correctly.

Best wishes,
Andreas

Original comment by andreas....@gmail.com on 21 Nov 2012 at 4:11