def validate(signals,chrom): juncfile = os.path.join(juncDir,'supposed.rawbin.splicemap.%s.new.bed'%(chrom,)) out = readBed.BEDWriter(os.path.join(outDir,chrom+'_recovered.bed')) junctions = calJuncCoverage.getJunctions(juncfile) global validated for junc in junctions: leftindex = junc['chromStart'] + junc['blockSizes'][0] - 1 rightindex = junc['chromStart'] + junc['blockStarts'][1] key = '_'.join([junc['chrom'],str(leftindex),str(rightindex)]) if key in signals: out.writerow(junc) validated += 1
"python26 calJuncCoverage.py -s -j %s -r %s -a %d -c %d -o %s" % (currJuncFile, spliceReadFile, 10, 15, spliceoutfile) ) tophatoutfile = os.path.join(outputdir, "tophat_chr%s.txt" % (str(i),)) os.system("echo tophat") os.system( "python26 calJuncCoverage.py -s -j %s -r %s -a %d -c %d -o %s" % (currJuncFile, tophatReadFile, 10, 15, tophatoutfile) ) simulatedoutfile = os.path.join(outputdir, "simulated_chr%s.txt" % (str(i),)) os.system("echo original_reads") os.system( "python26 calJuncCoverage.py -s -j %s -r %s -a %d -c %d -o %s" % (currJuncFile, simulatedReadFile, 0, 15, simulatedoutfile) ) tempjunctions, tempsignals = calJuncCoverage.getJunctions(currJuncFile, True) for sig in tempsignals: sigRev = "" for base in sig: sigRev = BASE[base] + sigRev if sig in signals: signals[sig] += tempsignals[sig] elif sigRev in signals: signals[sigRev] += tempsignals[sig] else: signals[sig] = tempsignals[sig] os.system("echo ") print "\n----------------------Summary---------------------------" for key in signals: print key, " ", signals[key]