Skip to content

Commit

Permalink
fix vignettes
Browse files Browse the repository at this point in the history
- replace MetMasheR with MetMashR in system.file calls
  • Loading branch information
grlloyd committed Jan 19, 2024
1 parent 54f5c69 commit a11617f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
14 changes: 7 additions & 7 deletions vignettes/Extending_MetMashR.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ we have cached the first 10 rows and stored them in the package.

```{r, include=FALSE,eval=TRUE}
AN = readRDS(
system.file('extdata/AN000465_subset.rds',package='MetMasheR')
system.file('extdata/AN000465_subset.rds',package='MetMashR')
)
```

Expand Down Expand Up @@ -217,7 +217,7 @@ setMethod(f = "read_database",
## for vignette use locally cached subset
AN = readRDS(
system.file('extdata/AN000465_subset.rds',package='MetMasheR')
system.file('extdata/AN000465_subset.rds',package='MetMashR')
)
return(AN)
Expand Down Expand Up @@ -447,26 +447,26 @@ refmet = mwb_refmet_database()
# pubchem caches
pubchem_cid_cache = rds_database(
source = system.file('cached/pubchem_cid_cache.rds',
package='MetMasheR')
package='MetMashR')
)
pubchem_smile_cache = rds_database(
source = system.file('cached/pubchem_smiles_cache.rds',
package='MetMasheR')
package='MetMashR')
)
```

```{r, eval=TRUE,include=FALSE}
refmet = rds_database(
source = system.file('cached/refmet_cache.rds',package = 'MetMasheR')
source = system.file('cached/refmet_cache.rds',package = 'MetMashR')
)
pubchem_cid_cache = rds_database(
source = file.path(
system.file('cached',package='MetMasheR'),
system.file('cached',package='MetMashR'),
'pubchem_cid_cache.rds')
)
pubchem_smile_cache = rds_database(
source = file.path(
system.file('cached',package='MetMasheR'),
system.file('cached',package='MetMashR'),
'pubchem_smiles_cache.rds')
)
Expand Down
14 changes: 7 additions & 7 deletions vignettes/annotate_mixtures.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,10 @@ for (assay in c('HILIC_NEG','HILIC_POS','LIPIDS_NEG','LIPIDS_POS')) {
source = c(
system.file(
paste0('extdata/MTox/CD/',assay,'.xlsx'),
package = 'MetMasheR'),
package = 'MetMashR'),
system.file(
paste0('extdata/MTox/CD/',assay,'_comp.xlsx'),
package = 'MetMasheR')),
package = 'MetMashR')),
tag = paste0('CD_',assay))
# update labels in workflow
Expand Down Expand Up @@ -338,7 +338,7 @@ for (assay in c('HILIC_NEG','HILIC_POS','LIPIDS_NEG','LIPIDS_POS')) {
AT = ls_source(
source = system.file(
paste0('extdata/MTox/LS/MTox_2023_',assay,'.txt'),
package = 'MetMasheR'),
package = 'MetMashR'),
tag = paste0('LS_',assay))
# update labels in workflow
Expand Down Expand Up @@ -537,7 +537,7 @@ in practice you would create your own (see [TODO]).
# import cached results
inchikey_cache = rds_database(
source = file.path(
system.file('cached',package='MetMasheR'),
system.file('cached',package='MetMashR'),
'pubchem_inchikey_mtox_cache.rds'),
.writable = FALSE
)
Expand Down Expand Up @@ -604,13 +604,13 @@ non-normalised names.
# prepare cached results for vignette
inchikey_cache2 = rds_database(
source = file.path(
system.file('cached',package='MetMasheR'),
system.file('cached',package='MetMashR'),
'pubchem_inchikey_mtox_cache2.rds'),
.writable = FALSE
)
inchikey_cache3 = rds_database(
source = file.path(
system.file('cached',package='MetMasheR'),
system.file('cached',package='MetMashR'),
'pubchem_inchikey_mtox_cache3.rds'),
.writable=FALSE
)
Expand Down Expand Up @@ -751,7 +751,7 @@ has ready been saved as an RDS file so we can use `rds_database` to import it.
# prepare object
R = rds_database(
source = file.path(
system.file('extdata',package='MetMasheR'),
system.file('extdata',package='MetMashR'),
'standard_mixtures.rds'
),
.writable = FALSE
Expand Down
24 changes: 12 additions & 12 deletions vignettes/daphnia_example.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ TODO
# import HILIC_POS
HP = openxlsx::read.xlsx(
system.file("extdata/daphnia/daphnia_example.xlsx",
package = 'MetMasheR'),
package = 'MetMashR'),
sheet='HILIC_POS',
rowNames=FALSE,
colNames=TRUE)
Expand All @@ -80,7 +80,7 @@ HP$rsd_sample=as.numeric(HP$rsd_sample)
# import LIPIDS_POS
LP = openxlsx::read.xlsx(
system.file("extdata/daphnia/daphnia_example.xlsx",
package = 'MetMasheR'),
package = 'MetMashR'),
sheet='LIPIDS_POS',
rowNames=FALSE,
colNames=TRUE)
Expand Down Expand Up @@ -157,20 +157,20 @@ cd_sources = list(
source = c(
system.file(
'extdata/daphnia/HILIC_POS_EL_CD.xlsx',
package = 'MetMasheR'),
package = 'MetMashR'),
system.file(
'extdata/daphnia/HILIC_POS_EL_CD_comp.xlsx',
package = 'MetMasheR')),
package = 'MetMashR')),
sheets = c('Compounds','Compounds')
),
LIPIDS_POS = cd_source(
source = c(
system.file(
'extdata/daphnia/LIPIDS_POS_EL_CD.xlsx',
package = 'MetMasheR'),
package = 'MetMashR'),
system.file(
'extdata/daphnia/LIPIDS_POS_EL_CD_comp.xlsx',
package = 'MetMasheR')),
package = 'MetMashR')),
sheets = c('Compounds','Compounds')
)
)
Expand Down Expand Up @@ -311,13 +311,13 @@ ls_sources = list(
source =
system.file(
'extdata/daphnia/HILIC_POS_EL_LS.txt',
package = 'MetMasheR')
package = 'MetMashR')
),
LIPIDS_POS = ls_source(
source =
system.file(
'extdata/daphnia/LIPIDS_POS_EL_LS.txt',
package = 'MetMasheR')
package = 'MetMashR')
)
)
```
Expand Down Expand Up @@ -401,16 +401,16 @@ For the vignette we used cached results, which we prepare now.
```{r}
cache1=rds_database(
source=file.path(
system.file('cached',package='MetMasheR'),'cache1.rds'))
system.file('cached',package='MetMashR'),'cache1.rds'))
cache2=rds_database(
source=file.path(
system.file('cached',package='MetMasheR'),'cache2.rds'))
system.file('cached',package='MetMashR'),'cache2.rds'))
cache3=rds_database(
source=file.path(
system.file('cached',package='MetMasheR'),'cache3.rds'))
system.file('cached',package='MetMashR'),'cache3.rds'))
cache4=rds_database(
source=file.path(
system.file('cached',package='MetMasheR'),'cache4.rds'))
system.file('cached',package='MetMashR'),'cache4.rds'))
```

Next we prepare the workflow and then apply it.
Expand Down
8 changes: 4 additions & 4 deletions vignettes/using_MetMashR.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ rest of the file into a table.
AT = ls_source(
source = system.file(
paste0('extdata/MTox/LS/MTox_2023_HILIC_POS.txt'),
package = 'MetMasheR')
package = 'MetMashR')
)
# read source
Expand Down Expand Up @@ -243,7 +243,7 @@ to be used as the first step in a workflow.
AT = ls_source(
source = system.file(
paste0('extdata/MTox/LS/MTox_2023_HILIC_POS.txt'),
package = 'MetMasheR')
package = 'MetMashR')
)
# prepare workflow
Expand Down Expand Up @@ -280,7 +280,7 @@ apply a filtering step to remove records with a lower Grading.
AT = ls_source(
source = system.file(
paste0('extdata/MTox/LS/MTox_2023_HILIC_POS.txt'),
package = 'MetMasheR')
package = 'MetMashR')
)
# prepare workflow
Expand Down Expand Up @@ -378,7 +378,7 @@ be included in a workflow and updated as more results are collected over time.
AT = ls_source(
source = system.file(
paste0('extdata/MTox/LS/MTox_2023_HILIC_POS.txt'),
package = 'MetMasheR')
package = 'MetMashR')
)
# prepare cache
Expand Down

0 comments on commit a11617f

Please sign in to comment.