package SGN::View::Mason::Commands;
use strict;
use vars qw($m $c);
HTML::Mason::Component::FileBased->new(
'code' => sub {
use utf8; local $SGN::View::Mason::Commands::m = $HTML::Mason::Commands::m;
HTML::Mason::Exception::Params->throw
    ( error =>
      "Odd number of parameters passed to component expecting name/value pairs"
    ) if @_ % 2;
my ( $marker );
{
    my %pos;
    for ( my $x = 0; $x < @_; $x += 2 )
    {
        $pos{ $_[$x] } = $x + 1;
    }

    foreach my $arg ( qw( marker ) )
    {
        HTML::Mason::Exception::Params->throw
            ( error => "no value sent for required parameter '$arg'" )
                unless exists $pos{$arg};
    }
#line 31 "/home/production/cxgn/sgn/mason/markers/ssr.mas"
    $marker = $_[ $pos{'marker'} ];
}
$m->debug_hook( $m->current_comp->path ) if ( HTML::Mason::Compiler::IN_PERL_DB() );

#line 1 "/home/production/cxgn/sgn/mason/markers/ssr.mas"
$m->print( '
' );
#line 29 "/home/production/cxgn/sgn/mason/markers/ssr.mas"
$m->print( '
' );
#line 33 "/home/production/cxgn/sgn/mason/markers/ssr.mas"
$m->print( '
' );
#line 34 "/home/production/cxgn/sgn/mason/markers/ssr.mas"


  if (!$marker->ssr_data()) { return; }

my $marker_id = $marker->marker_id();

my $html = "";
#my $query = 'SELECT repeat_motif, reapeat_nr FROM ssr_repeats WHERE marker_id='.$marker_id;
#my $repeats = $dbh->selectall_arrayref($query);
my $contig_page='/search/unigene.pl?type=legacy&';
my $est_page='/search/est.pl?request_type=automatic&amp;request_from=1&amp;request_id=';
my $ssr_page='/search/markers/markerinfo.pl?marker_id=';
#my @ssr_list;

my ($ssr_id, $ssr_name, $est_trace, $start_primer, $end_primer, $pcr_length, $ann_high, $ann_low) = $marker->ssr_data();
    
    

  $ann_high ||= "n/a";
  $ann_low ||= "n/a";
  # Get the repeat motifs.
#  my @repeat_motifs=();
#  my @repeat_numbers=();

   $html.="<br /><b>Annealing temperatures:</b> <b>Low:</b> " . $ann_low . " <b>High:</b> " . $ann_high;  

my @motifs = $marker->ssr_motif_info($ssr_id);
foreach my $m (@motifs) { 
  my ($motif, $r_nr)  = ($m->[0], $m->[1]);
  
  $html.="<br /><b>Repeat motif:</b> <span class=\"sequence\">$motif</span>&nbsp;&nbsp;&nbsp;<b>Repeat number:</b> $r_nr";
}
$html.="<br /><b>Forward primer:</b> <span class=\"sequence\">$start_primer</span>";
$html.="<br /><b>Reverse primer:</b> <span class=\"sequence\">$end_primer</span>";
$html.="<br /><b>Predicted size:</b> $pcr_length";

if($html) {
  $html =  CXGN::Page::FormattingHelpers::info_section_html(title=>'SSR info',contents=>$html)
}
else {
  $html = '';
}


#line 79 "/home/production/cxgn/sgn/mason/markers/ssr.mas"
$m->print( '
' );
#line 80 "/home/production/cxgn/sgn/mason/markers/ssr.mas"
$m->print(  $html  );
#line 80 "/home/production/cxgn/sgn/mason/markers/ssr.mas"
$m->print( '
' );
;return;
},
'declared_args' => {
  '$marker' => { default => undef }
},
'load_time' => 1763079527,

)
;