Skip to content

Commit

Permalink
clean documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lpantano committed Apr 25, 2024
1 parent 1f3f05e commit e147907
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 22 deletions.
54 changes: 32 additions & 22 deletions R/hello.R
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
# Hello, world!
#
# This is an example function named 'hello'
# which prints 'Hello, world!'.
#
# You can learn more about package authoring with RStudio at:
#
# http://r-pkgs.had.co.nz/
#
# Some useful keyboard shortcuts for package authoring:
#
# Install Package: 'Cmd + Shift + B'
# Check Package: 'Cmd + Shift + E'
# Test Package: 'Cmd + Shift + T'

.fix <- function(x){
x <- tolower(x) %>% str_replace_all(., "[[:punct:]]", "_")
return(x)
}

#' Function to help deploy analysis folder inside a project folder
#'
#' This function contains Rmd, R, md, files that help to structure
#' an analysis following HCBC best-practices.
#' For rnaseq, it will deploy: QC and DE Rmd with additional files to help
#' to facilitate the analysis as needed.
#'
#' Normally these helper files are inside a report folder inside a
#' project folder.
#'
#' @param type string indicating the type of analysis, supported: rnaseq.
#'
#' @param outpath string path indicating where to copy all the files to
#' @examples
#' \dontrun{
#' bcbio_templates("rnaseq", "path_to_projects/project1/reports")
#' }
#' @export
bcbio_templates <- function(type="rnaseq", outpath){
switch(type,
Expand All @@ -39,9 +41,23 @@ bcbio_templates <- function(type="rnaseq", outpath){
)
}

#' Function to help with project name used for parent folder
#'
#' This function will ask for user input about:
#' * numeric code
#' * PI full name
#' * technology
#' * tissue
#' * organism
#' * project description
#'
#' It removes special character with `_`. The output is a guideline to
#' what the folder used can be.
#'
#' @returns A string list with hbc_code, and project folder name
#' @export
bcbio_set_project <- function() {
hbc_code <- readline("What is the hbc code:\n")
hbc_code <- readline("What is the hbc code (only numbers):\n")
hbc_code <- paste0("hbc", hbc_code)
pi <- readline("What is PI last name:\n")
technology <- readline("What is the technology:\n")
Expand Down Expand Up @@ -70,12 +86,6 @@ bcbio_gitignore <- function(options) {

}


hello <- function() {
print("Hello, world!")

}

# This function showcases how one might write a function to be used as an
# RStudio project template. This function will be called when the user invokes
# the New Project wizard using the project template defined in the template file
Expand Down
26 changes: 26 additions & 0 deletions man/bcbio_set_project.Rd

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

28 changes: 28 additions & 0 deletions man/bcbio_templates.Rd

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

0 comments on commit e147907

Please sign in to comment.