INNER CODE UNIT · Python
proc_chr
nloyfer/wgbs_tools · src/python/add_cpg_counts.py:31
def proc_chr(input_path, out_path_name, region, genome, paired_end, ex_flags, mapq,
debug, verbose, min_cpg, clip, bed_file, extended_bed, add_pat, in_flags,
drop_singles):
""" Convert a temp single chromosome file, extracted from a bam file,
into a sam formatted (no header) output file."""
# Run patter tool 'bam' mode on a single chromosome
unsorted_bam = out_path_name + '_unsorted.output.bam'
out_path = out_path_name + '.output.bam'
out_directory = os.path.dirname(out_path)
# use samtools to extract only the reads from 'chrom'
# flag = '-f 3' if paired_end else ''
if in_flags is None:
in_flags = '-f 3' if paired_end else ''
else:
in_flags = f'-f {in_flags}'