[Bio] / Clearinghouse / clearinghouse_register.pl Repository:
ViewVC logotype

View of /Clearinghouse/clearinghouse_register.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (download) (as text) (annotate)
Mon Oct 9 16:43:48 2006 UTC (13 years ago) by olson
Branch: MAIN
CVS Tags: myrast_33, HEAD
Changes since 1.3: +1 -1 lines
some minor fixes.

#!/usr/bin/perl

use CH_Config;
use CGI qw/:standard/;
use File::Temp qw/ :mktemp /;

use SOAP::Lite;

use Clearinghouse::utils;

print header,
    start_html('Clearinghouse Genome and Feature Registration'),
    get_page_header(),
    h1('Clearinghouse Genome and Feature Registration');

if (param('registergenome')) {
	print_genome_results();
	print_returns();
} elsif (param('registerfeature')) {
	print_feature_results();
	print_returns();
} else{
	 print_start();
}
print end_html;
exit;


sub print_start {
        print start_multipart_form();
	if (param('TYPE') eq 'genome') {
		print h1("Genome Registration"),
	       "Your Genome Taxon: ", textfield(-name=>'taxon', -size=>30), br,br,
		submit(-label=>'Register Genome', -name=>'registergenome');
	} else {
		print h1("Feature Registration"),
	       "Genome ID for your feature: ", textfield(-name=>'genomeid', -size=>20), 
	       "Type of your feature: ", textfield(-name=>'type', -size=>10),br,br, 
	       "Number of id's:", textfield(-name=>'number_of_ids', -size=>10),br,br, 
		submit(-label=>'Register Feature', -name=>'registerfeature');
       }
	print end_form;
}

sub print_genome_results {
	#here, make the web service calls to register this genome
    my $taxon = param('taxon');

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

     $response = $proxy->register_genome($taxon);
     if ($response->fault) {
		print "Failed to deposit: ", $response->faultcode, " ", $response->faultstring, br;
     }
	print "Your Genome id is $taxon.", $response->result, "    Remember to put this in your GFF3 file", br, br;

}

sub print_feature_results {
	#here, make the web service calls to register this genome
    my $genome = param('genomeid');
    my $type = param('type');
    my $number = param('number_of_ids');

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

     $response = $proxy->register_feature($genome, $type, $number);
     if ($response->fault) {
		print "Failed to deposit: ", $response->faultcode, " ", $response->faultstring, br;
     }
	print "Your first id of $number id's is ", $response->result, "    Remember to put these in your GFF3 file", br, br;

}

sub print_returns() {
	print a({href=>'clearinghouse_upload.cgi'}, "Go to Clearinghouse Home Page"), p;
	print a({href=>"clearinghouse_browser.cgi"}, "Go to clearing house browser"), p;
	print a({href=>'clearinghouse_register.cgi?TYPE=genome'}, "Go to Genome registration page"), p;
	print a({href=>'clearinghouse_register.cgi?TYPE=feature'}, "Go Feature registration page");
}

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3