24小时热门版块排行榜    

查看: 2127  |  回复: 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

木虫 (正式写手)

前一半这样写是否正确:
#!/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的回帖
查看全部 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的回帖

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的回帖

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;
        }
my $input=$ARGV[0];
unless ( $ARGV[0]=~ m/:/ )
        {
                die ( "There is an error there.\n" )
        }
5楼2012-01-31 16:42:45
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 281求调剂(0805) +6 烟汐忆海 2026-03-16 16/800 2026-03-19 00:59 by 烟汐忆海
[考研] 354求调剂 +4 Tyoumou 2026-03-18 7/350 2026-03-18 21:45 by Tyoumou
[考研] 能源材料化学课题组招收硕士研究生8-10名 +4 脱颖而出 2026-03-16 10/500 2026-03-18 20:59 by 脱颖而出
[考研] 267一志愿南京工业大学0817化工求调剂 +8 SUICHILD 2026-03-12 8/400 2026-03-18 20:55 by winsuccess
[考研] 一志愿天津大学化学工艺专业(081702)315分求调剂 +10 yangfz 2026-03-17 10/500 2026-03-18 20:14 by walc
[考研] 070303一志愿西北大学学硕310找调剂 +6 d如愿上岸 2026-03-12 9/450 2026-03-18 19:50 by macy2011
[考研] 0703化学 305求调剂 +3 FY_yy 2026-03-14 3/150 2026-03-18 19:40 by macy2011
[考研] 085600材料与化工 +5 安全上岸! 2026-03-16 5/250 2026-03-18 15:33 by cmz0325
[考研] 311求调剂 +11 冬十三 2026-03-15 12/600 2026-03-18 14:36 by 星空星月
[考研] 0854,计算机类招收调剂 +3 胡辣汤放糖 2026-03-15 6/300 2026-03-18 12:09 by 上岸上岸……..
[考研] 材料,纺织,生物(0856、0710),化学招生啦 +3 Eember. 2026-03-17 9/450 2026-03-18 10:28 by Eember.
[考研] 277调剂 +5 自由煎饼果子 2026-03-16 6/300 2026-03-17 19:26 by 李leezz
[考研] 332求调剂 +6 Zz版 2026-03-13 6/300 2026-03-17 17:03 by ruiyingmiao
[考研] 304求调剂 +4 ahbd 2026-03-14 4/200 2026-03-16 16:48 by 我的船我的海
[考研] 277材料科学与工程080500求调剂 +3 自由煎饼果子 2026-03-16 3/150 2026-03-16 14:10 by 运气yunqi
[考研] 22408总分284求调剂 +3 InAspic 2026-03-13 3/150 2026-03-15 11:10 by zhq0425
[考研] 295求调剂 +3 小匕仔汁 2026-03-12 3/150 2026-03-13 15:17 by vgtyfty
[考研] 土木第一志愿276求调剂,科研和技能十分丰富,求新兴方向的导师收留 +3 土木小天才 2026-03-12 3/150 2026-03-13 15:01 by JourneyLucky
[考研] 308求调剂 +3 是Lupa啊 2026-03-12 3/150 2026-03-13 14:30 by 求调剂zz
[考研] 321求调剂(食品/专硕) +3 xc321 2026-03-12 6/300 2026-03-13 08:45 by xc321
信息提示
请填处理意见