Exemple #1
0
def noise_tree_groups(cd, nbs=20, noise=.1, mode='vdps', q=6000, N=14):
    """
    cd : CellDoc other args for noise_tree

    returns a document that contains a KeySet t of documents with "_" a tree2tup
    of a clustering tree, "cell" a cell name from cd, "cond" a condition name.
    These represent the result of running several sample noisy clustering trials
    (as done by noise_tree), and labeling the resulting trees for cell and
    condition

    """
    cn = cd.keys(0, 'cell')
    conds = ['cond1', 'cond2']
    d = gd.Doc()
    names = [cd[cn[0]]['stimclasses'][k]['file'] for k in
             cd[cn[0]]['stimclasses'].keys(sort=True)]
    i = 1
    for cell in cn:
        for cond in conds:
            trees = noise_tree(cd[cell][cond], nbs, noise, mode, q,
                               len(names), False)
            for t in trees:
                d['t%i' % i] = {'_': clust.tree2tup(t), 'cell': cell,
                                'cond': cond}
                i += 1
    d['names'] = names
    return d
Exemple #2
0
 def run(self, pars, out, messages):
     dm = np.array(pars['dm'])
     t = clust.dtree(dm)
     out['tree'] = clust.tree2tup(t)