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

[BUG]: Error in mtfrm.default(list(url = "https://api.opengwas.io/api/ld/clump", : cannot mtfrm #495

Open
DC-Jer opened this issue Mar 30, 2024 · 27 comments
Labels

Comments

@DC-Jer
Copy link

DC-Jer commented Mar 30, 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)

TwoSampleMR package can not query the IEU OpenGWAS database normally through API access.

截屏2024-03-30 13 52 13
截屏2024-03-30 13 53 57

Describe the current behaviour you observe (required)

Because of the API issue, TwoSampleMR package can not query any IEU OpenGWAS data online.
Attachment is API status. FYI.
截屏2024-03-30 14 09 24

Describe the behaviour you expect (required)

ex_dat<-extract_instruments(outcomes="ukb-b-19953")

ex_clump<- clump_data(
ex_dat,
clump_kb = 10000,
clump_r2 = 0.001,
clump_p1 = 1,
clump_p2 = 1,
pop = "EUR")

Contribute a solution (optional)

Please submit a pull request and/or briefly describe your proposed solution

System information

macOS
platform aarch64-apple-darwin20
version.string R version 4.3.3 (2024-02-29)
nickname Angel Food Cake

Additional context

Add any other context about the problem here

@DC-Jer DC-Jer added the bug label Mar 30, 2024
@ehfuefeg
Copy link

ehfuefeg commented Apr 1, 2024

I have encountered the same issue, how should I handle it?

1 similar comment
@xhxingjinyi
Copy link

I have encountered the same issue, how should I handle it?

@huww1998
Copy link

huww1998 commented Apr 2, 2024

I have encountered the same issue when I use the mv_extract_exposures_local function. Recently,when I use extract_outcome_data funciton, it always returns a NULL result even if it showed the message as below:

Extracting data for 10 SNP(s) from 1 GWAS(s)  
Finding proxies for 10 SNPs in outcome ebi-a-GCST90025956  
Extracting data for 10 SNP(s) from 1 GWAS(s)

May it was a server issue?

@docZ9
Copy link

docZ9 commented Apr 2, 2024

you can use this code:

options(ieugwasr_api = 'gwas-api.mrcieu.ac.uk/')

i believe you will appreciate me

@xhxingjinyi
Copy link

xhxingjinyi commented Apr 2, 2024 via email

@xhxingjinyi
Copy link

xhxingjinyi commented Apr 2, 2024 via email

@huww1998
Copy link

huww1998 commented Apr 3, 2024

Thanks a lot. I solved this problem. Now, I can run clump_data and mv_extract_exposures_local funtion smoothly.

you can use this code:

options(ieugwasr_api = 'gwas-api.mrcieu.ac.uk/')

i believe you will appreciate me

@huww1998
Copy link

huww1998 commented Apr 3, 2024

Thanks for your help. It works.

options(ieugwasr_api = 'gwas-api.mrcieu.ac.uk/') You can try this code,a kind guy sent it to me. ---- Replied Message ---- | From | Student @.> | | Date | 04/02/2024 17:11 | | To | MRCIEU/TwoSampleMR @.> | | Cc | xhxingjinyi @.>, Comment @.> | | Subject | Re: [MRCIEU/TwoSampleMR] [BUG]: Error in mtfrm.default(list(url = "https://api.opengwas.io/api/ld/clump", : cannot mtfrm (Issue #495) | I have encountered the same issue when I use the mv_extract_exposures_local function. Recently,when I use extract_outcome_data funciton, it always returns a NULL result even if it showed the message as below: Extracting data for 10 SNP(s) from 1 GWAS(s) Finding proxies for 10 SNPs in outcome ebi-a-GCST90025956 Extracting data for 10 SNP(s) from 1 GWAS(s) May it was a server issue? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

@huww1998
Copy link

huww1998 commented Apr 3, 2024

After I conducted the command options(ieugwasr_api = 'gwas-api.mrcieu.ac.uk/'), I check the api status using ieugwasr::api_status(), the result shows Total public datasets: 50044 .
That may mean I can acquire GWAS data from the server.
image

@YuxiaoRuoyao
Copy link

Thanks for this solution and it works. But it needs to be input every time. Any way to make it as default?

@yunjiang999
Copy link

Thanks a lot.

@huww1998
Copy link

I only input the command options(ieugwasr_api = 'gwas-api.mrcieu.ac.uk/') once. And it always works. Maybe you can input this in .Rprofile?

Thanks for this solution and it works. But it needs to be input every time. Any way to make it as default?

@ssxxmmm
Copy link

ssxxmmm commented Apr 16, 2024

I only input the command options(ieugwasr_api = 'gwas-api.mrcieu.ac.uk/') once. And it always works. Maybe you can input this in .Rprofile?

Thanks for this solution and it works. But it needs to be input every time. Any way to make it as default?

Thanks for your help. What should I do to get this code into .Rprofile? I don't know how to do this.

@zkhamis
Copy link

zkhamis commented May 29, 2024

I am having the same error, after clumping using TwoSampleMR version 0.6.3 and packageVersion("ieugwasr")
[1] ‘1.0.0’
how to solve this issue ? , tried the supplied code but it did not work

@minirose2021
Copy link

you can use this code:

options(ieugwasr_api = 'gwas-api.mrcieu.ac.uk/')

i believe you will appreciate me

OMG, You are my god.

@zkhamis
Copy link

zkhamis commented Jun 10, 2024

do you run this code before the packages or after, it did not work for me
please advice

No encoding supplied: defaulting to UTF-8.
Error in mtfrm.default(list(url = "http://gwas-api.mrcieu.ac.uk/ld/clump", :
cannot mtfrm

@minirose2021
Copy link

minirose2021 commented Jun 10, 2024 via email

@zkhamis
Copy link

zkhamis commented Jun 11, 2024

I run this code after library package

---- Replied Message ---- | From | @.> | | Date | 06/10/2024 23:02 | | To | @.> | | Cc | @.>@.> | | Subject | Re: [MRCIEU/TwoSampleMR] [BUG]: Error in mtfrm.default(list(url = "https://api.opengwas.io/api/ld/clump", : cannot mtfrm (Issue #495) | do you run this code before the packages or after, it did not work for me — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

it is giving me the same error after traffic, tried several times

Please look at vignettes for options on running this locally if you need to run many instances of this command.
Clumping xnJJrE, 2125 variants, using EUR population reference
Server code: 503; Server is possibly experiencing traffic, trying again...
Server code: 503; Server is possibly experiencing traffic, trying again...
Server code: 503; Server is possibly experiencing traffic, trying again...
Server code: 503; Server is possibly experiencing traffic, trying again...
Server code: 503; Server is possibly experiencing traffic, trying again...
Failed to retrieve results from server. See error status message in the returned object and contact the developers if the problem persists.
No encoding supplied: defaulting to UTF-8.
Error in mtfrm.default(list(url = "http://gwas-api.mrcieu.ac.uk/ld/clump", :
cannot mtfrm

@YF-93
Copy link

YF-93 commented Jun 12, 2024

I have encountered the same issue when I use the mv_extract_exposures_local function. Recently,when I use extract_outcome_data funciton, it always returns a NULL result even if it showed the message as below:

Extracting data for 10 SNP(s) from 1 GWAS(s)  
Finding proxies for 10 SNPs in outcome ebi-a-GCST90025956  
Extracting data for 10 SNP(s) from 1 GWAS(s)

May it was a server issue?

I have a similar problem: "when I use extract_outcome_data funciton, it always returns a NULL result even if it showed the messages about 'Extracting data...' and 'Finding proxies...' ". I tried more than 70 GWASs, the outcome was still "NULL".
--> Then, I tried to run this: "options(ieugwasr_api = 'gwas-api.mrcieu.ac.uk/')" before running extract_outcome_data function, and then I successfully obtained the outcome data.

I am not sure whether it is a good way to solve this problem.

@joellepasman
Copy link

I have tried putting it in my R environment but it doesn't work. Also, if you try running it in RMarkdown it doesn't work. If you run it on the console it works.

Right now even that is not working, I get the 'server is possibly experiencing traffic, trying again...' message until it stops and saus 'cannot mtfrm' again. But that DOES sound like a server issue ;) ?

@joellepasman
Copy link

As a fail safe backup it would be nice to get some guidance on what to specify under plink_bin and bfile (the same plink binaries for both?) if you want to use local reference files.

@explodecomputer
Copy link
Contributor

Can anyone who is experiencing this issue provide a reproducible example? For example a list of SNPs and p-values that you are using that leads to the 'cannot mtfrm' error?

@Taylorwu98
Copy link

Taylorwu98 commented Jul 23, 2024

experiencing the same problem

FLL_exp_dat <- clump_data(FLL_exp_dat)
Please look at vignettes for options on running this locally if you need to run many instances of this command.
Clumping VhC4Og, 10419 variants, using EUR population reference
Server code: 502; Server is possibly experiencing traffic, trying again...
Server code: 502; Server is possibly experiencing traffic, trying again...
Server code: 502; Server is possibly experiencing traffic, trying again...
Server code: 502; Server is possibly experiencing traffic, trying again...
Server code: 502; Server is possibly experiencing traffic, trying again...
Server code: 502; Server is possibly experiencing traffic, trying again...
Server error: 502
Failed to retrieve results from server. See error status message in the returned object and contact the developers if the problem persists.
Error in mtfrm.default(list(url = "http://gwas-api.mrcieu.ac.uk/ld/clump", :
cannot mtfrm

This persists even when I input options(ieugwasr_api = 'gwas-api.mrcieu.ac.uk/'), this used to work until few days ago.

Same thing happen when I input ieugwasr::api_status()

ieugwasr::api_status()
Server code: 502; Server is possibly experiencing traffic, trying again...
Server code: 502; Server is possibly experiencing traffic, trying again...
Server code: 502; Server is possibly experiencing traffic, trying again...
Server code: 502; Server is possibly experiencing traffic, trying again...
Server code: 502; Server is possibly experiencing traffic, trying again...
Server code: 502; Server is possibly experiencing traffic, trying again...
Server error: 502
Failed to retrieve results from server. See error status message in the returned object and contact the developers if the problem persists.
url: http://gwas-api.mrcieu.ac.uk/status
status_code: 502
headers: Error in cat(format(paste0(y, ":"), width = 30, justify = "right"), x[[y]], :
argument 2 (type 'list') cannot be handled by 'cat'

@Jega09
Copy link

Jega09 commented Aug 17, 2024

you can use this code:

options(ieugwasr_api = 'gwas-api.mrcieu.ac.uk/')

i believe you will appreciate me

That's really helpful. But I still have thesame issue when I try to knit the Rmarkdown file. See the error below

Error in mtfrm.default():
! cannot mtfrm
Backtrace:

  1. TwoSampleMR::clump_data(...)
  2. ieugwasr::ld_clump(...)
  3. ieugwasr:::ld_clump_api(...)
  4. base::subset.data.frame(dat, !dat[["rsid"]] %in% res)
  5. base::eval(e, x, parent.frame())
  6. base::eval(e, x, parent.frame())
  7. dat[["rsid"]] %in% res
  8. base::mtfrm.default(<response>)

@Jega09
Copy link

Jega09 commented Aug 17, 2024

I have tried putting it in my R environment but it doesn't work. Also, if you try running it in RMarkdown it doesn't work. If you run it on the console it works.

Right now even that is not working, I get the 'server is possibly experiencing traffic, trying again...' message until it stops and saus 'cannot mtfrm' again. But that DOES sound like a server issue ;) ?

I am having the same issue when try to knit the Rmarkdown. Were you able to resolve it?

@sure-yeah
Copy link

you can use this code:

options(ieugwasr_api = 'gwas-api.mrcieu.ac.uk/')

i believe you will appreciate me

Yes, I come here to thank you, and very much.

@Jega09
Copy link

Jega09 commented Sep 22, 2024

you can use this code:
options(ieugwasr_api = 'gwas-api.mrcieu.ac.uk/')
i believe you will appreciate me

Yes, I come here to thank you, and very much.

Great. That works. Thanks

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

No branches or pull requests