⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dotter.py

📁 ncbi源码
💻 PY
字号:
#!/usr/bin/python# $Id: dotter.py,v 1000.1 2003/11/21 21:44:13 gouriano Exp $## Author:  Josh Cherry## launch dotter (from gbench) using sequences we're handedimport sysimport cgiimport osimport tempfiledef writefasta(seq, fname, seqname):   s = ">" + seqname + "\n"   for pos in range(0, len(seq), 60):      s += seq[pos:pos+60]      s += '\n'   f = open(fname, "w")   f.write(s)   f.closeinput = sys.stdin.read()args = cgi.parse_qs(input)action = args['action'][0]# if a get info call ...if action == 'info':   print '''   PluginInfo ::= {      ver-major 0,      ver-minor 0,      ver-revision 0,      ver-build-date "",      class-name "dotter.py",      menu-item "Alignments/Dot matrix comparison",      tooltip "Dot matrix comparison of sequences using dotter",      commands algo {        {          command 3,          args {            {              name "hseq",              desc "Horizontal sequence",              data single object {                docaddr "(nil)",                objaddr "(nil)",                subtype "Seq-loc"              }            },            {              name "vseq",              desc "Vertical sequence",              data single object {                docaddr "(nil)",                objaddr "(nil)",                subtype "Seq-loc"              }            }          }        }      }    }    '''   sys.exit(0)# otherwise, runhseq = args['hseq'][0]vseq = args['vseq'][0]# write temporary fasta files containing the sequencesfname0 = tempfile.mktemp('.fasta')fname1 = tempfile.mktemp('.fasta')loc0 = cgi.parse_qs(hseq);loc1 = cgi.parse_qs(vseq);writefasta(loc0['seq'][0], fname0, loc0['title'][0])writefasta(loc1['seq'][0], fname1, loc1['title'][0])# run dotter in background# redirect all output to /dev/null (otherwise interpreter goes zombie)os.system('dotter %s %s >& /dev/null &' % (fname0, fname1))# cheesy: wait a few seconds so dotter can read its files,# then delete themimport timetime.sleep(5)os.system('rm %s %s' % (fname0, fname1))# ===========================================================================# $Log: dotter.py,v $# Revision 1000.1  2003/11/21 21:44:13  gouriano# PRODUCTION: UPGRADED [ORIGINAL] Dev-tree R1.4## Revision 1.4  2003/11/17 21:55:40  jcherry# Ask for two single Seq-locs rather than one array## Revision 1.3  2003/10/29 20:12:05  jcherry# Reflect new spec for plugin args## Revision 1.2  2003/10/07 13:47:02  dicuccio# Renamed CPluginURL* to CPluginValue*## Revision 1.1  2003/07/28 18:24:31  jcherry# Initial version## ===========================================================================# #  ===========================================================================#  PRODUCTION $Log: dotter.py,v $#  PRODUCTION Revision 1000.1  2003/11/21 21:44:13  gouriano#  PRODUCTION PRODUCTION: UPGRADED [ORIGINAL] Dev-tree R1.4#  PRODUCTION#  ===========================================================================# 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -