def write_read(read, chrom, out):
    if not read.is_unmapped:
        out.write('%s\t%s\t%s\t%s\t0\t%s\n' % (chrom, read.pos, read.aend, read.qname, '-' if read.is_reverse else '+'))
dataset/ETHPy150Open ngsutils/ngsutils/ngsutils/bam/tobed.py/write_read/original