plotExpressionGraph       package:geneplotter       R Documentation

_A _f_u_n_c_t_i_o_n _t_o _p_l_o_t _a _g_r_a_p_h _c_o_l_o_r_e_d _b_y _e_x_p_r_e_s_s_i_o_n _d_a_t_a

_D_e_s_c_r_i_p_t_i_o_n:

     Given a graph and expression data for one entity, will plot the
     graph with the nodes colored according to the expression levels
     provided.

_U_s_a_g_e:

     plotExpressionGraph(graph, nodeLLmap, exprs, LOCUSIDenvir, mapFun, log = FALSE, nodeAttrs = list(), ...)

_A_r_g_u_m_e_n_t_s:

   graph: The graph to plot

nodeLLmap: A list with element names being node names and the elements
          being LocusLink IDs corresponding to those node names.

   exprs: A vector of expression data, with names being Affymetrix IDs
          and values being the expression level.

LOCUSIDenvir: An environment mapping Affymetrix IDs to LocusLink IDs,
          such as the ones provided in the xxx2LOCUSID environments
          from the Bioconductor data packages (where xxx) is a data
          package)

  mapFun: A function to map expression levels to colors

     log: Whether or not the expression data 

nodeAttrs: A list of node attributes, as per 'plot.graph'

     ...: Any extra arguments to be passed to 'plot.graph' 

_D_e_t_a_i_l_s:

     This function can be used to plot a graph and have the nodes
     colored according to expression levels provided by the user.  The
     'graph' parameter is a 'graph' object from the 'graph' package.

     The 'nodeLLmap' parameter is a list that maps the nodes of the
     graphs to LocusLink IDs.  An example of this is the
     'IMCALocusLink' object in the 'integrinMediatedCellAdhesion' data
     set in the 'graph' package.

     The 'exprs' argument is a vector mapping expression levels to
     Affymetrix IDs.  One way to generate an appropriate vector is to
     extract a single column from an 'exprSet'.

     The 'LOCUSIDenvir' environment maps Affymetrix IDs to LocusLink
     IDs.  The simplest way to provide this argument is to load the
     preferred Bioconductor data package (e.g. 'hgu95av2') and pass in
     that package's 'xxx2LOCUSID', where 'xxx' is the name of the
     package.

     The 'mapFun' function defaults to the function 'defMapFun', which
     maps nodes to be either blue, green or red depending for
     expression ranges of 0-100, 101-500, and 501+.  In the case where
     'log' is 'TRUE' these ranges are modified with 'log2'.  Custom
     versions of this function can be supplied by the user - it must
     take two parameters, first the expression vector and a boolean
     value ('log') specifying if the data has had a 'log2' applied to
     it.  The function must return a vector with the same names as the
     expression vector, but the values of the vector will be color
     strings.

     The 'nodeAttrs' list can be specified if any other node attributes
     are desired to be set by the user.  Please see the 'plot.graph'
     man page for more information on this.  The other attribute list
     ('attrs' and 'edgeAttrs') can be passed in via the '...'
     parameter.

_A_u_t_h_o_r(_s):

     Jeff Gentry

_S_e_e _A_l_s_o:

     'plot.graph', 'integrinMediatedCellAdhesion'

_E_x_a_m_p_l_e_s:

        if ((require("Rgraphviz")) && (require("hgu95av2")) &&
             (require("fibroEset")) && (interactive())) {     
                 data(integrinMediatedCellAdhesion)
                 data(fibroEset)
                 attrs=getDefaultAttrs()
                 attrs$graph$rankdir <- "LR"
                 plotExpressionGraph(IMCAGraph, IMCALocusLink,
                                     exprs(fibroEset)[,1],
                                     hgu95av2LOCUSID, attrs=attrs)
        }

