<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <title> LAB4 (RNW) — bioconductor.org </title> <base href="http://bioconductor.fhcrc.org/workshops/2002/Seattle02/Lab4a.Rnw" /> <meta name="generator" content="Plone - http://plone.org" /> <meta content=" " name="description" /> <meta content=" " name="DC.description" /> <meta content="admin" name="DC.creator" /> <meta content="2005-07-01 10:23:34" name="DC.date.created" /> <meta content="2005-07-08 13:47:46" name="DC.date.modified" /> <meta content="Document" name="DC.type" /> <meta content="text/plain" name="DC.format" /> <!-- Basic crude style for Netscape4.x - This can be removed if you don't want the special NS4 look - it will still work, just be plain text instead. Column layout for Netscape4.x included --> <link rel="Stylesheet" type="text/css" href="http://bioconductor.fhcrc.org/ploneNS4.css" /> <!-- Column style sheet. --> <style type="text/css" media="screen"><!-- @import url(http://bioconductor.fhcrc.org/ploneColumns.css); --></style> <!-- Main style sheets for CSS2 capable browsers --> <style type="text/css" media="screen"><!-- @import url(http://bioconductor.fhcrc.org/plone.css); --></style> <!-- Old style sheet from Plone 1.0, remove tal:condition="nothing" if you need to use the old styles. Will be removed in Plone 2.1. --> <!-- Alternate style sheets for the bigger/smaller text switcher --> <link rel="alternate stylesheet" type="text/css" media="screen" href="http://bioconductor.fhcrc.org/ploneTextSmall.css" title="Small Text" /> <link rel="alternate stylesheet" type="text/css" media="screen" href="http://bioconductor.fhcrc.org/ploneTextLarge.css" title="Large Text" /> <!-- Style sheet used for printing --> <link rel="stylesheet" type="text/css" media="print" href="http://bioconductor.fhcrc.org/plonePrint.css" /> <!-- Style sheet used for presentations (Opera is the only browser supporting this at the moment) --> <link rel="stylesheet" type="text/css" media="projection" href="http://bioconductor.fhcrc.org/plonePresentation.css" /> <!-- Internet Explorer CSS Fixes --> <!--[if IE]> <style type="text/css" media="all">@import url(http://bioconductor.fhcrc.org/ploneIEFixes.css);</style> <![endif]--> <!-- Custom style sheet if available --> <style type="text/css" media="all"><!-- @import url(http://bioconductor.fhcrc.org/ploneCustom.css); --></style> <link rel="shortcut icon" href="http://bioconductor.fhcrc.org/favicon.ico" type="image/x-icon" /> <link rel="search" href="http://bioconductor.fhcrc.org/search_form" title="Search this site" /> <link rel="up" href="http://bioconductor.fhcrc.org/workshops/2002/Seattle02" title="Up one level" /> <!-- Disable IE6 image toolbar --> <meta http-equiv="imagetoolbar" content="no" /> <!-- A slot where you can insert CSS in the header from a template --> <!-- min-width support for IE via Javascript, required for tableless --> <!--[if IE]> <script type="text/javascript" src="http://bioconductor.fhcrc.org/plone_minwidth.js"></script> <![endif]--> <!-- A slot where you can insert elements in the header from a template --> <!-- A slot where you can insert javascript in the header from a template --> <!-- Common Plone ECMAScripts --> <!-- Pull-down ECMAScript menu, only active if logged in --> <!-- old google analytics here --> <!-- Define dynamic server-side variables for javascripts in this one --> <script type="text/javascript" src="http://bioconductor.fhcrc.org/plone_javascript_variables.js"> </script> <script type="text/javascript" src="http://bioconductor.fhcrc.org/plone_javascripts.js"> </script> <!-- Old JS from Plone 1.0, remove tal:condition="nothing" if you need to use the old pop-ups. Will be removed in Plone 2.1 --> </head> <body class="section-workshops"> <div id="visual-portal-wrapper"> <div id="portal-top"> <a href="#documentContent" class="hiddenStructure">Skip to content.</a> <h1 id="portal-logo"> <a href="http://bioconductor.fhcrc.org">bioconductor.org</a> </h1> <div id="portal-slogan"><p>Bioconductor is an open source and open development software project<br /> for the analysis and comprehension of genomic data.</p></div> <h5 class="hiddenStructure">Sections</h5> <ul id="portal-globalnav"><li id="portaltab-index_html" class="plain"><a href="http://bioconductor.fhcrc.org" accesskey="t">Home</a></li><li id="portaltab-GettingStarted" class="plain"><a href="http://bioconductor.fhcrc.org/GettingStarted" accesskey="t">Getting Started</a></li><li id="portaltab-overview" class="plain"><a href="http://bioconductor.fhcrc.org/overview" accesskey="t">Overview</a></li><li id="portaltab-download" class="plain"><a href="http://bioconductor.fhcrc.org/download" accesskey="t">Downloads</a></li><li id="portaltab-docs" class="plain"><a href="http://bioconductor.fhcrc.org/docs" accesskey="t">Documentation</a></li><li id="portaltab-biocpub" class="plain"><a href="http://bioconductor.fhcrc.org/pub" accesskey="t">Publications</a></li><li id="portaltab-workshops" class="selected"><a href="http://bioconductor.fhcrc.org/workshops" accesskey="t">Workshops</a></li><li id="portaltab-cabig" class="plain"><a href="http://wiki.fhcrc.org/caBioc" accesskey="t">caBIG</a></li></ul> </div> <div class="visualClear"></div> <!-- The wrapper div. It contains the three columns. --> <div id="portal-columns" class="visualColumnHideNone"> <!-- start of the main and left columns --> <div id="visual-column-wrapper"> <!-- start of main content block --> <div id="portal-column-content" class="topmargin1"> <div id="content" class=""> <div class="documentContent" id="region-content"> <a name="documentContent"></a> <h1 class="documentFirstHeading">LAB4 (RNW)</h1> <div class="documentDescription"> </div> <div class="plain"> % <br />% NOTE -- ONLY EDIT THE .Rnw FILE!!! The .tex file is <br />% likely to be overwritten. <br />% <br />% \VignetteIndexEntry{Seattle Lab 4A} <br />%\VignetteDepends{Biobase,marrayNorm,marrayPlots} <br />%\VignetteKeywords{Microarray} <br />\documentclass[12pt]{article} <br /> <br />\usepackage{amsmath,pstricks} <br />\usepackage[authoryear,round]{natbib} <br />\usepackage{hyperref} <br /> <br /> <br />\textwidth=6.2in <br />\textheight=8.5in <br />%\parskip=.3cm <br />\oddsidemargin=.1in <br />\evensidemargin=.1in <br />\headheight=-.3in <br /> <br />\newcommand{\scscst}{\scriptscriptstyle} <br />\newcommand{\scst}{\scriptstyle} <br /> <br />\bibliographystyle{plainnat} <br /> <br />\title{Lab 4A: An Introduction to Bioconductor's {\tt marray} packages} <br /> <br />\begin{document} <br /> <br />\maketitle <br /> <br />In this lab, we demonstrate the main functions in the \verb+marray+ <br />suite of packages for diagnostic plots and normalization of two-color <br />spotted microarray data. To load the packages <br /> <br /><<loadpacks>>= <br />library(marrayNorm) <br />@ <br /> <br />For a more detailed introduction, consult the package vignettes which <br />can be listed by the command {\tt openVignette()}. A demo for <br />\verb+marrayPlots+ can also be accessed by {\tt demo(marrayPlots)}. We <br />will work with the sample dataset \verb+swirl+; for a description of <br />\verb+swirl+, type {\tt ? swirl}. To load this dataset <br /> <br /><<loaddata>>= <br />data(swirl) <br />@ <br /> <br />%%%%%%%%%%%%%%%%%%%%%%%%% <br />%%% marrayClasses <br /> <br />\section{Basic classes and methods: {\tt marrayClasses} package} <br /> <br />One of the main classes in \verb+marrayClasses+ is the \verb+marrayLayout+ <br />class; it is used to keep track of important layout parameters, such as the total number of spotted probe sequences on the array, the dimensions of <br /> the spot and grid matrices, the plate origin of the probes, <br /> information on spotted control sequences. <br />For details on this class consult the help file, {\tt ? <br />marrayLayout. Two other important classes are <br />\verb+marrayRaw+ and \verb+marrayNorm+, which represent, respectively, <br />pre-normalization and post-normalization intensity data for a batch <br /> of spotted microarrays. Methods for manipulating instances of these <br />classes are also described in the help files. <br /> <br />The object \verb+swirl+ is an instance of the class <br />\verb+marrayRaw+. Try the following commands to obtain information on <br />this object <br /> <br /><<swirl1>>= <br />class(swirl) <br />slotNames(swirl) <br />swirl <br />@ <br /> <br /> <br />To access individual slots <br /> <br /><<swirl2>>= <br /> <br />maLayout(swirl) <br />maGnames(swirl) <br />@ <br /> <br />As with other microarray objects in Bioconductor packages, you can <br />use subsetting commands for {\tt marrayRaw} objects <br /> <br /><<sub>>= <br />sw<-swirl[1:100,2] <br />class(sw) <br />sw <br />@ <br /> <br />You can access red and green foreground and background intensities, <br />and log ratios as follows <br /><<RG>>= <br />Gb<-maGb(swirl) <br />dim(Gb) <br />Gb[1:5,] <br />Rf<-maRf(swirl) <br />dim(Rf) <br />Rf[1:5,] <br />M<-maM(swirl) <br />dim(M) <br />@ <br /> <br /> <br />%%%%%%%%%%%%%%%%%%%%%%%%% <br />%%% marrayInput <br /> <br />\section{Reading in data: {\tt marrayInput} package} <br /> <br />Functions and widgets for reading in spotted array data are <br />provided in the \verb+marrayInput+ package, see for example {\tt ? <br />read.marrayRaw} or {\tt ? widget.marrayRaw}. <br /> <br /> <br />%%%%%%%%%%%%%%%%%%%%%%%%% <br />%%% marrayPlots <br /> <br />\section{Diagnostic plots: {\tt marrayPlots} package} <br /> <br />The \verb+marrayPlots+ package provides functions for diagnostic plots <br />of microarray spot statistics. <br /> <br />To produce a spatial image of background intensities for the Cy3 <br />channel in the third array <br /><<image1,fig=TRUE>>= <br />tmp<-maImage(swirl[,3],x="maGb",bar=FALSE) <br />@ <br /> <br />To produce a spatial image of log ratios for the first array in the batch <br /><<image2,fig=TRUE>>= <br />tmp<-maImage(swirl[,1],col=maPalette(low="blue",high="yellow"),bar=FALSE) <br />@ <br /> <br />To produce boxplots of log ratios by sector for the first array in the batch <br /><<boxplot1,fig=TRUE>>= <br />maBoxplot(swirl[,1]) <br />@ <br /> <br /> <br />To produce boxplots of log ratios by plate for the second array in the batch <br /><<boxplot2,fig=TRUE>>= <br />maPlate(swirl)<-maCompPlate(swirl,n=384) <br />maBoxplot(swirl[,2],x="maPlate",names=NULL) <br />@ <br /> <br />For boxplots of log ratios for all four arrays <br /><<boxplot3,fig=TRUE>>= <br />maBoxplot(swirl) <br />@ <br /> <br /> <br />%%%%%%%%%%%%%%%%%%%%%%%%% <br />%%% marrayNorm <br /> <br />\section{Normalization: {\tt marrayNorm} package} <br /> <br />The \verb+marrayNorm+ package implements robust adaptive location and <br />scale normalization procedures, which correct for different types of dye <br />biases (e.g., intensity, spatial, plate biases). <br /> <br />The main location and scale normalization function is <br />\verb+maNormMain+. Simpler wrapper functions are provided in <br />\verb+maNorm+ and \verb+maNormScale+. <br />The function operate on objects of class \verb+marrayRaw+ (or possibly \verb+marrayNorm+, if normalization is performed in several steps) and return objects of class <br />\verb+marrayNorm+. <br /> <br />For within-print-tip-group loess location normalization of batch swirl <br /> <br /><<norm>>= <br />swirl.norm<-maNormMain(swirl) <br />@ <br /> <br />For boxplots of post-normalization log-ratios <br /><<boxplot4,fig=TRUE>>= <br />maBoxplot(swirl.norm[,1]) <br />@ <br /> <br /><<boxplot5,fig=TRUE>>= <br />maBoxplot(swirl.norm) <br />@ <br /> <br /> <br /> <br /> <br /> <br /> <br /> <br />\end{document} <br /> </div> <div class="discussion"> </div> </div> </div> </div> <!-- end of main content block --> <!-- start of the left (by default at least) column --> <div id="portal-column-one"> <div class="visualPadding"> <br><br><br> <!-- disabled left slot image <img tal:replace="structure nocall:here/pict.jpg" /> --> <div class="portlet" id="portlet-navigation-tree"> <div> <h5>Navigation</h5> <div class="portletBody"> <div class="portletContent odd"> <a href="http://bioconductor.fhcrc.org/GettingStarted/" accesskey="n" class="navItem navLevel1" title=""> <!-- Disable Folder icon <img src="" height="16" width="16" alt="" class="navIcon" tal:condition="not:isAnon" tal:attributes="src python:portal_url+'/'+sibling.getIcon(1); title sibling/Type;" /> --> <span class="navItemText">Getting Started</span> </a> <a href="http://bioconductor.fhcrc.org/overview/" accesskey="n" class="navItem navLevel1" title=""> <!-- Disable Folder icon <img src="" height="16" width="16" alt="" class="navIcon" tal:condition="not:isAnon" tal:attributes="src python:portal_url+'/'+sibling.getIcon(1); title sibling/Type;" /> --> <span class="navItemText">Overview</span> </a> <a href="http://bioconductor.fhcrc.org/download/" accesskey="n" class="navItem navLevel1" title=""> <!-- Disable Folder icon <img src="" height="16" width="16" alt="" class="navIcon" tal:condition="not:isAnon" tal:attributes="src python:portal_url+'/'+sibling.getIcon(1); title sibling/Type;" /> --> <span class="navItemText">Downloads</span> </a> <a href="http://bioconductor.fhcrc.org/docs/" accesskey="n" class="navItem navLevel1" title=""> <!-- Disable Folder icon <img src="" height="16" width="16" alt="" class="navIcon" tal:condition="not:isAnon" tal:attributes="src python:portal_url+'/'+sibling.getIcon(1); title sibling/Type;" /> --> <span class="navItemText">Documentation</span> </a> <a href="http://bioconductor.fhcrc.org/pub/" accesskey="n" class="navItem navLevel1" title=""> <!-- Disable Folder icon <img src="" height="16" width="16" alt="" class="navIcon" tal:condition="not:isAnon" tal:attributes="src python:portal_url+'/'+sibling.getIcon(1); title sibling/Type;" /> --> <span class="navItemText">Publications</span> </a> <a href="http://bioconductor.fhcrc.org/workshops/" accesskey="n" class="navItem navLevel1" title=""> <!-- Disable Folder icon <img src="" height="16" width="16" alt="" class="navIcon" tal:condition="not:isAnon" tal:attributes="src python:portal_url+'/'+sibling.getIcon(1); title sibling/Type;" /> --> <span class="navItemText">Workshops</span> </a> <a href="http://bioconductor.fhcrc.org/workshops/2010/" accesskey="n" class="navItem navLevel2" title=""> <!-- Disable Folder icon <img src="" height="16" width="16" alt="" class="navIcon" tal:condition="not:isAnon" tal:attributes="src python:portal_url+'/'+sibling.getIcon(1); title sibling/Type;" /> --> <span class="navItemText">2010</span> </a> <a href="http://bioconductor.fhcrc.org/workshops/2009/" accesskey="n" class="navItem navLevel2" title=""> <!-- Disable Folder icon <img src="" height="16" width="16" alt="" class="navIcon" tal:condition="not:isAnon" tal:attributes="src python:portal_url+'/'+sibling.getIcon(1); title sibling/Type;" /> --> <span class="navItemText">2009</span> </a> <a href="http://bioconductor.fhcrc.org/workshops/2008/" accesskey="n" class="navItem navLevel2" title=""> <!-- Disable Folder icon <img src="" height="16" width="16" alt="" class="navIcon" tal:condition="not:isAnon" tal:attributes="src python:portal_url+'/'+sibling.getIcon(1); title sibling/Type;" /> --> <span class="navItemText">2008</span> </a> <a href="http://bioconductor.fhcrc.org/workshops/2007/" accesskey="n" class="navItem navLevel2" title=""> <!-- Disable Folder icon <img src="" height="16" width="16" alt="" class="navIcon" tal:condition="not:isAnon" tal:attributes="src python:portal_url+'/'+sibling.getIcon(1); title sibling/Type;" /> --> <span class="navItemText">2007</span> </a> <a href="http://bioconductor.fhcrc.org/workshops/2006/" accesskey="n" class="navItem navLevel2" title=""> <!-- Disable Folder icon <img src="" height="16" width="16" alt="" class="navIcon" tal:condition="not:isAnon" tal:attributes="src python:portal_url+'/'+sibling.getIcon(1); title sibling/Type;" /> --> <span class="navItemText">2006</span> </a> <a href="http://bioconductor.fhcrc.org/workshops/2005/" accesskey="n" class="navItem navLevel2" title=""> <!-- Disable Folder icon <img src="" height="16" width="16" alt="" class="navIcon" tal:condition="not:isAnon" tal:attributes="src python:portal_url+'/'+sibling.getIcon(1); title sibling/Type;" /> --> <span class="navItemText">2005</span> </a> <a href="http://bioconductor.fhcrc.org/workshops/2004/" accesskey="n" class="navItem navLevel2" title=""> <!-- Disable Folder icon <img src="" height="16" width="16" alt="" class="navIcon" tal:condition="not:isAnon" tal:attributes="src python:portal_url+'/'+sibling.getIcon(1); title sibling/Type;" /> --> <span class="navItemText">2004</span> </a> <a href="http://bioconductor.fhcrc.org/workshops/2003/" accesskey="n" class="navItem navLevel2" title=""> <!-- Disable Folder icon <img src="" height="16" width="16" alt="" class="navIcon" tal:condition="not:isAnon" tal:attributes="src python:portal_url+'/'+sibling.getIcon(1); title sibling/Type;" /> --> <span class="navItemText">2003</span> </a> <a href="http://bioconductor.fhcrc.org/workshops/2002/" accesskey="n" class="navItem navLevel2" title="Workshops and courses 2002"> <!-- Disable Folder icon <img src="" height="16" width="16" alt="" class="navIcon" tal:condition="not:isAnon" tal:attributes="src python:portal_url+'/'+sibling.getIcon(1); title sibling/Type;" /> --> <span class="navItemText">2002</span> </a> <a href="http://bioconductor.fhcrc.org/workshops/2002/Seattle02/" accesskey="n" class="navItem navLevel3 currentNavItem" title=""> <!-- Disable Folder icon <img src="" height="16" width="16" alt="" class="navIcon" tal:condition="not:isAnon" tal:attributes="src python:portal_url+'/'+sibling.getIcon(1); title sibling/Type;" /> --> <span class="navItemText">Seattle Dec</span> </a> <a href="http://bioconductor.fhcrc.org/developers/" accesskey="n" class="navItem navLevel1" title=""> <!-- Disable Folder icon <img src="" height="16" width="16" alt="" class="navIcon" tal:condition="not:isAnon" tal:attributes="src python:portal_url+'/'+sibling.getIcon(1); title sibling/Type;" /> --> <span class="navItemText">Developers</span> </a> <a href="http://bioconductor.fhcrc.org/News/" accesskey="n" class="navItem navLevel1" title="BioC Project News"> <!-- Disable Folder icon <img src="" height="16" width="16" alt="" class="navIcon" tal:condition="not:isAnon" tal:attributes="src python:portal_url+'/'+sibling.getIcon(1); title sibling/Type;" /> --> <span class="navItemText">News</span> </a> </div> </div> </div> </div> </div> </div> <!-- end of the left (by default at least) column --> </div> <!-- end of the main and left columns --> <!-- start of right (by default at least) column --> <div id="portal-column-two"> <div class="visualPadding"> <div> <!-- The Related Items box --> <script type="text/javascript" src="plonesearchbox_utils.js"> </script> <div class="portlet"> <!-- <h5 i18n:translate="searchbox_title">Search Box</h5> --> <div class="portletBody"> <form name="searchbox_form" id="searchbox_form" method="post" onsubmit="return process()" action="redirectToUrl" target="_blank"> <div class="portletContent odd"> <div id="searchbox_fields"> <input type="text" name="toSearch" id="toSearch" size="22" /> </div> <select name="choice" id="choice" onchange="return generateForm();" style="margin: 3px 0px 0px 0px;"> <option value="http://bioconductor.fhcrc.org/workshops/2002/Seattle02/Lab4a.Rnw/search?SearchableText=" id="search_portal">In this site</option> <option value="http://bioconductor.fhcrc.org/workshops/2002/Seattle02/Lab4a.Rnw/search?path=/Plones/rgentlem/bioconductor/workshops/2002/Seattle02/Lab4a.Rnw&SearchableText=" id="search_rubric">In this folder</option> <option value="http://google.com/search?sitesearch=www.bioconductor.org&q=%(text)s">Google this site</option> </select> <input class="context searchButton" type="submit" value="Search" style="margin: 3px;" /> </div> <!-- <div class="portletContent odd"> <input class="context searchButton" type="submit" value="Search" style="margin: 3px;" i18n:attributes="value"/> </div> <div class="portletContent even"> <a href="" tal:attributes="href string:${portal_url}/search_form" i18n:translate="advanced_search_link">Advanced search</a> </div> --> </form> <script type="text/javascript"> <!-- /*in case the first choice of the combobox is an url with several fields*/ clearForm(); generateForm(); --> </script> </div> </div> </div> <div class="portlet" id="portlet-news"> <h5>News</h5> <div class="portletBody"> <div class="portletContent odd"> <div class="portletDetails"> <a href="http://bioconductor.fhcrc.org/News/AdvancedR" class="date" title="Advanced R Programming">2010-05-21</a> <p> Advanced R Programming for Bioinformatics course material now <a href="http://bioconductor.fhcrc.org/workshops/2010/AdvancedR/">available</a> </p> </div> </div> <div class="portletContent even"> <div class="portletDetails"> <a href="http://bioconductor.fhcrc.org/News/bioc_2.6_release" class="date" title="BioC 2.6 Released">2010-04-23</a> <p> Bioconductor 2.6, consisting of 389 packages and designed to work with R version 2.11, was released today. </p> </div> </div> <div class="portletContent odd"> <a href="http://bioconductor.fhcrc.org/news" class="portletMore"> More... </a> </div> </div> </div> </div> </div> <!-- end of the right (by default at least) column --> </div> <!-- end column wrapper --> <div class="visualClear"></div> <hr class="netscape4" /> <div id="portal-footer"> © 2003-2009 BioConductor. All Rights Reserved. <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try{ var pageTracker = _gat._getTracker("UA-357281-1"); pageTracker._trackPageview(); } catch(err) {} </script> </div> </div> </body> </html>