your code is pretty much unreadable but here is what you need to do.

you should turn your object "data" into a data.frame instance.  read
elementary documentation on this task.

you should then do table(data$type) and verify that the contents of the
data.frame "type" variable has values in a small
set of categories.  if this is not the case, go back to elementary
documentation and figure out why.

only when you have done the elementary work to get the "type" component of
your data frame into a categorical
form with a small number of levels will your intended computation succeed.

this has nothing to do with bioconductor at this stage; please take your
queries to r-help and you may find more relevant guidance.



On Fri, Mar 9, 2012 at 2:33 PM, Salwa Eid <salwaeid@hotmail.com> wrote:

>
>
>  Hello Steve,    Thanks for your reply.  I have attached the data.  I read
> 35 cel files(dna microarray) from ncbi website.  Then I normalized using
> quantile normalization and RMA expression.  Then I removed all afymetrix
> control probe sets.  My expression set consisted was ready and consisted of
> 22215 probe sets(rows) and 35 samples(columns).  The 35 samples belonged to
> two classes either HCV(virus C) or HCC(heptocellular carcionama or liver
> cancer).  So I added "Type" row which tells the class of each sample.  Due
> to the memory I selected only the first 2000 probesets.  I transposed the
> data and then tried applying random forest for "Type" classification.  And
> here is the code:
>
> library(affy)
>
> library(genefilter)library(hgu133a2.db)setwd(“C:/58 data”)
>
> x<-ReadAffy()
>
>
> datanorm<-expresso(x,bgcorrect.method="rma",normalize.method="quantiles",pmcorrect.method="pmonly",summary.method="medianpolish")
>
>
> newdata<-featureFilter(datanorm,require.entrez=FALSE,require.GOBP=FALSE,require.GOCC=FALSE,require.GOMF=FALSE,require.CytoBand=FALSE,remove.dupEntrez=FALSE,feature.exclude="^AFFX")
>
> eset<-exprs(newdata)
>
> predhcc<-matrix(“hcc”,1,15)
>
> predhcv<-matrix(“hcv”,,20)
>
> pred<-cbind(predhcc,predhcv)rownames(pred)<-"Type)data<-eset[1:2000,]data<rbind(data,pred)data<-t(data)colnames(data)<-paste("x",colnames(data),sep="")forest1.rf<-randomforest(xType,data=data,importance=TRUE,
> ntree=5000) I keep getting this error: Error in
> randomForest.default(m,y,...):  Can not handle categorical predctors wth
> more than 32 categories.
> Here is the output of sessionInfo()R version 2.11.1 (2010-05-31)
> i386-pc-mingw32 locale:
> [1] LC_COLLATE=English_Canada.1252  LC_CTYPE=English_Canada.1252
>  LC_MONETARY=English_Canada.1252
> [4] LC_NUMERIC=C                    LC_TIME=English_Canada.1252
>  attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
> loaded via a namespace (and not attached):
> [1] tools_2.11.1   I have tried the same code on a R version 2.14 and got
> the same error too. Hope this is a better picture of what I want to do.
> Thanks,salwa
>
> > Date: Fri, 9 Mar 2012 11:13:29 -0500
> > Subject: Re: [BioC] how can i apply random forest to expression sets of
> dna microarray
> > From: mailinglist.honeypot@gmail.com
> > To: salwaeid@hotmail.com
> > CC: bioconductor@r-project.org
> >
> > Hi Salwa,
> >
> > On Fri, Mar 9, 2012 at 9:53 AM, Salwa Eid <salwaeid@hotmail.com> wrote:
> > >
> > > Dear all,   Is it possible to apply random forest to an expression set
> of dna microarray directly and if so how? regards,salwa
> >
> > I'm sorry if this comes across as rude, but you keep asking the same
> > question in different ways and seem to be ignoring the help that a
> > number of people are giving you.
> >
> > So ... let's try again.
> >
> > The short answer is: yes, you can.
> >
> > The longer answer is that if you really want help, you need to
> > describe exactly what you are trying to do with some explanatory
> > description of the problem -- what you are trying to predict w/ your
> > random forest?
> >
> > Provide the *exact* code you are using, and show us where it fails.
> > Provide us with a dataset we can use with your code that exhibits your
> > problem so we can help you debug.
> >
> > Also, provide output of sessionInfo()
> >
> > There's really no other way to climb our selves out of this echo
> > chamber we seem to be stuck in, so ... help us help you.
> >
> > Thanks,
> >
> > -steve
> >
> > --
> > Steve Lianoglou
> > Graduate Student: Computational Systems Biology
> >  | Memorial Sloan-Kettering Cancer Center
> >  | Weill Medical College of Cornell University
> > Contact Info: http://cbio.mskcc.org/~lianos/contact
>
>         [[alternative HTML version deleted]]
>
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor@r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>

	[[alternative HTML version deleted]]

