±±¾©Ê¯ÓÍ»¯¹¤Ñ§Ôº2026ÄêÑо¿ÉúÕÐÉú½ÓÊÕµ÷¼Á¹«¸æ
²é¿´: 2167  |  »Ø¸´: 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µÄ»ØÌû
»ØÌûÖö¥ ( ¹²ÓÐ2¸ö )

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

ľ³æ (ÕýʽдÊÖ)

xueshuhan: »ØÌûÖö¥ 2012-02-02 09:18:42
ÔÚ¶àλÅóÓѰïÖúÏÂÖÕÓÚдºÃÁË£¬ÏÂÃæÊÇperl £º
#!/usr/bin/perl -w
use strict;
use SOAP::Lite;

my($USAGE) = "$0 PROTEIN\n\n";

unless (@ARGV)
        {
                print $USAGE;
                exit;
        }

unless (@ARGV==1)
        {
                print "There is an error.\n";
        exit;
        }

my($sequence) = $ARGV[0];

unless ($sequence =~ /[:]/g)
        {
                print "There is another error\n";
        }

my($service) = SOAP::Lite->proxy(

'http://www.ebi.ac.uk/soaplab/services/nucleic_gene_finding.sixpack'
);

my($soap_response) =
        $service->runAndWaitFor(
                SOAP:ata->type( map => { sequence_usa =>$sequence
} ) );

my(@res) = $soap_response->paramsout;

my($res) = $soap_response->result;

my($outfile) = %$res->{'outfile'};

print "$outfile\n";

exit;
10Â¥2012-02-02 09:18:06
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
ÆÕͨ»ØÌû

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µÄ»ØÌû

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µÄ»ØÌû

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µÄ»ØÌû

xueshuhan

ľ³æ (ÕýʽдÊÖ)

ÒýÓûØÌû:
Â¥: Originally posted by zhusheng303 at 2012-01-31 10:13:09:
¡¾1¡¿µ±ÄãʹÓá±use strict; use warnings ¡±, Óï¾ä"$input=$ARGV[0];"Ó¦¸Ãд³É¡°my $input=$ARGV[0]¡±£¬¡°my¡±¶¨Òå±äÁ¿µÄ×÷Óã¬ÏÞ¶¨±äÁ¿µÄ×÷ÓÃÓò¡£
¡¾2¡¿¡°die ( There is an error there.\n )¡±£¬×î ...

ллÄãµÄ°ïÖú£¬»¹ÓÐһЩÎÊÌâÇë½Ì£¬ÍûÖ¸½Ì
7Â¥2012-01-31 18:50:50
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢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µÄ»ØÌû

zhusheng303

ľ³æ (СÓÐÃûÆø)

ÒýÓûØÌû:
6Â¥: Originally posted by xueshuhan at 2012-01-31 18:49:35:
ÎÒдµÄÕâ¸öÎÊÌ⣬µ«²»ÖªµÀÔõô¸Ä
ÎÊÌâÒ»£ºÈçºÎÈõÚÒ»¸öargumentÐèҪΪ±äÁ¿
ÎÊÌâ¶þ£ºÎªÊ²Ã´ÎÒÔÚÃüÁîÀ¸ÀïÊäÈëºËÜÕËáµÄIDÈ´ÌáʾÃüÁîûÓÐÕÒµ½
#!/usr/bin/perl
use warnings;
use SOAP::Lite;

