def anncluster(c, clus_obj, db, type_ann, feature_id="<STR_LIT:name>"):
id_sa, id_ea, id_id, id_idl, id_sta = <NUM_LIT:1>, <NUM_LIT:2>, <NUM_LIT:3>, <NUM_LIT:4>, <NUM_LIT:5><EOL>if type_ann == "<STR_LIT>":<EOL><INDENT>id_sb = <NUM_LIT:7><EOL>id_eb = <NUM_LIT:8><EOL>id_stb = <NUM_LIT:11><EOL>id_tag = <NUM_LIT:9><EOL><DEDENT>ida = <NUM_LIT:0><EOL>clus_id = clus_obj.clus<EOL>loci_id = clus_obj.loci<EOL>db = os.path.splitext(db)[<NUM_LIT:0>]<EOL>logger.debug("<STR_LIT>" % type_ann)<EOL>for cols in c.features():<EOL><INDENT>if type_ann == "<STR_LIT>":<EOL><INDENT>cb, sb, eb, stb, db, tag = read_gtf_line(cols[<NUM_LIT:6>:], feature_id)<EOL><DEDENT>else:<EOL><INDENT>sb = int(cols[id_sb])<EOL>eb = int(cols[id_eb])<EOL>stb = cols[id_stb]<EOL>tag = cols[id_tag]<EOL><DEDENT>id = int(cols[id_id])<EOL>idl = int(cols[id_idl])<EOL>if (id in clus_id):<EOL><INDENT>clus = clus_id[id]<EOL>sa = int(cols[id_sa])<EOL>ea = int(cols[id_ea])<EOL>ida += <NUM_LIT:1><EOL>lento5, lento3, strd = _position_in_feature([sa, ea, cols[id_sta]], [sb, eb, stb])<EOL>if db in loci_id[idl].db_ann:<EOL><INDENT>ann = annotation(db, tag, strd, lento5, lento3)<EOL>tdb = loci_id[idl].db_ann[db]<EOL>tdb.add_db_ann(ida, ann)<EOL>loci_id[idl].add_db(db, tdb)<EOL><DEDENT>else:<EOL><INDENT>ann = annotation(db, tag, strd, lento5, lento3)<EOL>tdb = dbannotation(<NUM_LIT:1>)<EOL>tdb.add_db_ann(ida, ann)<EOL>loci_id[idl].add_db(db, tdb)<EOL><DEDENT>clus_id[id] = clus<EOL><DEDENT><DEDENT>clus_obj.clus = clus_id<EOL>clus_obj.loci = loci_id<EOL>return clus_obj<EOL>
intersect transcription position with annotation files