| 查看: 2136 | 回復(fù): 11 | ||
xueshuhan木蟲 (正式寫手)
|
[求助]
Perl 編程 請大神們幫忙。!生物信息的牛人請進(jìn)
|
|
|
我是學(xué)生物的研究生,我們一個老師講perl編程,才學(xué)了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. |
木蟲 (小有名氣)
|
【1】當(dāng)你使用”use strict; use warnings ”, 語句"$input=$ARGV[0];"應(yīng)該寫成“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 ) ” 這個語句,我沒有看懂。 |

木蟲 (正式寫手)
|
在多位朋友幫助下終于寫好了,下面是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; |
木蟲 (正式寫手)
|
-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. |
木蟲 (正式寫手)
|
前一半這樣寫是否正確: #!/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 ) } |
木蟲 (正式寫手)
|
這回寫是否正確,還有就是網(wǎng)絡(luò)服務(wù)調(diào)用部分如何編寫??? #!/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" ) } |
木蟲 (正式寫手)
木蟲 (正式寫手)
木蟲 (小有名氣)

木蟲 (小有名氣)
|
【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卻提示命令沒有找到 不好意思,這個我也沒有用過。這個網(wǎng)頁你可以看看http://www.ebi.ac.uk/Tools/webse ... perl/soap/soap-lite,希望對你有幫助 |

| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 梁成偉老師課題組歡迎你的加入 +9 | 一鴨鴨喲 2026-03-14 | 11/550 |
|
|---|---|---|---|---|
|
[考研] 一志愿福大288有機(jī)化學(xué),求調(diào)劑 +3 | 小木蟲200408204 2026-03-18 | 3/150 |
|
|
[考研] 一志愿中海洋材料工程專碩330分求調(diào)劑 +7 | 小材化本科 2026-03-18 | 7/350 |
|
|
[考研] 材料080500調(diào)劑求收留 +4 | 一顆meteor 2026-03-13 | 4/200 |
|
|
[考研] 一志愿985,本科211,0817化學(xué)工程與技術(shù)319求調(diào)劑 +10 | Liwangman 2026-03-15 | 10/500 |
|
|
[考研] 材料專碩英一數(shù)二306 +5 | z1z2z3879 2026-03-18 | 5/250 |
|
|
[考研] 085700資源與環(huán)境308求調(diào)劑 +3 | 墨墨漠 2026-03-18 | 3/150 |
|
|
[考研] 354求調(diào)劑 +4 | Tyoumou 2026-03-18 | 7/350 |
|
|
[考研] 一志愿武理材料305分求調(diào)劑 +5 | 想上岸的鯉魚 2026-03-18 | 6/300 |
|
|
[考研] 268求調(diào)劑 +8 | 一定有學(xué)上- 2026-03-14 | 9/450 |
|
|
[考研] 332求調(diào)劑 +6 | Zz版 2026-03-13 | 6/300 |
|
|
[考研] 有沒有道鐵/土木的想調(diào)劑南林,給自己招師弟中~ +3 | TqlXswl 2026-03-16 | 7/350 |
|
|
[考研] 302求調(diào)劑 +4 | 小賈同學(xué)123 2026-03-15 | 8/400 |
|
|
[考研] 278求調(diào)劑 +3 | Yy7400 2026-03-13 | 3/150 |
|
|
[考研] 0854控制工程 359求調(diào)劑 可跨專業(yè) +3 | 626776879 2026-03-14 | 9/450 |
|
|
[基金申請]
今年的國基金是打分制嗎?
50+3
|
zhanghaozhu 2026-03-14 | 3/150 |
|
|
[考研] 一志愿211 0703方向310分求調(diào)劑 +3 | 努力奮斗112 2026-03-15 | 3/150 |
|
|
[考研] 0703 物理化學(xué)調(diào)劑 +3 | 我可以上岸的對?/a> 2026-03-13 | 5/250 |
|
|
[考研] 080500,材料學(xué)碩302分求調(diào)劑學(xué)校 +4 | 初識可樂 2026-03-14 | 5/250 |
|
|
[考研] 330求調(diào)劑 +3 | ?醬給調(diào)劑跪了 2026-03-13 | 3/150 |
|