From 9d27fe76faddc272ea2c79ad000de4b65354274e Mon Sep 17 00:00:00 2001 From: martinahansen Date: Thu, 22 Oct 2009 05:48:35 +0000 Subject: [PATCH] added www git-svn-id: http://biopieces.googlecode.com/svn/trunk@706 74ccb610-7750-0410-82ae-013aeee3265d --- www/cgi-bin/index.cgi | 266 +++++ www/cgi-bin/test.svg | 2270 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2536 insertions(+) create mode 100755 www/cgi-bin/index.cgi create mode 100644 www/cgi-bin/test.svg diff --git a/www/cgi-bin/index.cgi b/www/cgi-bin/index.cgi new file mode 100755 index 0000000..3e8461b --- /dev/null +++ b/www/cgi-bin/index.cgi @@ -0,0 +1,266 @@ +#!/usr/bin/env perl + +# Copyright (C) 2006-2009 Martin A. Hansen. + +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# http://www.gnu.org/copyleft/gpl.html + +# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + +use strict; +use warnings; + +use lib "/Users/maasha/biopieces/code_perl/"; + +use CGI; +use Data::Dumper; +use Maasha::Common; +use Maasha::XHTML; + +my ( $cgi, $script, @html ); + +$cgi = new CGI; + +$script = Maasha::Common::get_scriptname(); + +push @html, Maasha::XHTML::html_header( + cgi_header => 1, + title => "KISS Genome Browser", +# css_file => "test.css", + author => "Martin A. Hansen, mail\@maasha.dk", + description => "Biopieces bacterial genome browser - KISS", + keywords => [ qw( KISS Biopieces genome browser bacterium bacteria prokaryote prokaryotes ) ], + no_cache => 1, +); + +push @html, Maasha::XHTML::h1( txt => "KISS Genome Browser", class => "center" ); +push @html, Maasha::XHTML::form_beg( action => $script, method => "get", enctype => "multipart/form-data" ); + +push @html, sec_navigate( $cgi ); +push @html, sec_browse(); + +push @html, Maasha::XHTML::form_end; +push @html, Maasha::XHTML::body_end; +push @html, Maasha::XHTML::html_end; + +print "$_\n" foreach @html; + + +# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + +sub sec_navigate +{ + my ( $cgi, # CGI object + ) = @_; + + # Returns a list. + + my ( $list_clade, $list_genome, $list_assembly, $list_contig, $def_clade, $def_genome, $def_assembly, $def_contig, $def_start, $def_end, @html ); + + $list_clade = nav_list_clade(); + $list_genome = nav_list_genome(); + $list_assembly = nav_list_assembly(); + $list_contig = nav_list_contig(); + + $def_clade = nav_def_clade( $cgi ); + $def_genome = nav_def_genome( $cgi ); + $def_assembly = nav_def_assembly( $cgi ); + $def_contig = nav_def_contig( $cgi ); + $def_start = nav_def_start( $cgi ); + $def_end = nav_def_end( $cgi ); + + push @html, Maasha::XHTML::table_beg( summary => "Navigation table" ); + push @html, Maasha::XHTML::table_row_simple( tr => [ qw( Clade Genome Assembly Contig Start End ) ], align => 'center' ); + push @html, Maasha::XHTML::table_row_simple( tr => [ + Maasha::XHTML::menu( name => "nav_clade", options => $list_clade, selected => $def_clade ), + Maasha::XHTML::menu( name => "nav_genome", options => $list_genome, selected => $def_genome ), + Maasha::XHTML::menu( name => "nav_assembly", options => $list_assembly, selected => $def_assembly ), + Maasha::XHTML::menu( name => "nav_contig", options => $list_contig, selected => $def_contig ), + Maasha::XHTML::text( name => "nav_start", value => $def_start, size => 20 ), + Maasha::XHTML::text( name => "nav_end", value => $def_end, size => 20 ), + Maasha::XHTML::submit( name => "nav_submit", value => "Submit" ), + ] ); + push @html, Maasha::XHTML::table_end; + + return wantarray ? @html : \@html; +} + + +sub sec_browse +{ + my ( @html ); + + push @html, Maasha::XHTML::object( type => "image/svg+xml", + # data => "/Users/maasha/test.svg", + data => "test.svg", + name => "owMain", + width => "1200", + height => "800" ); + + return wantarray ? @html : \@html; +} + + +sub nav_list_clade +{ + my ( $list_clade ); + + $list_clade = [ qw( Eukaryote Bacillus Fish ) ]; + + return wantarray ? @{ $list_clade } : $list_clade; +} + + +sub nav_list_genome +{ + my ( $list_genome ); + + $list_genome = [ qw( S.aur_COL E.col B.sub ) ]; + + return wantarray ? @{ $list_genome } : $list_genome; +} + + +sub nav_list_assembly +{ + my ( $list_assembly ); + + $list_assembly = [ qw( 2008-02-21 2009-01-23 ) ]; + + return wantarray ? @{ $list_assembly } : $list_assembly; +} + + +sub nav_list_contig +{ + my ( $list_contig ); + + $list_contig = [ qw( chr1 chr2 ) ]; + + return wantarray ? @{ $list_contig } : $list_contig; +} + + +sub nav_def_clade +{ + my ( $def_clade ); + + if ( defined $cgi->param( 'nav_clade' ) ) + { + $def_clade = $cgi->param( 'nav_clade' ); + } + else + { + $def_clade = "Bacteria"; + } + + return $def_clade; +} + + +sub nav_def_genome +{ + my ( $def_genome ); + + if ( defined $cgi->param( 'nav_genome' ) ) + { + $def_genome = $cgi->param( 'nav_genome' ); + } + else + { + $def_genome = "S.aur_COL"; + } + + return $def_genome; +} + + +sub nav_def_assembly +{ + my ( $def_assembly ); + + if ( defined $cgi->param( 'nav_assembly' ) ) + { + $def_assembly = $cgi->param( 'nav_assembly' ); + } + else + { + $def_assembly = "2009-01-23"; + } + + return $def_assembly; +} + + +sub nav_def_contig +{ + my ( $def_contig ); + + if ( defined $cgi->param( 'nav_contig' ) ) + { + $def_contig = $cgi->param( 'nav_contig' ); + } + else + { + $def_contig = "chr1"; + } + + return $def_contig; +} + + +sub nav_def_start +{ + my ( $def_start ); + + if ( defined $cgi->param( 'nav_start' ) ) + { + $def_start = $cgi->param( 'nav_start' ); + } + else + { + $def_start = 1; + } + + return $def_start; +} + + +sub nav_def_end +{ + my ( $def_end ); + + if ( defined $cgi->param( 'nav_end' ) ) + { + $def_end = $cgi->param( 'nav_end' ); + } + else + { + $def_end = 2809422; + } + + return $def_end; +} + + +# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + + +__END__ + + + diff --git a/www/cgi-bin/test.svg b/www/cgi-bin/test.svg new file mode 100644 index 0000000..31ced33 --- /dev/null +++ b/www/cgi-bin/test.svg @@ -0,0 +1,2270 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- 2.39.5