I try to match SNPs data between the GWAS summary statistics and the genotyping data using snp_match() with join_by_pos set to FALSE but get an error telling me that not enough variants have been matched.
My data looks like this:
str(sumstats)
'data.frame': 1429545 obs. of 10 variables:
$ rsid : chr "rs7899632" "rs3750595" "rs10786405" "rs41307056" ...
$ chr : int 10 10 10 10 10 10 10 10 10 10 ...
$ pos : int 100000625 100004906 100005282 100007694 100008436 100008785 100008926 100011219 100012890 100013438 ...
$ a0 : chr "g" "c" "c" "g" ...
$ a1 : chr "a" "a" "t" "a" ...
$ beta : num 0.028 -0.0289 -0.029 0.0339 0.0224 ...
$ beta_se: num 0.00503 0.00491 0.00491 0.01389 0.00509 ...
$ N : int 163528 181391 181337 145947 181311 90238 94784 155311 170685 180798 ...
$ p : num 2.75e-08 3.83e-09 3.65e-09 1.47e-02 1.02e-05 ...
$ n_eff : int 163528 181391 181337 145947 181311 90238 94784 155311 170685 180798 ...
df_beta <- snp_match(sumstats, map, join_by_pos=F)
1,429,545 variants to be matched.
0 ambiguous SNPs have been removed.
0 variants have been matched; 0 were flipped and 0 were reversed.
Error: Not enough variants have been matched.
The function tries to match 1 429 545 SNPs and finds zero matches. However, a simple matching done by rsid tells me that 456 570 SNPs are in both my GWAS summary statistics and genotyping data and thus should be matched. Is there something I'm not doing correctly when it comes to formatting the sumstats or something I should change for the function to work?
Hi,
I try to match SNPs data between the GWAS summary statistics and the genotyping data using snp_match() with join_by_pos set to FALSE but get an error telling me that not enough variants have been matched.
My data looks like this:
And the output I get is:
The function tries to match 1 429 545 SNPs and finds zero matches. However, a simple matching done by rsid tells me that 456 570 SNPs are in both my GWAS summary statistics and genotyping data and thus should be matched. Is there something I'm not doing correctly when it comes to formatting the sumstats or something I should change for the function to work?
Thanks in advance!