示例#1
0
def _maybe_add_peaks(algorithm, sample, out):
    for caller in dd.get_peakcaller(sample):
        out_dir = os.path.join(dd.get_work_dir(sample), caller, dd.get_sample_name(sample))
        if os.path.exists(out_dir):
            out.append({"path": out_dir,
                        "type": "directory",
                        "ext": caller})
    return out
示例#2
0
def peakcall_prepare(data, run_parallel):
    """Entry point for doing peak calling"""
    caller_fns = get_callers()
    to_process = []
    for sample in data:
        mimic = copy.copy(sample[0])
        for caller in dd.get_peakcaller(sample[0]):
            if caller in caller_fns and dd.get_phenotype(mimic) == "chip":
                mimic["peak_fn"] = caller
                name = dd.get_sample_name(mimic)
                mimic = _get_paired_samples(mimic, data)
                if mimic:
                    to_process.append(mimic)
                else:
                    logger.info("Skipping peak calling. No input sample for %s" % name)
    if to_process:
        after_process = run_parallel("peakcalling", to_process)
        data = _sync(data, after_process)
    return data
示例#3
0
def peakcall_prepare(data, run_parallel):
    """Entry point for doing peak calling"""
    caller_fns = get_callers()
    to_process = []
    for sample in data:
        mimic = copy.copy(sample[0])
        for caller in dd.get_peakcaller(sample[0]):
            if caller in caller_fns and dd.get_phenotype(mimic) == "chip":
                mimic["peak_fn"] = caller
                name = dd.get_sample_name(mimic)
                mimic = _get_paired_samples(mimic, data)
                if mimic:
                    to_process.append(mimic)
                else:
                    logger.info(
                        "Skipping peak calling. No input sample for %s" % name)
    if to_process:
        after_process = run_parallel("peakcalling", to_process)
        data = _sync(data, after_process)
    return data
示例#4
0
def peakcall_prepare(data, run_parallel):
    """Entry point for doing peak calling"""
    caller_fns = get_callers()
    to_process = []
    for sample in data:
        mimic = copy.copy(sample[0])
        callers = dd.get_peakcaller(sample[0])
        if not isinstance(callers, list):
            callers = [callers]
        for caller in callers:
            if caller in caller_fns:
                mimic["peak_fn"] = caller
                name = dd.get_sample_name(mimic)
                mimic = _check(mimic, data)
                if mimic:
                    to_process.append(mimic)
                else:
                    logger.info("Skipping peak calling. No input sample for %s" % name)
    if to_process:
        after_process = run_parallel("peakcalling", to_process)
        data = _sync(data, after_process)
    return data
示例#5
0
def peakcall_prepare(data, run_parallel):
    """Entry point for doing peak calling"""
    caller_fns = get_callers()
    to_process = []
    for sample in data:
        mimic = copy.copy(sample[0])
        callers = dd.get_peakcaller(sample[0])
        if not isinstance(callers, list):
            callers = [callers]
        for caller in callers:
            if caller in caller_fns:
                mimic["peak_fn"] = caller
                name = dd.get_sample_name(mimic)
                mimic = _check(mimic, data)
                if mimic:
                    to_process.append(mimic)
                else:
                    logger.info("Skipping peak calling. No input sample for %s" % name)
    if to_process:
        after_process = run_parallel("peakcalling", to_process)
        data = _sync(data, after_process)
    return data
示例#6
0
def _get_peak_file(x, fn_name):
    """Get peak caller for this file name."""
    for caller in dd.get_peakcaller(x):
        if fn_name.find(caller) > -1:
            return caller
    return os.path.basename(fn_name)
示例#7
0
def _get_peak_file(x, fn_name):
    """Get peak caller for this file name."""
    for caller in dd.get_peakcaller(x):
        if fn_name.find(caller) > -1:
            return caller
    return os.path.basename(fn_name)