def _read_gtf(gtf):
if not gtf:<EOL><INDENT>return gtf<EOL><DEDENT>db = defaultdict(list)<EOL>with open(gtf) as in_handle:<EOL><INDENT>for line in in_handle:<EOL><INDENT>if line.startswith("<STR_LIT:#>"):<EOL><INDENT>continue<EOL><DEDENT>cols = line.strip().split("<STR_LIT:\t>")<EOL>name = [n.split("<STR_LIT:=>")[<NUM_LIT:1>] for n in cols[-<NUM_LIT:1>].split("<STR_LIT:;>") if n.startswith("<STR_LIT:Name>")]<EOL>chrom, start, end, strand = cols[<NUM_LIT:0>], cols[<NUM_LIT:3>], cols[<NUM_LIT:4>], cols[<NUM_LIT:6>]<EOL>if cols[<NUM_LIT:2>] == "<STR_LIT>":<EOL><INDENT>db[name[<NUM_LIT:0>]].append([chrom, int(start), int(end), strand])<EOL><DEDENT><DEDENT><DEDENT>return db<EOL>
Load GTF file with precursor positions on genome