def show_seq(clus_obj, index):
current = clus_obj.clus<EOL>clus_seqt = clus_obj.seq<EOL>clus_locit = clus_obj.loci<EOL>itern = <NUM_LIT:0><EOL>for idc in current.keys():<EOL><INDENT>itern += <NUM_LIT:1><EOL>timestamp = str(idc)<EOL>seqListTemp = ()<EOL>f = open("<STR_LIT>"+timestamp+"<STR_LIT>","<STR_LIT:w>")<EOL>for idl in current[idc].loci2seq.keys():<EOL><INDENT>seqListTemp = list(set(seqListTemp).union(current[idc].loci2seq[idl]))<EOL><DEDENT>maxscore = <NUM_LIT:0><EOL>for s in seqListTemp:<EOL><INDENT>score = calculate_size(clus_seqt[s].freq)<EOL>maxscore = max(maxscore,score)<EOL>clus_seqt[s].score = score<EOL>seq = clus_seqt[s]<EOL>f.write("<STR_LIT:>>"+s+"<STR_LIT:\n>"+seq.seq+"<STR_LIT:\n>")<EOL><DEDENT>f.close()<EOL>locilen_sorted = sorted(current[idc].locilen.iteritems(), key = operator.itemgetter(<NUM_LIT:1>),reverse = True)<EOL>lmax = clus_locit[locilen_sorted[<NUM_LIT:0>][<NUM_LIT:0>]]<EOL>f = open("<STR_LIT>"+timestamp+"<STR_LIT>","<STR_LIT:w>")<EOL>f.write("<STR_LIT>" % (lmax.chr,lmax.start,lmax.end,lmax.strand))<EOL>f.close()<EOL>os.system("<STR_LIT>"+index+"<STR_LIT>"+timestamp+"<STR_LIT>"+timestamp+"<STR_LIT>")<EOL>os.system("<STR_LIT>"+timestamp+"<STR_LIT>"+timestamp+"<STR_LIT>")<EOL>os.system("<STR_LIT>"+timestamp+"<STR_LIT>"+timestamp+"<STR_LIT>"+timestamp+"<STR_LIT>")<EOL>f = open("<STR_LIT>"+timestamp+"<STR_LIT>","<STR_LIT:r>")<EOL>seqpos = {}<EOL>minv = <NUM_LIT><EOL>for line in f:<EOL><INDENT>line = line.strip()<EOL>cols = line.split("<STR_LIT:\t>")<EOL>seqpos[cols[<NUM_LIT:0>]] = int(cols[<NUM_LIT:3>])<EOL>if minv>int(cols[<NUM_LIT:3>]):<EOL><INDENT>minv = int(cols[<NUM_LIT:3>])<EOL><DEDENT><DEDENT>f.close()<EOL>seqpos_sorted = sorted(seqpos.iteritems(), key = operator.itemgetter(<NUM_LIT:1>),reverse = False)<EOL>showseq = "<STR_LIT>"<EOL>showseq_plain = "<STR_LIT>"<EOL>for (s,pos) in seqpos_sorted:<EOL><INDENT>ratio = (clus_seqt[s].score*<NUM_LIT:1.0>/maxscore*<NUM_LIT>)<EOL>realScore = (math.log(ratio,<NUM_LIT:2>)*<NUM_LIT:2>)<EOL>if realScore<<NUM_LIT:0>:<EOL><INDENT>realScore = <NUM_LIT:0><EOL><DEDENT>showseq_plain += "<STR_LIT>" % ("<STR_LIT>".join("<STR_LIT:.>" for i in range(pos-<NUM_LIT:1>)),realScore+<NUM_LIT:10>,s,clus_seqt[s].seq)<EOL><DEDENT>current[idc].showseq_plain = showseq_plain<EOL>os.system("<STR_LIT>"+timestamp+"<STR_LIT:*>")<EOL><DEDENT>clus_obj.clus = current<EOL>clus_obj.seq = clus_seqt<EOL>return clus_obj<EOL>
Get the precursor and map sequences to it.
       this way we create a positional map.