24小时热门版块排行榜    

查看: 2652  |  回复: 11
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

xueshuhan

木虫 (正式写手)

[求助] Perl 编程 请大神们帮忙!!!生物信息的牛人请进

我是学生物的研究生,我们一个老师讲perl编程,才学了10个小时,本人对编程一窍不通,希望好心人帮忙解答,谢谢了!!!
下面是我的编程:
Develop a Perl program that receives as argument on the command linethe id of a nucleotide sequence (in the form db:id) and invokes the"sixpack" Web Service from EBI printing its result.
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zhusheng303

木虫 (小有名气)

引用回帖:
5楼: Originally posted by xueshuhan at 2012-01-31 16:42:45:
这回写是否正确,还有就是网络服务调用部分如何编写???
#!/usr/bin/perl
use strict;
use warnings;
use SOAP::Lite;

if ( $#ARGV < 0 )
        {
                print "Usage: please input "; exit;
         ...

这里还有一个地方不对,
#######
unless ( $ARGV[0]=~ m/:/ )
        {
                die ( "There is an error there.\n" )
        }

############
这个语句“die ( "There is an error there.\n" )”,你最好写成
die  "There is an error there.\n" ;另外一个最重要的问题是:perl的每个语句必须以”;(分号)“结束。也就说:应该写成这样 “die  "There is an error there.\n" ;”才是对的。
积极面对
8楼2012-02-01 10:37:12
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 12 个回答

xueshuhan

木虫 (正式写手)

-It checks the number of arguments received on the command line and          if the number is not 1 it prints an error message and exits.
-It assigns the first argument to one variable.
-It checks with a pattern matching that the variable contains the
character ":". If not it prints an error message.
-It calls the "sixpack" Web Service as in the examples seen in class passing the received variable.
-It assigns to a variable the "outfile" returned by the service.
-It prints this variable.
2楼2012-01-30 22:31:01
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

xueshuhan

木虫 (正式写手)

前一半这样写是否正确:
#!/usr/bin/perl
use strict;
use warnings;
use SOAP::Lite;

if ( $#ARGV < 0 )
        {
                print "Usage: please input "; exit;
        }
# Get the first argumentmy
if ( $ARGV[0]<>1 )
        {
                print "There is an error there"; exit;
        }
$input=$ARGV[0];
unless ( $ input =~ m/:/ )
        {
                die ( There is an error there.\n )
        }
3楼2012-01-31 02:03:29
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

zhusheng303

木虫 (小有名气)

★
ben_ladeng(金币+1): 欢迎常来 2012-01-31 13:58:28
xueshuhan: 回帖置顶 2012-01-31 16:46:17
引用回帖:
3楼: Originally posted by xueshuhan at 2012-01-31 02:03:29:
前一半这样写是否正确:
#!/usr/bin/perl
use strict;
use warnings;
use SOAP::Lite;

if ( $#ARGV < 0 )
        {
                print "Usage: please input "; exit;
        }
# Get the first argumentmy
...

【1】当你使用”use strict; use warnings ”, 语句"$input=$ARGV[0];"应该写成“my $input=$ARGV[0]”,“my”定义变量的作用,限定变量的作用域。
【2】“die ( There is an error there.\n )”,最好写成“die (There is an error there.\n );”。
【3】“if ( $ARGV[0]<>1 ) ” 这个语句,我没有看懂。
积极面对
4楼2012-01-31 10:13:09
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[硕博家园] 售SCI一区文章,我:8.O.551.O.5.4,科目全,可伽急 +4 TgvkbZZl9tqB 2026-11-11 5/250 2026-11-17 08:33 by Equinoxhua
[硕博家园] 售SCI文章,我:8O.5.5.1O.54,科目全,可十急 +4 uKOSCocCb6Fm 2026-11-12 10/500 2026-11-16 22:49 by Equinoxhua
[考博] 27年药学 考博申请 +4 。12345 2026-11-14 5/250 2026-11-16 19:52 by 0611517sll
[考博] 售一区SCI文章T0P,我:8O.551.O54,科目全,可十急 +4 XJXMuRjD7cK7 2026-11-13 4/200 2026-11-16 13:29 by LrcgbaWjazY5
[论文投稿] 售一区SCI文章T0P,我:8O.551.O54,科目全,可十急 +4 XJXMuRjD7cK7 2026-11-13 4/200 2026-11-16 11:39 by K7HMGGdOpylw
[硕博家园] 售SCI一区文章,我:8.O.551.O.5.4,科目全,可伽急 +4 XJXMuRjD7cK7 2026-11-13 4/200 2026-11-16 11:28 by K7HMGGdOpylw
[硕博家园] 售一区SCI文章T0P,我:8O.551.O54,科目全,可十急 +4 uKOSCocCb6Fm 2026-11-13 4/200 2026-11-16 11:06 by K7HMGGdOpylw
[考博] 售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急 +3 uKOSCocCb6Fm 2026-11-13 3/150 2026-11-16 10:33 by K7HMGGdOpylw
[考研] 售SCI一区T0P文章,我:8O.55.1.O.54,科目全,可伽急 +4 uKOSCocCb6Fm 2026-11-13 4/200 2026-11-16 10:11 by K7HMGGdOpylw
[考研] 售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急 +3 SX5mJmPWDfOO 2026-11-13 3/150 2026-11-15 07:56 by xSrQNSSjcgoX
[论文投稿] 售SCI一区文章,我:8.O.551.O.5.4,科目全,可伽急 +4 XJXMuRjD7cK7 2026-11-13 4/200 2026-11-15 07:01 by xSrQNSSjcgoX
[考研] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +3 uKOSCocCb6Fm 2026-11-13 3/150 2026-11-15 05:11 by xSrQNSSjcgoX
[考博] 售SCI文章,我:8O5.5.1.O.54,科目齐全,可+急 +3 uKOSCocCb6Fm 2026-11-12 7/350 2026-11-15 03:32 by xSrQNSSjcgoX
[考研] 售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急 +3 uKOSCocCb6Fm 2026-11-12 8/400 2026-11-15 02:26 by xSrQNSSjcgoX
[教师之家] 售SCI一区T0P文章,我:8.O.55.1.O.5.4,科目全,可+急 +4 1Nb0IVlmV6v0 2026-11-11 4/200 2026-11-13 11:18 by Equinoxhua
[公派出国] 售SCI一区T0P文章,我:8.O55.1.O.54,科目全,可十急 +3 TgvkbZZl9tqB 2026-11-11 4/200 2026-11-12 12:51 by ECLTXnJnRSXf
[硕博家园] 售SCI一区T0P文章,我:8.O55.1.O.54,科目全,可十急 +4 cdqGD6ftHmbl 2026-11-11 4/200 2026-11-12 12:26 by ECLTXnJnRSXf
[教师之家] 售SCI一区T0P文章,我:8.O.55.1.O.54,科目齐全,可+急 +3 TgvkbZZl9tqB 2026-11-11 4/200 2026-11-12 08:15 by HajghKOMynmz
[基金申请] 售SCI一区文章,我:8.O.551.O.5.4,科目全,可伽急 +3 TgvkbZZl9tqB 2026-11-11 5/250 2026-11-12 08:15 by HajghKOMynmz
[考研] 售SCI一区文章,我:8.O.55.1.O.54,科目齐全,可伽急 +3 cdqGD6ftHmbl 2026-11-11 3/150 2026-11-12 07:53 by HajghKOMynmz
信息提示
请填处理意见