In [5]:
import os, os.path
from itertools import groupby
import numpy as np
import csv
os.chdir('/home/will/Dropbox/IpythonShare/HIVCov/')

In [2]:
def fasta_iter(handle):
    
    for key, lines in groupby(handle, lambda x: x.startswith('>')):
        if key:
            name = lines.next().strip()[1:]
        else:
            seq = ''.join(line.strip() for line in lines)
            yield name, seq

In [14]:
with open('gp120.aln') as handle:
    aligns = list(csv.reader(handle, delimiter = '\t'))
names = [n for n, s in aligns]
seqs = [s for n, s in aligns]
align_mat = np.array([list(s) for s in seqs])


Out[14]:
687

In [106]:
from itertools import product
allowed_lets = list('ACDEFGHIKLMNPQRSTVWY')

align_mask = np.array([align_mat == l for l in allowed_lets]).astype(np.float32)

In [107]:
#(lets, seqs, columns)
check_seq = align_mat[:,5]
check_mask = align_mask[:,:,5]

In [24]:
pAbase = align_mask.mean(axis = 1)
pAcheck = pAbase[:,5]

In [71]:
MI = np.zeros((754,))
for x, y in product(range(len(allowed_lets)), repeat = 2):
    if pAcheck[x]==0:
        continue
    
    pXY = (np.tile(check_mask[x,:], (754,1)).T & align_mask[y,:,:]).mean(axis = 0)
    mask = (pAbase[y,:] == 0) | (pXY == 0)
    t = pXY[~mask]*np.log10(pXY[~mask]/(pAcheck[x]*pAbase[y,~mask]))
    if (t != t).any():
        print('breaking')
        break
    MI[~mask] += pXY[~mask]*np.log10(pXY[~mask]/(pAcheck[x]*pAbase[y,~mask]))

In [108]:
def calculate_MI_double(check_mask, pAcheck, align_mask, pAbase, allowed_lets = list('ACDEFGHIKLMNPQRSTVWY')):
    MI = np.zeros((align_mask.shape[2],))
    for x, y in product(range(len(allowed_lets)), repeat = 2):
        if pAcheck[x]==0:
            continue
    
        pXY = (np.tile(check_mask[x,:], (pAbase.shape[1],1)).T * align_mask[y,:,:]).mean(axis = 0)
        mask = (pAbase[y,:] == 0) | (pXY == 0)
        MI[~mask] += pXY[~mask]*np.log10(pXY[~mask]/(pAcheck[x]*pAbase[y,~mask]))
    return MI

In [102]:
dcheck_mask = check_mask.astype(np.float32)
dalign_mask = align_mask.astype(np.float32)

inds = np.arange(check_mask.shape[1])
Tres = calculate_MI_double(dcheck_mask[:,inds], pAcheck, dalign_mask, pAbase)
Rres = np.zeros((100,align_mat.shape[1]))
for rep in range(100):
    np.random.shuffle(inds)
    Rres[rep,:] = calculate_MI_double(dcheck_mask[:,inds], pAcheck, dalign_mask, pAbase)

In [105]:
def calulcate_nullMI(check_mask, pAcheck, align_mask, pAbase, allowed_lets = list('ACDEFGHIKLMNPQRSTVWY'), nreps = 100):
    inds = np.arange(check_mask.shape[1])
    Rres = np.zeros((nreps,align_mat.shape[1]))
    for rep in range(nreps):
        Rres[rep,:] = calculate_MI_double(check_mask[:,inds], pAcheck, align_mask, pAbase)
    return Rres.mean(axis = 0)

In [117]:
#nullInfo = np.zeros((align_mat.shape[1], align_mat.shape[1]))

for col in range(54, align_mat.shape[1]):
    if (col % 100 == 0) | (col == 1) | (col == 5) | (col == 10):
        print(col)
    check_mask = align_mask[:,:,col]
    nullInfo[col,:] = calulcate_nullMI(check_mask, pAcheck, align_mask, pAbase, nreps = 50)


100
200
300
400
500
600
700

In [134]:
check_cols = [(i, align_mask[:,:,i], pAcheck, align_mask, pAbase) for i in range(align_mat.shape[1])]

In [135]:
from IPython.parallel import Client

rc = Client()
lview = rc.load_balanced_view()

In [139]:
@lview.parallel()
def multi_linker(tup):
    col, check_mask, pAcheck, align_mask, pAbase = tup
    return col, calulcate_nullMI(check_mask, pAcheck, align_mask, pAbase, nreps = 50)

In [140]:
larg_res = multi_linker.map(check_cols[:50])

In [141]:
for r in larg_res:
    print(r)


[23:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[27:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[29:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[30:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[22:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[25:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[7:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[2:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[3:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[20:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[17:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[16:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[14:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[13:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[0:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[12:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[8:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[5:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[4:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[1:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[19:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[6:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[15:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[9:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[10:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[21:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[18:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[11:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[26:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[24:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[28:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[31:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[23:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[27:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[29:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[30:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[22:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[25:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[7:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[2:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[3:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[20:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[17:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[16:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[14:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[13:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[0:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[12:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[8:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

[5:apply]: 
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)<string> in <module>()
/usr/local/lib/python3.2/dist-packages/ipython-0.13.1-py3.2.egg/IPython/parallel/client/remotefunction.py in <lambda>(f, *sequences)
    203             if hasattr(self, '_map'):
    204                 if sys.version_info[0] >= 3:
--> 205                     f = lambda f, *sequences: list(map(f, *sequences))
    206                 else:
    207                     f = map
<ipython-input-139-69680802d29a> in multi_linker(tup)
NameError: global name 'calulcate_nullMI' is not defined

In [ ]: