示例#1
0
def umi_hist_facet_stratify(br: CellBranch,
                            facet: str,
                            stratify: str,
                            histtype="step",
                            xlim=(0, 12500),
                            **kwargs):
    # TODO: use subplots outside of loop and return single ax
    for indication, brr in br.groupby(facet):
        print(indication)
        fig, ax = plt.subplots(figsize=(20, 5))
        for lane, brrr in brr.groupby(stratify):
            brrr.rna.hist(bins=200,
                          ax=ax,
                          labels=brrr.meta[stratify],
                          histtype=histtype,
                          **kwargs)
        ax.set_xlim(*xlim)
        plt.show()
示例#2
0
def test_process_aliasing(root_path_2, sample_paths, alias_spec):
    cf = CellBranch.from_input_dirs(root_path_2, sample_paths, spec=alias_spec, mode="rna")
    cf.process.process_1()
    cf.process.process_2()
    return cf
示例#3
0
def test_process_chain(root_path, build_root_fix, process_chain_spec):
    cf = CellBranch(root_dir=root_path, spec=process_chain_spec)
    cf.process.normalize()
    cf.process.test_process()
    return cf
示例#4
0
def test_norm_reduce(root_path, build_root_fix, norm_reduce_spec, test_norm_fix):
    cf = CellBranch(root_dir=root_path, spec=norm_reduce_spec)
    cf.process.reduce()
    return cf
示例#5
0
def test_norm_fix(root_path, build_root_fix, norm_spec):
    cf = CellBranch(root_dir=root_path, spec=norm_spec)
    cf.process.normalize()
    return cf
示例#6
0
def test_from_input_dirs_fix(root_path, sample_paths):
    cf = CellBranch.from_input_dirs(root_path, sample_paths, mode="rna")
    _ = cf.meta
    _ = cf.rna
    return sample_paths
示例#7
0
def test_from_input_dirs_single(root_path, sample_1):
    cf = CellBranch.from_input_dirs(root_path, sample_1, mode="rna")
    _ = cf.meta
    _ = cf.rna
    return sample_1
示例#8
0
def build_root_fix(root_path, metadata):
    cf = CellBranch.from_metadata(root_path, metadata)
    _ = cf.meta
    _ = cf.rna
    assert len(cf.meta.columns) > 0
    return cf