3 # Copyright (C) 2006-2009 Martin A. Hansen.
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 # http://www.gnu.org/copyleft/gpl.html
21 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
26 use lib "/Users/maasha/biopieces/code_perl/";
33 my ( $cgi, $script, @html );
37 $script = Maasha::Common::get_scriptname();
39 push @html, Maasha::XHTML::html_header(
41 title => "KISS Genome Browser",
42 # css_file => "test.css",
43 author => "Martin A. Hansen, mail\@maasha.dk",
44 description => "Biopieces bacterial genome browser - KISS",
45 keywords => [ qw( KISS Biopieces genome browser bacterium bacteria prokaryote prokaryotes ) ],
49 push @html, Maasha::XHTML::h1( txt => "KISS Genome Browser", class => "center" );
50 push @html, Maasha::XHTML::form_beg( action => $script, method => "get", enctype => "multipart/form-data" );
52 push @html, sec_navigate( $cgi );
53 push @html, sec_browse();
55 push @html, Maasha::XHTML::form_end;
56 push @html, Maasha::XHTML::body_end;
57 push @html, Maasha::XHTML::html_end;
59 print "$_\n" foreach @html;
62 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
67 my ( $cgi, # CGI object
72 my ( $list_clade, $list_genome, $list_assembly, $list_contig, $def_clade, $def_genome, $def_assembly, $def_contig, $def_start, $def_end, @html );
74 $list_clade = nav_list_clade();
75 $list_genome = nav_list_genome();
76 $list_assembly = nav_list_assembly();
77 $list_contig = nav_list_contig();
79 $def_clade = nav_def_clade( $cgi );
80 $def_genome = nav_def_genome( $cgi );
81 $def_assembly = nav_def_assembly( $cgi );
82 $def_contig = nav_def_contig( $cgi );
83 $def_start = nav_def_start( $cgi );
84 $def_end = nav_def_end( $cgi );
86 push @html, Maasha::XHTML::table_beg( summary => "Navigation table" );
87 push @html, Maasha::XHTML::table_row_simple( tr => [ qw( Clade Genome Assembly Contig Start End ) ], align => 'center' );
88 push @html, Maasha::XHTML::table_row_simple( tr => [
89 Maasha::XHTML::menu( name => "nav_clade", options => $list_clade, selected => $def_clade ),
90 Maasha::XHTML::menu( name => "nav_genome", options => $list_genome, selected => $def_genome ),
91 Maasha::XHTML::menu( name => "nav_assembly", options => $list_assembly, selected => $def_assembly ),
92 Maasha::XHTML::menu( name => "nav_contig", options => $list_contig, selected => $def_contig ),
93 Maasha::XHTML::text( name => "nav_start", value => $def_start, size => 20 ),
94 Maasha::XHTML::text( name => "nav_end", value => $def_end, size => 20 ),
95 Maasha::XHTML::submit( name => "nav_submit", value => "Submit" ),
97 push @html, Maasha::XHTML::table_end;
99 return wantarray ? @html : \@html;
107 push @html, Maasha::XHTML::object( type => "image/svg+xml",
108 # data => "/Users/maasha/test.svg",
114 return wantarray ? @html : \@html;
122 $list_clade = [ qw( Eukaryote Bacillus Fish ) ];
124 return wantarray ? @{ $list_clade } : $list_clade;
132 $list_genome = [ qw( S.aur_COL E.col B.sub ) ];
134 return wantarray ? @{ $list_genome } : $list_genome;
138 sub nav_list_assembly
140 my ( $list_assembly );
142 $list_assembly = [ qw( 2008-02-21 2009-01-23 ) ];
144 return wantarray ? @{ $list_assembly } : $list_assembly;
152 $list_contig = [ qw( chr1 chr2 ) ];
154 return wantarray ? @{ $list_contig } : $list_contig;
162 if ( defined $cgi->param( 'nav_clade' ) )
164 $def_clade = $cgi->param( 'nav_clade' );
168 $def_clade = "Bacteria";
179 if ( defined $cgi->param( 'nav_genome' ) )
181 $def_genome = $cgi->param( 'nav_genome' );
185 $def_genome = "S.aur_COL";
194 my ( $def_assembly );
196 if ( defined $cgi->param( 'nav_assembly' ) )
198 $def_assembly = $cgi->param( 'nav_assembly' );
202 $def_assembly = "2009-01-23";
205 return $def_assembly;
213 if ( defined $cgi->param( 'nav_contig' ) )
215 $def_contig = $cgi->param( 'nav_contig' );
219 $def_contig = "chr1";
230 if ( defined $cgi->param( 'nav_start' ) )
232 $def_start = $cgi->param( 'nav_start' );
247 if ( defined $cgi->param( 'nav_end' ) )
249 $def_end = $cgi->param( 'nav_end' );
260 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<