def _get_multiplier(samples): """Get multiplier to get jobs only for samples that have input """ to_process = 1.0 for sample in samples: if dd.get_phenotype(sample[0]) != "control" and dd.get_replicate(sample[0]) == 1: to_process += 1.0 if to_process / len(samples) < 1.0: to_process = 1.0 else: to_process = to_process / len(samples) return to_process
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