目录

iPath

简介

iPath(Interactive Pathways Explorer),是一款网页版的通路图 (pathways maps)可视化分析软件。

脚本说明

脚本路径:/TJPROJ6/RNA_SH/personal_dir/zhanghailei/script/ipath/ipath.py

python /TJPROJ6/RNA_SH/personal_dir/zhanghailei/script/ipath/ipath.py –help usage: prepare_ipath_info [opthions] [value]

This program is used to prepare ipath info!

optional arguments:

  1. h, –help show this help message and exit
  2. I , –input the kegg Enrichment result
  3. O , –outfile the output file

效果展示

脚本

#!/usr/bin/python
#00FF00 green

import re
import os
import argparse
parser=argparse.ArgumentParser(prog='prepare_ipath_info',usage='%(prog)s [opthions] [value]',description='This program is used to prepare ipath info!')
parser.add_argument('-I','--input',help='the kegg Enrichment result',metavar='')
parser.add_argument('-O','--outfile',help='the output file',metavar='')
argv=vars(parser.parse_args())

if argv['input'] == None:
    raise Exception('You should provide the kegg Enrichment result !')
else:
    in_file=argv['input']

if argv['outfile'] == None:
    raise Exception('You should provide the outfile!')
else:
    out=argv['outfile']

output = open(out,"w")
output.write("path_id\twidth\tcolour/green\tpath_id\twidth\tcolour/yellow\tpath_id\twidth\tcolour/red\n")
for line in open(in_file,"r"):
    if re.search(r'^[A-z]+\d+\t',line):
        data    = line.strip().split("\t")[0]
        path_id = re.findall(r'[A-z]+(\d+)',data)[0]
        output.write("map"+path_id+"\tW5.0\t#00FF00\t"+"map"+path_id+"\tW5.0\t#FFFF00\t"+"map"+path_id+"\tW5.0\t#FF0000\n")
cp_dir = os.path.dirname(out)
if len(cp_dir) == 0:
    cp_dir = os.getcwd()
os.system("cp /TJPROJ6/RNA_SH/personal_dir/zhanghailei/script/ipath/readme.pdf "+cp_dir)

参考文献