Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plotHeatmap not working with NMF development version #235

Open
rufletch opened this issue Jan 26, 2018 · 16 comments
Open

plotHeatmap not working with NMF development version #235

rufletch opened this issue Jan 26, 2018 · 16 comments

Comments

@rufletch
Copy link

rufletch commented Jan 26, 2018

Error in strsplit(newName, "\\.") : non-character argument

This error occurs with all plotHeatmap commands that I've tested. It does not prevent producing the heat map, for instance, making a pdf of the heatmap, but it will stop R from knitting an Rmd file. The error can be traced to line 817, caused by an issue in line 816.

@diyadas
Copy link

diyadas commented Jan 26, 2018

I've also had the same issue on my machine and gotten past the error by wrapping the plotHeatmap command in a try statement, but this is obviously not ideal.

@epurdom
Copy link
Owner

epurdom commented Jan 27, 2018

What version of clusterExperiment is this? Does it happen on the develop branch or the current release?

Any chance you have some example I could run to reproduce? (I have made a small change to develop around this code, but I don't see how it would effect this. Otherwise, this is very old code so I'm a bit baffled.)

@diyadas
Copy link

diyadas commented Jan 27, 2018

I think it may be linked to the development version of NMF (which we installed to get support for the na.color argument). In this version of NMF, line 816 of plotHeatmap (NMF:::vplayout(NULL)) produces FALSE, which is causing the error in line 817. (I have clusterExperiment 1.4.0 which is loading NMF 0.23.6.)

Here's sample code which produces the same error for me:

mat=matrix(runif(10, 5.0, 10), 2,5)
mat[c(4,7,10)] <- NA
plotHeatmap(mat, clusterSamples=F, clusterFeatures=F, labRow = c("A","B"), 
sampleData=data.frame(clusters=c(1,1,2,3,4)), 
clusterLegend=list(clusters=c("red","blue","green","purple")), cexRow = .4, annLegend=F, 
layout='_', na.color="black", labCol=rep("", ncol(mat)))

As far as a temporary patch is concerned, would it be possible to alter the code so a warning is generated instead of an error? We are getting the heatmaps we want; it's just that the error stops the knitting of Rmd files.

@epurdom
Copy link
Owner

epurdom commented Jan 28, 2018

Thanks Diya, that is very helpful, because I wouldn't have found that since I'm not using the development version.
I have pushed a patch to the develop branch of cluster experiment to skip this step if it hits an error there (this is what puts names next to the colored rectangles next to the samples). Try it and see if it at least clears without giving an error.

@rufletch
Copy link
Author

rufletch commented Jan 29, 2018 via email

@rufletch
Copy link
Author

rufletch commented Jan 29, 2018 via email

@rufletch
Copy link
Author

rufletch commented Jan 29, 2018 via email

@epurdom
Copy link
Owner

epurdom commented Jan 30, 2018

Hi Russell,
The image is not coming through because this is through github issues tracking and the attachments to those don't get posted. Can you go to the issue tracking online and upload the image there?

Is this in legend, you mean? Is it showing levels of the clustering factor for which there are no samples (e.g. because you subset the data)?

Thanks,
Elizabeth

@rufletch
Copy link
Author

screen shot 2018-01-30 at 12 42 54 pm

Hi Elizabeth,
This is an example of the heatmaps I'm getting - in this case there are 11 clusters. On my end I can probably solve it by subsetting the color palette for the clusters to be the same length as the number of clusters.
Best,
Russell

@epurdom
Copy link
Owner

epurdom commented Jan 30, 2018 via email

@epurdom
Copy link
Owner

epurdom commented Jan 31, 2018

Hi Russell,
I'm having a hard time replicating this. Could you give me some information about the vector giving the cluster identification and the color vector that goes along with it?

In particular, if clusters is the vector giving the cluster assignment,

  1. Is clusters a factor
  2. If so what are the levels (levels(clusters))
  3. If not, what is class(clusters)
  4. What does table(clusters,useNA="ifany") look like?
  5. Does clusters have NA values?

If clusterColors is the vector of colors,

  1. What are the names of clusterColors (if any)

Thanks,
Elizabeth

@rufletch
Copy link
Author

rufletch commented Feb 1, 2018 via email

@epurdom
Copy link
Owner

epurdom commented Feb 2, 2018 via email

@drisso
Copy link
Collaborator

drisso commented Feb 2, 2018

If some changes in the development version of NMF caused this, is this a good time to switch to pheatmap?

I see at least two advantages:

  • In my experience pheatmap is more stable than aheatmap (e.g., it can be displayed in RStudio)
  • Depending on the NMF package seems an overkill since we're only using its heat map function.

@rufletch
Copy link
Author

rufletch commented Feb 2, 2018 via email

@epurdom
Copy link
Owner

epurdom commented Feb 3, 2018 via email

@epurdom epurdom changed the title Error in strsplit(newName, "\\.") : non-character argument plotHeatmap not working with NMF development version Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants