pheatmap - Error in do_one(nmeth) : NA/NaN/Inf in foreign function call (arg 1)
Entering edit mode
Assa Yeroslaviz ★ 1.5k
Last seen 26 days ago
Munich, Germany

I am trying to plot a heatmap using pheatmap(). 

I'm using the following script to set the parameters and plot the various clusters. 

  hmx.parameters <- list(counts_filtered_df, 
    color = col.pal,
    cellwidth = 15, cellheight = 12, scale = "none",
    treeheight_row = 200,
    kmeans_k = 20, # maxclust,
    show_rownames = T, show_colnames = T, 
    main = main,
    clustering_method = "average",
    cluster_rows = TRUE, cluster_cols = TRUE,
    clustering_distance_rows = drows1,
    clustering_distance_cols = NA)

  # To store cluster mappings and draw
    set.seed(123) <-"pheatmap", hmx.parameters)

But I get the following error 

Error in do_one(nmeth) : NA/NaN/Inf in foreign function call (arg 1)

I have read some questions about it and have checked the sd of my matrix. But it seems to be fine

> dim(sample_mat)
[1] 2297  100
> counts_filtered<- sample_mat[apply(sample_mat, MARGIN = 1, FUN = function(x) sd(x) != 0),] 
> dim(counts_filtered)
[1] 2297  100

So, even after trying to filter for 0 sd rows, it still does not run. 

Is there any other reason for this problem?

thanks, Assa




pheatmap kmeans • 2.0k views

Login before adding your answer.

Traffic: 520 users visited in the last hour
Help About
Access RSS

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6