[Bio] / FigWebServices / genome_statistics.cgi Repository:
ViewVC logotype

Diff of /FigWebServices/genome_statistics.cgi

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

revision 1.26, Sun Sep 11 17:02:41 2005 UTC revision 1.27, Thu Sep 15 19:13:20 2005 UTC
# Line 64  Line 64 
64      }      }
65  }  }
66    
67  warn "REQ='$request'\n";  # warn "REQ='$request'\n";
68    
69  if ($request eq "subsystems_summary")  if ($request eq "subsystems_summary")
70  {  {
# Line 439  Line 439 
439      my($fig,$cgi,$genome) = @_;      my($fig,$cgi,$genome) = @_;
440    
441      my $rdbH = $fig->db_handle;      my $rdbH = $fig->db_handle;
442      my $subsystem_data = $rdbH->SQL("SELECT DISTINCT subsystem,role,protein FROM subsystem_index WHERE ( protein like 'fig\|$genome.peg.%')");  
443        #
444        # For now need to try with variant first, then back off to not using variant
445        # if we hit a database error.
446        #
447    
448        my $subsystem_data;
449    
450        {
451            my $dbh = $rdbH->{_dbh};
452            local $dbh->{RaiseError} = 1;
453            local $dbh->{PrintError} = 0;
454    
455            eval {
456                $subsystem_data = $rdbH->SQL(qq(SELECT DISTINCT subsystem,role,protein
457                                                FROM subsystem_index
458                                                WHERE (protein like 'fig\|$genome.peg.%' AND
459                                                       variant != '-1')
460                                               ));
461            };
462        }
463        if ($@ =~ /variant/)
464        {
465            $subsystem_data = $rdbH->SQL(qq(SELECT DISTINCT subsystem,role,protein
466                                            FROM subsystem_index
467                                            WHERE (protein like 'fig\|$genome.peg.%')
468                                           ));
469        }
470      my $assignment_data = $rdbH->SQL("SELECT prot,assigned_function FROM assigned_functions WHERE ( prot like 'fig\|$genome.peg.%' AND made_by = 'master' )");      my $assignment_data = $rdbH->SQL("SELECT prot,assigned_function FROM assigned_functions WHERE ( prot like 'fig\|$genome.peg.%' AND made_by = 'master' )");
471    
472      return ($subsystem_data,$assignment_data);      return ($subsystem_data,$assignment_data);

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3