Skip to content.

bioconductor.org

Bioconductor is an open source and open development software project
for the analysis and comprehension of genomic data.

Sections

OldGraphics

% % NOTE -- ONLY EDIT THE .Rnw FILE!!! The .tex file is % likely to be overwritten. % % \VignetteIndexEntry{Seattle Lab 1} %\VignetteDepends{Biobase} %\VignetteKeywords{Microarray} \documentclass[12pt]{article}

\usepackage{amsmath,pstricks} \usepackage[authoryear,round]{natbib} \usepackage{hyperref}

\textwidth=6.2in \textheight=8.5in %\parskip=.3cm \oddsidemargin=.1in \evensidemargin=.1in \headheight=-.3in

\newcommand{\scscst}{\scriptscriptstyle} \newcommand{\scst}{\scriptstyle}

\bibliographystyle{plainnat}

\begin{document}

\section*{An Introduction to Some Graphics in Bioconductor}

We first need to set up the basic data regarding the genome of interest. In this case we will look at human data and rely on information from Cheng Li.

<>= # Chromosomal maps

# hgByChroms: list matching affy names to location for each chrom (24) # hgCLengths: vector with length of 24 chromosomes data(hgByChroms) data(hgCLengths)

newChrom <- buildChromClass("Human", "Cheng Li's HG data", hgByChroms, hgCLengths) newChrom

@

We have a number of different plotting features available to us.

<>=

cPlot(newChrom) cPlot(newChrom,c("1","2"),fg="blue",scale="relative")

@ <>=

par(mfrow=c(2,1)) for (sc in c("max","relative")) cPlot(newChrom,fg="blue",scale=sc)

@

<< alongChrom >>=

data(eset) data(hgu95AProbLocs) cols <- c("red", "green", "blue") cols <- cols[eset$cov3]

par(mfrow=c(3,2)) alongChrom(eset, "1", newChrom, xloc="equispaced", plotFormat="cumulative", col=cols,lwd=2) alongChrom(eset, "1", newChrom, xloc="physical", col=cols,lwd=2) alongChrom(eset, "1", newChrom, xloc="equispaced", plotFormat="local", col=cols,lwd=2) alongChrom(eset, "1", newChrom, xloc="equispaced", plotFormat="local", col=cols, type="p", pch=16) alongChrom(eset, "1", newChrom, xlim = c(87511280,127717880), xloc="equispaced", plotFormat="local", col=cols, type="p", pch=16) alongChrom(eset, "1", newChrom, xloc="equispaced", plotFormat="image")

@

\section*{Graphics for the Golub Data}

In this section we will explore some of the functionality in the geneplotter package. This package relies on a data structure that specifies certain statistics about the genome of interest. Specifically how many chromosomes and their respective lengths in nucleotides.

We can render all chromosomes the same length.

<>=

data(hu6800ChrClass) cPlot(hu6800ChrClass) @

Or we can scale them by their relative lengths.

<>=

cPlot(hu6800ChrClass, scale="rel") @

Now, we just jam a new definition of cColor in here, cause the one in Bioconductor is broken.

<>=

cColor <- function(genes, color, plotChroms, scale=c("max","relative"), glen=0.4) { ## Passed a vector of gene names, a color and an instance of a ## chromLocation class. Will recolor the specific genes in the ## cPlot created plot to match the specified color. Scale should ## be the same as the scale from cPlot scale <- match.arg(scale) xPoints <- 1000

## if (!exists("hgu95Achrom", mode="environment")) ## data(hgu95Achrom) gcO <- multiget(genes,env=geneToChrom(plotChroms)) gc <- sapply(gcO, function(x) {if( class(x) == "chromLoc") return(x@chrom) return(NA)} ) gchr <- split(names(gc),gc) gchr[["NA"]] <- NULL

## Look up the locations of these genes in each chromosome, ## plotting any results. locList <- chromLocs(plotChroms)

if (!exists("hgCLengths", mode="environment")) data(hgCLengths)

lens <- hgCLengths

for (cName in names(gchr)) { locs <- locList[[cName]][gchr[[cName]]] locs <- as.numeric(locs[!is.na(locs)]) if (length(locs) > 0) { .plotData(cName, locs, xPoints, lens, color, scale, glen) } } }

@

Then we can color different genes according to what ever color scheme we want. For example, those that were selected by t-test can be colored red.

<>=

cColor(geneNames(gTrsubtt), "red", hu6800ChrClass, scale="rel")

@

And for the Anova filter we will color them blue.

<>=

cColor(geneNames(gTrsubAv), "blue", hu6800ChrClass, scale="rel")

@

\end{document}

News
2010-05-21

Advanced R Programming for Bioinformatics course material now available

2010-04-23

Bioconductor 2.6, consisting of 389 packages and designed to work with R version 2.11, was released today.