pheatmap - Error in do_one(nmeth) : NA/NaN/Inf in foreign function call (arg 1)
0
0
Entering edit mode
Assa Yeroslaviz ★ 1.5k
@assa-yeroslaviz-1597
Last seen 21 days ago
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) 
    kmean.hm <- do.call("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 • 3.1k views
ADD COMMENT

Login before adding your answer.

Traffic: 769 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6