[NMF-user] A segfault problem from NMF package

謝 宜軒 xyxmsn at hotmail.com
Fri Nov 25 09:43:09 CET 2016


Dear Dr. Gaujoux


    I am a graduate student majoring in bioinformatics. My current project is about data mining of microarray datasets to explore dysregulated pathways in cancers.


I read your paper about applying NMF to data analysis. I found it very interesting and I tried your NMF package. However, when analyzing a dataset, ~50,000 probesets x 50 samples, I got an error:”caught segfault error” on R3.2.2 X86_64linux.

My server spec. is CentOS release 6.4, memory: 264G.


Here are the command lines I have used:

……………………………………………………………………………………………………………………
>library(NMF)
>raw.data<-read.csv("HCC_RMA_normalized_expression_matrix.csv")
>patient.data<-read.csv(“HCC_survival_data.csv")
>group_NT<-patient.data[,5]
>exp.data<-raw.data[,-(1:3)]
>exp.data<-exp.data[,order(group_NT)]
>tumor_exp_data<-exp.data[,38:87]
>row.names(tumor_exp_data)<-raw.data[,2]
>tumor_exp_data<-as.matrix(tumor_exp_data)
>estim.r<-nmf(tumor_exp_data,2:6,method=“brunet”,nrun=4)
……………………………………………………………………………………………………………………

 “tumor_exp_data" here is a ~50,000 x 50 numeric matrix object. The error message is as attached at the end of this e-mail.

However, if I set nrun=1, there would be no error message and NMF calculation could be finished.


……………………………………………………………………………………………………………………


 *** caught segfault ***
address 0x7f6606886048, cause 'memory not mapped'

Traceback:
 1: cor(t(x))
 2: .local(object, ...)
 3: predict(x, what = what, dmatrix = TRUE)
 4: predict(x, what = what, dmatrix = TRUE)
 5: silhouette.NMF(object, what = "features")
 6: silhouette(object, what = "features")
 7: .local(object, ...)
 8: summary(fit(object), ...)
 9: summary(fit(object), ...)
10: summary(best.fit, ...)
11: summary(best.fit, ...)
12: summary(res, target = V)
13: summary(res, target = V)
14: doTryCatch(return(expr), name, parentenv, handler)
15: tryCatchOne(expr, names, parentenv, handlers[[1L]])
16: tryCatchList(expr, classes, parentenv, handlers)
17: tryCatch({    res <- nmf(x, r, method, nrun = nrun, model = model, ...)    if (!isNMFfit(res, recursive = FALSE))         return(res)    c.matrices[[as.character(r)]] <<- consensus(res)    fit[[as.character(r)]] <<- res    if (verbose)         cat("+ measures ... ")    measures <- summary(res, target = V)    if (verbose)         cat("OK\n")    measures}, error = function(e) {    mess <- if (is.null(e$call))         e$message    else paste(e$message, " [in call to '", e$call[1], "']",         sep = "")    mess <- paste("[r=", r, "] -> ", mess, sep = "")    if (stop) {        if (verbose)             cat("\n")        stop(mess, call. = FALSE)    }    if (verbose)         message("ERROR")    return(mess)})
18: FUN(X[[i]], ...)
19: lapply(X = X, FUN = FUN, ...)
20: sapply(range, function(r, ...) {    k.rank <<- k.rank + 1L    if (verbose)         cat("Compute NMF rank=", r, " ... ")    orng <- RNGseed()    if (k.rank < length(range))         on.exit(RNGseed(orng), add = TRUE)    res <- tryCatch({        res <- nmf(x, r, method, nrun = nrun, model = model,             ...)        if (!isNMFfit(res, recursive = FALSE))             return(res)        c.matrices[[as.character(r)]] <<- consensus(res)        fit[[as.character(r)]] <<- res        if (verbose)             cat("+ measures ... ")        measures <- summary(res, target = V)        if (verbose)             cat("OK\n")        measures    }, error = function(e) {        mess <- if (is.null(e$call))             e$message        else paste(e$message, " [in call to '", e$call[1], "']",             sep = "")        mess <- paste("[r=", r, "] -> ", mess, sep = "")        if (stop) {            if (verbose)                 cat("\n")            stop(mess, call. = FALSE)        }        if (verbose)             message("ERROR")        return(mess)    })    res}, ..., simplify = FALSE)
21: nmfEstimateRank(x, range = rank, method = method, nrun = nrun,     seed = seed, rng = rng, model = model, .pbackend = .pbackend,     .callback = .callback, verbose = verbose, .options = .options,     ...)
22: .local(x, rank, method, ...)
23: nmf(x, rank, method = strategy, ...)
24: nmf(x, rank, method = strategy, ...)
25: nmf(tumor_exp_data, 2:6, method = "brunet", nrun = 4)
26: nmf(tumor_exp_data, 2:6, method = "brunet", nrun = 4)

……………………………………………………………………………………………………………………

I also used ‘top’ to inspect the memory usage, the R NMF process was running until it took up to 16G RAM and then the R session was terminated.
At that moment, my server still had much free memory when this error occurred.

However,if I set nrun=1,there would be no error message and NMF calculation could be finished.
I was wondering if there is anything I can do to get around this problem. I notice that there could be additional supporting packages such as “bigmemory”. So, might it be helpful if I install those packages? Thank you very much.


Best,
Yi-hausan Hsieh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/nmf-user/attachments/20161125/29cac9b1/attachment.html>


More information about the nmf-user mailing list