- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "page", value => "dna" ) );
- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "user", value => "$cookie->{ 'USER' }" ) );
- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "clade", value => "$cookie->{ 'CLADE' }" ) );
- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "genome", value => "$cookie->{ 'GENOME' }" ) );
- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "assembly", value => "$cookie->{ 'ASSEMBLY' }" ) );
- push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "contig", value => "$cookie->{ 'CONTIG' }" ) );
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "page", value => "dna" ) );
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "user", value => $cookie->{ 'USER' } ) );
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "clade", value => $cookie->{ 'CLADE' } ) );
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "genome", value => $cookie->{ 'GENOME' } ) );
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "assembly", value => $cookie->{ 'ASSEMBLY' } ) );
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::hidden( name => "contig", value => $cookie->{ 'CONTIG' } ) );
+
+ return wantarray ? @html : \@html;
+}
+
+
+sub section_export_pdf
+{
+ # Martin A. Hansen, March 2010.
+
+ # Returns a HTML section with export table.
+
+ my ( $cookie, # cookie hash
+ ) = @_;
+
+ # Returns a list.
+
+ my ( @tracks, @track_list, $i, $file, @html );
+
+ push @tracks, [ Maasha::BGB::Track::track_ruler( $cookie ) ];
+ push @tracks, [ Maasha::BGB::Track::track_seq( $cookie ) ];
+
+ @track_list = Maasha::BGB::Track::list_track_dir( $cookie->{ 'USER' }, $cookie->{ 'CLADE' }, $cookie->{ 'GENOME' }, $cookie->{ 'ASSEMBLY' }, $cookie->{ 'CONTIG' } );
+
+ for ( $i = 0; $i < @track_list; $i++ )
+ {
+ $cookie->{ 'FEAT_COLOR' } = Maasha::BGB::Draw::palette( $i );
+
+ push @tracks, [ Maasha::BGB::Track::track_feature( $track_list[ $i ], $cookie ) ];
+ }
+
+ unshift @tracks, [ Maasha::BGB::Track::track_grid( $cookie ) ];
+
+ $file = "$cookie->{ 'SESSION_DIR' }/$cookie->{ 'USER' }/BGB_export.pdf";
+
+ Maasha::BGB::Draw::render_pdf_file( $file, $cookie->{ 'IMG_WIDTH' }, $cookie->{ 'TRACK_OFFSET' }, \@tracks );
+
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::ln( txt => "BGB_export.pdf", href => $file ), class => 'center' );
+
+ return wantarray ? @html : \@html;
+}
+
+
+sub section_export_svg
+{
+ # Martin A. Hansen, March 2010.
+
+ # Export view in SVG format.
+
+ my ( $cookie, # cookie hash
+ ) = @_;
+
+ # Returns a list.
+
+ my ( @tracks, @track_list, $i, $file, @html );
+
+ push @tracks, [ Maasha::BGB::Track::track_ruler( $cookie ) ];
+ push @tracks, [ Maasha::BGB::Track::track_seq( $cookie ) ];
+
+ @track_list = Maasha::BGB::Track::list_track_dir( $cookie->{ 'USER' }, $cookie->{ 'CLADE' }, $cookie->{ 'GENOME' }, $cookie->{ 'ASSEMBLY' }, $cookie->{ 'CONTIG' } );
+
+ for ( $i = 0; $i < @track_list; $i++ )
+ {
+ $cookie->{ 'FEAT_COLOR' } = Maasha::BGB::Draw::palette( $i );
+
+ push @tracks, [ Maasha::BGB::Track::track_feature( $track_list[ $i ], $cookie ) ];
+ }
+
+ unshift @tracks, [ Maasha::BGB::Track::track_grid( $cookie ) ];
+
+ $file = "$cookie->{ 'SESSION_DIR' }/$cookie->{ 'USER' }/BGB_export.svg";
+
+ Maasha::BGB::Draw::render_svg_file( $file, $cookie->{ 'IMG_WIDTH' }, $cookie->{ 'TRACK_OFFSET' }, \@tracks );
+
+ push @html, Maasha::XHTML::p( txt => Maasha::XHTML::ln( txt => "BGB_export.svg", href => $file ), class => 'center' );