lgatto / pRolocGUI

Interactive visualisation and exploration of spatial proteomics data
http://lgatto.github.io/pRolocGUI
7 stars 5 forks source link

Error with GOAnnotations matrix and pRolocVis #77

Closed lmsimp closed 8 years ago

lmsimp commented 8 years ago

This is almost certainly related to #76.

library('pRoloc')
library('pRolocdata')
library('pRolocGUI')
data("hyperLOPIT2015")
hyperLOPIT2015 <- markerMSnSet(hyperLOPIT2015)
params <- setAnnotationParams(inputs = c("Mus musculus", 
                                         "UniProt/Swissprot"))
cc <- addGoAnnotations(hyperLOPIT2015, params, 
                   namespace = "cellular_component")
pRolocVis(cc, fcol = "GOAnnotations")

Error in : fcol %in% fvarLabels(object) is not TRUE

With pRolocVis looks okay to start with... but then trying to zoom, then click an item in the table results in an error with regard to fcol

lmsimp commented 8 years ago

I now can not reproduce the above error.

But the issue I have is that if you pass a matrix of markers e.g. fcol = GOAnnotations then it appears as a long vector of 1's and 0's which is a bit ugly and also it's not at all informative. e.g.

example

lmsimp commented 8 years ago

So to fix this @lgatto I have changed the pRolocVis_pca code so that any fcol which is a matrix is converted to a vector using mrkMatToVec. I do this for all columns that are a matrix not just the one called by fcol as we also have to Table Selection tab where we can select other columns. So I want the same behaviour for all matrix of markers.

Is this okay with you @lgatto?

lmsimp commented 8 years ago

Fixed in 2c332d39430973616fa8716f47784b46da627db0

lgatto commented 8 years ago

Would it not be easier to do something like

fData(object) <- rbind(fData(object), fData(object)[, fcol])
fData(object)[, fcol] <- NULL
lmsimp commented 8 years ago

Dammit, yes it would be easier

lmsimp commented 8 years ago

I am now fixing a similar bug in pRolocVis_comp so will have a look at re-coding the above first...