INNER CODE UNIT · Python
FLAGS_FILTER_NANOPORE
nloyfer/wgbs_tools · src/python/bam2pat.py:28
FLAGS_FILTER_NANOPORE = 3844 # 0x4+0x100+0x200+0x400+0x800 = unmapped, secondary, QC-fail, duplicate, supplementary
MAX_READ_SIZE = 1000 # extend samtools view region by this size
# currently we are missing the far mates
def extend_region(region, by=MAX_READ_SIZE):
if ':' not in region:
return region
chrom, r = region.split(':')
start, end = map(int, r.split('-'))
start = max(1, start - by)
end += by
return f'{chrom}:{start}-{end}'
def subprocess_wrap(cmd, debug):
if debug:
eprint(cmd)
return