[Bio] / FigKernelPackages / Observation.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/Observation.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18, Tue Jun 26 19:52:09 2007 UTC revision 1.19, Wed Jun 27 14:59:39 2007 UTC
# Line 1  Line 1 
1  package Observation;  package Observation;
2    
3    use lib '/vol/ontologies';
4    use DBMaster;
5    
6  require Exporter;  require Exporter;
7  @EXPORT_OK = qw(get_objects);  @EXPORT_OK = qw(get_objects);
8    
# Line 392  Line 395 
395  sub get_objects {  sub get_objects {
396      my ($self,$fid,$classes) = @_;      my ($self,$fid,$classes) = @_;
397    
   
398      my $objects = [];      my $objects = [];
399      my @matched_datasets=();      my @matched_datasets=();
400    
# Line 1198  Line 1200 
1200      my $links_list = [];      my $links_list = [];
1201      my $descriptions = [];      my $descriptions = [];
1202    
1203      my $description_function;      my $db_and_id = $thing->acc;
1204      $description_function = {"title" => $thing->class,      my ($db,$id) = split("::",$db_and_id);
                              "value" => $thing->acc};  
1205    
1206      push(@$descriptions,$description_function);      my $dbmaster = DBMaster->new(-database =>'Ontology');
1207    
1208        my ($name_title,$name_value,$description_title,$description_value);
1209        if($db eq "CDD"){
1210            my $cdd_objs = $dbmaster->cdd->get_objects( { 'id' => $id } );
1211            if(!scalar(@$cdd_objs)){
1212                $name_title = "name";
1213                $name_value = "not available";
1214                $description_title = "description";
1215                $description_value = "not available";
1216            }
1217            else{
1218                my $cdd_obj = $cdd_objs->[0];
1219                $name_title = "name";
1220                $name_value = $cdd_obj->term;
1221                $description_title = "description";
1222                $description_value = $cdd_obj->description;
1223            }
1224        }
1225    
1226        my $name;
1227        $name = {"title" => $name_title,
1228                 "value" => $name_value};
1229        push(@$descriptions,$name);
1230    
1231        my $description;
1232        $description = {"title" => $description_title,
1233                                 "value" => $description_value};
1234        push(@$descriptions,$description);
1235    
1236      my $score;      my $score;
1237      $score = {"title" => "score",      $score = {"title" => "score",

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3