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

  
use CXGN::Page::FormattingHelpers qw | info_section_html |;  
  #sgn id, collections, and sources
  my $about_html='';
my $sources=$marker->derived_from_sources();
if($sources and @{$sources}) {
  for my $source(@{$sources}) {
    my $link='';
    if($source->{id_in_source}) {
      if($source->{source_name} eq 'SGN unigene') {
	$link="<a href=\"/search/unigene.pl?unigene_id=$source->{id_in_source}\">$source->{source_name} SGN-U$source->{id_in_source}</a>";
      }
      elsif($source->{source_name} eq 'EST read') {
	$link="<a href=\"/search/est.pl?request_from=0&amp;request_id=SGN-E$source->{id_in_source}&amp;request_type=7&amp;search=search\">EST read SGN-E$source->{id_in_source}</a>";
      }
      elsif($source->{source_name} eq 'EST clone') {
	$link="<a href=\"/search/est.pl?request_from=0&amp;request_id=SGN-C$source->{id_in_source}&amp;request_type=8&amp;search=search\">EST clone SGN-C$source->{id_in_source}</a>";
      }
      elsif($source->{source_name} eq 'BAC') {
	my $clone=CXGN::Genomic::Clone->retrieve($source->{id_in_source});
	my $bac_name=$clone->clone_name();
	$link="<a href=\"/maps/physical/clone_info.pl?id=$source->{id_in_source} \">BAC $bac_name</a>";
      }
    }
    else {
      $link="a(n) $source->{source_name} (ID unknown)";
    }
    if($link) {
      $about_html.="This marker was derived from $link<br />";
    }
  }
}
if($about_html) {
  print info_section_html(title=>'Derivations',contents=>$about_html);
}

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

)
;