Slide 1

Slide 1 text

Making R/Bioconductor packages with biocthis recount3 use case 2020-09-10 Leonardo Collado Torres lcolladotor.github.io https://speakerdeck.com/lcolladotor/making-bioc-packages-with-biocthis

Slide 2

Slide 2 text

R functions: why? ● Avoid copy-paste errors ● Facilitate maintenance ● Building blocks for expanding your universe https://twitter.com/LIBDrstats/status/1294355117916000258?s=20

Slide 3

Slide 3 text

R packages: why? ● Allows you to organize your functions ● Allows testing your code ○ testthat ○ covr ○ R CMD check ○ R CMD BiocCheck ● Allows sharing your code ○ remotes::install_github("user/repository") ○ BiocManager::install("user/repository")

Slide 4

Slide 4 text

Bioconductor packages: why? ● Quality standard: has to pass a peer review process ○ Users will trust more your package ● Open source community ○ You’ll get help from others. Very useful if you don’t have others around you to ask for help ● Provides a DOI ● Generally helps when publishing ● Automatically tested on macOS, linux and winOS every day ○ Helps anticipate errors users might run into

Slide 5

Slide 5 text

Where to start? ● Bioconductor package guidelines: http://bioconductor.org/developers/package-guidelines/ ● Building Tidy Tools workshop by Charlotte & Hadley Wickham (RStudio) ● R packages book by Hadley Wickham & Jenny Bryan https://r-pkgs.org/ ● Bioconductor submission steps http://bioconductor.org/developers/package-submission/

Slide 6

Slide 6 text

usethis: helpful framework for making R packages ● https://usethis.r-lib.org/ ● usethis::create_package() https://usethis.r-lib.org/reference/create _package.html

Slide 7

Slide 7 text

GitHub Actions ● Saves you time ● Enables automatically testing your package on winOS, macOS, linux, docker ○ https://docs.github.com/en/actions/reference/virtual-environments-for-github-hosted-run ners ● Reproducible framework ○ Particularly when you use docker http://bioconductor.org/help/docker/ ○ powered by https://www.rocker-project.org/ ● But it’s also cutting edge ○ You might run into the latest R issues ○ Might need to figure out how to install ● https://github.com/r-lib/actions ● https://www.jimhester.com/talk/2020-rsc-github-actions/

Slide 8

Slide 8 text

biocthis: helps jumpstart this process ● Includes a GitHub Actions workflow that is Bioconductor-friendly ○ https://lcolladotor.github.io/biocthis/reference/use_bioc_github_action.html ○ Bioconductor docker + macOS + winOS ○ R CMD build + check + BiocCheck ○ covr: code coverage ○ pkgdown: documentation website ● Has functions similar to usethis but that are tailored for Bioconductor’s needs (and/or mine) ○ https://lcolladotor.github.io/biocthis/reference/use_bioc_vignette.html creates a BiocStyle-based vignette with a structure that I like to use for my R/Bioconductor packages ● Includes 4 dev/*.R scripts that will guide you throughout the process of making your R/BioC package

Slide 9

Slide 9 text

Examples: recount3 ● https://github.com/LieberInstitute/recount3 ● http://research.libd.org/recount3/ ● http://research.libd.org/recount3/reference/create_rse.html ● Bookdown: http://research.libd.org/SPEAQeasy/ ● R Markdown site: https://lcolladotor.github.io/twitter-stats/CDSB2020.html ● More? https://lcolladotor.github.io/pkgs/

Slide 10

Slide 10 text

Developing on Windows? ● https://github.com/r-lib/pkgdown/issues/1329 now at https://github.com/r-lib/pkgdown/issues/1365 related to https://twitter.com/jimhester_/status/1296469378062589952?s=20 ● Short version: Windows has multiple “home” directories which makes things a mess

Slide 11

Slide 11 text

Want more? Check the LIBD rstats club ● Friday’s 1pm EST. Typically tweet links around 3pm EST ● https://twitter.com/LIBDrstats ● Twitter zoom links: https://twitter.com/search?q=from%3Alibdrstats%20jh.zoom.us&src=type d_query&f=live