예제 #1
0
def process_fastq(bc, ref_index, cur_config, config, config_file):
    do_realignment = config["algorithm"].get("realignment", "")
    do_kmercorrect = config["algorithm"].get("kmer_correct", "")
    trim_three = config["algorithm"].get("trim_three", "")
    picard = broad.runner_from_config(config)
    in_file = bc["file"]
    if trim_three:
        in_file = trim_fastq(in_file, three=int(trim_three))
    if do_kmercorrect:
        in_file = remove_ns(in_file)
        in_file = kmer_filter(in_file, do_kmercorrect, config)
    unique_file = uniquify_bioplayground(in_file, config)
    align_sam = novoalign.align(config["dir"]["align"], ref_index, unique_file,
                                qual_format=cur_config.get("format", None))
    align_bam = sam_to_sort_bam(align_sam, config["ref"], unique_file, None,
                                "", bc["name"], config)
    if do_realignment == "gatk":
        align_bam = gatk_realigner(align_bam, config["ref"], config, deep_coverage=True)
    picard.run_fn("picard_index", align_bam)
    if config["algorithm"].get("range_params", None):
        call_analyze_multiple(align_bam, bc, in_file, config)
    else:
        call_bases_and_analyze(align_bam, bc, in_file, config)
예제 #2
0
def process_fastq(in_file, ref_index, cur_config, config, config_file):
    do_realignment = config["algorithm"].get("realignment", "")
    do_kmercorrect = config["algorithm"].get("kmer_correct", "")
    trim_three = config["algorithm"].get("trim_three", "")
    picard = BroadRunner(config["program"]["picard"], config["program"]["gatk"],
                         config["algorithm"]["java_memory"])
    if trim_three:
        in_file = trim_fastq(in_file, three=int(trim_three))
    if do_kmercorrect:
        in_file = remove_ns(in_file)
        in_file = kmer_filter(in_file, do_kmercorrect, config)
    unique_file = uniquify_bioplayground(in_file, config)
    align_sam = novoalign.align(config["dir"]["align"], ref_index, unique_file,
                                qual_format=cur_config.get("format", None))
    align_bam = to_bamsort(align_sam, unique_file, config, config_file)
    if do_realignment == "gatk":
        picard.run_fn("picard_index", align_bam)
        align_bam = picard.run_fn("gatk_realigner", align_bam, config["ref"],
                                  deep_coverage=True)
    picard.run_fn("picard_index", align_bam)
    if config["algorithm"].get("range_params", None):
        call_analyze_multiple(align_bam, in_file, config)
    else:
        call_bases_and_analyze(align_bam, in_file, config)