24小时热门版块排行榜    

北京石油化工学院2026年研究生招生接收调剂公告
查看: 2160  |  回复: 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的回帖

xueshuhan

木虫 (正式写手)

我写的这个问题,但不知道怎么改
问题一:如何让第一个argument需要为变量
问题二:为什么我在命令栏里输入核苷酸的ID却提示命令没有找到
#!/usr/bin/perl
use warnings;
use SOAP::Lite;

if ( $#ARGV < 0 )
        {
                print "Usage: please input\n "; exit;
        }
# Get the first argumentmy
if ( $ARGV[0]!=1 )
        {
                print "There is an error there"; exit;
        }

$input=$ARGV[0];

unless ( $ARGV[0]=~ m/:/ )
        {
                die ( "There is an error there.\n" );
        }

$service = SOAP::Lite->proxy(
        'http://www.ebi.ac.uk/soaplab/services/dispaly.sixpack'
);

$soap_response =
        $service->runAndWaitFor(
                SOAP:ata->type( map => { sequence_usa =>$ARGV[0]
} ) );

@res = $soap_response->paramsout;

$res = $soap_response->result;

$outfile = %$res->{'outfile'};

print "$outfile\n";

图一

6楼2012-01-31 18:49:35
已阅   回复此楼   关注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的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 0703化学 +19 妮妮ninicgb 2026-03-27 19/950 2026-03-31 10:55 by 罗文姬.
[考研] 362求调剂 +3 西南交材料专硕3 2026-03-31 3/150 2026-03-31 10:39 by jp9609
[考研] 张芳铭-中国农业大学-环境工程专硕-298 +7 手机用户 2026-03-26 7/350 2026-03-31 10:13 by cal0306
[论文投稿] chinese chemical letters英文版投稿求助 130+3 Yishengeryi 2026-03-30 3/150 2026-03-31 10:10 by 北京莱茵润色
[考研] 276求调剂 +3 赵久华 2026-03-29 3/150 2026-03-31 10:06 by cal0306
[考研] 285求调剂 +6 AZMK 2026-03-30 9/450 2026-03-31 08:01 by jp9609
[考研] 370求调剂 +3 080700调剂 2026-03-30 3/150 2026-03-31 01:09 by A_Zhe
[考研] 食品工程专硕一志愿中海洋309求调剂 +5 小张zxy张 2026-03-26 10/500 2026-03-31 00:29 by jp9609
[考研] 367求调剂 +5 芋泥啵啵… 2026-03-28 5/250 2026-03-30 19:56 by 无际的草原
[考研] 334分 一志愿武理 材料求调剂 +16 李李不服输 2026-03-26 16/800 2026-03-30 17:47 by wangjy2002
[考研] 求调剂,一志愿 南京航空航天大学大学 ,080500材料科学与工程学硕 +6 @taotao 2026-03-26 7/350 2026-03-30 10:43 by 我是小康
[考研] 348求调剂 +6 小懒虫不懒了 2026-03-28 6/300 2026-03-30 10:29 by Evan_Liu
[考研] 311求调剂 +10 lin0039 2026-03-26 10/500 2026-03-30 10:26 by herarysara
[考研] 一志愿211,335分,0856,求调剂院校和导师 +7 倾____萧 2026-03-27 8/400 2026-03-30 09:37 by longlotian
[考研] 求调剂 +4 QiMing7 2026-03-25 5/250 2026-03-29 21:10 by 唐沐儿
[考研] 0856材料化工调剂 总分330 +14 zhubinhao 2026-03-27 14/700 2026-03-29 10:01 by Sjndkwm
[考研] 305求调剂 +8 RuiFairyrui 2026-03-28 8/400 2026-03-29 08:22 by fmesaito
[考研] 调剂 +3 好好读书。 2026-03-28 3/150 2026-03-28 12:04 by 王保杰33
[考研] 一志愿 西北大学 总分282 英语一62 求调剂 +7 18419759900 2026-03-25 8/400 2026-03-27 16:38 by 18419759900
[考研] 一志愿吉林大学材料与化工303分求调剂 +4 为学666 2026-03-24 4/200 2026-03-25 11:27 by BruceLiu320
信息提示
请填处理意见