ideogram              package:ideogram              R Documentation

_P_l_o_t_t_i_n_g _o_f _G_e_n_o_m_i_c _D_a_t_a

_D_e_s_c_r_i_p_t_i_o_n:

     Function for plotting genomic data along with corresponding
     cytogenetic banding information

_U_s_a_g_e:

     ideogram(data, genome, chr=NULL, organism=NULL,
     method=c("plot","matplot","image"), margin=c("ticks","ideogram"),
     grid.col=c("red","grey"), grid.lty=c(1,2), widths=c(1,2),
     relative=FALSE, dlim=NULL, main=NA, xlab=NA,
     ylab=NA,cex.axis=.7,...)

_A_r_g_u_m_e_n_t_s:

    data: a vector or matrix of numeric data to plot. The
          names/rownames attribute _needs_ to contain corresponding
          gene identifiers

  genome: a chromLocation object associated with the specified data
          set. See below for details. 

     chr: which chromosome to plot 

organism: if NULL, determination of the host organism will be retrieved
          from the 'organism' slot of the chromLocation object.
          Otherwise '"h"', '"r"', or '"m"' can be used to specify
          *h*uman, *r*at, or *m*ouse chromosome information

  method: plotting method 

  margin: type of banding information to display in the plot margin

grid.col: a two element vector specifying the centromere and band grid
          colors.

grid.lty: a two element vector specifying the centromere and band grid
          line type.

  widths: a two element vector specifying the relative width of the
          margin ideogram two the adjacent graph. This option is
          currently ignored.

relative: If 'relative' is TRUE, the vertical height of the plot is
          scaled relative to the size of largest chromosome.

    dlim: a two element vector specifying the minimum and maximum
          values for 'x'.  Data in 'x' that exceed the min and max
          limits will be set to the min/max limit values before
          plotting.

    main: an overall title for the plot. Defaults to the chromosome
          name.

    xlab: a title for the x axis.

    ylab: a title for the y axis.

cex.axis: the magnification to be used for axis annotation relative to
          the current.

     ...: additional graphical parameters can be given as arguments.

_D_e_t_a_i_l_s:

     This function displays cytogenetic banding information in the plot
     margin and calls a secondary plotting function to display
     associated data at the same relative position.  Cytogenetic data
     for human, mouse, and rat genomes are currently included.

     The data is arranged by associating gene identifiers to genomic
     location using a 'chromLoc' annotation object built using the
     'buildChromLocatio'n function from the annotation package. As
     such, a vector of data is to be plotted, the 'names' attribute of
     the vector _needs_ to contain the gene identifiers.  Likewise if a
     matrix of data is to be plotted, the 'rownames' attribute of the
     matrix _needs_ to contain the gene identifiers.

     To date, 'plot' can be called for vector data, while 'matplot' and
     'image' can be called for matrix data.  Most additional plotting
     arguments can be passed down via ....  However, the ideogram
     function plots the axis independently. Currently, only the
     'cex.axis','col.axis', and 'font.axis' parameters are intercepted
     from ... and redirected to the specialized 'axis' call. Other
     parameters that effect the axis should be set via 'par'.

     The function 'mideogram' is a simple wrapper around 'ideogram' to
     plot all the chromosomes from a particular organism using sensible
     default values. The '"m"' refers to plotting *m*ultiple ideograms.

_A_u_t_h_o_r(_s):

     Kyle Furge <kyle.furge@vai.org> and Karl Dykema
     <karl.dykema@vai.org>

_S_e_e _A_l_s_o:

     'buildChromLocation', 'Hs.cytoband', 'ideograb'

_E_x_a_m_p_l_e_s:

     library(ideogram)

     ## 
     ## NOTE:This requires an annotation package to work.
     ##      In this example packages "hu6800" and "golubEsets" are used.
     ##      They can be downloaded from http://www.bioconductor.org
     ##      "hu6800" is under MetaData, "golubEsets" is under Experimental
     ##      Data.

     if(require(hu6800) && require(golubEsets)) {
        library(golubEsets)
        data(golubTrain)

        hu.chr <- buildChromLocation("hu6800")
        ex <- golubTrain@exprs[,1]

        ## make sure the names() attribute is set correctly
        gN <- names(ex)
        gN[1:10]   

        ideogram(ex,hu.chr,chr="1")

        colors <- rep("black",times=length(ex))
        colors[ex > 10000] <- "red"
        pts <- rep(1,times=length(ex))
        pts[ex > 10000] <- 2
        ideogram(ex,hu.chr,chr="1",col=colors,pch=pts,font.axis=2,cex.axis=1)
        abline(v=0,col="darkgreen")

        ## An example of the dlim option. It is most useful for making
        ## consistant multi-panel plots
        colors <- rep("black",times=length(ex))
        colors[ex > 10000] <- "red"
        colors[ex < 0] <- "blue"

        ideogram(ex,hu.chr,chr="1",col=colors,xlim=c(-3000,21000))
        ideogram(ex,hu.chr,chr="1",col=colors,dlim=c(-100,7500),xlim=c(-3000,21000))
        ideogram(ex,hu.chr,chr="1",col=colors,dlim=c(-100,7500),xlim=c(-3000,10000))

        ## Using the identify function
        ip <- ideogram(ex,hu.chr,chr="1",col=colors,pch=19)
        #identify(ip$x,ip$y,labels=ip$labels)
        
     } else print("This example requires the hu6800 and golubEsets data packages.")

     ## The example data is BAC array CGH data from J. Fridlyand's
     ## aCGH package

     data(ideogramExample)

     ideogram(colo.eset@exprs[,1],ucsf.chr,chr="1")

     ideogram(colo.eset@exprs,ucsf.chr,chr="1",method="image")

     ideogram(colo.eset@exprs,ucsf.chr,chr="1",method="image",col=topo.colors(50),grid.lty=c(1,NA))

     ideogram(colo.eset@exprs,ucsf.chr,chr="1",method="mat",type="l")

     ## for a consistant multi-panel plot it can be helpful to force the data
     ## range within each panel to a defined range using 'dlim'
     ## This is similar to calling the 'mideogram' function

     op <- par(no.readonly=TRUE)
     par(mai=par("mai")*c(0.1,0.5,0.5,0.5))
     layout(rbind(c(1:8),c(0,9:14,0),c(15:22)))

     for(i in c(1:22)) {
       ideogram(colo.eset@exprs,ucsf.chr,chr=i,method="i",dlim=c(-1,1),margin="i",relative=TRUE)
     }

     par(op)

