Skip to content

Commit d4a969e

Browse files
authored
Merge pull request #52 from bcbio/devel
downgrade to warning minor version
2 parents 3a72be5 + 9181c65 commit d4a969e

File tree

18 files changed

+108
-36
lines changed

18 files changed

+108
-36
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: bcbioR
22
Type: Package
33
Title: Templates and functions to guide downstream analysis and data interpretation
4-
Version: 0.3.0
4+
Version: 0.3.1
55
Authors@R: person("Pantano", "Lorena", , "lorena.pantano@gmail.com",
66
role = c("aut", "cre"))
77
Description: Collaborative code repository at the Harvard Chan Bioinformatics Core.

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export(cb_friendly_pal)
77
export(list_cb_friendly_cols)
88
export(scale_color_cb_friendly)
99
export(scale_fill_cb_friendly)
10+
export(use_library)
1011
import(R.utils)
1112
import(fs)
1213
import(usethis)

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# bcbioR 0.3.1
2+
3+
- Fix bugs in RNAseq
4+
- Add function to set up library
5+
16
# bcbioR 0.3.0
27

38
* re-structure templates

R/helpers.R

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,29 @@ bcbio_render <- function(path, pipeline, data){
251251
}
252252
}
253253

254+
255+
#' Set custom library to your project
256+
#'
257+
#' This function will create the .Rprofile file in a project path
258+
#' to use a custom library path for future session
259+
#' @param custom_lib_path path with a R library folder
260+
#' @param project_path project path
261+
#' @examples
262+
#' path <- withr::local_tempdir()
263+
#' use_library(.libPaths(), path)
264+
#' @export
265+
use_library <- function(custom_lib_path, project_path="."){
266+
# Path to your project's .Rprofile file
267+
project_path <- fs::path_abs(project_path)
268+
ui_info("Using this project path: {project_path}")
269+
rprofile_path <- file.path(project_path, ".Rprofile")
270+
# Command to set the library path
271+
lib_path_command <- sprintf('.libPaths("%s")\n', custom_lib_path)
272+
# Write the command to .Rprofile
273+
writeLines(lib_path_command, con = rprofile_path)
274+
source(rprofile_path)
275+
}
276+
254277
# help with bcbio analysis setup
255278
use_bcbio_analysis <- function(path, pipeline, copy=TRUE, metadata=NULL){
256279

README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
# bcbioR
22

3-
<!-- badges: start -->
4-
53
[![R-CMD-check](https://github.com/bcbio/bcbioR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/bcbio/bcbioR/actions/workflows/R-CMD-check.yaml)
64

7-
<!-- badges: end -->
8-
95
The goal of `bcbioR` is to create guidelines for NGS data interpretation based on the experience of the Harvard Chan Bioinformatics Core and everybody who contributes to this package.
106

117
## Installation
@@ -24,13 +20,13 @@ devtools::install_github("bcbio/bcbioR",ref = "devel")
2420

2521
use `setwd()` to set your current directory to the place where you want to work. The bcbioR functions will automatically write to whatever directory you have set.
2622

27-
```
23+
```
2824
setwd("/path/to/analysis/folder")
2925
```
3026

3127
The following code will pop up a Rmd template will populate that folder with HCBC data structure guidelines
3228

33-
```
29+
```
3430
path="/path/to/analysis/folder"
3531
bcbio_templates(type="base", outpath=path)
3632
bcbio_templates(type="rnaseq", outpath=path)
@@ -41,10 +37,27 @@ bcbio_templates(type="singlecell", outpath=path)
4137

4238
This code will populate the folder with HCBC data structure guidelines and Rmd code: **You do not need to create a reports folder prior to running this code. This will create and populate the reports folder.**
4339

44-
```
40+
```
4541
bcbio_templates(type="rnaseq", outpath="/path/to/analysis/folder/reports")
4642
```
4743

44+
## Supported analyses
45+
46+
- base/reports/example.Rmd: ![](https://img.shields.io/badge/status-stable-green)
47+
- rnaseq/DE/Intersections.Rmd: ![](https://img.shields.io/badge/status-alpha-yellow)
48+
- rnaseq/DE/GSVA.Rmd: ![](https://img.shields.io/badge/status-alpha-yellow)
49+
- rnaseq/DE/DEG.Rmd: ![](https://img.shields.io/badge/status-stable-green)
50+
- rnaseq/DE/Cross-comparison-analysis.Rmd: ![](https://img.shields.io/badge/status-alpha-yellow)
51+
- rnaseq/QC/QC_nf-core.Rmd: ![](https://img.shields.io/badge/status-stable-green)
52+
- singlecell/Integration/norm_integration.rmd: ![](https://img.shields.io/badge/status-alpha-yellow)
53+
- singlecell/QC/QC.rmd: ![](https://img.shields.io/badge/status-alpha-yellow)
54+
- singlecell_delux/CellToCell/cellchat.Rmd: ![](https://img.shields.io/badge/status-draft-grey)
55+
- chipseq/diffbind/diffbind.Rmd: ![](https://img.shields.io/badge/status-alpha-yellow)
56+
- chipseq/QC/QC.Rmd: ![](https://img.shields.io/badge/status-alpha-yellow)
57+
- spatial/cosmx/QC/QC.Rmd: ![](https://img.shields.io/badge/status-draft-grey)
58+
- methylation/QC/QC.Rmd: ![](https://img.shields.io/badge/status-draft-grey)
59+
- multiomics/teaseq/QC/QC.Rmd: ![](https://img.shields.io/badge/status-draft-grey)
60+
4861
### Discover more…
4962

5063
Go to the vignette to know more `vignette("bcbioR_quick_start", package="bcbioR")`

inst/templates/base/reports/example.Rmd

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ setwd(fs::path_dir(getSourceEditorContext()$path))
2727
# NOTE: This code will check version, this is our recommendation, it may work
2828
#. other versions
2929
stopifnot(R.version$major>= 4) # requires R4
30-
stopifnot(compareVersion(R.version$minor,"3.3")==0) # requires >=4.3.3
30+
if (compareVersion(R.version$minor,"3.1")<0) warning("We recommend >= R4.3.1")
3131
stopifnot(compareVersion(as.character(BiocManager::version()), "3.18")>=0)
3232
```
3333

@@ -76,3 +76,11 @@ opts_chunk[["set"]](
7676
- PI: `r PI`
7777
- Analyst: `r analyst`
7878
- Experiment: `r experiment`
79+
80+
# R session
81+
82+
List and version of tools used for the QC report generation.
83+
84+
```{r}
85+
sessionInfo()
86+
```

inst/templates/chipseq/QC/QC.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ setwd(fs::path_dir(getSourceEditorContext()$path))
3333
# NOTE: This code will check version, this is our recommendation, it may work
3434
#. other versions
3535
stopifnot(R.version$major>= 4) # requires R4
36-
stopifnot(compareVersion(R.version$minor,"3.3")>=0) # requires >=4.3.3
36+
if (compareVersion(R.version$minor,"3.1")<0) warning("We recommend >= R4.3.1")
3737
stopifnot(compareVersion(as.character(BiocManager::version()), "3.18")>=0)
3838
```
3939

inst/templates/chipseq/diffbind/diffbind.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ setwd(fs::path_dir(getSourceEditorContext()$path))
4040
# NOTE: This code will check version, this is our recommendation, it may work
4141
#. other versions
4242
stopifnot(R.version$major>= 4) # requires R4
43-
stopifnot(compareVersion(R.version$minor,"3.3")>=0) # requires >=4.3.3
43+
if (compareVersion(R.version$minor,"3.1")<0) warning("We recommend >= R4.3.1")
4444
stopifnot(compareVersion(as.character(BiocManager::version()), "3.18")>=0)
4545
```
4646

inst/templates/methylation/QC/QC.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ setwd(fs::path_dir(getSourceEditorContext()$path))
2828
# NOTE: This code will check version, this is our recommendation, it may work
2929
#. other versions
3030
stopifnot(R.version$major>= 4) # requires R4
31-
stopifnot(compareVersion(R.version$minor,"3.3")==0) # requires >=4.3.3
31+
if (compareVersion(R.version$minor,"3.1")<0) warning("We recommend >= R4.3.1")
3232
stopifnot(compareVersion(BiocManager::version(), "3.18")>=0)
3333
```
3434

inst/templates/rnaseq/DE/Cross-comparison-analysis.Rmd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ setwd(fs::path_dir(getSourceEditorContext()$path))
2727
# NOTE: This code will check version, this is our recommendation, it may work
2828
#. other versions
2929
stopifnot(R.version$major>= 4) # requires R4
30-
stopifnot(compareVersion(R.version$minor,"3.3")==0) # requires >=4.3.3
30+
if (compareVersion(R.version$minor,"3.1")<0) warning("We recommend >= R4.3.1")
3131
stopifnot(compareVersion(as.character(BiocManager::version()), "3.18")>=0)
3232
```
3333

@@ -178,7 +178,7 @@ ggplot(lfc, aes(x=comp1, y=comp2, color=col)) + geom_point() +
178178
```
179179

180180

181-
## Compare ajusted P-values
181+
## Compare adjusted P-values
182182

183183
We plot adjusted P-values for our contrasts and color points by whether or not they are significant in our contrasts. The black line is 1:1.
184184

0 commit comments

Comments
 (0)