[BioC] affycoretools repost

James W. MacDonald jmacdon at med.umich.edu
Tue Jun 24 21:59:00 CEST 2008


Hi Louisa,

Louisa A Rispoli/AS/EXP/UTIA wrote:
> Hi-
> 
> Thank you for your help. I checked that sampleNames(pd) and looks like I
> think it should, but since I am a newbie I will leave it to you to tell me.
> Re-ran with 2.7.1 because when opened R2.7.0 this AM affycoretools not
> loading biomaRt for some reason. I think it may have to do that I updated
> packages but I have no clue. So uninstalled 2.7.0 then installed the 2.7.1
> because could not get the link for 2.7.0 to function for me. I do get some
> additional warnings and errors with the 2.7.1 version that I did not see
> yesterday. When I do plotPCA the legend formed correctly so I am not sure
> what went wrong with the affystart. I appreciate help and any
> recommendations.
> 
> Sincerely
> 
> Louisa
> 
> 
> R version 2.7.1 (2008-06-23)
> Copyright (C) 2008 The R Foundation for Statistical Computing
> ISBN 3-900051-07-0
> 
>> library(affycoretools)
> Loading required package: affy
> Loading required package: Biobase
> Loading required package: tools
> 
> Welcome to Bioconductor
> 
>   Vignettes contain introductory material. To view, type
>   'openVignette()'. To cite Bioconductor, see
>   'citation("Biobase")' and for packages 'citation(pkgname)'.
> 
> Loading required package: affyio
> Loading required package: preprocessCore
> Loading required package: limma
> Loading required package: GOstats
> Loading required package: graph
> Loading required package: GO.db
> Loading required package: AnnotationDbi
> Loading required package: DBI
> Loading required package: RSQLite
> Loading required package: annotate
> Loading required package: xtable
> Loading required package: RBGL
> Loading required package: Category
> Loading required package: genefilter
> Loading required package: survival
> Loading required package: splines
> Loading required package: biomaRt
> Loading required package: RCurl
> 
> Attaching package: 'biomaRt'
> 
> 
>         The following object(s) are masked from package:annotate :
> 
>          getGO
> 
> Loading required package: gcrma
> Loading required package: matchprobes
> Loading required package: annaffy
> Loading required package: KEGG.db
> 
> Attaching package: 'annaffy'
> 
> 
>         The following object(s) are masked from package:RCurl :
> 
>          getURL
>> pd <-read.AnnotatedDataFrame("pData.txt", sep="\t", header=TRUE,
> row.names=1)
>> dat <- ReadAffy(phenoData= pd)
>> pData(dat)
>                amp  trt
> PolyC-1.CEL  PolyA Ctrl
> PolyC-2.CEL  PolyA Ctrl
> PolyC-3.CEL  PolyA Ctrl
> PolyC-4.CEL  PolyA Ctrl
> PolyC-5.CEL  PolyA Ctrl
> PolyC-6.CEL  PolyA Ctrl
> PolyC-7.CEL  PolyA Ctrl
> PolyC-8.CEL  PolyA Ctrl
> PolyHS-1.CEL PolyA   HS
> PolyHS-2.CEL PolyA   HS
> PolyHS-3.CEL PolyA   HS
> PolyHS-4.CEL PolyA   HS
> PolyHS-5.CEL PolyA   HS
> PolyHS-6.CEL PolyA   HS
> PolyHS-7.CEL PolyA   HS
> PolyHS-8.CEL PolyA   HS
> WTC-1.CEL       WT Ctrl
> WTC-2.CEL       WT Ctrl
> WTC-3.CEL       WT Ctrl
> WTC-4.CEL       WT Ctrl
> WTC-5.CEL       WT Ctrl
> WTC-6.CEL       WT Ctrl
> WTC-7.CEL       WT Ctrl
> WTC-8.CEL       WT Ctrl
> WTHS-1.CEL      WT   HS
> WTHS-2.CEL      WT   HS
> WTHS-3.CEL      WT   HS
> WTHS-4.CEL      WT   HS
> WTHS-5.CEL      WT   HS
> WTHS-6.CEL      WT   HS
> WTHS-7.CEL      WT   HS
> WTHS-8.CEL      WT   HS
> 
>> eset <-affystart(groups=rep(1:4, each = 8), groupsnames =
> unique(paste(pData(pd)[,1],pData(pd)[,2], sep="-")), phenoData = pd)
> Background correcting
> Normalizing
> Calculating Expression
> Please give the x-coordinate for a legend.
> Please give the y-coordinate for a legend.
> Error in method(paste("Density plot", plottype, sep = "."), height =
> height,  :
>   unused argument(s) (groupsnames = c("PolyA-Ctrl", "PolyA-HS", "WT-Ctrl",
> "WT-HS"), phenoData = <S4 object of class "AnnotatedDataFrame">)
> In addition: Warning messages:
> 1: In pca.legend(pca, groupnames, pch, col, x.coord = x.coord, y.coord =
> y.coord,  :
>   NAs introduced by coercion
> 2: In pca.legend(pca, groupnames, pch, col, x.coord = x.coord, y.coord =
> y.coord,  :
>   NAs introduced by coercion
> 
> 
>> eset1 <-affystart(filenames=list.celfiles()[1:16], plot = FALSE,
> pca=FALSE)
> Background correcting
> Normalizing
> Calculating Expression
>> eset2 <-affystart(filenames=list.celfiles()[17:32], plot=FALSE,
> pca=FALSE)
> Background correcting
> Normalizing
> Calculating Expression
>> eset <- new("ExpressionSet", exprs=cbind(exprs(eset1), exprs(eset2)),
> phenoData = pd, annotation=annotation(eset1))
> Error in validObject(.Object) :
>   invalid class "ExpressionSet" object: sampleNames differ between
> assayData and phenoData
>> sampleNames(pd)
>  [1] "PolyC-1.cel"  "PolyC-2.cel"  "PolyC-3.cel"  "PolyC-4.cel"
> "PolyC-5.cel"  "PolyC-6.cel"  "PolyC-7.cel"  "PolyC-8.cel"
>  [9] "PolyHS-1.cel" "PolyHS-2.cel" "PolyHS-3.cel" "PolyHS-4.cel"
> "PolyHS-5.cel" "PolyHS-6.cel" "PolyHS-7.cel" "PolyHS-8.cel"
> [17] "WTC-1.cel"    "WTC-2.cel"    "WTC-3.cel"    "WTC-4.cel"
> "WTC-5.cel"    "WTC-6.cel"    "WTC-7.cel"    "WTC-8.cel"
> [25] "WTHS-1.cel"   "WTHS-2.cel"   "WTHS-3.cel"   "WTHS-4.cel"
> "WTHS-5.cel"   "WTHS-6.cel"   "WTHS-7.cel"   "WTHS-8.cel"

This is the problem. If you look at the sample names above, you can see 
that the extension is .cel, whereas below it is .CEL. Since R is 
case-sensitive, these names are all different.

You need to change the sample names in the pd object to have capitalized 
CEL extensions.

Best,

Jim


>> sampleNames(eset1)
>  [1] "PolyC-1.CEL"  "PolyC-2.CEL"  "PolyC-3.CEL"  "PolyC-4.CEL"
> "PolyC-5.CEL"  "PolyC-6.CEL"  "PolyC-7.CEL"  "PolyC-8.CEL"
>  [9] "PolyHS-1.CEL" "PolyHS-2.CEL" "PolyHS-3.CEL" "PolyHS-4.CEL"
> "PolyHS-5.CEL" "PolyHS-6.CEL" "PolyHS-7.CEL" "PolyHS-8.CEL"
>> sampleNames(eset2)
>  [1] "WTC-1.CEL"  "WTC-2.CEL"  "WTC-3.CEL"  "WTC-4.CEL"  "WTC-5.CEL"
> "WTC-6.CEL"  "WTC-7.CEL"  "WTC-8.CEL"  "WTHS-1.CEL" "WTHS-2.CEL"
> [11] "WTHS-3.CEL" "WTHS-4.CEL" "WTHS-5.CEL" "WTHS-6.CEL" "WTHS-7.CEL"
> "WTHS-8.CEL"
> 
> 
>> eset <- rma(dat)
> Background correcting
> Normalizing
> Calculating Expression
>> plotPCA(eset, groups = rep(1:4, each =8), groupnames =
> unique(paste(pData(pd)[,1],pData(pd)[,2], sep="-")))
> 

-- 
James W. MacDonald, M.S.
Biostatistician
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109
734-647-5623



More information about the Bioconductor mailing list