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

Proxy error #20

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Proxy error #20

wants to merge 3 commits into from

Conversation

jwr-git
Copy link

@jwr-git jwr-git commented Apr 26, 2022

Sometimes when searching for proxy SNPs using local files, Plink will throw an error ("Error: No valid variants specified by --ld-snp/--ld-snps/--ld-snp-list") and output no file. This will cause a knock-on effect for the R package which itself will throw some (rather worrying) errors:

Error: No valid variants specified by --ld-snp/--ld-snps/--ld-snp-list.
Taking input= as a system command ('gunzip -c /user/work/jr18055/Rtemp/RtmpP8vEkP/fileaa72ecf4882.targets.ld.gz') and a variable has been used in the expression passed to `input=`. Please use fread(cmd=...). There is a security concern if you are creating an app, and the app could have a malicious user, and the app is not running in a secure environment; e.g. the app is running as root. Please read item 5 in the NEWS file for v1.11.6 for more information and for the option to suppress this message.
gzip: /user/work/jr18055/Rtemp/RtmpP8vEkP/fileaa72ecf4882.targets.ld.gz: No such file or directory
Error in `dplyr::filter()`:
! Problem while computing `..1 = .data[["R"]]^2 > tag_r2`.
Caused by error in `.data[["R"]]`:
! Column `R` not found in `.data`.

My solution would be to wrap the parts of the code which load this file around checks to ensure that 1) the file exists and 2) it contains any rows.

It seems this problem can arise when the SNPs are not found in the local reference panel. This is most obvious when using a mismatched build (e.g. data is GRCh38 and panel is GRCh37) but can also occur when the data are imputed to contain more SNPs than the panel. Dropping those SNPs would likely be better than killing the entire process.

jwr-git added 3 commits April 7, 2022 14:00
…ere found

Also fixes a scary looking warning RE security concerns using fread when file is not found
@nicholsn
Copy link

nicholsn commented Feb 2, 2023

thanks for submitting this, @jwr-git... I'm also running into this error that's been reported in #23 and #21. I tried installing this branch but still hitting an error constructing the results. I'm using the ldfile distributed by the ieugwasr package.

Any thoughts on getting this up and running is much appreciated!

> gwasvcf::query_gwas(outcome_vcf, rsid=exposures_dat$SNP, proxies = "yes", bfile=ldfile)
Initial search...
Extracted 1 out of 10 rsids
Searching for proxies for 9 rsids
Determining searchspace...
Proxy lookup...
Finding proxies...
Taking input= as a system command ('gunzip -c /data/tmp/RtmpMryugX/file12b7b488a6876.targets.ld.gz') and a variable has been used in the expression passed to `input=`. Please use fread(cmd=...). There is a security concern if you are creating an app, and the app could have a malicious user, and the app is not running in a secure environment; e.g. the app is running as root. Please read item 5 in the NEWS file for v1.11.6 for more information and for the option to suppress this message.
Error in `dplyr::arrange()`:
! Problem with the implicit `transmute()` step.
Caused by error in `initialize()`:
! attempt to use zero-length variable name
Backtrace:
  1. gwasvcf::query_gwas(...)
  2. gwasvcf::proxy_match(...)
  3. gwasvcf::get_ld_proxies(...)
  5. dplyr:::arrange.data.frame(ld, dplyr::desc(abs(.data[["R"]])))
  6. dplyr:::arrange_rows(.data, dots)
  9. dplyr:::transmute.data.frame(new_data_frame(.data), !!!quosures)
 10. dplyr:::mutate_cols(.data, dots, caller_env = caller_env())
 11. DataMask$new(.data, caller_env, "mutate", error_call = error_call)
 12. dplyr (local) initialize(...)
 13. ```

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

Successfully merging this pull request may close these issues.

2 participants