I have a list of enzymes (EC numbers, "df" from the code) that I want to highlight in KEGG PATHWAY maps. I would like to make a python script that automatically saves the highlighted maps. So far I could only make urls from which I manually download them:
from bioservices import KEGG
import webbrowser
s = KEGG()
def mapping(df, map_list):
for map in map_list:
names = ""
to_parse = s.get("ec"+map)
parsed = s.parse(to_parse)
for ECs in df["EC_numbers"]:
if str(ECs) in parsed["ENZYME"]:
names=names+"+EC:"+str(ECs)
url = "https://www.genome.jp/pathway/map"+map+names
s.logging.info(url)
webbrowser.open(url)
map_list_example = ["00520", "00010", "00020"]
Any ideas?
You can use the function
save_pathway
for this purpose.This will produce