Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New project - other resources #184

Merged
merged 5 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
24 changes: 23 additions & 1 deletion R/new_project.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -33,6 +36,7 @@ new_project <- function(name,
funder,
initiative,
datasets = NULL,
other_resources = NULL,
publicview = FALSE,
webview = FALSE,
...) {
Expand Down Expand Up @@ -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"]]
Expand All @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions man/make_folder.Rd

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

10 changes: 7 additions & 3 deletions man/new_project.Rd

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

Loading