gc.tcl
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:1k
- #!/usr/bin/tclsh
- # $Id: gc.tcl,v 1000.0 2003/10/31 21:37:39 gouriano Exp $
- #
- # Author: Josh Cherry
- #
- # test case for running external executable from gbench
- # compute gc (+s) content
- proc gc_content {seq} {
- set seq [string toupper $seq]
- set count 0
- for {set i 0} {$i < [string length $seq]} {incr i} {
- set nuc [string index $seq $i]
- if {"$nuc"=="G" | "$nuc"=="C" | "$nuc"=="S"} {
- incr count
- }
- }
- return [expr $count.0 / [string length $seq]]
- }
- set seqs [read stdin]
- foreach seq $seqs {
- puts [gc_content $seq]
- }
- exit 0
- # ===========================================================================
- # $Log: gc.tcl,v $
- # Revision 1000.0 2003/10/31 21:37:39 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: gc.tcl,v $
- # PRODUCTION Revision 1000.0 2003/10/31 21:37:39 gouriano
- # PRODUCTION PRODUCTION: IMPORTED [ORIGINAL] Dev-tree R1.1
- # PRODUCTION
- # ===========================================================================
- #