satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.27k stars 910 forks source link

Issue with FindCluster #106

Closed MichelNivard closed 7 years ago

MichelNivard commented 7 years ago

Hi,

I get an error when using FindCluster():

data.seurat <- FindClusters(object = data.seurat, reduction.type = "pca", dims.use = 1:13, resolution = 0.6, print.output = 0, save.SNN = TRUE,temp.file.location="/")
Error in file(file, "rt") : cannot open the connection
In addition: Warning messages:
1: running command 'java -jar "C:/Users/Michel Nivard/Documents/R/win-library/3.3/Seurat/java/ModularityOptimizer.jar" "/edge_53883.txt" "/output_53883.txt" 1 0.6 1 100 10 0 0' had status 127 
2: In file(file, "rt") :
  cannot open file '/output_53883.txt': No such file or directory

Any ideas what might be going wrong? Running Windows 10, 64 biy R 3.4.1 I have java - version returning: 1.8.0_144

Thanks in advance, Michel Nivard

MichelNivard commented 7 years ago

PS: like the previous issue raised yesterday, running the java command directly in the command prompt, and omitting the quotation marks works.

andrewwbutler commented 7 years ago

Have you tried installing to a library path without spaces in the name? That seemed to resolve the other issue and I'm guessing it's what's causing the problem here as well.

preyfman commented 7 years ago

I had this issue and was able to solve it by changing the value for CurrentVersion for [HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment] from 1.8 to 1.7. A more permanent solution would be awesome. Thanks, Paul Reyfman

batson commented 7 years ago

Hi all, I'm about to help a big group (20 or so scientists) get started with Seurat, and I've been running into the same issue as others above on my laptop. I installed R via anaconda on my mac laptop (the straight R studio install was giving incompatibility with the matrix library). I have the same error in FindClusters as above, using

temp.file.location = "/Users/josh/src/seurat/tmp/"

When I run the jar from Terminal,

`java -jar ./lib/R/library/Seurat/java/ModularityOptimizer.jar

Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck

Input file name: /Users/josh/src/seurat/tmp/edge_65915.txt Output file name: /Users/josh/src/seurat/tmp/out_65915.txt`

it runs fine.

liver <- FindClusters(object = liver, reduction.type = "pca", dims.use = 1:30, resolution = 1.0, print.output = 0, save.SNN = TRUE, temp.file.location = "/Users/josh/src/seurat/tmp/")

Then runs, since the file has been deposited by the command-line job.

This seems somewhat inconvenient. The reason I was going to recommend seurat over a canned python or R notebook was the ease of use and quality of documentation, but if everyone is going to have install issues like this I'm hesitant to proceed, @satijalab.

Do you understand what is causing this problem? Alternatively, do you have an anaconda or other package manager solution that people can use to avoid this problem?

satijalab commented 7 years ago

Hi Joshua,

I apologize for the hassle. We've tried to make sure that our default options result in easy installations for most users, as we certainly understand the frustration of being unable to get setup in this context. Most of the issues surrounding this have been in a subset of Windows environments (with a couple solutions proposed above), though you're of course working on a mac.

My guess is that there is something different resulting from the installation of R using anaconda, which we have not tried before, but certainly want to support. We're looking into this now and will get back to you as soon as we have a solution.

best, Rahul

batson commented 7 years ago

Thanks, Rahul.

To give a bit more context, we are trying to empower a bunch of labs we're working with on a big single cell project to explore the data on their own, w/ minimal need for handholding from out data science team. Seurat stood out because:

  1. You've got detailed walkthroughs of the steps in a typical analysis, with descriptive function names and examples.
  2. You are working to incorporate the best methods available for clustering and normalization into one coherent system, so people don't have to download a bunch of packages to get started. In my own work I've found the graph-based clustering methods to be the most interpretable and respectful of the inherent high-dimensionality of the data, and so having those in Seurat makes it a strong contender.

Given that you're now using graphs to compute clusters, do you have any plans to do the 2-d embeddings using the graph instead of tsne? In one example I was looking at today, the tsne split a cluster into a handful of distinct regions. (I was looking at hepatocytes from the liver, where there are spatial gradients, and tsne's general tendency to split things can introduce artifacts.) When I'd analyzed the same data using phenograph (basically Louvain) and then graphviz's sfdp embeddings, it was easier to relate the clusters to the 2d representation. I was using a different normalization (cosine distance on UMIs) than the default Seurat flow, which may account for this, but it would be easier to debug from a projection more aligned with the clustering construction.

The installation hiccups (compatibility of R versions and, perhaps, java versions) are inevitable with software distribution. I'd like to figure out as foolproof of an on-ramp for these folks as possible. Any guidance you can give there would be appreciated.

Thanks!

-Josh

On Wed, Sep 27, 2017 at 6:50 PM, satijalab notifications@github.com wrote:

Hi Joshua,

I apologize for the hassle. We've tried to make sure that our default options result in easy installations for most users, as we certainly understand the frustration of being unable to get setup in this context. Most of the issues surrounding this have been in a subset of Windows environments (with a couple solutions proposed above), though you're of course working on a mac.

My guess is that there is something different resulting from the installation of R using anaconda, which we have not tried before, but certainly want to support. We're looking into this now and will get back to you as soon as we have a solution.

best, Rahul

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/satijalab/seurat/issues/106#issuecomment-332703831, or mute the thread https://github.com/notifications/unsubscribe-auth/ABM-aqcDNqBOEozR3XLCkYDtfnW4HGfrks5smvtJgaJpZM4Onl7B .

andrewwbutler commented 7 years ago

Hi Josh,

I think this is an issue with R being able to talk to Java specifically within the context of your anaconda environment. One way to test this would be to run the following from within your anaconda installed R.

system("java -version")

If this produces an error, you could try installing java from within anaconda.

As far as alternative package managers, we typically use Homebrew for package management on macs. The path of least resistance though is likely to be a straight install via Rstudio (outside of an anaconda environment). Could you elaborate on what incompatibility issues you were having with the Matrix package?

-Andrew

batson commented 7 years ago

Hi Andrew,

IIRC the issue I was having in RStudio was with colSums not recognizing the dgTMatrix type. I see that the tutorial now uses Matrix::colSums, which is works fine for me. I'll proceed with RStudio.

FWIW I am now (in R 3.4.1) getting warnings on the PCHeatmap function:

> PCHeatmap(object = pbmc, pc.use = 1, cells.use = 500, do.balanced = TRUE,
label.columns = FALSE)
Warning messages:
1: In heatmap.2(data.use, Rowv = NA, Colv = NA, trace = "none", col =
col.use,  :
  Discrepancy: Rowv is FALSE, while dendrogram is `both'. Omitting row
dendogram.
2: In heatmap.2(data.use, Rowv = NA, Colv = NA, trace = "none", col =
col.use,  :
  Discrepancy: Colv is FALSE, while dendrogram is `column'. Omitting column
dendogram.
3: In plot.window(...) : "dimTitle" is not a graphical parameter
4: In plot.xy(xy, type, ...) : "dimTitle" is not a graphical parameter
5: In title(...) : "dimTitle" is not a graphical parameter

The result of system("java -version") was

java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)