-
Notifications
You must be signed in to change notification settings - Fork 13
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
Genetic correlation between metabolites #2
Comments
Thanks rtabassu, the genetic correlation is simply the correlation between the genetic associations (or beta's) of the risk factors measured on the SNPs you use as instrumental variables. If your input matrix is betaX (dimension n (#SNPs) x p (#risk factors)) you can compute the correlation matrix (dimension pxp) using cor and plot using the library ggplot2 and reshape: cor_beta = cor(betaX) print( |
Hi Verena,
Thanks for the prompt reply. Yes, I realized so and found the code in one of your scripts in github.
Best,
Rubina
Rubina Tabassum, PhD
Postdoctoral Researcher
Institute for Molecular Medicine Finland (FIMM)
University of Helsinki, Finland
From: Verena Zuber <notifications@github.com>
Reply-To: verena-zuber/demo_AMD <reply@reply.github.com>
Date: Thursday, 4 June 2020 at 11:10
To: verena-zuber/demo_AMD <demo_AMD@noreply.github.com>
Cc: "Tabassum, Rubina" <rubina.tabassum@helsinki.fi>, Author <author@noreply.github.com>
Subject: Re: [verena-zuber/demo_AMD] Genetic correlation between metabolites (#2)
Thanks rtabassu, the genetic correlation is simply the correlation between the genetic associations (or beta's) of the risk factors measured on the SNPs you use as instrumental variables. If your input matrix is betaX (dimension n (#SNPs) x p (#risk factors)) you can compute the correlation matrix (dimension pxp) using cor and plot using the library ggplot2 and reshape:
cor_beta = cor(betaX)
dim(cor_beta)
melted_cormat = melt(cor_beta)
print(
ggplot(data = melted_cormat, aes(Var2, Var1, fill = value))+
geom_tile(color = "white")+
scale_fill_gradient2(low = "blue", high = "red", mid = "white",
midpoint = 0, limit = c(-1,1), space = "Lab",
name="Correlation \n between betas") +
theme_minimal()+
theme(axis.text.x = element_text(angle = 45, vjust = 1, size = 12, hjust = 1))+
coord_fixed()+
theme(
axis.title.x = element_blank(),
axis.title.y = element_blank()
)
)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#2 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AP2VEGNBXPBJSIYW7BETT4LRU5JFFANCNFSM4NSLJTOA>.
|
Dear Rubina, great happy to hear this, I am closing the issue now. Thanks for your interest, Verena |
Hi, you suggested that metabolites with high genetic correlation based on genetic instruments should be excluded. Could you suggest a method to calculate the genetic correlation based on a few selected variants? Thanks!
The text was updated successfully, but these errors were encountered: