Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 0.94 is not assigning significant ocurrences correctly #279

Closed
brenoliisboa opened this issue Sep 14, 2024 · 3 comments
Closed

Version 0.94 is not assigning significant ocurrences correctly #279

brenoliisboa opened this issue Sep 14, 2024 · 3 comments

Comments

@brenoliisboa
Copy link

Captura de tela 2024-09-14 014559
Captura de tela 2024-09-14 014527

As written in the title, v.0.94 is having this issue (top image). Version 0.92 plots correctly p value under 0.05 (bottom image).
[..]
method = c("color"),
tl.col = "black",
order = "hclust",
p.mat = p_value_matrix,
sig.level = 0.05,
insig = "label_sig"
[..]

@taiyun
Copy link
Owner

taiyun commented Sep 17, 2024

Can you show me your data and code?

@david-priest
Copy link

david-priest commented Oct 11, 2024

I'm getting the same issue. If order = "original", then the significances and correlations line up fine, but if order = "hclust", then the correlations and significances no longer align. The significances remain in the original position. I shared correlation and p value matrices with my colleague, and they did not get the issue, so it might be related to version.
Screenshot 2024-10-11 at 2 47 58 PM

Here's a workaround that performs the clustering externally

# Load necessary libraries
library(corrplot)
library(Hmisc)

# Prepare correlation matrix
MS2 <- cor(data2, use = "pairwise.complete.obs", method = c("spearman"))

# Prepare matrix of statistical significance
res <- cor.mtest(data2, conf.level = 0.95, alternative = c("two.sided"), method = c("spearman"), exact = F)

# Perform hierarchical clustering on the correlation matrix
hc <- hclust(as.dist(1 - MS2), method = 'complete')

# Extract the order of rows and columns
order <- hc$order

# Reorder the correlation matrix and p-value matrix
MS2_ordered <- MS2[order, order]
res_p_ordered <- res$p[order, order]

# Plot the correlation matrix with the reordered p-value matrix
corrplot(MS2_ordered, method = "square", type = "full", diag = T, tl.cex = 0.75, tl.col = "black", na.label = "NA", 
         p.mat = res_p_ordered, insig = "label_sig", sig.level = c(0.001, 0.01, 0.05), pch.cex = 0.9, pch.col = "black", 
         order = "original", hclust.method = 'complete', tl.srt = 45, title = title, mar = c(0, 0, 1, 0), cl.cex = 1)

@taiyun taiyun closed this as completed in 7025cfa Oct 14, 2024
@taiyun
Copy link
Owner

taiyun commented Oct 14, 2024

Many Thanks. I fixed it and will submit new version v0.95 to CRAN soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants