Example #1
0
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)
Example #2
0
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)
Example #3
0
File: test.py Project: Jia340/MARIO
import sys
from RNAstructure import dot2block

stems = dot2block(sys.argv[1],"test")

print stems
Example #4
0
import sys
from RNAstructure import dot2block

stems = dot2block(sys.argv[1], "test")

print stems