How to use the pypeline.common.utilities.set_in function in Pypeline

To help you get started, we’ve selected a few Pypeline examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MikkelSchubert / paleomix / pypeline / commands / sam_to_bam.py View on Github external
def call(min_quality, exclude_flags, flag_as_sorted):
    input_file = pysam.Samfile("-", "r")
    header = input_file.header
    if flag_as_sorted:
        set_in(header, ("HD", "SO"), "coordinate")
        set_in(header, ("HD", "GO"), "none")
        set_in(header, ("HD", "VN"), "1.0")

    output_file = pysam.Samfile("-", "wb", header = header)
    for read in input_file:
        if read.flag & exclude_flags:
            continue
        elif read.mapq < min_quality:
            continue
               
        output_file.write(read)
    output_file.close()
    input_file.close()
github MikkelSchubert / paleomix / pypeline / commands / sam_to_bam.py View on Github external
def call(min_quality, exclude_flags, flag_as_sorted):
    input_file = pysam.Samfile("-", "r")
    header = input_file.header
    if flag_as_sorted:
        set_in(header, ("HD", "SO"), "coordinate")
        set_in(header, ("HD", "GO"), "none")
        set_in(header, ("HD", "VN"), "1.0")

    output_file = pysam.Samfile("-", "wb", header = header)
    for read in input_file:
        if read.flag & exclude_flags:
            continue
        elif read.mapq < min_quality:
            continue
               
        output_file.write(read)
    output_file.close()
    input_file.close()
github MikkelSchubert / paleomix / pypeline / commands / sam_to_bam.py View on Github external
def call(min_quality, exclude_flags, flag_as_sorted):
    input_file = pysam.Samfile("-", "r")
    header = input_file.header
    if flag_as_sorted:
        set_in(header, ("HD", "SO"), "coordinate")
        set_in(header, ("HD", "GO"), "none")
        set_in(header, ("HD", "VN"), "1.0")

    output_file = pysam.Samfile("-", "wb", header = header)
    for read in input_file:
        if read.flag & exclude_flags:
            continue
        elif read.mapq < min_quality:
            continue
               
        output_file.write(read)
    output_file.close()
    input_file.close()