[BioC] (no subject)
Robert Gentleman
rgentlem at fhcrc.org
Sat Apr 16 17:07:06 CEST 2005
Hi John,
Have you looked at the vignette in Biobase that explains how to do
this?
The short answer is that
On Apr 16, 2005, at 7:52 AM, Jiuzhou song wrote:
> Hi,
> I want to creat a exprSet class, it combines expression data and
> phenotype
> data together. expression data is a matrix with columns representing
> patients and rows respresent genes. The phenoData contains the patient
> level, the column represent level and the rows represent patients. The
> format of the two datasets are shown below:
>
> The gene expression data:
> P01 P02 P03 P04 P05 P06 P07 P08 P09 P10 P11 P12 P13 P14 P15
> 1007_s_at 1336.97 1244.81 1242.41 1514.92 1531.80 1244.61 1030.43
> 967.83 866.32
> 1253.16 1218.51 1518.09 1401.07 1281.88 1438.96
> ........
>
> the phenotype data:
>
> Patient Phenotype
> P01 Def
> P02 Def
> P03 Def
> ......
>
> My codes:
>> x<-read.table("exprstry.txt", header=TRUE)
>> y<-read.table("phenotype.txt", header=TRUE)
>> eset<-new('exprSet', exprs=x, phenoData=y)
> Error in validObject(.Object) : Invalid "exprSet" object: 1: Invalid
> object
> for slot "exprs" in class "exprSet": got class "data.frame", should be
> or
> extend class "exprMatrix"
read.table returns a data.frame, you need to turn that into a matrix
(which is not the same thing)
you might just want to check and see if the data is correct - has row
names that are meaningful etc.
the second argument needs to be an object of class phenoData, such
objects do have a data.frame with the sample level covariate
information but it also has a slot named varLabels where you should put
a list which describes the variables in your data.frame (and hence
these are self-documenting data structures).
class?phenoData
will give you information on the class.
Robert
An example copied straight from the vignette:
library(Biobase)
data(geneCov)
data(geneData)
covN <- list(cov1 = "Covariate 1; 2 levels",
cov2 = "Covariate 2; 2 levels",
cov3 = "Covariate 3; 3 levels")
pD <- new("phenoData", pData=geneCov, varLabels=covN)
eSet <- new("exprSet", exprs=geneData, phenoData=pD)
> Invalid "exprSet" object: 2: Invalid object for slot "phenoData" in
> class
> "exprSet": got class "data.frame", should be or extend class
> "phenoData"
>
> Why it doesn't work.
> Thanks.
>
> Yours
>
> John
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
>
>
+-----------------------------------------------------------------------
----------------+
| Robert Gentleman phone: (206) 667-7700
|
| Head, Program in Computational Biology fax: (206) 667-1319 |
| Division of Public Health Sciences office: M2-B865
|
| Fred Hutchinson Cancer Research Center
|
| email: rgentlem at fhcrc.org
|
+-----------------------------------------------------------------------
----------------+
+-----------------------------------------------------------------------
----------------+
| Robert Gentleman phone: (206) 667-7700
|
| Head, Program in Computational Biology fax: (206) 667-1319 |
| Division of Public Health Sciences office: M2-B865
|
| Fred Hutchinson Cancer Research Center
|
| email: rgentlem at fhcrc.org
|
+-----------------------------------------------------------------------
----------------+
More information about the Bioconductor
mailing list