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

Quality control of summary statistics #195

Closed
JingZhang1227 opened this issue Mar 22, 2021 · 7 comments
Closed

Quality control of summary statistics #195

JingZhang1227 opened this issue Mar 22, 2021 · 7 comments

Comments

@JingZhang1227
Copy link

Hi Florian,

Sorry for another question.

I am using ldpred2 to calculate polygenic risk scores. I am running the automatic model with the provided LD reference based on the example-with-provided-ldref.R.

I have three datasets: the summary statistics, the provided LD reference, and a test dataset (plink format). The positions of both the summary statistics and the test dataset are on hg38.

Based on the example-with-provided-ldref.R line 27, I will perform the quality control of summary statistics using the allele frequency from the provided LD reference with is “af_UKBB” to get sd_ldref. Since my test dataset is different from the provided LD reference, I just want to double check if I should also calculate and use standard deviations of genotypes of individuals in the test dataset in this step. My test dataset is family data. Individuals within a family are related (father, mother, and children).

Thank you very much!

@privefl
Copy link
Owner

privefl commented Mar 22, 2021

I guess you can use both.
Checking with af_UKBB will check if you have some consistency between sumstats and LD ref, and checking with sd in your test data will check for this consistency between sumstats and test set.

@JingZhang1227
Copy link
Author

Thanks for getting back to me!

I saw in your prepare-sumstats.R line 16, you used sqrt(big_colstats(G, ind.val, ncores = NCORES)$var) to calculate the standard deviations of genotypes of individuals in the validation dataset. I have related individuals in my test dataset, I was wondering if I could use the same command.

Thanks again!

@privefl
Copy link
Owner

privefl commented Mar 22, 2021

Yeah I guess related individuals might reduce the standard deviation.
You can probably use sqrt(2 * af * (1-af)) instead, as i don't think the allele frequency is biased by relatedness.

@JingZhang1227
Copy link
Author

Thank you very much! This is very helpful! Sorry I think I have just one more related question. For the allele frequency, or af, I think I can get it using big_colstats(G, ncores = NCORES)$sum / (2 * nrow(G)) (from the provide-ld-ref.R line 15). Or I was wondering if you would suggest me calculate af using something like plink --freq function where the minor allele frequencies is calculated only based on founders (individuals without parents) in the test sample.

@privefl
Copy link
Owner

privefl commented Mar 22, 2021

Yeah you can use PLINK if you prefer.
Call it directly from R using system(glue::glue()) :')

@privefl
Copy link
Owner

privefl commented Mar 29, 2021

Any update on this?

@JingZhang1227
Copy link
Author

Sorry for the late response. Thank you very much for your suggestions! I used the PLINK MAF! I had another unrelated question so I submitted a new issue which is issue #200.

Thank you very much again!

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

2 participants