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 29 "/home/production/cxgn/sgn/mason/markers/cos.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/cos.mas"
$m->print( '
' );
#line 27 "/home/production/cxgn/sgn/mason/markers/cos.mas"
$m->print( '
' );
#line 31 "/home/production/cxgn/sgn/mason/markers/cos.mas"
$m->print( '
' );
#line 32 "/home/production/cxgn/sgn/mason/markers/cos.mas"


#   my $cos_query = q{SELECT c.cos_marker_id, c.marker_id, c.cos_id, c.at_match, 
# 	    c.at_position, c.bac_id, c.best_gb_prot_hit, c.at_evalue, 
# 	    c.at_identities, c.mips_cat, c.description, c.comment, 
# 	    c.gbprot_evalue, c.gbprot_identities, s.trace_name 
# 	    FROM cos_markers AS c LEFT JOIN seqread AS s ON 
# 	    c.est_read_id=s.read_id WHERE c.marker_id = ?};

#   my $cos_sth = $dbh->prepare($cos_query);
#   $cos_sth->execute($marker_id);
#   my $r = $cos_sth->fetchrow_hashref();

  my $r = $marker->cos_data();

  unless($r->{cos_marker_id}) { return''; }

  my $at_page='http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&amp;db=Nucleotide&amp;dopt=GenBank&amp;list_uids=';
  my $map_link='/search/markers/markerinfo.pl?marker_id=';
  my $est_read_page='/search/est.pl?request_from=0&amp;request_type=automatic&amp;search=Search&amp;request_id=';
  my $cos_page='/search/markers/markerinfo.pl?marker_id=';
  my $at_match=$r->{at_match};
  my $bac_id=$r->{bac_id};
  my $trace_name=$r->{trace_name};
  my $at_posn=$r->{at_position};
  if($trace_name) {
    $trace_name="<a href=\"$est_read_page$trace_name\">$trace_name</a>"
  }
  else {
    $trace_name="<span class=\"ghosted\">None</span>";
  }

  my $orth = <<EOT;
<b>Arabidopsis identities: </b>$r->{at_identities}<br />
EOT
  ;

my $basic = <<HTML;
<b><a href="/documents/markers/role_categories.txt">MIPS Category</a>: </b>$r->{mips_cat}<br />
<b>Tomato EST read:</b> $trace_name<br />
<b>Arabidopsis best BAC match:</b> <a href="$at_page$bac_id">$at_match</a><br />
<b>Arabidopsis position:</b> $at_posn<br />
HTML

  my $genbank = <<EOT;
<b>Best GenBank protein hit: </b><a href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=Protein&amp;cmd=search&amp;term=$r->{best_gb_prot_hit}">$r->{best_gb_prot_hit}</a><br />
<b>Evalue: </b>$r->{gbprot_evalue}<br />
<b>Identities: </b>$r->{gbprot_identities}<br />
<b>Description: </b>$r->{description}<br />
<b>Comment: </b>$r->{comment}<br />
More information about COS markers can be found on the <a href="/markers/cos_markers.pl">COS markers</a> page.
EOT
  ;

### print  CXGN::Page::FormattingHelpers::blue_section_html('COS information', $basic.$orth.$genbank);

#line 89 "/home/production/cxgn/sgn/mason/markers/cos.mas"
$m->print( '

' );
#line 91 "/home/production/cxgn/sgn/mason/markers/cos.mas"
$m->comp( { content => sub {
#line 91 "/home/production/cxgn/sgn/mason/markers/cos.mas"
$m->print( ' ' );
#line 91 "/home/production/cxgn/sgn/mason/markers/cos.mas"
$m->print(  $basic.$orth.$genbank  );
#line 91 "/home/production/cxgn/sgn/mason/markers/cos.mas"
$m->print( ' ' );
#line 91 "/home/production/cxgn/sgn/mason/markers/cos.mas"
} }, '/page/info_section.mas', title=>'COS information'
 );
#line 91 "/home/production/cxgn/sgn/mason/markers/cos.mas"
$m->print( '




' );
;return;
},
'declared_args' => {
  '$marker' => { default => undef }
},
'load_time' => 1763079527,

)
;