generated from kevinrue/MyBioconductorPackage
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support configurations in YAML format (#27)
* add support for YAML files * ignore files for testing during development * change yaml file structure; check for duplicate identifiers; add unit tests * fix unit tests that depend on console width * document data.frame and list formats supported for resource metadata
- Loading branch information
Showing
11 changed files
with
465 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#' Import Resource Metadata from YAML | ||
#' | ||
#' @param file Path to a suitable YAML file. | ||
#' | ||
#' @return A `data.frame` | ||
#' | ||
#' @rdname INTERNAL_list_to_dataframe | ||
#' | ||
#' @examples | ||
#' library(yaml) | ||
#' | ||
#' datasets_file <- system.file(package="iSEEindex", "example.yaml") | ||
#' yaml_data <- read_yaml(system.file(package = "iSEEindex", "example.yaml")) | ||
#' | ||
#' # Data sets ---- | ||
#' | ||
#' iSEEindex:::.list_to_dataframe(yaml_data$datasets) | ||
#' | ||
#' # Initial configurations ---- | ||
#' | ||
#' iSEEindex:::.list_to_dataframe(yaml_data$initial) | ||
.list_to_dataframe <- function(x) { | ||
# Convert list to a list of data.frames | ||
list_of_df <- lapply(x, as.data.frame) | ||
# rbind into a single data.frame | ||
df <- do.call("rbind", list_of_df) | ||
df | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dev-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
datasets: | ||
- id: ID1 | ||
label: ReprocessedAllenData.rds | ||
uri: https://zenodo.org/record/7304331/files/ReprocessedAllenData.rds | ||
description: | | ||
Reprocessed Allen Data. | ||
- id: ID2 | ||
label: ReprocessedAllenData.rds | ||
uri: https://zenodo.org/record/7304331/files/ReprocessedAllenData.rds | ||
description: | | ||
Reprocessed Allen Data (copy). | ||
initial: | ||
- config_id: config01rcall | ||
dataset_id: ID1 | ||
label: Configuration 1 (R call) | ||
uri: rcall://system.file(package='iSEEindex','ReprocessedAllenData_config_01.R') | ||
description: | | ||
One `ReducedDimensionPlot` panel, one `ColumnDataTable` panel. | ||
File distributed with the `iSEEindex` package. | ||
<Source: YAML> | ||
- config_id: config02rcall | ||
dataset_id: ID1 | ||
label: Configuration 2 (R call) | ||
uri: rcall://system.file(package='iSEEindex','ReprocessedAllenData_config_02.R') | ||
description: | | ||
One `RowDataTable` panel, one `ColumnDataTable` panel. | ||
File distributed with the `iSEEindex` package. | ||
<Source: YAML> | ||
- config_id: config01zenodo | ||
dataset_id: ID1 | ||
label: Configuration 1 (zenodo.org) | ||
uri: https://zenodo.org/record/7304331/files/ReprocessedAllenData_config_01.R | ||
description: | | ||
One `ReducedDimensionPlot` panel, one `ColumnDataTable` panel. | ||
File downloaded from <https://zenodo.org/record/7304331>. | ||
<Source: YAML> | ||
- config_id: config02zenodo | ||
dataset_id: ID1 | ||
label: Configuration 2 (zenodo.org) | ||
uri: https://zenodo.org/record/7304331/files/ReprocessedAllenData_config_02.R | ||
description: | | ||
One `RowDataTable` panel, one `ColumnDataTable` panel. | ||
File downloaded from <https://zenodo.org/record/7304331>. | ||
<Source: YAML> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
dataset_id,config_id,label,uri,description | ||
ID1,config01rcall,"Configuration 1 (R call)","rcall://system.file(package='iSEEindex','ReprocessedAllenData_config_01.R')","One `ReducedDimensionPlot` panel, one `ColumnDataTable` panel.<br/><br/>File distributed with the `iSEEindex` package." | ||
ID1,config02rcall,"Configuration 2 (R call)","rcall://system.file(package='iSEEindex','ReprocessedAllenData_config_02.R')","One `RowDataTable` panel, one `ColumnDataTable` panel.<br/><br/>File distributed with the `iSEEindex` package." | ||
ID1,config01zenodo,"Configuration 1 (zenodo.org)",https://zenodo.org/record/7304331/files/ReprocessedAllenData_config_01.R?download=1,"One `ReducedDimensionPlot` panel, one `ColumnDataTable` panel.<br/><br/>File downloaded from <https://zenodo.org/record/7304331>." | ||
ID1,config02zenodo,"Configuration 2 (zenodo.org)",https://zenodo.org/record/7304331/files/ReprocessedAllenData_config_02.R?download=1,"One `RowDataTable` panel, one `ColumnDataTable` panel.<br/><br/>File downloaded from <https://zenodo.org/record/7304331>." | ||
ID1,config01rcall,"Configuration 1 (R call)","rcall://system.file(package='iSEEindex','ReprocessedAllenData_config_01.R')","One `ReducedDimensionPlot` panel, one `ColumnDataTable` panel.<br/><br/>File distributed with the `iSEEindex` package.<br/><br/><Source: CSV>" | ||
ID1,config02rcall,"Configuration 2 (R call)","rcall://system.file(package='iSEEindex','ReprocessedAllenData_config_02.R')","One `RowDataTable` panel, one `ColumnDataTable` panel.<br/><br/>File distributed with the `iSEEindex` package.<br/><br/><Source: CSV>" | ||
ID1,config01zenodo,"Configuration 1 (zenodo.org)",https://zenodo.org/record/7304331/files/ReprocessedAllenData_config_01.R?download=1,"One `ReducedDimensionPlot` panel, one `ColumnDataTable` panel.<br/><br/>File downloaded from <https://zenodo.org/record/7304331>.<br/><br/><Source: CSV>" | ||
ID1,config02zenodo,"Configuration 2 (zenodo.org)",https://zenodo.org/record/7304331/files/ReprocessedAllenData_config_02.R?download=1,"One `RowDataTable` panel, one `ColumnDataTable` panel.<br/><br/>File downloaded from <https://zenodo.org/record/7304331>.<br/><br/><Source: CSV>" |
Oops, something went wrong.