stephenslab / susieR

R package for "sum of single effects" regression.
https://stephenslab.github.io/susieR
Other
174 stars 44 forks source link

Using LD from reference panel #104

Closed zx8754 closed 4 years ago

zx8754 commented 4 years ago

Struggling to understand the formula given to calculate R_ref in the manuals:

image

Could you clarify based on below settings I have:

Questions:

Apologies, probably missing basic understanding of how this package is supposed to work, appreciate any input. Thank you.

zouyuxin commented 4 years ago

w weight would be: 1/20000 ?

Yes

X ref is the panel genotype matrix with rows 20000 samples and columns 1000 SNPs?

Yes, and it should be column standardized (column mean 0, variance 1)

Why transpose and multiply X^T ref ?

This is how we compute sample correlation, X_ref^T X_ref / n_ref

What is z^T, how transposing a vector help?

z^T is the transpose of your z score vector. In the formula, we use z z^T, which is a matrix (1000 x 1000 matrix).

Do we need to set z_ld_weight = 1/100000, too?

No, z_ld_weight = 1/20000.

Your susie call should like susie_rss(z=z, R=cor(X_ref), L=10, z_ld_weight=1/20000, estimate_residual_variance=T, estimate_prior_variance=T) cor(X_ref) is the LD matrix, it is X_ref^T X_ref / (n_ref-1) with column-standardized X_ref. cor() function will column-standardize X_ref for you.

zx8754 commented 4 years ago

@zouyuxin Thank you, this should get me going.