[Bio] / FigKernelScripts / register_features_with_clearinghouse.pl Repository:
ViewVC logotype

Annotation of /FigKernelScripts/register_features_with_clearinghouse.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (view) (download) (as text)

1 : olson 1.1
2 :     use SOAP::Lite;
3 :     use strict;
4 :    
5 :     my $usage = "register_features_with_clearinghouse genome_id type num_features\n";
6 :    
7 :     my $service_url = "http://clearinghouse.theseed.org/Clearinghouse/clearinghouse_services.cgi";
8 :    
9 :    
10 :     my $proxy = SOAP::Lite-> uri('http://www.soaplite.com/Scripts') -> proxy($service_url);
11 :    
12 :     if (@ARGV != 3)
13 :     {
14 :     die $usage;
15 :     }
16 :    
17 :     my $genome = shift;
18 :     my $type = shift;
19 :     my $n_features = shift;
20 :    
21 :     my @valid_types = qw(peg pp rna pi);
22 :     my %valid_types;
23 :     map { $valid_types{$_}++ } @valid_types;
24 :    
25 :     if (!$valid_types{$type})
26 :     {
27 :     die "Type '$type' should be one of @valid_types\n";
28 :     }
29 :    
30 :     if ($genome !~ /^\d+\.\d+$/)
31 :     {
32 :     die "Invalid genome id '$genome'\n";
33 :     }
34 :    
35 :     if ($n_features !~ /^\d+$/ or $n_features <= 0)
36 :     {
37 :     die "Number of features '$n_features' needs to be a positive number\n";
38 :     }
39 :    
40 :     #
41 :     # Everything validated.
42 :     #
43 :    
44 :     my $response = $proxy->register_feature($genome, $type, $n_features);
45 :    
46 :     if ($response->fault)
47 :     {
48 :     die "Failed to register: ", $response->faultcode, " ", $response->faultstring, "\n";
49 :     }
50 :    
51 :     my $start = $response->result;
52 :     my $end = $start + $n_features - 1;
53 :    
54 :     print "$start\t$end\n";

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3