def quantitate_expression_noparallel(samples, run_parallel): """ run transcript quantitation for algorithms that don't run in parallel """ data = samples[0][0] if "express" in dd.get_expression_caller(data): samples = run_parallel("run_express", samples) samples = run_parallel("run_dexseq", samples) if "rmats" in dd.get_splicecaller(data): samples = run_parallel("run_rmats", samples) return samples
def splicecall_prepare(data, run_parallel): """Entry point for doing alternative splice callers""" gtf_file = dd.get_gtf_file(data) caller_fns = get_callers() to_process = [] caller = "rmats" for sample in data: if dd.get_replicate(sample[0]) == 1: mimic = copy.copy(sample[0]) if caller in dd.get_splicecaller(sample[0]): if caller in caller_fns and dd.get_phenotype(mimic) != "control": mimic["rmats_fn"] = caller name = dd.get_sample_name(mimic) rep_mimic = _get_replicate_samples(mimic, data) mimic = _get_paired_samples(mimic, data) if mimic: to_process.append(mimic) else: logger.info("Skipping alternative splice calling. No input sample for %s" % name) if to_process: after_process = run_parallel("splicecalling", to_process) data = _sync(data, after_process) return data
def run_rmats(data): """Detect differential alternative splicing by rMATS""" splicecaller = dd.get_splicecaller(data) if "rmats" in splicecaller: data = splice.peakcall_prepare(data) return [[data]]
def _get_splice_file(x, fn_name): """Get peak caller for this file name.""" for caller in dd.get_splicecaller(x): if fn_name.find(caller) > -1: return caller return os.path.basename(fn_name)