INNER CODE UNIT · Python

subprocess_wrap

nloyfer/wgbs_tools · src/python/bam2pat.py:42

def subprocess_wrap(cmd, debug):
    if debug:
        eprint(cmd)
        return
    subprocess.check_call(cmd, shell=True, executable='/bin/bash')


def set_regions(bam_path, gr, tmp_dir=None):
    # if user specified a region, just use it
    if gr.region_str:
        return [gr.region_str]

    # get all chromosomes from the reference genome:
    ref_chroms = gr.genome.get_chroms()
    if bam_path.endswith('.cram'):
        return list(sorted(ref_chroms, key=chromosome_order))

    # get all chromosomes present in the bam file header

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…