line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::FuncNet::Request; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
2941
|
use strict; |
|
2
|
|
|
|
|
17
|
|
|
2
|
|
|
|
|
90
|
|
4
|
2
|
|
|
2
|
|
12
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
75
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
12
|
use base 'WebService::FuncNet'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
748
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.2'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
WebService::FuncNet::Request - object representing a request |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 FUNCTIONS |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head2 new |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
Creates a new request object. Takes as input a reference to an array of reference proteins, |
19
|
|
|
|
|
|
|
a reference to an array of query proteins and optionally an email address used for tracking |
20
|
|
|
|
|
|
|
the job at a later stage. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my $ra_ref_proteins = [ 'A3EXL0','Q8NFN7', 'O75865' ]; |
23
|
|
|
|
|
|
|
my $ra_query_proteins = [ 'Q9H8H3','Q5SR05','P22676' ]; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my $r = WebService::FuncNet::Request->new( |
26
|
|
|
|
|
|
|
$ra_ref_proteins, |
27
|
|
|
|
|
|
|
$ra_query_proteins, |
28
|
|
|
|
|
|
|
[ 'test@example.com' ] ); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
This subroutine returns I on error. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub new { |
35
|
|
|
|
|
|
|
my $class = shift; |
36
|
|
|
|
|
|
|
my $ra_ref_proteins = shift; |
37
|
|
|
|
|
|
|
my $ra_query_proteins = shift; |
38
|
|
|
|
|
|
|
my $email = shift || 'anonymous-perl-user@funcnet.eu'; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
my $self = { }; |
41
|
|
|
|
|
|
|
bless $self, $class; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
unless ( defined $ra_query_proteins |
44
|
|
|
|
|
|
|
&& defined $ra_ref_proteins ) { |
45
|
|
|
|
|
|
|
return; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
if ( ! $self->{'clients'} ) { |
49
|
|
|
|
|
|
|
$self->{'clients'} = $self->init( ); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
$self->{'params'} = { |
53
|
|
|
|
|
|
|
'queryProteins' => { p => $ra_query_proteins }, |
54
|
|
|
|
|
|
|
'refProteins' => { p => $ra_ref_proteins }, |
55
|
|
|
|
|
|
|
'emailAddress' => $email, |
56
|
|
|
|
|
|
|
'enableEmailNotify' => 1, |
57
|
|
|
|
|
|
|
}; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
return $self; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 submit |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Submits the request to the frontend. This is done by implementing the |
65
|
|
|
|
|
|
|
I SOAP method in the background. The frontend by default |
66
|
|
|
|
|
|
|
will submit the request to all available predictors. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
This subroutine returns a L object. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
my $j = $r->submit( ); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
This subroutine will return I on error. |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=cut |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
sub submit { |
77
|
|
|
|
|
|
|
my $self = shift; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
my ( $answer, $trace ) = |
80
|
|
|
|
|
|
|
$self->{'clients'}->{'SubmitTwoProteinSets'}->( |
81
|
|
|
|
|
|
|
'parameters' => $self->{'params'} ); |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
if ( $answer ) { |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
my $rh_job_params = { |
86
|
|
|
|
|
|
|
'id' => $answer->{'parameters'}->{'jobID'}, |
87
|
|
|
|
|
|
|
'emailAddress' => $self->{'params'}->{'emailAddress'}, |
88
|
|
|
|
|
|
|
'clients' => $self->{'clients'}, |
89
|
|
|
|
|
|
|
}; |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
return WebService::FuncNet::Job->new( $rh_job_params ); |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
} else { |
94
|
|
|
|
|
|
|
return; |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
1; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=head1 REVISION INFO |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
Revision: $Rev: 64 $ |
104
|
|
|
|
|
|
|
Last editor: $Author: andrew_b_clegg $ |
105
|
|
|
|
|
|
|
Last updated: $Date: 2009-07-06 16:12:20 +0100 (Mon, 06 Jul 2009) $ |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
The latest source code for this project can be checked out from: |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
https://funcnet.svn.sf.net/svnroot/funcnet/trunk |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=cut |