[Bio] / Sprout / SearchHelper.pm Repository:
ViewVC logotype

Diff of /Sprout/SearchHelper.pm

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

revision 1.30, Thu Apr 19 00:05:51 2007 UTC revision 1.31, Fri May 11 06:28:21 2007 UTC
# Line 2338  Line 2338 
2338      return $retVal;      return $retVal;
2339  }  }
2340    
2341    
2342    =head3 PrintLine
2343    
2344    C<< $shelp->PrintLine($message); >>
2345    
2346    Print a line of CGI output. This is used during the operation of the B<Find> method while
2347    searching, so the user sees progress in real-time.
2348    
2349    =over 4
2350    
2351    =item message
2352    
2353    HTML text to display.
2354    
2355    =back
2356    
2357    =cut
2358    
2359    sub PrintLine {
2360        # Get the parameters.
2361        my ($self, $message) = @_;
2362        # Send them to the output.
2363        print "$message\n";
2364    }
2365    
2366  =head2 Feature Column Methods  =head2 Feature Column Methods
2367    
2368  The methods in this section manage feature column data. If you want to provide the  The methods in this section manage feature column data. If you want to provide the
# Line 2428  Line 2453 
2453          $retVal = "Annotation Page";          $retVal = "Annotation Page";
2454      } elsif ($colName eq 'subsystem') {      } elsif ($colName eq 'subsystem') {
2455          $retVal = "Subsystems";          $retVal = "Subsystems";
2456        } elsif ($colName eq 'pdb') {
2457            $retVal = "Best PDB Match";
2458      }      }
2459      # Return the result.      # Return the result.
2460      return $retVal;      return $retVal;
# Line 2556  Line 2583 
2583      } elsif ($colName eq 'subsystem') {      } elsif ($colName eq 'subsystem') {
2584          # Another run-time column: subsystem list.          # Another run-time column: subsystem list.
2585          $retVal = "%%subsystem=$fid";          $retVal = "%%subsystem=$fid";
2586        } elsif ($colName eq 'pdb') {
2587            $retVal = "%%pdb=$fid";
2588      }      }
2589      # Return the result.      # Return the result.
2590      return $retVal;      return $retVal;
# Line 2647  Line 2676 
2676                                        "Feature($keywordName)");                                        "Feature($keywordName)");
2677          # String them into a list.          # String them into a list.
2678          $retVal = join(", ", @values);          $retVal = join(", ", @values);
2679        } elsif ($type eq 'pdb') {
2680            # Here the caller wants the best PDB match to this feature. The text
2681            # is the feature ID. We will display the PDB with a link to the
2682            # PDB page along with the match score. If there are docking results we
2683            # will display a link to the docking result search.
2684            my $fid = $text;
2685            # Ask for the best PDB.
2686            my ($bestPDB) = $sprout->GetAll(['IsProteinForFeature', 'PDB'],
2687                                            "IsProteinForFeature(from-link) = ? ORDER BY IsProteinForFeature(score) LIMIT 1",
2688                                            [$fid], ['PDB(id)', 'PDB(docking-count)', 'IsProteinForFeature(score)']);
2689            # Only proceed if there is a PDB.
2690            if ($bestPDB) {
2691                my ($pdbID, $dockingCount, $score) = @{$bestPDB};
2692                # Convert the PDB ID to a hyperlink.
2693                my $pdbLink = SHDrugSearch::PDBLink($cgi, $pdbID);
2694                # Append the score.
2695                $retVal = "$pdbLink ($score)";
2696                # If there are docking results, append a docking results link.
2697                if ($dockingCount > 0) {
2698                    my $dockString = "$dockingCount docking results";
2699                    my $dockLink = $cgi->a({ href =>  $cgi->url() . "?Class=DrugSearch;PDB=$pdbID;NoForm=1",
2700                                             alt =>   "View computed docking results for $pdbID",
2701                                             title => "View computed docking results for $pdbID",
2702                                             target => "_blank"},
2703                                           $dockString);
2704                }
2705            }
2706      }      }
2707      # Return the result.      # Return the result.
2708      return $retVal;      return $retVal;
# Line 2976  Line 3032 
3032      return $retVal;      return $retVal;
3033  }  }
3034    
3035  =head3 PrintLine  =head3 SearchTitle
3036    
3037  C<< $shelp->PrintLine($message); >>  C<< my $titleHtml = $shelp->SearchTitle(); >>
3038    
3039  Print a line of CGI output. This is used during the operation of the B<Find> method while  Return the display title for this search. The display title appears above the search results.
3040  searching, so the user sees progress in real-time.  If no result is returned, no title will be displayed. The result should be an html string
3041    that can be legally put inside a block tag such as C<h3> or C<p>.
3042    
3043    =cut
3044    
3045    sub SearchTitle {
3046        # Get the parameters.
3047        my ($self) = @_;
3048        # Declare the return variable.
3049        my $retVal;
3050        # Return it.
3051        return $retVal;
3052    }
3053    
3054    =head3 DownloadFormatAvailable
3055    
3056    C<< my $okFlag = $shelp->DownloadFormatAvailable($format); >>
3057    
3058    This method returns TRUE if a specified download format is legal for this type of search
3059    and FALSE otherwise. For any feature-based search, there is no need to override this
3060    method.
3061    
3062  =over 4  =over 4
3063    
3064  =item message  =item format
3065    
3066  HTML text to display.  Download format type code.
3067    
3068    =item RETURN
3069    
3070    Returns TRUE if the download format is legal for this search and FALSE otherwise.
3071    
3072  =back  =back
3073    
3074  =cut  =cut
3075    
3076  sub PrintLine {  sub DownloadFormatAvailable {
3077      # Get the parameters.      # Get the parameters.
3078      my ($self, $message) = @_;      my ($self, $format) = @_;
3079      # Send them to the output.      # Declare the return variable.
3080      print "$message\n";      my $retVal = 1;
3081        # Return the result.
3082        return $retVal;
3083  }  }
3084    
   
3085  1;  1;

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3