24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 2159  |  回复: 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的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 335求调剂 +3 321* 2026-03-31 3/150 2026-03-31 09:00 by 功夫疯狂
[考研] 22408 359分调剂 +4 Qshers 2026-03-27 8/400 2026-03-31 08:53 by Qshers
[考研] 322求调剂 +7 旧吢 2026-03-24 7/350 2026-03-31 08:37 by jp9609
[考研] 085600 295分求调剂 +7 W55j 2026-03-30 9/450 2026-03-30 20:36 by dick_runner
[考研] 生物学 296 求调剂 +5 朵朵- 2026-03-26 7/350 2026-03-30 20:07 by 源_2020
[考研] 0703化学321分求调剂 +10 三dd. 2026-03-30 11/550 2026-03-30 19:24 by markhwc
[考研] 求调剂323材料与化工 +10 1124361 2026-03-24 10/500 2026-03-30 16:26 by 690616278
[考研] 考研调剂 +5 Sanmu-124 2026-03-26 5/250 2026-03-30 13:36 by chemdavid
[考研] 一志愿211,335分,0856,求调剂院校和导师 +7 倾____萧 2026-03-27 8/400 2026-03-30 09:37 by longlotian
[考研] 求调剂 +10 张zz111 2026-03-27 11/550 2026-03-30 09:17 by 无际的草原
[考研] 一志愿南航 335分 | 0856 | GPA 4.07 | 有科研经历 +8 cccchenso 2026-03-29 8/400 2026-03-29 23:53 by 我是小康
[硕博家园] 招收生物学/细胞生物学调剂 +4 IceGuo 2026-03-26 5/250 2026-03-29 01:25 by griffith2014
[考研] 339求调剂,想调回江苏 +6 烤麦芽 2026-03-27 8/400 2026-03-28 10:40 by 烤麦芽
[考研] 340求调剂 +5 jhx777 2026-03-27 5/250 2026-03-28 04:18 by fmesaito
[考研] 266求调剂 +11 阳阳哇塞 2026-03-27 12/600 2026-03-27 17:56 by yu221
[考研] 调剂 +3 李嘉图·S·路 2026-03-27 3/150 2026-03-27 11:19 by wangjy2002
[考研] 0703化学338求调剂! +6 Zuhui0306 2026-03-26 7/350 2026-03-27 10:35 by shangxh
[考研] 085602化学工程求调剂。 +4 平乐乐乐 2026-03-26 4/200 2026-03-26 17:57 by fmesaito
[考研] 材料专硕 335 分求调剂 +4 拒绝冷暴力 2026-03-25 4/200 2026-03-25 18:45 by haxia
[考研] 【2026考研调剂】制药工程 284分 求相关专业调剂名额 +4 袁奂奂 2026-03-25 8/400 2026-03-25 14:32 by lbsjt
信息提示
请填处理意见