def generateJSON(geneDot, count, name, out_file_name): ''' generate JSON file for uploading into RNA 2D browser for visualization ''' RNA = {} count = [int(x) for x in count] RNA["ideograms"] = [{"id": name, "length": len(geneDot), "color": "grey"}] RNA["tracks"] = [{ "name": "coverage", "color": "blue", "type": "plot", "values": [{ "chr": name, "values": count }] }] stems = dot2block(geneDot, name) RNA["tracks"].append({ "name": "stems", "color": "green", "type": "links", "values": stems }) out = open(out_file_name, 'w') print >> out, json.dumps(RNA, indent=2)
def generateJSON(geneDot,count,name,out_file_name): ''' generate JSON file for uploading into RNA 2D browser for visualization ''' RNA = {} count=[int(x) for x in count] RNA["ideograms"]=[{"id":name,"length":len(geneDot),"color":"grey"}] RNA["tracks"]=[{"name":"coverage","color":"blue","type":"plot","values":[{"chr":name,"values":count}]}] stems = dot2block(geneDot,name) RNA["tracks"].append({"name":"stems","color":"green","type":"links","values":stems}) out = open(out_file_name,'w') print >>out, json.dumps(RNA, indent=2)
import sys from RNAstructure import dot2block stems = dot2block(sys.argv[1],"test") print stems
import sys from RNAstructure import dot2block stems = dot2block(sys.argv[1], "test") print stems