[Bioperl-l] FW: A bio-perl networking problem
Brian Osborne
osborne1 at optonline.net
Sun Aug 6 15:38:11 UTC 2006
------ Forwarded Message
From: deepak shingan <deep_ans at yahoo.com>
Date: Sun, 06 Aug 2006 01:09:42 -0700 (PDT)
To: <osborne1 at optonline.net>
Subject: A bio-perl networking problem
Hello Sir,
I am in a greate trouble and I really want your help.
I am using SearchIO algorithm for parsing the blast result file in the
xml-rpc environment.
I have a client and server written in perl. The very first request that
I am sending is getting executed and I am able to see the output result
at the client side.
But for the second request I am sending is not getting executed
succesfully. Even it dose not throw any exception.
I think the problem is with "->next_result" statement which can not collect
result on the second request even the file contains many hits.
Can you give some light on this. I am really sorry for disturbing you
but I am not able to make out anything.
So please help me.
Here , I am sending the source code for testClient and testParser and
also a tempoaray Blast result file for testing.
Thanks and egoursly waiting for your responce.
Deepak
#fileName :: TestServer.pl
use warnings;
use strict;
use Frontier::Daemon;
use Bio::SimpleAlign;
use Bio::SearchIO;
use Bio::AlignIO;
use Error qw(:try);
#**************************************************************************
*****
# start the daemon
Frontier::Daemon->new(
LocalPort => 8901,
methods => {
'blastParser'=>\&blastParser,
}
)
or die "Failed to start daemon: $!\n";
#**************************************************************************
*****
# Methods
#**************************************************************************
*****
sub blastParser
{
try{
print "\nInside...";
my @outputArray;
my $arrayCntr = 0;
#This is the file that is transfered by ftp to the current working
#directory
#but for testing just hardcoded
my $file = "tempBlastFile";
print "\n$file";
#hardcoded just for testing
my $recordCounts = 10;
my $in = new Bio::SearchIO(-format => 'blast',
# comment out the next line to read STDIN
-file => $file );
#for the second request its not entering into the while loop
#even though the file has many hits
while ( my $result = $in->next_result )
{
print "\nInside result..";
my @stats = $result->available_statistics;
my @params = $result->available_parameters;
while ( my $hit = $result->next_hit and $recordCounts)
{
print "\n\nRecordcount ::\t$recordCounts\n\n";
$recordCounts--;
my $id = $hit->matches('id');
my $cons = $hit->matches('cons');
my @accs = $hit->each_accession_number;
my @qidentical = $hit->seq_inds('query','identical');
my @qconserved = $hit->seq_inds('query','conserved');
my @hidentical = $hit->seq_inds('hit','identical');
my @hconserved = $hit->seq_inds('hit','conserved');
$outputArray[$arrayCntr] = $hit->name;
$arrayCntr++;
$outputArray[$arrayCntr] = $hit->accession;
$arrayCntr++;
$outputArray[$arrayCntr] = $hit->raw_score;
$arrayCntr++;
$outputArray[$arrayCntr] = $hit->bits;
$arrayCntr++;
$outputArray[$arrayCntr] = $hit->gaps;
$arrayCntr++;
while ( my $hsp = $hit->next_hsp )
{
my ($qid,$qcons) = $hsp->matches('hit');
my ($id,$cons) = $hsp->matches('query');
@qidentical = $hsp->seq_inds('query','identical');
@qconserved = $hsp->seq_inds('query','conserved');
@hidentical = $hsp->seq_inds('hit','identical');
@hconserved = $hsp->seq_inds('hit','conserved');
my @hrange = $hsp->range('hit');
my @qrange = $hsp->range('query');
my $aln = $hsp->get_aln;
my $alnIO =
Bio::AlignIO->new(-format=>"clustalw",-file=>'>tempHitFile');
$outputArray[$arrayCntr] = $hsp->evalue;
$arrayCntr++;
$outputArray[$arrayCntr] = $hsp->percent_identity;
$arrayCntr++;
$alnIO->write_aln($aln);
open hitFile, "tempHitFile" or die "Can't read file";
undef $/;
my $allignMent = <hitFile>;
$outputArray[$arrayCntr] = $allignMent;
$arrayCntr++;
close hitFile; $logger->debug("Allignment :",$allignMent);
undef $hsp;
}#hsp while ends
undef $hit;
}#hit while ends
}#result while end
print "\nReturning Output Array...\n";
undef $in;
return \@outputArray;
} catch Error with
{
my $ex = shift;
print "Exception...!: $ex";
}
}
#fileName : testClient
use Frontier::Client;
# Make an object to represent the XML-RPC server.
$server_url = 'http://localhost:8901/RPC2';
<http://www.google.com/url?sa=D&q=http://localhost:8901/RPC2%27%3B>
$server = Frontier::Client->new(url => $server_url);
# Call the remote server and get our result.
$result = $server->call('blastParser');
print "Got the result back\n". @$result ;
Behind every successful man, there is a woman
And behind every unsuccessful man, there are two...!!!
Yahoo! Messenger with Voice. Make PC-to-Phone Calls
<http://us.rd.yahoo.com/mail_us/taglines/postman1/*http://us.rd.yahoo.com/ev
t=39663/*http://voice.yahoo.com> to the US (and 30+ countries) for 2¢/min
or less.
BLASTN 2.2.11 [Jun-05-2005]
Reference: Altschul, Stephen F., Thomas L. Madden, Alejandro A. Schaffer,
Jinghui Zhang, Zheng Zhang, Webb Miller, and David J. Lipman (1997),
"Gapped BLAST and PSI-BLAST: a new generation of protein database search
programs", Nucleic Acids Res. 25:3389-3402.
Query= 1_636_39
(844 letters)
Database: Chimp_Genome_With_GeneID_coordinates_BUILD1.fasta
40,517 sequences; 3,089,631,664 total letters
Searching...................................................done
Score E
Sequences producing significant alignments: (bits)
Value
112104-112105: 22707394-23965543 224
7e-56
113895-113896: 10715500-10725880 176
1e-41
110427-110428: 29765264-29902644 145
5e-32
108622-108623: 129300340-130310706 141
8e-31
111131: 144643645-144703036 111
7e-22
122818-122819: 145994494-147531331 88
1e-14
>112104-112105: 22707394-23965543
Length = 1258150
Score = 224 bits (113), Expect = 7e-56
Identities = 237/278 (85%), Gaps = 4/278 (1%)
Strand = Plus / Minus
Query: 20 ggccttgttcaattaagcactctattcttaatttactgctaaatcctccttggactctca 79
|||| ||||||| ||||||||||| ||||| ||||||||||||||| |||| ||| || |
Sbjct: 44216 ggccctgttcaactaagcactctactcttagtttactgctaaatccaccttcgaccctta
44157
Query: 80 ggtttcatgagagttatcgtgggttttctaggatagaaaatgtagcccatctttttccgt
139
|||||||| || |||||||| ||| | || ||||||||||||||||| | || ||
Sbjct: 44156 ggtttcataagggttatcgtaattttcatggggtagaaaatgtagcccatttcttgccac
44097
Query: 140 ctcataggctacaccttgacctaacgtttttgcgaaaaggggtacttgcgctcactttgt
199
||||| ||||||||||||||||||||| ||| || ||||||||||||| |||||||
Sbjct: 44096 ctcatgggctacaccttgacctaacgtctttacgt----gggtacttgcgcttactttgt
44041
Query: 200 gacctttatcagggtttgctgaagatggcggtatataggctgagcaagagagggtagggt
259
||||| ||||||||||||||||||||||||||||||||||||||||||| ||| |||
Sbjct: 44040 aaccttcatcagggtttgctgaagatggcggtatataggctgagcaagaggtggtgaggt
43981
Query: 260 ggatcggggtttatcgattatgggacaggctcctctag 297
||||||||||||||||||| | ||||||||||||||
Sbjct: 43980 tgatcggggtttatcgattacagaacaggctcctctag 43943
>113895-113896: 10715500-10725880
Length = 10381
Score = 176 bits (89), Expect = 1e-41
Identities = 230/274 (83%), Gaps = 6/274 (2%)
Strand = Plus / Plus
Query: 25 tgttcaattaagcactctattcttaatttactgctaaatcctccttggactctcaggttt 84
||||||| ||||||||||| ||||| ||||||||||||||| |||| ||| || | |||
Sbjct: 4798 tgttcaactaagcactctactcttagtttactgctaaatccaccttcgacccttaaattt
4857
Query: 85 catgagagttatcgtgggttttctaggatagaaaatgtagcccatctttttccgtctcat 144
||| || |||||||| | |||||| ||||||||||||||||| | || || |||||
Sbjct: 4858 cataagggttatcgtag-ttttctgaagtagaaaatgtagcccatttcttgccacctcat
4916
Query: 145 aggctacaccttgacctaacgtttttgcgaaaaggggtacttgcgctcactttgtgacct 204
||||||||||||||||||||| ||| || ||||||||||||| |||||| | |||
Sbjct: 4917 gggctacaccttgacctaacgtctttacgt----gggtacttgcgcttactttgcggcct
4972
Query: 205 ttatcagggtttgctgaagatggcggtatataggctgagcaagagag-ggtagggtggat 263
| |||||||||||||||||||||||||||||||||||||||||| | ||| ||| |||
Sbjct: 4973 tcgtcagggtttgctgaagatggcggtatataggctgagcaagagggtggtgaggttgat
5032
Query: 264 cggggtttatcgattatgggacaggctcctctag 297
|||||||||||||||| | |||||| |||||||
Sbjct: 5033 cggggtttatcgattacagaacaggcccctctag 5066
>110427-110428: 29765264-29902644
Length = 137381
Score = 145 bits (73), Expect = 5e-32
Identities = 137/158 (86%), Gaps = 4/158 (2%)
Strand = Plus / Minus
Query: 140 ctcataggctacaccttgacctaacgtttttgcgaaaaggggtacttgcgctcactttgt
199
||||| ||||||||||||||||||||| ||| || ||||||||||||| ||||||
Sbjct: 126023 ctcatgggctacaccttgacctaacgtctttacgt----gggtacttgcgcttactttgc
125968
Query: 200 gacctttatcagggtttgctgaagatggcggtatataggctgagcaagagagggtagggt
259
|||| ||||||||||||||||||||||||||||||||||||||||||| ||| |||
Sbjct: 125967 agccttcatcagggtttgctgaagatggcggtatataggctgagcaagaggtggtgaggt
125908
Query: 260 ggatcggggtttatcgattatgggacaggctcctctag 297
||||||||||||||||||| | ||||||||||||||
Sbjct: 125907 tgatcggggtttatcgattacagaacaggctcctctag 125870
>108622-108623: 129300340-130310706
Length = 1010367
Score = 141 bits (71), Expect = 8e-31
Identities = 195/232 (84%), Gaps = 7/232 (3%)
Strand = Plus / Minus
Query: 20 ggccttgttcaattaagcactctattcttaatttactgctaaatcctccttggactctca
79
|||||| |||||||||||||||| || ||||||||||||||||||||||||| | || |
Sbjct: 110910 ggccttattcaattaagcactctgctcctaatttactgctaaatcctccttgggccctta
110851
Query: 80 ggtttcatgagagttatcgtg-ggttttctagga-tagaaaatgtagcccatctttttcc
137
|||||||| || ||| | ||| | |||||||||| |||||||| |||||||| | || ||
Sbjct: 110850 ggtttcataagggttgttgtgagattttctaggagtagaaaatatagcccatttcttacc
110791
Query: 138 gtctcataggctacaccttgacctaacgtttttgcgaaaaggggtacttgcgctcacttt
197
||||| ||||||| ||||||||||||||||| || | | |||||||||| |||||
Sbjct: 110790 acctcatgggctacaacttgacctaacgtttttacgta----gatacttgcgcttacttt
110735
Query: 198 gtgacctttatcagggtttgctgaagatggcggtatataggctgagcaagag 249
| | | ||| ||||||||||||||||||| ||||||||||||||||||||
Sbjct: 110734 g-cagccttactagggtttgctgaagatggcagtatataggctgagcaagag 110684
>111131: 144643645-144703036
Length = 59392
Score = 111 bits (56), Expect = 7e-22
Identities = 153/185 (82%), Gaps = 4/185 (2%)
Strand = Plus / Minus
Query: 113 tagaaaatgtagcccatctttttccgtctcataggctacaccttgacctaacgtttttgc 172
||||||||||||||||| | || || ||||| |||||||||||||||||| ||||||
Sbjct: 9254 tagaaaatgtagcccatttcttaccacctcatgggctacaccttgacctaatgtttttat
9195
Query: 173 gaaaaggggtacttgcgctcactttgtgacctttatcagggtttgctgaagatggcggta 232
| | | |||||| ||| |||||||||| |||| ||||||||||||||||| ||||
Sbjct: 9194 gtaga----tacttgtgcttactttgtgacttttactagggtttgctgaagatgatggta
9139
Query: 233 tataggctgagcaagagagggtagggtggatcggggtttatcgattatgggacaggctcc 292
||||||||||||||||| ||| ||| || |||||||||| ||||| | |||||||||
Sbjct: 9138 tataggctgagcaagaggtggtgaggtaaattggggtttatccattatagaacaggctcc
9079
Query: 293 tctag 297
|||||
Sbjct: 9078 tctag 9074
>122818-122819: 145994494-147531331
Length = 1536838
Score = 87.7 bits (44), Expect = 1e-14
Identities = 111/132 (84%), Gaps = 1/132 (0%)
Strand = Plus / Minus
Query: 39 ctctattcttaatttactgctaaatcctccttggactctcaggtttcatgagagttatcg
98
|||||||||| ||||||| ||||||||||||| ||| | | |||||||||| ||| ||
Sbjct: 1324540 ctctattcttgatttactactaaatcctcctttgacctttaagtttcatgagggttgtca
1324481
Query: 99 tgggttttctaggat-agaaaatgtagcccatctttttccgtctcataggctacaccttg
157
||||| |||||| | ||||||||| |||||| | ||||| |||||| ||||||||||||
Sbjct: 1324480 tgggtgttctagatttagaaaatgtggcccatttctttccatctcatgggctacaccttg
1324421
Query: 158 acctaacgtttt 169
| ||||| ||||
Sbjct: 1324420 atctaacatttt 1324409
Database: Chimp_Genome_With_GeneID_coordinates_BUILD1.fasta
Posted date: Nov 16, 2005 5:29 PM
Number of letters in database: 3,089,631,664
Number of sequences in database: 40,517
Lambda K H
1.37 0.711 1.31
Gapped
Lambda K H
1.37 0.711 1.31
Matrix: blastn matrix:1 -3
Gap Penalties: Existence: 5, Extension: 2
Number of Hits to DB: 1,543,047
Number of Sequences: 40517
Number of extensions: 1543047
Number of successful extensions: 4846
Number of sequences better than 1.0e-10: 6
Number of HSP's better than 0.0 without gapping: 5
Number of HSP's successfully gapped in prelim test: 1
Number of HSP's that attempted gapping in prelim test: 4821
Number of HSP's gapped (non-prelim): 20
length of query: 844
length of database: 3,089,631,664
effective HSP length: 21
effective length of query: 823
effective length of database: 3,088,780,807
effective search space: 2542066604161
effective search space used: 2542066604161
T: 0
A: 0
X1: 11 (21.8 bits)
X2: 15 (29.7 bits)
S1: 12 (24.3 bits)
S2: 38 (75.8 bits)
------ End of Forwarded Message
More information about the Bioperl-l
mailing list