Skip to content

pCMF example gives segmentation fault #1

@pcarbo

Description

@pcarbo

Hi @gdurif, I tried to use your R package. I was able to successfully install the package, but I ran into trouble when trying to run the cNMF example provided. This is the error I get:

Declaration
Initialization
Optimization
iter 0
 *** caught segfault ***
address 0x7ffeecfec000, cause 'memory not mapped'

This is the exact code I ran (note that I added a set.seed; without it, your example is not reproducible):

library(pCMF)
set.seed(1)
n <- 100
p <- 500
K <- 20

# SIMULATE DATA
# -------------
factorU <- generate_factor_matrix(n,K,ngroup = 3,
                                  average_signal = c(250,100,250),
                                  group_separation = 0.8,
                                  distribution = "exponential",
                                  shuffle_feature = TRUE)

factorV <- generate_factor_matrix(p,K,ngroup = 2,average_signal = 80,
                                  group_separation = 0.8,
                                  distribution = "exponential",
                                  shuffle_feature = TRUE,
                                  prop_noise_feature = 0.6)

U <- factorU$factor_matrix
V <- factorV$factor_matrix

count_data <- generate_count_matrix(n,p,K,U,V,ZI = TRUE,prob1 = rep(0.3,p))
X          <- count_data$X
kept_cols  <- prefilter(X,prop = 0.05,quant_max = 0.95,
            	        presel = TRUE,threshold = 0.2)
X          <- X[,kept_cols]

# FIT MATRIX FACTORIZATION
# ------------------------
out <- pCMF(X,K,verbose = TRUE,zero_inflation = TRUE,sparsity = TRUE)

Please advise. Note that I am using R 3.4.3 on a MacBook Pro:

> sessionInfo()
R version 3.4.3 (2017-11-30)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.4/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] pCMF_1.2.1

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.1          magrittr_1.5        maps_3.3.0
 [4] tidyselect_0.2.5    munsell_0.4.3       colorspace_1.4-0
 [7] lattice_0.20-35     R6_2.4.0            rlang_0.3.1
[10] plyr_1.8.4          dplyr_0.8.0.1       tools_3.4.3
[13] fields_9.6          dotCall64_1.0-0     grid_3.4.3
[16] spam_2.2-2          gtable_0.2.0        lazyeval_0.2.1
[19] assertthat_0.2.1    tibble_2.1.1        RcppEigen_0.3.3.5.0
[22] crayon_1.3.4        Matrix_1.2-12       purrr_0.2.5
[25] ggplot2_3.2.0       glue_1.3.1          compiler_3.4.3
[28] pillar_1.3.1        scales_0.5.0        pkgconfig_2.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions