dotter.py

来自「ncbi源码」· Python 代码 · 共 66 行

PY
66
字号
#!/usr/bin/python# $Id: dotter.py,v 1000.0 2003/10/31 21:37:23 gouriano Exp $## Author:  Josh Cherry## launch dotter (from gbench) using sequences we're handedimport sysimport stringimport commandsimport osdef writefasta(seq, fname):   s = ">" + fname + "\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()l = string.split(input)if len(l) != 1 and len(l) != 2:   sys.stderr.write("need exactly 1 or 2 sequences; you supplied %d\n" % len(l))   sys.exit(1)# if given just one sequence, 'double' it to plot against itselfif len(l) == 1:   l = [ l[0], l[0] ]writefasta(l[0], 'seq1.fasta')writefasta(l[1], 'seq2.fasta')# run dotter in background# redirect all output to /dev/null (otherwise interpreter goes zombie)os.system('dotter seq1.fasta seq2.fasta >& /dev/null &')# cheesey: wait a few seconds so dotter can read its files,# then delete themimport timetime.sleep(5)os.system('rm seq1.fasta seq2.fasta')# ===========================================================================# $Log: dotter.py,v $# Revision 1000.0  2003/10/31 21:37:23  gouriano# PRODUCTION: IMPORTED [ORIGINAL] Dev-tree R1.1## Revision 1.1  2003/06/24 16:41:12  jcherry# Initial versions of scripts for use with gbench## ===========================================================================# #  ===========================================================================#  PRODUCTION $Log: dotter.py,v $#  PRODUCTION Revision 1000.0  2003/10/31 21:37:23  gouriano#  PRODUCTION PRODUCTION: IMPORTED [ORIGINAL] Dev-tree R1.1#  PRODUCTION#  ===========================================================================# 

⌨️ 快捷键说明

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