NAME

GO::View - Creates a gif or png image for visualizing the GO DAG

DESCRIPTION

This perl module generates a graphic that displays the parent and child relationships of a selected GO term. It also provides the visualization for the GO::TermFinder perl module created by the Stanford Microarray Database (SMD). This module is useful when analyzing experimental or computational results that produce a set of gene products that may have a common function or process.

SYNOPSIS

    use GO::View;

    my $goView = 

       GO::View->new(-goid               => $goid,
		     -ontologyProvider   => $ontology,
		     -annotationProvider => $annotation,
		     -termFinder         => \@pvalues,
		     -aspect             => 'P',
		     -configFile         => $confFile,
		     -imageDir           => "/tmp",
		     -imageUrlRoot       => "http://www.ABC.com/tmp",
		     -imageName          => "GOview.88.png",
		     -tree               => 'up',
		     -nodeUrl            => $goUrl,
                     -geneUrl            => $geneUrl,
		     -pvalueCutOff       => '0.01',
		     -imageLabel         => "SGD");
				  

    argument              required             expect data and type
    -------------------------------------------------------------------------
    -goid                 No          A gene ontology ID (GOID).
                                      If nothing is passed in, the module 
                                      will use the top goid of each ontology 
                                      branch (i.e, goid for 
				      molecular_function, biological_process,
				      or cellular_component)

    -ontologyProvider	  Yes         An ontology provider instance.

    -annotationProvider   No          An annotation provider instance. It is
                                      required for creating tree for GO Term
                                      Finder result.
    
    -termFinder           No          An array of hash references returned 
                                      from 'findTerms' method of 
                                      GO::TermFinder module. It is required
                                      for creating tree for GO Term Finder 
                                      result. 

    -aspect               No          <P|C|F>. The aspect of the ontology 
                                      provider. It is required for creating 
                                      tree for GO Term Finder result.
    
    -configFile           Yes         The configuration file for setting the
                                      general variables for the graphic 
                                      display. 
				  
    -imageDir             Yes         The directory for storing the newly 
                                      created image file. It must be 
                                      world (nobody) readable and writable
                                      if you want to display the image to 
                                      the web.
 
    -imageUrlRoot         No          The url root for the -imageDir. It is
                                      required if you want to display the
                                      image to the web.

    -imageName            No          The image file name. By default, the 
                                      name will be something like 
                                      'GOview.xxxx.png'. The 'xxxx' will be
                                      the process id.  A suffix for the image (.png
                                      or .gif) should not be provided, as that will
                                      be determined at run time, depending on the
                                      capabilities of the GD library.

    -treeType             No          <up|down>. The tree type. 
                                      
                                      1. up   => display the ancestor tree 
                                                 for the given goid.
                                      2. down => display the descendant tree
                                                 for the given goid.
                                      By default, it will display the 
                                      descendant tree.

    -geneUrl              No          The URL for each Gene to link to.
                                      It needs to have the text <REPLACE_THIS> in 
                                      the url which will be substituted 
                                      by the real goid for a node.

    -nodeUrl              No          The url for each GO node to link to.
                                      It needs to have the text <REPLACE_THIS> in 
                                      the url which will be substituted 
                                      by the real goid for a node.

    -pvalueCutOff         No          The p-value cutoff for displaying
                                      the graphic for GO Term Finder. 
                                      The default is 0.01

    -imageLabel           No          The image label which will appear at
                                      the left bottom corner of the map.
    ------------------------------------------------------------------------

    To display the image on the web:

         $goView->showGraph;
    
    To create and return image file name with full path:
    
         my $imageFile = $goView->createImage;

FEEDBACK

Reporting Bugs

Bug reports can be submitted via email

shuai@genome.stanford.edu

AUTHOR

Shuai Weng, shuai@genome.stanford.edu

COPYRIGHT

Copyright (c) 2003 Stanford University. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

APPENDIX

The rest of the documentation details each of the public methods.

METHODS

new

Title   : new
Function: Initializes the GO::View object. 
        : Recognized named parameters are -goid, -ontologyProvider,
          -annotationProvider, -termFinder, -aspect, -configFile, 
          -imageDir, -imageUrlRoot, -imageName, -treeType, -nodeUrl, 
          -imageLabel
Returns : a new object
Args    : named parameters

graph

Title   : graph
Usage   : my $graph = $goView->graph;
Function: Gets the newly created Graphviz instance.   
Returns : a new Graphviz instance.

showGraph

Title   : showGraph
Usage   : $goView->showGraph;
Function: Creates the image and print the map image to a file.  
Returns : the name of the file to which the image was written
Throws  : Exception if the imageUrlRoot is not passed to the object.  

imageFile

Title   : imageFile
Usage   : my $imageFile = $goView->imageFile;
Function: Gets the newly created image file name (with full path).  
Returns : image file name.

createImage

Title   : createImage
Usage   : $goView->createImage; 
Function: Creates the GO tree image file. Calls it only if you 
          want to create the image file only and do not want to
          display the image.  
Returns : The newly created image file name with full path.

imageMap

Title    : imageMap
Usage    : my $map = $goView->imageMap;
Function : returns the text that constitutes an image map for the
           created image.
Returns  : a string