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()
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
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
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
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
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
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
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