Thanks, how should I proceed?
• 0 views
•
link
I need to prepare a heatmap on top 36 genes with pheatmap but I keep getting this error:
Error in seq.int(rx[1L], rx[2L], length.out = nb) :
'from' must be a finite number
In addition:
Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
This is my code:
top_36 <- head(results(dds, contrast = c ("strain", "mut", "wt")), n=36)
mat <- counts(dds, normalized = T)[rownames(top_36), ]
mat.z <- t(apply(mat, 1, scale))
colnames(mat.z) <- coldata$sample
df <- as.data.frame(colData(dds)[,c("hour","strain")])
pheatmap(mat.z, annotation_col = df)
Can anyone point me to the error?
Errors and warnings are clear, we can reproduce them with this simple example
Somewhere pheatmap is getting a minimum value excluding NA values, when all values are NA, min returns Inf:
min(c(NA,NA,NA), na.rm = TRUE)
# [1] Inf
# Warning message:
# In min(c(NA, NA, NA), na.rm = TRUE) :
# no non-missing arguments to min; returning Inf
Then when we want to get a sequence of integers with from set to Inf, as expected, we get an error:
seq.int(from = Inf, to = 10)
# Error in seq.int(from = Inf, to = 10) : 'from' must be a finite number
Log in to answer this question.
Show us the output to
That answers half of what I asked you. Where's the output to the first command?
Please report
You already have the response to the first one, so there was no need to include that.