dotter.tcl
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:2k
- #!/usr/bin/tclsh
- # $Id: dotter.tcl,v 1000.0 2003/10/31 21:37:31 gouriano Exp $
- #
- # Author: Josh Cherry
- #
- # launch dotter on sequences we're handed
- # for use with gbench
- # dotter must be on path
- # procedure to write a fasta file
- proc writefasta {seq filename} {
- set f [open $filename w]
- puts $f >[string trimleft $filename 0]
-
- set fseq [exec fold -60 << $seq]
- puts $f $fseq
-
- close $f
- }
- # main program
- set seqs [read stdin]
- set nseqs [llength $seqs]
- if {$nseqs != 1 && $nseqs != 2} {
- puts stderr "need exactly 1 or 2 sequences; you provided $nseqs"
- exit 1
- }
- # if handed just one sequence, we'll plot it against itself,
- # so 'double' it
- if {$nseqs == 1} {
- set seqs [list $seqs $seqs]
- }
- # write temporary fasta files
- writefasta [lindex $seqs 0] seq1.fasta
- writefasta [lindex $seqs 1] seq2.fasta
- # execute dotter on temporaries
- exec dotter seq1.fasta seq2.fasta >& /dev/null &
- # cheesy: wait a few seconds to let dotter read files
- # before removing them
- exec sleep 5
- exec rm seq1.fasta seq2.fasta
- exit 0
- # ===========================================================================
- # $Log: dotter.tcl,v $
- # Revision 1000.0 2003/10/31 21:37:31 gouriano
- # PRODUCTION: IMPORTED [ORIGINAL] Dev-tree R1.1
- #
- # Revision 1.1 2003/06/19 19:39:20 jcherry
- # Some simple scripts for execution by gbench
- #
- # ===========================================================================
- #
- # ===========================================================================
- # PRODUCTION $Log: dotter.tcl,v $
- # PRODUCTION Revision 1000.0 2003/10/31 21:37:31 gouriano
- # PRODUCTION PRODUCTION: IMPORTED [ORIGINAL] Dev-tree R1.1
- # PRODUCTION
- # ===========================================================================
- #