if ( $#ARGV &l ...

¡¾1¡¿ÎÊÌâÒ»£ºÈçºÎÈõÚÒ»¸öargumentÐèҪΪ±äÁ¿
Use $ARGV[n] to display argument.
Use $#ARGV to get total number of passed argument to a perl script.
ÀýÈ磺./foo.pl one two three
$ARGV[0]£ºone
$ARGV[1]: two
$ARGV[2]: three
¡¾2¡¿ÎÊÌâ¶þ£ºÎªÊ²Ã´ÎÒÔÚÃüÁîÀ¸ÀïÊäÈëºËÜÕËáµÄIDÈ´ÌáʾÃüÁîûÓÐÕÒµ½
²»ºÃÒâ˼£¬Õâ¸öÎÒҲûÓÐÓùý¡£Õâ¸öÍøÒ³Äã¿ÉÒÔ¿´¿´http://www.ebi.ac.uk/Tools/webse ... perl/soap/soap-lite£¬Ï£Íû¶ÔÄãÓаïÖú
»ý¼«Ãæ¶Ô
9Â¥2012-02-01 11:01:49
ÒÑÔÄ   »Ø¸´´ËÂ¥   ¹Ø×¢TA ¸øTA·¢ÏûÏ¢ ËÍTAºì»¨ TAµÄ»ØÌû
Ïà¹Ø°æ¿éÌø×ª ÎÒÒª¶©ÔÄÂ¥Ö÷ xueshuhan µÄÖ÷Ìâ¸üÐÂ
×î¾ßÈËÆøÈÈÌûÍÆ¼ö [²é¿´È«²¿] ×÷Õß »Ø/¿´ ×îºó·¢±í
[¿¼ÑÐ] ÉúÎïÓëÒ½Ò©Çóµ÷¼Á +5 heguanhua 2026-04-05 6/300 2026-04-05 22:58 by Hdyxbekcb
[¿¼ÑÐ] Ò»Ö¾Ô¸Äϲý´óѧ£¬085600£¬344·ÖÇóµ÷¼Á +6 µ÷¼ÁÉϰ¶«^ 2026-04-05 6/300 2026-04-05 22:11 by 789·ç
[¿¼ÑÐ] Çóµ÷¼Á +4 chenxrlkx 2026-04-05 6/300 2026-04-05 18:38 by imissbao
[¿¼ÑÐ] 326Çóµ÷¼Á +3 ¹ËÈô¸¡Éú 2026-04-05 3/150 2026-04-05 18:32 by À¶ÔÆË¼Óê
[¿¼ÑÐ] 288Çóµ÷¼Á Ò»Ö¾Ô¸¹þ¹¤´ó ²ÄÁÏÓ뻯¹¤ +13 ÂåÉñ¸ç¸ç 2026-04-03 13/650 2026-04-05 17:27 by zzx2138
[¿¼ÑÐ] 278Çóµ÷¼Á +14 ·¶æÃÄÈ 2026-04-04 15/750 2026-04-04 22:15 by lqwchd
[¿¼ÑÐ] 296²ÄÁÏר˶Çóµ÷¼Á +21 202451007219 2026-04-02 22/1100 2026-04-04 21:48 by hemengdong
[¿¼ÑÐ] Ò»Ö¾Ô¸211£¬»¯Ñ§Ñ§Ë¶£¬310·Ö£¬±¾¿ÆÖصãË«·Ç£¬Çóµ÷¼Á +11 ŬÁ¦·Ü¶·112 2026-04-04 11/550 2026-04-04 20:51 by À¶ÔÆË¼Óê
[¿¼ÑÐ] 319Çóµ÷¼Á +4 ÐÇÐDz»Õ£ÑÛà¶ 2026-04-03 4/200 2026-04-04 16:25 by ÖзÉÔº¿Õ¹ÜѧԺÑ
[¿¼ÑÐ] 293·ÖÇóµ÷¼Á£¬ÍâÓïΪ¶íÓï +6 ¼ÓÒ»Ò»¾Å 2026-03-31 6/300 2026-04-04 14:57 by ´ÏÃ÷µÄ´óËÉÊó
[¿¼ÑÐ] ²ÄÁÏ295 +13 СӢ11 2026-04-03 14/700 2026-04-04 09:02 by À´¿´Á÷ÐÇÓê10
[¿¼ÑÐ] 322Çóµ÷¼Á +6 FZAC123 2026-04-03 6/300 2026-04-03 22:23 by ¿ÆÑÐСר¼Ò
[¿¼ÑÐ] 285Çóµ÷¼Á +5 AZMK 2026-04-03 8/400 2026-04-03 18:17 by AZMK
[¿¼ÑÐ] ÍÁľˮÀû328·ÖÇóµ÷¼Á +6 ¼²·çÖª¾¢²Ý666 2026-04-02 6/300 2026-04-03 11:38 by znian
[¿¼ÑÐ] 085600£¬320·ÖÇóµ÷¼Á +6 ´ó²öС×Ó 2026-04-02 6/300 2026-04-02 21:54 by dongzh2009
[¿¼ÑÐ] Ò»Ö¾Ô¸±±½»´ó²ÄÁϹ¤³Ì×Ü·Ö358 +8 cs0106 2026-04-01 9/450 2026-04-02 10:36 by ²»³Ôô~µÄ؈
[¿¼ÑÐ] ÍÁľ304Çóµ÷¼Á +5 ¶¥¼¶²Á²Á 2026-03-31 5/250 2026-04-01 08:15 by fdcxdystjk£¤
[¿¼ÑÐ] Çóµ÷¼Á ÉúÎïѧ 377·Ö +6 zzll03 2026-03-31 6/300 2026-03-31 17:33 by ÌÆãå¶ù
[¿¼ÑÐ] ¸£½¨Àí¹¤´óѧ²ÄÁÏѧԺÏȽøºÏ½ðÍŶÓÕÐÊÕ¿¼Ñе÷¼ÁѧÉú +3 ´ó»ª½ðÉ̶¼ 2026-03-30 4/200 2026-03-31 01:04 by ·½Ó¢¿¡602
[¿¼ÑÐ] 293Çóµ÷¼Á +3 ĩδmm 2026-03-30 5/250 2026-03-30 17:23 by Íõ±£½Ü33
ÐÅÏ¢Ìáʾ
ÇëÌî´¦ÀíÒâ¼û