Skip to content

Commit

Permalink
import-export accesory files
Browse files Browse the repository at this point in the history
  • Loading branch information
lpantano committed Apr 18, 2024
1 parent 532b59b commit a29d73e
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 2 deletions.
2 changes: 2 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ LazyData: true
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
Imports:
stringr
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Generated by roxygen2: do not edit by hand

export(bcbio_gitignore)
export(bcbio_set_project)
export(bcbio_start_project)
importFrom(stringr,str_replace_all)
7 changes: 7 additions & 0 deletions R/bcbioR-package.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#' @keywords internal
"_PACKAGE"

## usethis namespace: start
#' @importFrom stringr str_replace_all
## usethis namespace: end
NULL
18 changes: 17 additions & 1 deletion R/hello.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,23 @@
# Check Package: 'Cmd + Shift + E'
# Test Package: 'Cmd + Shift + T'

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

#' @export
bcbio_set_project <- function() {
hbc_code <- readline("What is the hbc code:\n")
pi <- readline("What is PI last name:\n")
technology <- readline("What is the technology:\n")
tissue <- readline("What is the tissue:\n")
org <- readline("What is the organism:\n")
project <- readline("What is the project name:\n")
dropbox <- readline("What is the dropbox name:\n")
github_org <- readline("What is the github organization:\n")
project_full <- paste0(project, "_", hbc_code)
#hbc_$technology_of_$pilastname_$intervention_on_$tissue_in_$organism_$hbccode
project_full <- paste(project, technology, fix(pi), project, tissue, organism, hbc_code, sep="_")
github <- c(github_org,project_full)
opts <- list(code=hbc_code, project=project_full,
dropbox=file.path(dropbox,project_full),
Expand All @@ -33,6 +43,12 @@ bcbio_start_project <- function(options) {

}

#' @export
bcbio_gitignore <- function(options) {

}


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

Expand Down
2 changes: 2 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ library(bcbioR)

You'll still need to render `README.Rmd` regularly, to keep `README.md` up-to-date. `devtools::build_readme()` is handy for this.

Use `usethis::use_import_from()` to make sure all the imports are correct.

Don't forget to commit and push the resulting figure files, so they display on GitHub and CRAN.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@ library(bcbioR)
You’ll still need to render `README.Rmd` regularly, to keep `README.md`
up-to-date. `devtools::build_readme()` is handy for this.

Use `usethis::use_import_from()` to make sure all the imports are
correct.

Don’t forget to commit and push the resulting figure files, so they
display on GitHub and CRAN.
6 changes: 5 additions & 1 deletion inst/rmarkdown/templates/rnaseq/skeleton/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
[ ] Replace Title in this file matching title projects
[ ] run function`bcbio_set_project()` to set up information for this project
- hbcxxxx code
- technology
- tissue
- organism
- pi
- project name to be used in storage/github/dropbox
- project name
[ ] run function `bcbio_set_git()` to set up git repository
[ ] run function `bcbio_copy_dropbox()` to copy files to dropbox location

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
library(rmarkdown)

render_de <- function(subset_value, numerator, denominator){
rmarkdown::render(input = "DEG.Rmd",
output_dir = "reports",
output_format = "html_document",
output_file = paste0('DE_', subset_value, '_', numerator, '_vs_', denominator, '.html'),
clean = TRUE,
envir = new.env(),
params = list(
subset_value = subset_value,
numerator = numerator,
denominator = denominator
)
)
}

render_de('HDFn', "TNF", "untreated")

0 comments on commit a29d73e

Please sign in to comment.