From f6f06da9ac3678b77788a3beade60b4fd02e151d Mon Sep 17 00:00:00 2001 From: Gavin Rhys Lloyd Date: Fri, 22 Sep 2023 15:54:25 +0100 Subject: [PATCH] update vignette - move cached to shorter path - stop requesting png in vignette as doesnt work with cache --- .../Introduction_to_metabolomicsWorkbenchR.Rmd | 18 ++++++++++++++---- vignettes/example_using_structToolbox.Rmd | 13 +++++++++++++ .../rest => mb}/compound/regno/11/all.json | 0 .../gene/gene_name/acetyl-CoA/all.json | 0 .../analysis_id/AN000023/untarg_factors.json | 0 .../study/study_id/ST000001/data.json | 0 .../study/study_id/ST000001/factors.json | 0 .../study/study_id/ST000001/summary.json | 0 .../study/study_id/ST000009/data.json | 0 .../study/study_id/ST000009/factors.json | 0 .../study/study_id/ST000009/summary.json | 0 .../study/study_id/ignored/untarg_studies.json | 0 .../study/study_title/Diabetes/summary.json | 0 .../analysis_id/AN000025/untarg_factors.json | 0 .../study/study_id/ST000010/summary.json | 0 .../study/study_id/ignored/untarg_studies.json | 0 16 files changed, 27 insertions(+), 4 deletions(-) rename vignettes/introduction/0/{www.metabolomicsworkbench.org/rest => mb}/compound/regno/11/all.json (100%) rename vignettes/introduction/0/{www.metabolomicsworkbench.org/rest => mb}/gene/gene_name/acetyl-CoA/all.json (100%) rename vignettes/introduction/0/{www.metabolomicsworkbench.org/rest => mb}/study/analysis_id/AN000023/untarg_factors.json (100%) rename vignettes/introduction/0/{www.metabolomicsworkbench.org/rest => mb}/study/study_id/ST000001/data.json (100%) rename vignettes/introduction/0/{www.metabolomicsworkbench.org/rest => mb}/study/study_id/ST000001/factors.json (100%) rename vignettes/introduction/0/{www.metabolomicsworkbench.org/rest => mb}/study/study_id/ST000001/summary.json (100%) rename vignettes/introduction/0/{www.metabolomicsworkbench.org/rest => mb}/study/study_id/ST000009/data.json (100%) rename vignettes/introduction/0/{www.metabolomicsworkbench.org/rest => mb}/study/study_id/ST000009/factors.json (100%) rename vignettes/introduction/0/{www.metabolomicsworkbench.org/rest => mb}/study/study_id/ST000009/summary.json (100%) rename vignettes/introduction/0/{www.metabolomicsworkbench.org/rest => mb}/study/study_id/ignored/untarg_studies.json (100%) rename vignettes/introduction/0/{www.metabolomicsworkbench.org/rest => mb}/study/study_title/Diabetes/summary.json (100%) rename vignettes/structToolbox_example/0/{www.metabolomicsworkbench.org/rest => mb}/study/analysis_id/AN000025/untarg_factors.json (100%) rename vignettes/structToolbox_example/0/{www.metabolomicsworkbench.org/rest => mb}/study/study_id/ST000010/summary.json (100%) rename vignettes/structToolbox_example/0/{www.metabolomicsworkbench.org/rest => mb}/study/study_id/ignored/untarg_studies.json (100%) diff --git a/vignettes/Introduction_to_metabolomicsWorkbenchR.Rmd b/vignettes/Introduction_to_metabolomicsWorkbenchR.Rmd index 11def14..721ab52 100644 --- a/vignettes/Introduction_to_metabolomicsWorkbenchR.Rmd +++ b/vignettes/Introduction_to_metabolomicsWorkbenchR.Rmd @@ -24,6 +24,19 @@ vignette: > suppressPackageStartupMessages(library(grid)) suppressPackageStartupMessages(library(httptest)) suppressPackageStartupMessages(library(metabolomicsWorkbenchR)) + +httptest::set_requester( + function(request){ + httptest::gsub_request(request,'https\\://www.metabolomicsworkbench.org/rest',"mb/") + } +) + +httptest::set_redactor( + function(response){ + httptest::gsub_response(response,'https\\://www.metabolomicsworkbench.org/rest',"mb/") + } +) + httptest::start_vignette('introduction') ``` @@ -94,16 +107,13 @@ df[,1:3] ``` We can also request an image of the molecular structure: -```{r} +```{r,eval=FALSE} img = do_query( context = 'compound', input_item = 'regno', input_value = '11', output_item = 'png' ) - -grid.raster(img) - ``` Valid contexts, input items and output items can be listed using the `names` function: diff --git a/vignettes/example_using_structToolbox.Rmd b/vignettes/example_using_structToolbox.Rmd index 09c2d20..2a3c786 100644 --- a/vignettes/example_using_structToolbox.Rmd +++ b/vignettes/example_using_structToolbox.Rmd @@ -24,6 +24,19 @@ vignette: > suppressPackageStartupMessages(library(structToolbox)) suppressPackageStartupMessages(library(httptest)) suppressPackageStartupMessages(library(metabolomicsWorkbenchR)) + +httptest::set_requester( + function(request){ + httptest::gsub_request(request,'https\\://www.metabolomicsworkbench.org/rest',"mb/") + } +) + +httptest::set_redactor( + function(response){ + httptest::gsub_response(response,'https\\://www.metabolomicsworkbench.org/rest',"mb/") + } +) + httptest::start_vignette('structToolbox_example') ``` diff --git a/vignettes/introduction/0/www.metabolomicsworkbench.org/rest/compound/regno/11/all.json b/vignettes/introduction/0/mb/compound/regno/11/all.json similarity index 100% rename from vignettes/introduction/0/www.metabolomicsworkbench.org/rest/compound/regno/11/all.json rename to vignettes/introduction/0/mb/compound/regno/11/all.json diff --git a/vignettes/introduction/0/www.metabolomicsworkbench.org/rest/gene/gene_name/acetyl-CoA/all.json b/vignettes/introduction/0/mb/gene/gene_name/acetyl-CoA/all.json similarity index 100% rename from vignettes/introduction/0/www.metabolomicsworkbench.org/rest/gene/gene_name/acetyl-CoA/all.json rename to vignettes/introduction/0/mb/gene/gene_name/acetyl-CoA/all.json diff --git a/vignettes/introduction/0/www.metabolomicsworkbench.org/rest/study/analysis_id/AN000023/untarg_factors.json b/vignettes/introduction/0/mb/study/analysis_id/AN000023/untarg_factors.json similarity index 100% rename from vignettes/introduction/0/www.metabolomicsworkbench.org/rest/study/analysis_id/AN000023/untarg_factors.json rename to vignettes/introduction/0/mb/study/analysis_id/AN000023/untarg_factors.json diff --git a/vignettes/introduction/0/www.metabolomicsworkbench.org/rest/study/study_id/ST000001/data.json b/vignettes/introduction/0/mb/study/study_id/ST000001/data.json similarity index 100% rename from vignettes/introduction/0/www.metabolomicsworkbench.org/rest/study/study_id/ST000001/data.json rename to vignettes/introduction/0/mb/study/study_id/ST000001/data.json diff --git a/vignettes/introduction/0/www.metabolomicsworkbench.org/rest/study/study_id/ST000001/factors.json b/vignettes/introduction/0/mb/study/study_id/ST000001/factors.json similarity index 100% rename from vignettes/introduction/0/www.metabolomicsworkbench.org/rest/study/study_id/ST000001/factors.json rename to vignettes/introduction/0/mb/study/study_id/ST000001/factors.json diff --git a/vignettes/introduction/0/www.metabolomicsworkbench.org/rest/study/study_id/ST000001/summary.json b/vignettes/introduction/0/mb/study/study_id/ST000001/summary.json similarity index 100% rename from vignettes/introduction/0/www.metabolomicsworkbench.org/rest/study/study_id/ST000001/summary.json rename to vignettes/introduction/0/mb/study/study_id/ST000001/summary.json diff --git a/vignettes/introduction/0/www.metabolomicsworkbench.org/rest/study/study_id/ST000009/data.json b/vignettes/introduction/0/mb/study/study_id/ST000009/data.json similarity index 100% rename from vignettes/introduction/0/www.metabolomicsworkbench.org/rest/study/study_id/ST000009/data.json rename to vignettes/introduction/0/mb/study/study_id/ST000009/data.json diff --git a/vignettes/introduction/0/www.metabolomicsworkbench.org/rest/study/study_id/ST000009/factors.json b/vignettes/introduction/0/mb/study/study_id/ST000009/factors.json similarity index 100% rename from vignettes/introduction/0/www.metabolomicsworkbench.org/rest/study/study_id/ST000009/factors.json rename to vignettes/introduction/0/mb/study/study_id/ST000009/factors.json diff --git a/vignettes/introduction/0/www.metabolomicsworkbench.org/rest/study/study_id/ST000009/summary.json b/vignettes/introduction/0/mb/study/study_id/ST000009/summary.json similarity index 100% rename from vignettes/introduction/0/www.metabolomicsworkbench.org/rest/study/study_id/ST000009/summary.json rename to vignettes/introduction/0/mb/study/study_id/ST000009/summary.json diff --git a/vignettes/introduction/0/www.metabolomicsworkbench.org/rest/study/study_id/ignored/untarg_studies.json b/vignettes/introduction/0/mb/study/study_id/ignored/untarg_studies.json similarity index 100% rename from vignettes/introduction/0/www.metabolomicsworkbench.org/rest/study/study_id/ignored/untarg_studies.json rename to vignettes/introduction/0/mb/study/study_id/ignored/untarg_studies.json diff --git a/vignettes/introduction/0/www.metabolomicsworkbench.org/rest/study/study_title/Diabetes/summary.json b/vignettes/introduction/0/mb/study/study_title/Diabetes/summary.json similarity index 100% rename from vignettes/introduction/0/www.metabolomicsworkbench.org/rest/study/study_title/Diabetes/summary.json rename to vignettes/introduction/0/mb/study/study_title/Diabetes/summary.json diff --git a/vignettes/structToolbox_example/0/www.metabolomicsworkbench.org/rest/study/analysis_id/AN000025/untarg_factors.json b/vignettes/structToolbox_example/0/mb/study/analysis_id/AN000025/untarg_factors.json similarity index 100% rename from vignettes/structToolbox_example/0/www.metabolomicsworkbench.org/rest/study/analysis_id/AN000025/untarg_factors.json rename to vignettes/structToolbox_example/0/mb/study/analysis_id/AN000025/untarg_factors.json diff --git a/vignettes/structToolbox_example/0/www.metabolomicsworkbench.org/rest/study/study_id/ST000010/summary.json b/vignettes/structToolbox_example/0/mb/study/study_id/ST000010/summary.json similarity index 100% rename from vignettes/structToolbox_example/0/www.metabolomicsworkbench.org/rest/study/study_id/ST000010/summary.json rename to vignettes/structToolbox_example/0/mb/study/study_id/ST000010/summary.json diff --git a/vignettes/structToolbox_example/0/www.metabolomicsworkbench.org/rest/study/study_id/ignored/untarg_studies.json b/vignettes/structToolbox_example/0/mb/study/study_id/ignored/untarg_studies.json similarity index 100% rename from vignettes/structToolbox_example/0/www.metabolomicsworkbench.org/rest/study/study_id/ignored/untarg_studies.json rename to vignettes/structToolbox_example/0/mb/study/study_id/ignored/untarg_studies.json