Example on constructing AffyBatch object
1
0
Entering edit mode
Peng Yu ▴ 940
@peng-yu-3586
Last seen 7.7 years ago
Hi, I see that I can use data() to load AffyBatch object from affydata, or I could load cel files to get AffyBatch. But I'd rather construct an example AffyBatch object using fake data so that I can understand how AffyBatch works. I adapted the example from Biobase (note that I don't load any data from a file) which help me understand exactly the member functions and the object construction. But I don't find such a tutorial for AffyBatch. If it is available somewhere, would you please point it me. If it is not, would give some examples so that I can understand how AffyBatch is constructed and how the new member functions in AffyBatch (as AffyBatch is inherent from ExpressionSet) is related to the construction? library('Biobase') nFeatures=10 nSamples=4 exprs=matrix(runif(nFeatures*nSamples), nrow=nFeatures, ncol=nSamples) colnames(exprs)=LETTERS[1:nSamples] rownames(exprs)=letters[1:nFeatures] set.seed(0) varlabels=c('gender', 'type') pData=data.frame( sample(c('Female', 'Male'), nSamples, replace=T) , sample(c('Control', 'Case'), nSamples, replace=T) ) names(pData)=varlabels row.names(pData)=LETTERS[1:nSamples] metadata=data.frame( labelDescription=c('Patient gender', 'Case/control status') , row.names=varlabels ) pData metadata phenoData=new('AnnotatedDataFrame', data=pData, varMetadata=metadata) str(phenoData) experimentData=new( 'MIAME', name='Pierre Fermat', lab='Francis Galton Lab', contact='pfermat at lab.not.exist', title='Smoking-Cancer Experiment', abstract='An example ExpressionSet', url='www.lab.not.exist', other=list(notes='Created from text files') ) annotation='hgu95av2' eset=new('ExpressionSet', exprs=exprs, phenoData=phenoData, experimentData=experimentData, annotation=annotation) exprs(eset) featureNames(eset) sampleNames(eset) phenoData(eset) experimentData(eset) -- Regards, Peng
Biobase affydata Biobase affydata • 1.8k views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 1 day ago
United States
Look at the code for read.affybatch. Best, Jim On 7/1/2010 12:29 PM, Peng Yu wrote: > Hi, > > I see that I can use data() to load AffyBatch object from affydata, or > I could load cel files to get AffyBatch. But I'd rather construct an > example AffyBatch object using fake data so that I can understand how > AffyBatch works. > > I adapted the example from Biobase (note that I don't load any data > from a file) which help me understand exactly the member functions and > the object construction. But I don't find such a tutorial for > AffyBatch. If it is available somewhere, would you please point it me. > If it is not, would give some examples so that I can understand how > AffyBatch is constructed and how the new member functions in AffyBatch > (as AffyBatch is inherent from ExpressionSet) is related to the > construction? > > library('Biobase') > nFeatures=10 > nSamples=4 > exprs=matrix(runif(nFeatures*nSamples), nrow=nFeatures, ncol=nSamples) > colnames(exprs)=LETTERS[1:nSamples] > rownames(exprs)=letters[1:nFeatures] > > set.seed(0) > > varlabels=c('gender', 'type') > pData=data.frame( > sample(c('Female', 'Male'), nSamples, replace=T) > , sample(c('Control', 'Case'), nSamples, replace=T) > ) > names(pData)=varlabels > row.names(pData)=LETTERS[1:nSamples] > > metadata=data.frame( > labelDescription=c('Patient gender', 'Case/control status') > , row.names=varlabels > ) > > pData > metadata > > phenoData=new('AnnotatedDataFrame', data=pData, varMetadata=metadata) > str(phenoData) > > experimentData=new( > 'MIAME', > name='Pierre Fermat', > lab='Francis Galton Lab', > contact='pfermat at lab.not.exist', > title='Smoking-Cancer Experiment', > abstract='An example ExpressionSet', > url='www.lab.not.exist', > other=list(notes='Created from text files') > ) > > annotation='hgu95av2' > > eset=new('ExpressionSet', exprs=exprs, phenoData=phenoData, > experimentData=experimentData, annotation=annotation) > > exprs(eset) > featureNames(eset) > sampleNames(eset) > phenoData(eset) > experimentData(eset) > > > -- James W. MacDonald, M.S. Biostatistician Douglas Lab University of Michigan Department of Human Genetics 5912 Buhl 1241 E. Catherine St. Ann Arbor MI 48109-5618 734-615-7826 ********************************************************** Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues
ADD COMMENT

Login before adding your answer.

Traffic: 429 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6