Skip to contents
library(bcbioR)
#> Warning: replacing previous import 'S4Arrays::makeNindexFromArrayViewport' by
#> 'DelayedArray::makeNindexFromArrayViewport' when loading 'SummarizedExperiment'
library(ggplot2)
library(ggprism)

colors=cb_friendly_cols(1:15)
ggplot2::theme_set(theme_prism(base_size = 14))

Color blind friendly palette

Compatible with ggplot.

set.seed(596)
dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
ggplot(dsamp, aes(carat, price)) +
  geom_point(aes(colour = clarity)) +
  scale_color_cb_friendly()

And get the colors directly:

cb_friendly_cols(1:16)
#>         blue light_orange  olive_green       purple         pink     sky_blue 
#>    "#2759F6"    "#FFD37D" "olivedrab3"    "#9176C8"    "#E93380"    "#4FAEEB" 
#>    blue_grey forest_green       yellow  dark_purple  dark_orange   army_green 
#>    "#92A6BC"    "#3C877B"     "yellow"    "#402999"    "#D5392C"    "#C3C380" 
#>        black    dark_grey   light_blue        brown 
#>      "black"   "darkgrey"  "lightblue"    "#661100"

This is the full palette:

Set projects

HCBC uses a structured based directory to organize projects. You can set up this by using:

tmp_dir=withr::local_tempdir()
bcbio_templates(type="base", outpath=tmp_dir)
fs::dir_ls(tmp_dir, recurse=TRUE)
#> /tmp/Rtmp3ZTsjG/file17d61049278d/README.md
#> /tmp/Rtmp3ZTsjG/file17d61049278d/code
#> /tmp/Rtmp3ZTsjG/file17d61049278d/code/placeholder.R
#> /tmp/Rtmp3ZTsjG/file17d61049278d/data
#> /tmp/Rtmp3ZTsjG/file17d61049278d/data/readme
#> /tmp/Rtmp3ZTsjG/file17d61049278d/information.R
#> /tmp/Rtmp3ZTsjG/file17d61049278d/meta
#> /tmp/Rtmp3ZTsjG/file17d61049278d/meta/placeholder.R
#> /tmp/Rtmp3ZTsjG/file17d61049278d/scripts
#> /tmp/Rtmp3ZTsjG/file17d61049278d/scripts/placeholder
#> /tmp/Rtmp3ZTsjG/file17d61049278d/skeleton.Rmd

We support multiple analyses type:

  • RNAseq
  • scRNAseq
  • TEAseq
  • COSMX

To get the example code for any of them you can use a similar command:

analysis_tmp=fs::path_join(c(tmp_dir, "reports"))
bcbio_templates(type="rnaseq", outpath=analysis_tmp)
fs::dir_ls(analysis_tmp, recurse=TRUE)
#> /tmp/Rtmp3ZTsjG/file17d61049278d/reports/DE
#> /tmp/Rtmp3ZTsjG/file17d61049278d/reports/DE/DEG.Rmd
#> /tmp/Rtmp3ZTsjG/file17d61049278d/reports/DE/PCA_variance_analysis.Rmd
#> /tmp/Rtmp3ZTsjG/file17d61049278d/reports/DE/load_data.R
#> /tmp/Rtmp3ZTsjG/file17d61049278d/reports/DE/params_de-example.R
#> /tmp/Rtmp3ZTsjG/file17d61049278d/reports/DE/params_de.R
#> /tmp/Rtmp3ZTsjG/file17d61049278d/reports/DE/run_markdown.R
#> /tmp/Rtmp3ZTsjG/file17d61049278d/reports/QC
#> /tmp/Rtmp3ZTsjG/file17d61049278d/reports/QC/QC.Rmd
#> /tmp/Rtmp3ZTsjG/file17d61049278d/reports/QC/QC_nf-core.Rmd
#> /tmp/Rtmp3ZTsjG/file17d61049278d/reports/QC/params_qc.R
#> /tmp/Rtmp3ZTsjG/file17d61049278d/reports/QC/params_qc_nf-core-example.R
#> /tmp/Rtmp3ZTsjG/file17d61049278d/reports/QC/params_qc_nf-core.R
#> /tmp/Rtmp3ZTsjG/file17d61049278d/reports/QC/placeholder
#> /tmp/Rtmp3ZTsjG/file17d61049278d/reports/QC/run_markdown.R
#> /tmp/Rtmp3ZTsjG/file17d61049278d/reports/README.md
#> /tmp/Rtmp3ZTsjG/file17d61049278d/reports/information.R
#> /tmp/Rtmp3ZTsjG/file17d61049278d/reports/skeleton.Rmd

Use scrnaseq, teaseq or cosmx to get those other templates.