Skip to content
New issue

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

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

Already on GitHub? # to your account

[BUG]: Issues in running clump_data() #507

Open
eun-codeful opened this issue Apr 16, 2024 · 2 comments
Open

[BUG]: Issues in running clump_data() #507

eun-codeful opened this issue Apr 16, 2024 · 2 comments
Labels

Comments

@eun-codeful
Copy link

eun-codeful commented Apr 16, 2024

Please make sure that this is a bug! If you have questions about how to use TwoSampleMR please use the Discussions function instead.

Describe the bug (required)

Hi, I am trying to run an MR analysis using TwoSampleMR (version 5.11.0).
First, I read in exposure (protein - GDF15) and outcome data (dementia) and formatted them using read_exposure_data() and read_outcome_data(),
Then, I subsetted significant GWAS using the threshold p< 5*10^(-8)) and filtered significant proteins in outcome GWAS before clumping.

The first issue found is that when I tried filtering significant proteins in outcome GWAS, all the observations were removed.

So I skipped the step of filtering for significant proteins in outcome GWAS, and when for clumping using clump_data() function but I receive error message saying

"Please look at vignettes for options on running this locally if you need to run many instances of this command.
Clumping NA, 0 variants, using EUR population reference
Clumping , 0 variants, using EUR population reference
Error in res[[i]] <- ld_clump_api(x, clump_kb = clump_kb, clump_r2 = clump_r2, :
attempt to select less than one element in integerOneIndex"

Provide a clear and concise description of what the bug is

R code to reproduce the issue (required)

Please provide a minimal code snippet that will reproduce this issue

protein_sig <- protein_exposure[protein_exposure$pval.exposure < 5*10^(-8), ]

#STEP2: To get the largest number of IVs, filter the protein_sig in outcome GWAS before clumping

protein_sig2 <- subset(protein_sig, protein_sig$SNP %in% outcome$SNP)

#STEP3: Clump the Significant SNPs

### Clump the Significant SNPs 
MR_exposure <- clump_data(
  protein_sig2, 
  clump_kb = 500,##change to 2000
  clump_r2 = 0.01,
  clump_p1 = 0.01,
  clump_p2 = 1,
  pop = "EUR"
)

Could you please help me solve this issue?
The same code ran perfectly fine before but all of sudden it is not working.

Thank you.

@MichaelPudjihartono
Copy link

any solution to this?

@dbfk2000
Copy link

dbfk2000 commented Jun 9, 2024

same here. any solution for this?

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

No branches or pull requests

3 participants