-
Notifications
You must be signed in to change notification settings - Fork 55
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
Error running sc3() - Error in unserialize(socklist[[n]]) : error reading from connection #33
Comments
Hi, thanks for reporting this! Could you please provide an output of |
Small update in the meantime. Local computer with error
Server without error
|
Hmm, that's a hard error to catch... Looks like some memory issues... R version should not be a problem here. Did you run it on the example dataset? If not, could you please share your dataset with me? Cheers, |
I used the example you provided and my dataset, same error. here is the sequence of commands with my dataset:
|
Could you share your dataset with me?
On Wed, Dec 21, 2016 at 12:29 PM Patrick Roelli ***@***.***> wrote:
I used the example you provided and my dataset, same error.
here is the sequence of commands with my dataset:
library(scater)
library(SC3)
#Load the data
Mouse = read.table('gene_name_matrix.tsv')
phenoData_matrix = data.frame(Cell = colnames(Mouse), Species=rep('Mouse', ncol(Mouse)))
phenoData <- new("AnnotatedDataFrame", data=phenoData_matrix)
rownames(phenoData) = phenoData_matrix$Cell
mouse = newSCESet(countData = Mouse, phenoData = phenoData)
keep_feature <- rowSums(exprs(mouse) > 0) > 0
mouse <- mouse[keep_feature,]
mouse <- calculateQCMetrics(mouse)
mouse <- sc3(mouse, ks = 2:4)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#33 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACO-zmxXlBJTlbRKlmgQlKjw2n1J3Ey2ks5rKRu4gaJpZM4LSTCs>
.
|
sent via email |
Hi Patrick, Unfortunately, I can't reproduce your error using your data. Everything works fine for me. However, it looks like the C++ call to
Cheers, |
Hello, just tried on both platforms, same error on the local computer, works on the server: SC3::norm_laplacian(matrix(runif(100), nrow = 10))
Maybe it has something to do with armadillo? |
Yes, most probably you are right, since I mostly call armadillo functions in |
I am getting the same error. Here is my session info:
|
Thanks for your message, Jake! Hmm, now I think it maybe the R version problem (3.3.2). Would you be able to test on a different version of R, say 3.3.1? Another option is Ubuntu. In Patrick's message above it worked under Ubuntu 14.04. In your case it is Ubuntu 16.10. I can't really understand what the current problem in norm_laplacian() can be, maybe you guys have some ideas:
If I don't find problems in this C++ code, I suppose the most reasonable thing I could do is to rewrite norm_laplacian() using only R functions... |
Interestingly, Bioconductor builds for SC3 are all ok and the vignettes are built ok - http://bioconductor.org/packages/3.4/bioc/vignettes/SC3/inst/doc/my-vignette.html All Bioconductor builds are made on R 3.3.2: So I really have no idea what the problem is... I have posted a question on Biocoductor devel mailing list. I am copying it here (will let you know if anybody answers): R version-dependent segfault My package (SC3 - http://bioconductor.org/packages/3.4/bioc/html/SC3.html) has a function that causes R version/platform-dependent seqfault. Here is the function (it's in C++ using RccpArmadillo):
The test code that provides a segfault on some R versions/platforms:
(where address can be a different sequence) So far by a collaborative effort (me and some users of the package) we figured out configurations that cause or do not cause a segfault:
R version 3.3.2 (2016-10-31) R version 3.3.2 (2016-10-31)
R version 3.3.2 (2016-10-31) R version 3.3.1 (2016-06-21) R version 3.3.0 (2016-05-03) R Under development (unstable) (2016-10-20 r71540) More details on our discussion can be found here: Has anybody had a similar issue? Do you have any suggestions on how to fix this, except rewriting the function in R? Or maybe there already exists a normalised Laplacian function written in C++? Many thanks, |
I resintalled Rccparmadillo and SC3 on the local comp, still not working. I
even tried to "cheat" and hardcopied the compiled version of the server
onto local libs, still same error.
2016-12-21 21:12 GMT+01:00 Vladimir Kiselev <notifications@github.com>:
… Yes, most probably you are right, since I mostly call armadillo functions
in norm_laplacian(). Could you please reinstall both Rccparmadillo and
SC3 on your local computer and try again? And could you please also check
whether you have different versions of gcc compilers on your local computer
and the server? Maybe the problem is in the compiler...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#33 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABNXaMejUMnnHsNJ1sDbARNBQl_mp_37ks5rKYgagaJpZM4LSTCs>
.
|
Hi Patrick, thanks for the updates. Please see my posts above. |
Here is a reply from Martin Morgan at Bioconductor. Could you please follow his steps, guys, and let me know about your output? Many thanks in advance! The first line of attack is to simplify the problem as much as possible.
and then in R, e.g., norm_laplacian.R
It would be helpful to use set.seed() to make the example more
would produce a segfault. Unfortunately not for me. My next step was to
again hoping for a report of 'invalid write' or 'invalid read', but You could see if your collaborators are able to generate segfaults with Here's my output; it's also useful to know information about the
if the segfault does not occur with the simpler code, then one could try Martin |
Hi Vladimir I know you have moved past the R version, but I was also getting the segfault on 3.3.1. I ran the simplified code suggested above and did not receive the segfault. Below is the output
I can try to work with valgrind a bit later, thanks for the help. |
Here is the output from valgrind.
|
Hi Jake, many thanks for your help! I've sent the following message back to Martin at Bioconductor. Will let you know when he replies. Dear Martin, Many thanks for your reply, it was really helpful. My collaborator ran the commands you suggested and got the following output:
So running the simplified code did not produce a segfault and suggested that the problem was in SC3::norm_laplacian(). And indeed, running valgrind with SC3::norm_laplacian(matrix(runif(100), nrow = 10)) did catch the error:
So, it looks like the problem is in finding the max of the input matrix A, specifically in the direct_max() function of Armadillo library. But the segfault only appears when running SC3::norm_laplacian() and not the simplified code. Does it suggest that I have some linking or exporting problems in the package? Can you think of any solution to this problem? In case this can help, the SC3::norm_laplacian() function is stored in the file with the following header:
Many thanks in advance, |
Hi guys, I am trying to make a simple fix, not sure whether it will work but worth trying. Could you please reinstall SC3 from GitHub:
And then run this command again a new R session?
|
It worked for me!
2017-01-06 12:44 GMT+01:00 Vladimir Kiselev <notifications@github.com>:
… Hi guys, I am trying to make a simple fix, not sure whether it will work
but worth trying. Could you please reinstall SC3 from GitHub:
install.packages("devtools")
devtools::install_github("hemberg-lab/SC3")
And then run this command again a new R session?
SC3::norm_laplacian(matrix(runif(100), nrow = 10))
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#33 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABNXaOmdiWZJXPo8K9uaaxElYT-AUl21ks5rPikcgaJpZM4LSTCs>
.
|
It also worked for me. Let me know if you need anymore testing. |
Wow, this is great, guys! At the end it was a simple conflict in namespaces between RcppArmadillo and Rccp. By removing one of them from the header the problem was solved. Thanks so much for testing it for me! Cheers, |
I am also copying a reply I received from Bioconductor's Martin Morgan without whom I would have never solved this problem. Thanks to him as well! I don't think #include is required. I also don't know C++ I should have added --vanilla to the incantation
Using gdb seems more intimidating than it actually is. One would need to
install RcppArmadillo and SC3 (the compiler should report flags -g -O0)
probably ending up in the debugger where you could do
to go up the call stack unitil you see something like
then down to the line that fails
then take a peak at the source code
and check out things to make sure that they make sense
etc. One might go up the call stack, verifying along the way
My next stop would be the Rcpp mailing list Hope that helps somehow... Martin |
… for more details git-svn-id: file:///home/git/hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/SC3@125739 bc3139a8-67e5-0310-9ffc-ced21a209358
Hello,
I was trying out your package but I get a pretty long error list when I run sc3()
I used the example your provide.
Any idea?
The text was updated successfully, but these errors were encountered: