diff --git a/DESCRIPTION b/DESCRIPTION index 9e74f721..6c8a23d9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -14,7 +14,7 @@ License: MIT + file LICENSE Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 Imports: dplyr, data.table, diff --git a/R/new_project.R b/R/new_project.R index c9aa42f9..c70b2c02 100644 --- a/R/new_project.R +++ b/R/new_project.R @@ -18,7 +18,10 @@ #' @param institution Affiliated institution(s), **semicolon-sep if multiple**, e.g. "Stanford University; University of California, San Francisco". #' @param funder The funding agency. The relevant funder team will be made admin. #' @param initiative Title of funding initiative, e.g. "Young Investigator Award". -#' @param datasets (Optional) Datasets for which folders will be created under main data folder ("Raw Data"). +#' @param datasets (Optional) List of datasets for which folders will be created under main data folder ("Raw Data"). +#' Attributes set on the list items become annotations on the dataset folders. +#' @param other_resources (Optional) List of non-data resource types for which folders will be created. +#' Attributes set on the list items become annotations on these folders. #' @param publicview Whether to put this project in the public view instead of staying private (registered or non-registered users can see project). #' @param webview Whether to open web browser to view newly created project. Defaults to FALSE. #' @param ... Additional arguments. Not used. @@ -33,6 +36,7 @@ new_project <- function(name, funder, initiative, datasets = NULL, + other_resources = NULL, publicview = FALSE, webview = FALSE, ...) { @@ -73,6 +77,19 @@ new_project <- function(name, } # ASSETS ---------------------------------------------------------------------# + + # Folder structure looks something like this, + # where * elements are conditionally present on data given: + #├── Analysis + #├── Milestone Reports + #├── Protocols* + #├── Raw Data + #│ ├── IHC dataset* + #│ └── RNA-seq dataset* + #└── Scripts* + + # Note that all protocol files, etc. is expected to live in a single protocol folder and not further nested. + # Create default upper-level folders folders <- add_default_folders(project) data_folder <- folders[["Raw Data"]] @@ -82,6 +99,11 @@ new_project <- function(name, make_folder(parent = data_folder$properties$id, folders = datasets) } + # Create homes for non-data resources alongside "Raw Data" + if(length(other_resources)) { + make_folder(parent = project, folders = other_resources) + } + # Add Project Files and Metadata fileview, add NF schema; currently doesn't add facets fv <- add_default_fileview(project) diff --git a/man/make_folder.Rd b/man/make_folder.Rd index a52a91bc..95fda51b 100644 --- a/man/make_folder.Rd +++ b/man/make_folder.Rd @@ -19,10 +19,10 @@ Use to set up a scaffold of standard upper-level folders as well as customized data folders within "Raw Data" for a new project. } \examples{ -\dontrun{ +\dontrun{ datasets <- list("sequencing data", "imaging data") assays <- c("rnaSeq", "immunohistochemistry") -for(i in seq_along(datasets)) attr(datasets[[i]], "assay") <- assays[[i]] -make_folder(parent = "syn26462036", datasets) +for(i in seq_along(datasets)) attr(datasets[[i]], "assay") <- assays[[i]] +make_folder(parent = "syn26462036", datasets) } } diff --git a/man/new_project.Rd b/man/new_project.Rd index bafe4f40..ef77e9f0 100644 --- a/man/new_project.Rd +++ b/man/new_project.Rd @@ -14,6 +14,7 @@ new_project( funder, initiative, datasets = NULL, + other_resources = NULL, publicview = FALSE, webview = FALSE, ... @@ -26,8 +27,7 @@ new_project( \item{lead}{Name(s) of the project lead/data coordinator, comma-sep if multiple, e.g. "Jane Doe, John Doe".} -\item{admin_user}{(Optional) Synapse username of specified user to be made admin. -Currently, only takes one admin user, and the rest can be added via the UI.} +\item{admin_user}{(Optional) Single id or list of ids of users to be made admin(s).} \item{abstract}{Project abstract/description.} @@ -37,7 +37,11 @@ Currently, only takes one admin user, and the rest can be added via the UI.} \item{initiative}{Title of funding initiative, e.g. "Young Investigator Award".} -\item{datasets}{(Optional) Datasets for which folders will be created under main data folder ("Raw Data").} +\item{datasets}{(Optional) List of datasets for which folders will be created under main data folder ("Raw Data"). +Attributes set on the list items become annotations on the dataset folders.} + +\item{other_resources}{(Optional) List of non-data resource types for which folders will be created. +Attributes set on the list items become annotations on these folders.} \item{publicview}{Whether to put this project in the public view instead of staying private (registered or non-registered users can see project).}