[BioC] lost inherent methods of hist() for AffyBatch objects

Jenny Drnevich drnevich at uiuc.edu
Tue Mar 21 19:15:28 CET 2006


Hi,

I'm getting a weird error when trying to load the affy package 
automatically during start-up using a .Rprofile file. The .Rprofile has 
only the following:

library(RWinEdt)
library(affy)

When I put this .Rprofile in the same folder that Rgui.exe starts in 
(working directory) and start Rgui, everythings seems to load fine (see 
code 1 below), except that boxplot() and hist() seem to have lost their 
inherited methods for AffyBatch and exprSet objects. If I rename the 
.Rprofile to test.Rprofile so it won't automatically be sourced, but 
instead source it myself, boxplot() and hist() work fine (see code 2 
below). If I change the .Rprofile so that the library(affy) is first, then 
I do get a error message upon loading (see code 3 below). Now, obviously a 
solution is to just manually source a file that has all the extra libraries 
and my own functions that I want to load each time, but I was wondering why 
it doesn't work to automatically work when using a .Rprofile file, and if 
this is a problem with the affy package or R instead. I should also mention 
that the same problems occur even if the .Rprofile file is:
.First <- function() {
library(RWinEdt)
library(affy)
}

Thanks,
Jenny

CODE 1: (with .Rprofile in the working directory)

R : Copyright 2005, The R Foundation for Statistical Computing
Version 2.2.1  (2005-12-20 r36812)
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

   Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

Loading required package: methods
Loading required package: utils
Loading required package: Biobase
Loading required package: tools

Welcome to Bioconductor

         Vignettes contain introductory material.
         To view, simply type 'openVignette()' or start with 'help(Biobase)'.
         For details on reading vignettes, see the openVignette help page.

 > raw.data <- ReadAffy()
 > hist(raw.data)
Error in hist.default(raw.data) : 'x' must be numeric

 > boxplot(raw.data)
Error in boxplot.default(raw.data) : 'names' attribute [12] must be the 
same length as the vector [0]

 > rma.data <- rma(raw.data)
Background correcting
Normalizing
Calculating Expression

 > boxplot(rma.data)
Error in boxplot.default(rma.data) : invalid first argument

 > raw.data
AffyBatch object
size of arrays=732x732 features (50240 kb)
cdf=Canine (23913 affyids)
number of samples=12
number of genes=23913
annotation=canine

 > rma.data
Expression Set (exprSet) with
         23913 genes
         12 samples
                  phenoData object with 1 variables and 12 cases
          varLabels
                 sample: arbitrary numbering

 > sessionInfo()
R version 2.2.1, 2005-12-20, i386-pc-mingw32

attached base packages:
[1] "stats"     "graphics"  "grDevices" "datasets"  "tools"     "utils"
[7] "methods"   "base"

other attached packages:
caninecdf      affy   Biobase   RWinEdt
  "1.10.0"   "1.8.1"   "1.8.0"   "1.7-4"
 >



CODE 2: (no .Rprofile in working directory)

R : Copyright 2005, The R Foundation for Statistical Computing
Version 2.2.1  (2005-12-20 r36812)
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

   Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

 > source("test.Rprofile")
Loading required package: Biobase
Loading required package: tools

Welcome to Bioconductor

         Vignettes contain introductory material.
         To view, simply type 'openVignette()' or start with 'help(Biobase)'.
         For details on reading vignettes, see the openVignette help page.

 > raw.data <- ReadAffy()
 > hist(raw.data)
 > boxplot(raw.data)
 > raw.data
AffyBatch object
size of arrays=732x732 features (50240 kb)
cdf=Canine (23913 affyids)
number of samples=12
number of genes=23913
annotation=canine
 > sessionInfo()
R version 2.2.1, 2005-12-20, i386-pc-mingw32

attached base packages:
[1] "tools"     "methods"   "stats"     "graphics"  "grDevices" "utils"
[7] "datasets"  "base"

other attached packages:
caninecdf      affy   Biobase   RWinEdt
  "1.10.0"   "1.8.1"   "1.8.0"   "1.7-4"
 >


CODE 3: (using .Rprofile with library(affy) first)

R : Copyright 2005, The R Foundation for Statistical Computing
Version 2.2.1  (2005-12-20 r36812)
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

   Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

Loading required package: Biobase
Loading required package: tools
Loading required package: methods

Welcome to Bioconductor

         Vignettes contain introductory material.
         To view, simply type 'openVignette()' or start with 'help(Biobase)'.
         For details on reading vignettes, see the openVignette help page.

Error in inherits(x, "factor") : couldn't find function "winMenuNames"
Error: .onLoad failed in 'loadNamespace' for 'Biobase'
Error: package 'Biobase' could not be loaded
 > raw.data <- ReadAffy()
Error: couldn't find function "ReadAffy"
 > sessionInfo()
R version 2.2.1, 2005-12-20, i386-pc-mingw32

attached base packages:
[1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods"
[7] "tools"     "base"
 >


Jenny Drnevich, Ph.D.

Functional Genomics Bioinformatics Specialist
W.M. Keck Center for Comparative and Functional Genomics
Roy J. Carver Biotechnology Center
University of Illinois, Urbana-Champaign

330 ERML
1201 W. Gregory Dr.
Urbana, IL 61801
USA

ph: 217-244-7355
fax: 217-265-5066
e-mail: drnevich at uiuc.edu



More information about the Bioconductor mailing list