gc.pl
来自「ncbi源码」· PL 代码 · 共 95 行
PL
95 行
#!/usr/local/bin/perl# $Id: gc.pl,v 1000.0 2003/10/31 21:38:25 gouriano Exp $## Author: Josh Cherry## calculate G+C+S content# (from gbench)use CGI;$qs = <STDIN>;$query = new CGI($qs);#if a get info call...if ($query->param('action') eq "info") { print ' PluginInfo ::= { ver-major 0, ver-minor 0, ver-revision 0, ver-build-date "", class-name "gc.pl", menu-item "Test scripts/GC content in perl", tooltip "G+C+S content by a perl script ", commands algo { { command 3, args { { name "locs", desc "Locations to evaluate", data array { object { docaddr "(nil)", objaddr "(nil)", subtype "Seq-loc" } } } } } } } '} else { # otherwise, run @locs = $query->param('locs'); foreach $loc (@locs) { $seq = new CGI($loc); print($seq->param("short_title"), "\t", &gc_content($seq->param("seq")), "\n"); }}sub gc_content { my $s = $_[0]; my $count = 0; for ($i=0; $i < length($s); $i++) { $c = substr($s, $i, 1); if ($c eq "G" || $c eq "C" || $c eq "S") { $count++; } } return $count / length($s);}# ===========================================================================# $Log: gc.pl,v $# Revision 1000.0 2003/10/31 21:38:25 gouriano# PRODUCTION: IMPORTED [ORIGINAL] Dev-tree R1.3## Revision 1.3 2003/10/29 20:12:05 jcherry# Reflect new spec for plugin args## Revision 1.2 2003/10/07 13:47:03 dicuccio# Renamed CPluginURL* to CPluginValue*## Revision 1.1 2003/07/28 19:59:10 jcherry# Initial version## ===========================================================================# # ===========================================================================# PRODUCTION $Log: gc.pl,v $# PRODUCTION Revision 1000.0 2003/10/31 21:38:25 gouriano# PRODUCTION PRODUCTION: IMPORTED [ORIGINAL] Dev-tree R1.3# PRODUCTION# ===========================================================================#
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?