comparison mkpthwpng.py @ 23:66a183c44dd5

bugfix for Pathway Image tool
author Richard Burhans <burhans@bx.psu.edu>
date Wed, 22 May 2013 15:58:18 -0400
parents 2c498d40ecde
children
comparison
equal deleted inserted replaced
22:95a05c1ef5d5 23:66a183c44dd5
28 request=mechanize.Request("http://www.genome.jp/kegg/tool/map_pathway2.html") 28 request=mechanize.Request("http://www.genome.jp/kegg/tool/map_pathway2.html")
29 response = mechanize.urlopen(request) 29 response = mechanize.urlopen(request)
30 forms = mechanize.ParseResponse(response, backwards_compat=False) 30 forms = mechanize.ParseResponse(response, backwards_compat=False)
31 form=forms[0] 31 form=forms[0]
32 form["unclassified"]=inpx 32 form["unclassified"]=inpx
33 form["org_name"]=[sppPrefx] 33 form["org"]=sppPrefx
34 request2 = form.click() 34 request2 = form.click()
35 response2 = mechanize.urlopen(request2) 35 response2 = mechanize.urlopen(request2)
36 a=str(response2.read()).split('href="/kegg-bin/show_pathway?')[1] 36 a=str(response2.read()).split('href="/kegg-bin/show_pathway?')[1]
37 code=a.split('/')[0]#response2.read() 37 code=a.split('/')[0]#response2.read()
38 request=mechanize.Request("http://www.genome.jp/kegg-bin/show_pathway?%s/%s.args"%(code,pthwcod))#request=mechanize.Request("http://www.genome.jp/kegg-bin/show_pathway?%s/%s.args"%('13171478854246','hsa00410')) 38 request=mechanize.Request("http://www.genome.jp/kegg-bin/show_pathway?%s/%s.args"%(code,pthwcod))#request=mechanize.Request("http://www.genome.jp/kegg-bin/show_pathway?%s/%s.args"%('13171478854246','hsa00410'))