[BioC] design matrix

James MacDonald jmacdon at med.umich.edu
Wed Oct 3 18:40:25 CEST 2007


?write.fit

>>> Lev Soinov <lev_embl1 at yahoo.co.uk> wrote:
> Dear List,
>    
>   Could you help me with another small issue?
>   I usually write out the results of my analysis using the
write.table 
> function as follows:
>    
>   Assuming 30000 probes in the dataset:
>   data <- ReadAffy()
>   eset <- rma(data)
>    
>   design <- model.matrix(~ -1+factor(c(1,1,1,2,2,3,3,3)))
>   colnames(design) <- c("group1", "group2", "group3")
>   contrast.matrix <- makeContrasts(group2-group1, group3-group2,
group3-group1, 
> levels=design)
>    
>   fit <- lmFit(temp, design)
>   fit2 <- contrasts.fit(fit, contrast.matrix)
>   fit2 <- eBayes(fit2)
>    
>   C1<-topTable(fit2, coef=1, number=30000, adjust=*BH*)
>   
>
write.table(C1,file="comparison1.txt*,append=TRUE,quote=FALSE,sep="\t",row.n
> ames=TRUE,col.names=FALSE)
>    
>   C2<-topTable(fit2, coef=2, number=30000, adjust=*BH*)
>   
>
write.table(C2,file="comparison2.txt*,append=TRUE,quote=FALSE,sep="\t",row.n
> ames=TRUE,col.names=FALSE)
>    
>   C3<-topTable(fit2, coef=3, number=30000, adjust=*BH*)
>   
>
write.table(C3,file="comparison3.txt*,append=TRUE,quote=FALSE,sep="\t",row.n
> ames=TRUE,col.names=FALSE)
>    
>   I then use the written out txt files (comparison1.txt,
comparison2.txt and 
> comparison3.txt) to select significant probes on the basis of
log2fold change 
> and adjusted p values thresholds, using Excel.
>   Would you say that this is a correct way to do this and could you
please 
> recommend me some other, may be more efficient way of writing the
results of 
> topTable for all 30000 probes out?
>    
>   With kind regards,
>   Lev.
> 
>        
> ---------------------------------
>  For ideas on reducing your carbon footprint visit Yahoo! For Good
this 
> month.

**********************************************************
Electronic Mail is not secure, may not be read every day, and should not
be used for urgent or sensitive issues



More information about the Bioconductor mailing list