[BioC] merge{base}

Al Ivens alicat at sanger.ac.uk
Thu Aug 17 22:43:23 CEST 2006


Jay,

Not in the fewest lines possible, but:

indexfile <- match(stat.result$probeID,annotated$probeID)
all <- cbind(stat.result,annotated[indexfile,])
write.table(all,file="./annotated_result.txt",sep="\t",row.names=F)

should do it, but perhaps also requiring as.character() around each of
your two match terms if it doesnt.

Cheers,

al

> -----Original Message-----
> From: bioconductor-bounces at stat.math.ethz.ch 
> [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of Jay Shin
> Sent: 17 August 2006 19:59
> To: Bioconductor
> Subject: [BioC] merge{base}
> 
> 
> I am having very hard time merging two data frames into one.
> 
> I have two sets of data:
> 1) data frame of significant genes called, "stat.result" and probeID  
> as an identifier
> 2) data frame of my own annotation file called, "annotated" and  
> probeID as an identifier
> 
> when I run the following:
>  >all<-merge(stat.result, annotated, by.x="probeID", by.y="probeID",  
> all.x = TRUE)
>  >write.table(all, file = annotated_result.txt, sep = "\t", 
> row.names  
> = F, col.names = T)
> 
> I get a text file called, "annotated_result.txt" AND when I open the  
> file, some, but not all my probes are annotated and some are labeled  
> "NA" although there's a matching ID in my own annotation file.
> 
> Can someone please help me to fix this problem?
> Thank you!
> Jay
> 
> 
> 
> 
> ________________________________________________________
> ETH Zurich
> Jay W. Shin
> Institute of Pharmaceutical Sciences
> HCI H394
> Wolfgang-Paulistrasse 10
> 8093 Zurich, Switzerland
> 
> jay.shin at pharma.ethz.ch
> www.pharma.ethz.ch
> 
> ++41 44 633 73 68 phone
> ++41 44 633 13 64 fax
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch 
> https://stat.ethz.ch/mailman/listinfo/biocondu> ctor
> Search the 
> archives: 
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>



More information about the Bioconductor mailing list