Пример #1
0
def parallel_realign_sample(sample_info, parallel_fn):
    """Realign samples, running in parallel over individual chromosomes.
    """
    to_process = []
    finished = []
    for x in sample_info:
        if x[0]["config"]["algorithm"]["snpcall"]:
            to_process.append(x)
        else:
            finished.append(x)
    if len(to_process) > 0:
        file_key = "work_bam"
        split_fn = split_bam_by_chromosome("-realign.bam", file_key, default_targets=["nochr"])
        processed = parallel_split_combine(
            to_process, split_fn, parallel_fn, "realign_sample", "combine_bam", file_key, ["config"]
        )
        finished.extend(processed)
    return finished
Пример #2
0
def parallel_variantcall(sample_info, parallel_fn):
    """Provide sample genotyping, running in parallel over individual chromosomes.
    """
    to_process = []
    finished = []
    for x in sample_info:
        if x[0]["config"]["algorithm"]["snpcall"]:
            to_process.append(x)
        else:
            finished.append(x)
    if len(to_process) > 0:
        split_fn = split_bam_by_chromosome("-variants.vcf", "work_bam")
        processed = parallel_split_combine(to_process, split_fn, parallel_fn,
                                           "variantcall_sample",
                                           "combine_variant_files",
                                           "vrn_file", ["sam_ref", "config"])
        finished.extend(processed)
    return finished
Пример #3
0
def parallel_variantcall(sample_info, parallel_fn):
    """Provide sample genotyping, running in parallel over individual chromosomes.
    """
    to_process = []
    finished = []
    for x in sample_info:
        if x[0]["config"]["algorithm"]["snpcall"]:
            to_process.append(x)
        else:
            finished.append(x)
    if len(to_process) > 0:
        split_fn = split_bam_by_chromosome("-variants.vcf", "work_bam")
        processed = parallel_split_combine(to_process, split_fn, parallel_fn,
                                           "variantcall_sample",
                                           "combine_variant_files",
                                           "vrn_file", ["sam_ref", "config"])
        finished.extend(processed)
    return finished
Пример #4
0
def parallel_realign_sample(sample_info, parallel_fn):
    """Realign samples, running in parallel over individual chromosomes.
    """
    to_process = []
    finished = []
    for x in sample_info:
        if x[0]["config"]["algorithm"]["snpcall"]:
            to_process.append(x)
        else:
            finished.append(x)
    if len(to_process) > 0:
        file_key = "work_bam"
        split_fn = split_bam_by_chromosome("-realign.bam",
                                           file_key,
                                           default_targets=["nochr"])
        processed = parallel_split_combine(to_process, split_fn, parallel_fn,
                                           "realign_sample", "combine_bam",
                                           file_key, ["config"])
        finished.extend(processed)
    return finished