Hi Sam,

Sorry for missing so much of the discussion!


On Wed, Jun 19, 2013 at 3:17 PM, Sam McInturf <smcinturf@gmail.com> wrote:

> Still having some troubles : /
>
> My intention was to load annotation data into a $genes slot for publish()
> to pick up by not including the annotations argument in the publish call.
>
> tempDE <- DGELists$Roots
> tempDE$genes <- select(org.At.tair.db, keys= rownames(tempDE$genes), col =
> c("SYMBOL", "PMID", "GENENAME"), keytype="TAIR")
> myHTML <- HTMLReport(shortName = "RootsDE.html", title = "File made from
> edgeR output",basePath = basePath, reportDirectory = "./reports")
> publish(tempDE, myHTML, countTable = cpmMat, conditions = group,
> pvaueCutoff = 0.01, lfc =2, n = 100, name = "RootsLRT")
> finish(myHTML)
>
> Error: More than half of your IDs could not be mapped.
>
>
I believe that you can get around this by adding annotation.db=NULL to you
publish call. This will force the use of the genes frame from the DGELRT
object.


> tempDE <- DGELists$Roots
> tempDE$genes <- select(org.At.tair.db, keys= rownames(tempDE$genes), col =
> c("SYMBOL", "PMID", "GENENAME"), keytype="TAIR")
> otDE <- as.data.frame(topTags(tempDE))
> myHTML <- HTMLReport(shortName = "RootsDE.html", title = "File made from
> edgeR output",basePath = basePath, reportDirectory = "./reports")
> publish(otDE, myHTML, countTable = cpmMat, conditions = group,  name =
> "RootsLRT")
> finish(myHTML)
>
> But I am left wonder, if I pass a DGELRT object to publish(), I understand
> that it should call topTags() on it and then do its thing from there.  But
> this is essentially what I did as well, so why is it working when I do it
> 'manually' or what am I missing?
>

We generally try to produce default annotations based on the Bioc org.Xx.db
packages. I'm really not sure why this would fail for the org.At.tair.db
package, especially since the select you're doing there is doing the same
thing as us.


> Additionally, I am getting this to work because I am taking annotations and
> loading them into the $genes slot, which is only looked at by publish()
> when nothing is passed to the annotation argument.  What do I have to do to
> my DGELRT object for the annotations argument to work / what am I missing?
>

Aha! I just found the answer to this, and it results from an assumption
that holds true for mouse and human but probably not other species. We
expect that most genes will have a symbol in the org.Xx.db package. This
turns out not to be the case for Arabidopsis. I'll downgrade this from an
error to a warning.

Thanks for finding this! Unfortunately, most of our work is on mouse and
human, so we just don't see the breadth of what's out there for annotation
packages. I'll let you know when we update the package, and can send you a
new version with the change, if you'd like.


> 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?
>
>
Being relatively unfamiliar with the select method for annotation db's,
I'll leave this for someone else to answer. My general way of doing
something like this is to use mget and something like this:

pmidL <- mget(ids, org.At.tairPMID)
pmids <- sapply(pmidL, function(x) { if(all(!is.na(x))) {paste(x,
collapse=" / ")} else {""} }



>
> Thanks
>
> On Wed, Jun 19, 2013 at 4:25 PM, Gabriel Becker <gmbecker@ucdavis.edu
> >wrote:
>
>
Cheers,

Jason

-- 
Jason A. Hackney, Ph.D.
Bioinformatics and Computational Biology
Genentech
hackney.jason@gene.com
650-467-5084

	[[alternative HTML version deleted]]

