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

View of /FigKernelScripts/register_features_with_clearinghouse.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (as text) (annotate)
Wed Aug 3 20:08:08 2005 UTC (14 years, 10 months ago) by olson
Branch: MAIN
CVS Tags: caBIG-dataload-0, caBIG-00-00-00
New script to register feature IDs with the clearinghouse.

use SOAP::Lite;
use strict;

my $usage = "register_features_with_clearinghouse genome_id type num_features\n";

my $service_url = "http://clearinghouse.theseed.org/Clearinghouse/clearinghouse_services.cgi";


my $proxy = SOAP::Lite-> uri('http://www.soaplite.com/Scripts') -> proxy($service_url);

if (@ARGV != 3)
{
    die $usage;
}

my $genome = shift;
my $type = shift;
my $n_features = shift;

my @valid_types = qw(peg pp rna pi);
my %valid_types;
map { $valid_types{$_}++ } @valid_types;

if (!$valid_types{$type})
{
    die "Type '$type' should be one of @valid_types\n";
}

if ($genome !~ /^\d+\.\d+$/)
{
    die "Invalid genome id '$genome'\n";
}

if ($n_features !~ /^\d+$/ or $n_features <= 0)
{
    die "Number of features '$n_features' needs to be a positive number\n";
}

#
# Everything validated.
#

my $response = $proxy->register_feature($genome, $type, $n_features);

if ($response->fault)
{
    die "Failed to register: ", $response->faultcode, " ", $response->faultstring, "\n";
}

my $start = $response->result;
my $end = $start + $n_features - 1;

print "$start\t$end\n";

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3