示例#1
0
文件: lane.py 项目: schae234/pypeline
def _build_bowtie2_nodes(config, parameters, input_filename, tags, options):
    if paths.is_paired_end(input_filename):
        input_filename_1 = input_filename_2 = input_filename
    else:
        input_filename_1,  input_filename_2 = input_filename, ""

    params = Bowtie2Node.customize(input_file_1    = input_filename_1.format(Pair = 1),
                                   input_file_2    = input_filename_2.format(Pair = 2),
                                   threads         = config.bowtie2_max_threads,
                                   **parameters)

    params.commands["convert"].set_option('-q', options["Aligners"]["Bowtie2"]["MinQuality"])
    if options["QualityOffset"] == 64:
        params.commands["aln"].set_option("--phred64")
    elif options["QualityOffset"] == 33:
        params.commands["aln"].set_option("--phred33")
    else:
        params.commands["aln"].set_option("--solexa-quals")
    _apply_aln_user_parameters(options["Aligners"]["Bowtie2"], params, ("aln",))

    pg_tag = "bowtie2:CL:%s" % (_build_bowtie_cl_tag(options).replace("%", "%%"),)
    params.commands["convert"].add_option("--update-pg-tag", pg_tag)

    params.commands["aln"].set_option("--rg-id", tags["ID"])
    for tag_name in ("SM", "LB", "PU", "PL", "PG"):
        if tag_name == "PG":
            tag_value = tags["PG"].lower()
        elif tag_name == "PU":
            tag_value = tags["PU_src"]
        else:
            tag_value = tags[tag_name]
        params.commands["aln"].add_option("--rg", "%s:%s" % (tag_name, tag_value))

    return params.build_node()
示例#2
0
def _bowtie2_build_nodes(config, parameters, tags, options):
    params = Bowtie2Node.customize(threads=config.bowtie2_max_threads,
                                   **parameters)

    apply_options(params.commands["aln"], _bowtie2_aln_parameters(options))

    pg_tags = "bowtie2:CL:%s" % (_bowtie2_build_cl_tag(options), )
    _set_rg_tags(params.commands["convert"], tags, pg_tags)

    return params
示例#3
0
def _bowtie2_build_nodes(config, parameters, tags, options):
    params = Bowtie2Node.customize(threads         = config.bowtie2_max_threads,
                                   **parameters)

    apply_options(params.commands["aln"], _bowtie2_aln_parameters(options))

    pg_tags = "bowtie2:CL:%s" % (_bowtie2_build_cl_tag(options),)
    _set_rg_tags(params.commands["convert"], tags, pg_tags)

    return params
示例#4
0
def _bowtie2_aln_pe(config, index):
    node_params = {"input_file_1" : "tests/data/sim_reads/mate_1.fastq.gz",
                   "input_file_2" : "tests/data/sim_reads/mate_2.fastq.gz",
                   "prefix"       : os.path.join(config.destination, "rCRS"),
                   "reference"    : "tests/data/rCRS.fasta",
                   "dependencies" : (config.dependencies, index)}

    standard = Bowtie2Node(output_file = os.path.join(config.destination, "aln_pe_standard", "output.bam"),
                           **node_params)
    custom   = Bowtie2Node.customize(output_file = os.path.join(config.destination, "aln_pe_custom", "output.bam"),
                                     **node_params)
    custom.commands["aln"].set_option("--very-sensitive")

    return MetaNode(description  = "Bowtie2 aln PE",
                    dependencies = [standard, custom.build_node()])
示例#5
0
def _bowtie2_aln_pe(config, index):
    node_params = {
        "input_file_1": "tests/data/sim_reads/mate_1.fastq.gz",
        "input_file_2": "tests/data/sim_reads/mate_2.fastq.gz",
        "prefix": os.path.join(config.destination, "rCRS"),
        "reference": "tests/data/rCRS.fasta",
        "dependencies": (config.dependencies, index)
    }

    standard = Bowtie2Node(output_file=os.path.join(config.destination,
                                                    "aln_pe_standard",
                                                    "output.bam"),
                           **node_params)
    custom = Bowtie2Node.customize(output_file=os.path.join(
        config.destination, "aln_pe_custom", "output.bam"),
                                   **node_params)
    custom.commands["aln"].set_option("--very-sensitive")

    return MetaNode(description="Bowtie2 aln PE",
                    dependencies=[standard, custom.build_node()])
示例#6
0
def _build_bowtie2_nodes(config, parameters, input_filename, tags, options):
    if paths.is_paired_end(input_filename):
        input_filename_1 = input_filename_2 = input_filename
    else:
        input_filename_1, input_filename_2 = input_filename, ""

    params = Bowtie2Node.customize(
        input_file_1=input_filename_1.format(Pair=1),
        input_file_2=input_filename_2.format(Pair=2),
        threads=config.bowtie2_max_threads,
        **parameters)

    params.commands["convert"].set_option(
        '-q', options["Aligners"]["Bowtie2"]["MinQuality"])
    if options["QualityOffset"] == 64:
        params.commands["aln"].set_option("--phred64")
    elif options["QualityOffset"] == 33:
        params.commands["aln"].set_option("--phred33")
    else:
        params.commands["aln"].set_option("--solexa-quals")
    _apply_aln_user_parameters(options["Aligners"]["Bowtie2"], params,
                               ("aln", ))

    pg_tag = "bowtie2:CL:%s" % (_build_bowtie_cl_tag(options).replace(
        "%", "%%"), )
    params.commands["convert"].add_option("--update-pg-tag", pg_tag)

    params.commands["aln"].set_option("--rg-id", tags["ID"])
    for tag_name in ("SM", "LB", "PU", "PL", "PG"):
        if tag_name == "PG":
            tag_value = tags["PG"].lower()
        elif tag_name == "PU":
            tag_value = tags["PU_src"]
        else:
            tag_value = tags[tag_name]
        params.commands["aln"].add_option("--rg",
                                          "%s:%s" % (tag_name, tag_value))

    return params.build_node()