Skip to content

Commit

Permalink
Even simpler example files
Browse files Browse the repository at this point in the history
  • Loading branch information
Adafede committed Aug 5, 2024
1 parent 545e399 commit 882ecd4
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 27 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: tima
Title: Taxonomically Informed Metabolite Annotation
Version: 2.10.0
Version: 2.10.1
Authors@R: c(
person("Adriano", "Rutz", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-0443-9902")),
Expand Down
50 changes: 32 additions & 18 deletions R/get_example_files.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,42 @@
#' @include go_to_cache.R
#' @include parse_yaml_paths.R
#'
#' @param example The example(s) you want to download
#'
#' @return Example files.
#'
#' @export
#'
#' @examples NULL
get_example_files <- function() {
go_to_cache()
message("Features")
get_file(
url = tima::parse_yaml_paths()$urls$examples$features,
export = tima::parse_yaml_paths()$data$source$features
)
message("Metadata")
get_file(
url = tima::parse_yaml_paths()$urls$examples$metadata,
export = tima::parse_yaml_paths()$data$source$metadata
)
message("Sirius")
get_example_sirius()
message("Spectra")
get_file(
url = tima::parse_yaml_paths()$urls$examples$spectra,
export = tima::parse_yaml_paths()$data$source$spectra
get_example_files <- function(example = c("features", "metadata", "sirius", "spectra")) {
stopifnot(
"Example files available are `features`, `metadata`, `sirius` and `spectra`." =
example %in% c("features", "metadata", "sirius", "spectra")
)
go_to_cache()
if ("features" %in% example) {
message("Features")
get_file(
url = tima::parse_yaml_paths()$urls$examples$features,
export = tima::parse_yaml_paths()$data$source$features
)
}
if ("metadata" %in% example) {
message("Metadata")
get_file(
url = tima::parse_yaml_paths()$urls$examples$metadata,
export = tima::parse_yaml_paths()$data$source$metadata
)
}
if ("sirius" %in% example) {
message("Sirius")
get_example_sirius()
}
if ("spectra" %in% example) {
message("Spectra")
get_file(
url = tima::parse_yaml_paths()$urls$examples$spectra,
export = tima::parse_yaml_paths()$data$source$spectra
)
}
}
4 changes: 2 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"codeRepository": "https://github.com/taxonomicallyinformedannotation/tima",
"issueTracker": "https://github.com/taxonomicallyinformedannotation/tima/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "2.10.0",
"version": "2.10.1",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down Expand Up @@ -644,7 +644,7 @@
"SystemRequirements": null
},
"keywords": ["metaboliteannotation", "chemotaxonomy", "scoringsystem", "naturalproducts", "computationalmetabolomics", "taxonomicdistance", "specializedmetabolome"],
"fileSize": "3169.746KB",
"fileSize": "3170.327KB",
"citation": [
{
"@type": "ScholarlyArticle",
Expand Down
5 changes: 4 additions & 1 deletion man/get_example_files.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions vignettes/articles/II-preparing.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,10 @@ The edges are created based on the `spectral entropy similarity` calculated betw
targets::tar_make(names = matches("fea_edg_spe"))
```

If needed, you can get an example of what your minimal feature table should look like by running (no parameters needed):
If needed, you can get an example of what your minimal feature table should look like by running:

```{r get-features, results="hide", message=FALSE, warning=FALSE}
tima::get_file(
url = tima::parse_yaml_paths()$urls$examples$features,
export = tima::parse_yaml_paths()$data$source$features
)
tima::get_example_files(example = "features")
```

```{r prepare-features, results="hide", message=FALSE, warning=FALSE, include = FALSE}
Expand Down

0 comments on commit 882ecd4

Please sign in to comment.