Merge pull request #4106 from solgenomics/topic/wishlist
[sgn.git] / mason / markers / derivation.mas
blobd392a754caa18b7468dde0dda0f6c009ffefff09
2 <%doc>
4 =head1 NAME
6 /markers/derivation.mas - a Mason component displaying information about how a marker was derived.
8 =head1 DESCRIPTION
10 parameters 
12 =over 5
14 =item *
16 $marker - a CXGN::Marker object.
18 =back
20 =head1 AUTHOR
22 Lukas Mueller <lam87@cornell.edu>
24 =cut
26 </%doc>
28 <%args>
29 $marker
30 </%args>
32 <%perl>
33   
34 use CXGN::Page::FormattingHelpers qw | info_section_html |;  
35   #sgn id, collections, and sources
36   my $about_html='';
37 my $sources=$marker->derived_from_sources();
38 if($sources and @{$sources}) {
39   for my $source(@{$sources}) {
40     my $link='';
41     if($source->{id_in_source}) {
42       if($source->{source_name} eq 'SGN unigene') {
43         $link="<a href=\"/search/unigene.pl?unigene_id=$source->{id_in_source}\">$source->{source_name} SGN-U$source->{id_in_source}</a>";
44       }
45       elsif($source->{source_name} eq 'EST read') {
46         $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>";
47       }
48       elsif($source->{source_name} eq 'EST clone') {
49         $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>";
50       }
51       elsif($source->{source_name} eq 'BAC') {
52         my $clone=CXGN::Genomic::Clone->retrieve($source->{id_in_source});
53         my $bac_name=$clone->clone_name();
54         $link="<a href=\"/maps/physical/clone_info.pl?id=$source->{id_in_source} \">BAC $bac_name</a>";
55       }
56     }
57     else {
58       $link="a(n) $source->{source_name} (ID unknown)";
59     }
60     if($link) {
61       $about_html.="This marker was derived from $link<br />";
62     }
63   }
65 if($about_html) {
66   print info_section_html(title=>'Derivations',contents=>$about_html);
69 </%perl>