Comments (3)
I had no problems after the test, and can you tell me what your problem is?
library(linkET)
library(dplyr)
library(ggplot2)
data_o <- read.table(file.choose(), sep="\t", row.names = 1, header = TRUE)
O_e <- read.table(file.choose(), sep="\t", row.names = 1, header = TRUE)
###mantel test
mantel_oms <- mantel_test(data_o, O_e,
spec_select = list(m1 = 1:1,
m2 = 2:2,
m3 = 3:3,
m4 = 4:4,
m5 = 5:5,
m6 = 6:6,
m7 = 7:7,
m8 = 8:8),
spec_dist = dist_func(.FUN = "vegdist",
method = "euclidean")) %>%
mutate(rd = cut(r, breaks = c(-Inf, 0.2, 0.4, Inf),
labels = c("< 0.2", "0.2 - 0.4", ">= 0.4")),
pd = cut(p, breaks = c(-Inf, 0.01, 0.05, Inf),
labels = c("< 0.01", "0.01 - 0.05", ">= 0.05")))
o_plot <- correlate(O_e, engine = "correlation") %>%
as_md_tbl(type = "lower", diag = FALSE) %>%
qcorrplot() +
geom_square() +
geom_mark(
sep = '\n',
size = 3,
sig_level = c(0.05, 0.01, 0.001),
mark = c("*", "**", "***"),
colour = "#000000", only_mark = FALSE) +
scale_fill_gradientn(
colours = colorRampPalette(colors =c("#A6CEE3","white","#ED665D"),space="Lab")(10),
limits = c(-1, 1),
breaks = seq(-1,1,0.5))+
geom_couple(aes(x = .x - 0.2, colour = pd, size = rd, linetype = r > 0),
data = mantel_oms,
curvature = nice_curvature(0.1), label.size =4, nudge_x= 0.2) +
scale_size_manual(values = c(0.5, 1, 2)) +
scale_color_manual(values = c("#d00000", "#fcbf49","#d9d9d9")) +
#scale_color_manual(values = c("#d9d9d9")) +
scale_linetype_manual(values = c("TRUE" = "solid", "FALSE" = "dashed"),
labels = c("Positive", "Negative")) +
theme(axis.text.x.bottom = element_text(angle = 45, hjust = 1, vjust = 1)) +
guides(size = guide_legend(title = "Mantel's r",
override.aes = list(colour = "grey35"),
order = 2),
colour = guide_legend(title = "Mantel's p",
override.aes = list(size = 3),
order = 1),
fill = guide_colorbar(title = "Pearson's r", order = 4),
linetype = guide_legend(title = "Mantel's r > 0",
override.aes = list(size = 0.5, colour = "darkblue"),
order = 3))
o_plot
from linket.
Thank you Houyun.
My problem is that all significant relationships are denoted as positive relationship instead of some significant positive relationship and some significant negative relationship. I know I asked once. Sorry for the double asking. Maybe you can close the question.
Best,
Bing
from linket.
I think it's OK.
Finally, it's better to email me for similar questions rather than an issue, since it's not a question about linkET
package.
from linket.
Related Issues (20)
- Need a cor_tbl. HOT 1
- namespace ‘vctrs’ 0.5.1 is already loaded, but >= 0.5.2 is required HOT 1
- Feature requirement for showing the positive or negative correlation in the plot HOT 7
- Caused by error in `spec_dist()`: ! could not find function "spec_dist" HOT 3
- Multiple results for CFLAGS found, something is wrong.FALSE HOT 4
- 是否可以实现热图聚类 HOT 2
- How can I use the subscription or superscription in LinkET HOT 2
- How to fill the missed values in matrix before running linkET? HOT 7
- 是否可以改变Mantel test连线起点和终点的形状和颜色? HOT 1
- 关于geom_square函数设定数据范围的问题 HOT 2
- upcoming 1.0.0 HOT 2
- issue in using different distance matrix for mantel test () HOT 4
- Data volume HOT 4
- what methods to calculate the correlation (r) and p.value in Mantel_test() HOT 1
- How to add significant level stars in qcorrplot function? HOT 2
- Error in cor(as.vector(xdis), ydis, method = method, use = use) : missing observations in cov/cor HOT 4
- Error in calcCurveGrob(x, x$debug) : 端点两头的值是不能相等的 HOT 5
- `correlate()` not return a matrix of p-value when `adjust = TRUE`
- How to deal with the dataframe with NA? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linket.