[Biopython] multiprocessing problem with pysam

Brad Chapman chapmanb at 50mail.com
Tue Apr 12 01:31:19 UTC 2011


Michal;

> Thank you for your response. I changed the code in the following way:
[...]
> class Pileup_info():
>     def __init__(pileup_pos, coverage):
>         self.pileup_pos = pileup_pos
>         self.coverage = coverage
> 
>     reads = []
> 
> class Reads_info():
>     def __init__(read_name, read_base):
>         self.read_name = read_name
>         self.read_base = read_base
[...]
> and I have got this error:
[...]
> TypeError: __init__() takes exactly 2 arguments (3 given)
> --------------------------
> 
> What did I do wrong?

You are missing the 'self' argument as the first argument to your
classes:

http://docs.python.org/tutorial/classes.html#random-remarks

As a general principle, I'd recommend testing and getting your code
working as a single process before introducing multiprocessing. The
multiprocessing traces can be messier than the normal beautiful ones
python produces and obscure some problems.

Brad



More information about the Biopython mailing list