Skip to content

Tools for writing reproducible reports at VISC

License

Unknown, GPL-3.0 licenses found

Licenses found

Unknown
LICENSE
GPL-3.0
LICENSE.md
Notifications You must be signed in to change notification settings

FredHutch/VISCtemplates

Repository files navigation

VISCtemplates

The goal of VISCtemplates is to:

  • automate project setup
  • provide a common, easy-to-understand directory structure across analyses
  • provide consistency across VISC reports

Installation

The package is available on the Fred Hutch organization GitHub page.

remotes::install_github("FredHutch/VISCtemplates")

# install the package with vignettes:
remotes::install_github("FredHutch/VISCtemplates", build_vignettes = TRUE)

Requirements

  • R (version >= 3.0)
  • RStudio (version >= 1.2)
    • Includes Pandoc (version >= 2.0), which is needed for Word reports.
  • TinyTeX (or MiKTeX), which is needed for PDF reports.
    • install.packages(“tinytex”)
    • tinytex::install_tinytex()

Vignettes

The package vignettes will guide you through setting up an analysis project with VISCtemplates and usethis and using a VISC report template.

vignette("using_pdf_and_word_template")
vignette("create_a_visc_analysis_project")

Usage

Many of the functions in this package build on functions from usethis and rmarkdown. Like usethis, most use_*() functions operate on the active project. VISCtemplates is designed to be used interactively.

The main functions in VISCtemplates are create_visc_project(), for setting up analysis projects, and use_visc_report(), for using VISC report templates. Take a look at the package vignettes for more details.

Create an analysis project:

path <- "~/mydir/VDCnnnAnalysis"

create_visc_project(path)

Use a VISC Report:

use_visc_report(
  report_name = "VDCnnn_BAMA_PT_Report_statusifapplicable", # the name of the report file
  path = "BAMA", # the path within the active directory, usually the name of the assay
  report_type = "bama" # "empty", "generic", "bama", or "nab"
)

Why use an R package structure?

The R package structure is used for analysis projects because it provides an easily recognizable format for file organization and allows for the use of packages like devtools and roxygen2. For more information, see:

  1. Ben Marwick, Carl Boettiger, and Lincoln Mullen. Paper: Packaging data analytical work reproducibily using R (and friends)
  2. Karthik Ram. Rstudio::conf 2019 talk: How To Make Your Data Analysis Notebooks More Reproducible
  3. rOpenSci Community Call: Reproducible Research with R