https://www.nature.com/collections/prbfkwmwvz/
https://www.nature.com/news/1-500-scientists-lift-the-lid-on-reproducibility-1.19970
A large percentage of research is not reproducible by other researchers or by the original researchers themselves. This concern has been lately addressed by several high profile journals.
"The difference between a scientist and a crazy person is that a scientist takes notes."
Problems with using Excel for data analyses. ]
Manually handling workflow is hard to reproduce because it is hard to know the exact step carried out. A programmatic workflow allows full transparency to the exact steps followed.
A reproducible workflow allows a lot of convenience.
Reproducible projects can be performed at different levels. Reproducibility is the ability for a work to be reproduced by an independently working third-party.
Reproducible programming is not an R specific issue. R offers a set of tools and an environment that is conducive to reproducible research.
install.packages(), devtools::install_github()
read.delim(), source(), readr::read_tsv()
dplyr, tidyr
ggplot2
lm(), wilcox.test()
system("./plink --file --flag1 --flag2 --out bla")
C:/R/
rather than C:/R/Program Files/
BiocManager
to avoid conflictsCreate a new project
project_name/+-- raw/| +-- gene_counts.txt| +-- metadata.txt+-- results/| +-- gene_filtered_counts.txt| +-- gene_vst_counts.txt+-- images/| +-- exp-setup.jpg+-- scripts/| +-- bash/| | +-- fastqc.sh| | +-- trim_adapters.sh| | +-- mapping.sh| +-- r/| +-- qc.R| +-- functions.R| +-- dge.R+-- report/ +-- report.Rmd
Try to organise all material related to a project in a common directory. Organise the directory in a sensible manner. Use relative links to refer to files. Consider raw as read-only content.
Create a new .Rmd document
R Notebook demonstration.
.Rmd
---title: "This is a title"output: rmarkdown::html_document---
File > New File > R Markdown
opens up an Rmd templatermarkdown::render("report.Rmd")
### Heading 3#### Heading 4_italic text_ __bold text__ `code text` ~~strikethrough~~ 2^10^ 2~10~ - bullet pointLink to [this](somewhere.com)
Today's date is `r date()`
Today's date is Fri Jun 7 12:43:36 2019
```{r}date()```
date()
## [1] "Fri Jun 7 12:43:36 2019"
eval=FALSE
to not evaluate a code chunkecho=FALSE
to hide input coderesults="hide"
to hide outputR Markdown reference https://rmarkdown.rstudio.com/
R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
OS: Ubuntu 18.04.2 LTS
Built on : 07-Jun-2019 at 12:43:36
2019 • SciLifeLab • NBIS
Keyboard shortcuts
↑, ←, Pg Up, k | Go to previous slide |
↓, →, Pg Dn, Space, j | Go to next slide |
Home | Go to first slide |
End | Go to last slide |
Number + Return | Go to specific slide |
b / m / f | Toggle blackout / mirrored / fullscreen mode |
c | Clone slideshow |
p | Toggle presenter mode |
t | Restart the presentation timer |
?, h | Toggle this help |
Esc | Back to slideshow |