[BioC] ReportingTools - trouble incorporating annotations
James W. MacDonald
jmacdon at uw.edu
Thu Jun 20 16:15:34 CEST 2013
Hi Sam,
On 6/19/2013 6:17 PM, Sam McInturf wrote:
> Finally, some of my annotations have a one to many mapping which
> results in one gene being displayed on several lines with the only
> change being in one field (say, PMIDs). Is there a 'fast' way to put
> all of these many to one mappings into a a single deliminated field
> (18614708 / 18614708 / 18614708) or is it something that I should just
> make a quick function for?
I usually do this sort of thing with a combination of the Xapply family
of functions.
annot <- select(org.At.tair.db, keys= rownames(tempDE$genes), col =
c("SYMBOL", "PMID", "GENENAME"), keytype="TAIR")
annotlst <- tapply(seq_len(nrow(annot)), annot[,1], function(x) annot[x,])
annotlst <- do.call("rbind", lapply(annotlst, function(x) t(apply(x, 2,
function(y) paste(unique(y), collapse = "/")))))
Best,
Jim
--
James W. MacDonald, M.S.
Biostatistician
University of Washington
Environmental and Occupational Health Sciences
4225 Roosevelt Way NE, # 100
Seattle WA 98105-6099
More information about the Bioconductor
mailing list