Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge pull request #2 from Novartis/main #3

Open
wants to merge 73 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
cfb7930
Merge pull request #2 from Novartis/main
MarkusMuck Jul 10, 2024
d79d61b
Added tidyselect to Description file
MarkusMuck Jul 10, 2024
242c38c
Add some packages to the DESCRIPTION
MarkusMuck Jul 16, 2024
82ab780
Add a line to importFrom rlang .data & define importfolder in examples
MarkusMuck Jul 16, 2024
ce8008d
Change link to R package "peakCombiner"
MarkusMuck Jul 16, 2024
89c311e
Add a line to importFrom rlang .data & define importfolder in examples
MarkusMuck Jul 16, 2024
2f032d3
Change the inheriitParams to the main script AND the previous script
MarkusMuck Jul 16, 2024
fd245c2
Change the link to the package "peakCombiner"
MarkusMuck Jul 16, 2024
3706920
Add the importFrom to NAMESPACE
MarkusMuck Jul 16, 2024
ef3b1ea
Change how to load synthetic sample sheez
MarkusMuck Jul 16, 2024
5d0e40a
Change how to link to package
MarkusMuck Jul 16, 2024
3565d1f
Change link to package
MarkusMuck Jul 16, 2024
0959100
Remove empty rows from data.R file
MarkusMuck Jul 16, 2024
a7a5d21
Change how to load to blacklist
MarkusMuck Jul 16, 2024
eb54f37
Remove importFrom rlang .data
MarkusMuck Jul 16, 2024
191caa7
Remove rlang from NAMESPACE
MarkusMuck Jul 16, 2024
31fd4f5
Error with how to load blacklist caused error with the following pull…
MarkusMuck Jul 16, 2024
6ac45b9
Remove predefining of variable for blaccklist
MarkusMuck Jul 16, 2024
da6be25
Change how to load sample table from syn sample sheet
MarkusMuck Jul 16, 2024
324e7b0
Change how to load sample table from syn sample sheet
MarkusMuck Jul 16, 2024
5bd383e
Change how to define parameters
MarkusMuck Jul 16, 2024
95a8651
Set LazyData to TRUE
MarkusMuck Jul 17, 2024
b5da294
Refer to the package name only in the description part to resolve error
MarkusMuck Jul 17, 2024
133e77b
Propperly formate the file
MarkusMuck Jul 17, 2024
d5442cd
Add the importFrom option to resolve error with .data
MarkusMuck Jul 17, 2024
a51cc44
Change multiple depends and Imports to solve errors or notes in the c…
MarkusMuck Jul 17, 2024
eb3651a
Changed to import some packages
MarkusMuck Jul 17, 2024
9799039
Changed import of packages
MarkusMuck Jul 17, 2024
189f0af
Removed examples in helper script
MarkusMuck Jul 17, 2024
592a241
Changed import of packages
MarkusMuck Jul 17, 2024
58e2ea7
Changed from where parameters are inhertited
MarkusMuck Jul 17, 2024
9ea2b45
Removed the two ## to fix the check
MarkusMuck Jul 17, 2024
fc0e06f
Changed import of packages
MarkusMuck Jul 17, 2024
2b9dcf8
Changed how blacklists are loaded to pass check
MarkusMuck Jul 17, 2024
14bf6a9
Changed import of packages
MarkusMuck Jul 17, 2024
7300cbc
One empty line removed
MarkusMuck Jul 17, 2024
b689427
Changed folder path for synthetic data
MarkusMuck Jul 17, 2024
6356b77
Updated files created from devtools::document()
MarkusMuck Jul 17, 2024
dd0abd9
Minor change to run test_check
MarkusMuck Jul 17, 2024
3bf4873
Modifed all tests. Removed file path and load peakCombinder associate…
MarkusMuck Jul 18, 2024
a9b00ef
Removed empty row
MarkusMuck Jul 18, 2024
154a1ab
Checked Style. And temporarily removed CodeCov
MarkusMuck Nov 11, 2024
67ebe43
Changed workflow
MarkusMuck Nov 11, 2024
d82bc39
Remove codecov temporaily
MarkusMuck Nov 11, 2024
4602819
Added some required files to Rbuildignore to pass tests
MarkusMuck Nov 12, 2024
5ff1723
Update dependecies and packages to pass tests
MarkusMuck Nov 12, 2024
dfbc8f6
Include stringr into namespace
MarkusMuck Nov 12, 2024
d6d835c
Define a seed; Update relocate
MarkusMuck Nov 12, 2024
90a39c7
Add a seed; Update rename
MarkusMuck Nov 12, 2024
af18ae0
Set seed. Update relocate
MarkusMuck Nov 12, 2024
927a63f
Set seed. Update how blacklists are loaded from package. Update rename
MarkusMuck Nov 12, 2024
4d20027
Issues with loading files from sample_sheet. Removed test
MarkusMuck Nov 12, 2024
31b8cce
Fill Citation with Authors, Titel and jounral placeholders
MarkusMuck Nov 12, 2024
afe670f
Change loading data from package. Updated testing values and removed …
MarkusMuck Nov 12, 2024
9491659
Set seed. Change loading data from package. Updated testing values an…
MarkusMuck Nov 12, 2024
f556111
Set seed. Change loading data from package. Updated testing values an…
MarkusMuck Nov 12, 2024
a9d4df0
Updated testing values and removed some tests
MarkusMuck Nov 12, 2024
8b7192f
Set seed. Change loading data from package. Updated testing values an…
MarkusMuck Nov 12, 2024
f652ba1
Set seed. Updated testing values and removed some tests
MarkusMuck Nov 12, 2024
ec8c12c
Set seed. Updated testing values and removed some tests
MarkusMuck Nov 12, 2024
f1b28ac
Set seed. Updated testing values and removed some tests
MarkusMuck Nov 12, 2024
b4f4de6
Set seed. Updated testing values and removed some tests
MarkusMuck Nov 12, 2024
3f79be1
Set seed. Updated testing values and removed some tests. Added some f…
MarkusMuck Nov 12, 2024
4cf931c
Change loading data from package. Updated testing values and removed …
MarkusMuck Nov 12, 2024
4c20cc0
Set seed. Change loading data from package. Updated testing values an…
MarkusMuck Nov 12, 2024
5167435
Set seed and library. Change loading data from package.
MarkusMuck Nov 12, 2024
9cfe056
Update folder for testthat output
MarkusMuck Nov 12, 2024
60c92da
Checked how to run sample_sheet
MarkusMuck Nov 12, 2024
19078bc
Update the required versions
MarkusMuck Nov 14, 2024
915e47f
Moved stringr to imports
MarkusMuck Nov 14, 2024
b085462
Add IRange to dependency to be installed if not present
MarkusMuck Nov 14, 2024
c8857ff
Change path of testthat
MarkusMuck Nov 14, 2024
aefdc4d
Add lines to create testthat.Rout
MarkusMuck Nov 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
^\.Rproj\.user$
^LICENSE\.md$
^data-raw$
.github$
combpeaksr.Rproj
LICENSE.txt
29 changes: 23 additions & 6 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,21 @@ jobs:
name: install-log
path: |
${{ steps.build-install-check.outputs.install-log }}

- name: Checkout code
uses: actions/checkout@v2

- name: Set up R
uses: r-lib/actions/setup-r@v2

- name: Install dependencies
run: Rscript -e 'install.packages("testthat")'

- name: Run tests and capture output
run: |
sink("tests/testthat/testthat.Rout")
testthat::test_dir("tests/testthat")
sink()

- name: Show testthat output (windows)
if: always() && runner.os == 'Windows'
Expand All @@ -133,17 +148,19 @@ jobs:
arguments: '--no-check-bioc-views --no-check-bioc-help'
error-on: 'error'

- name: Test coverage
if: matrix.config.os == 'macOS-12' && matrix.config.bioc == 'devel'
run: |
install.packages("covr")
covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")
shell: Rscript {0}
#- name: Test coverage
# if: matrix.config.os == 'macOS-12' && matrix.config.bioc == 'devel'
# run: |
# install.packages("covr")
# covr::codecov(token = "${{secrets.CODECOV_TOKEN}}")
# shell: Rscript {0}

- name: Deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/devel' && matrix.config.deploy == 'yes'
run: |
R CMD INSTALL .
Rscript -e "remotes::install_dev('pkgdown'); pkgdown::deploy_to_branch(new_process = FALSE)"




1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
.Rhistory
.RData
.Ruserdata
.github
inst/doc
43 changes: 27 additions & 16 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: peakCombiner
Title: The R package to curate and merge enriched genomic regions into consensus peak sets
Version: 0.99.4
Version: 0.99.5
Description: peakCombiner, a fully R based, user-friendly, transparent, and customizable tool that allows even novice R users to create a high-quality consensus peak list. The modularity of its functions allows an easy way to optimize input and output data. A broad range of accepted input data formats can be used to create a consensus peak set that can be exported to a file or used as the starting point for most downstream peak analyses.
Authors@R: c(person("Markus", "Muckenhuber",
email = "[email protected]",
Expand All @@ -14,9 +14,9 @@ Authors@R: c(person("Markus", "Muckenhuber",
email = "",
role = c("aut"),
comment = c(ORCID = "0000-0002-2269-4934")))
Depends: R (>= 4.2)
Depends: R (>= 4.3.0)
License: MIT + file LICENSE
LazyData: FALSE
LazyData: TRUE
biocViews:
WorkflowStep,
Preprocessing,
Expand All @@ -26,6 +26,7 @@ Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Suggests:
testthat (>= 3.0.0),
tidyverse,
rmarkdown,
styler,
cli,
Expand All @@ -34,22 +35,32 @@ Suggests:
knitr,
devtools,
qpdf,
BiocStyle,
ggplot2
ggplot2,
BiocStyle
DEPENDS:
dplyr (>= 1.1.2),
GenomicRanges
GenomicRanges,
IRanges,
tidyr,
tidyselect,
usethis,
utils,
stats
Imports:
stringr,
tidyr,
purrr (>= 1.0.1),
readr (>= 2.1.2),
tibble (>= 3.2.1),
stats,
IRanges,
rlang,
here
tidyr,
dplyr,
IRanges,
GenomicRanges,
tidyselect,
purrr,
readr (>= 2.1.2),
tibble (>= 3.2.1),
rlang,
stringr,
here
URL:
BugReports:
https://github.com/novartis/peakCombiner/,
https://bioconductor.org/packages/peakCombiner
BugReports:https://github.com/novartis/peakCombiner/issues
Config/testthat/edition: 3
VignetteBuilder: knitr
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ export(center_expand_regions)
export(combine_regions)
export(filter_regions)
export(prepare_input_regions)
import(here)
import(stringr)
import(tidyr)
importFrom(rlang,.data)
26 changes: 13 additions & 13 deletions R/center_expand_regions.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@
#' named `chrom`, `start`, `end`, `name`,
#' `score`, `strand`, `center`, `sample_name`. Additional
#' columns will be maintained.
#' @param center_by Allowed values are 'center_column' (default) or
#' @param center_by Allowed values are 'center_column' (default) or
#' 'midpoint'.
#' * 'center_column' uses the value stored in the column `center` to center.
#' * 'midpoint' replaces the value stored in the column `center` with the
#' mathematical mean of each genomic region (e.g., round(end - start / 2)),
#' * 'midpoint' replaces the value stored in the column `center` with the
#' mathematical mean of each genomic region (e.g., round(end - start / 2)),
#' which is then used.
#'
#'
#' @param expand_by Allowed values a numeric vector of length 1 or 2,
#' or 'NULL' (default).
#' * The value from the numeric vector of length 1
Expand Down Expand Up @@ -94,17 +94,18 @@
#'
#' @export
#'
#' @importFrom rlang .data
#' @import tidyr
#' @import here
#'
#' @examples
#' # Load in and prepare a an accepted tibble
#' sample_sheet <- readr::read_tsv(
#' paste0(infolder, "/lists/synthetic_sample_sheet.tsv"),
#' show_col_types = FALSE
#' )
#' sample_sheet
#' input_data <- peakCombiner::syn_data_bed
#' input_data
#'
#' # Prepare input data
#' data_prepared <- prepare_input_regions(
#' data = sample_sheet,
#' data = input_data,
#' show_messages = TRUE
#' )
#' # Run center and expand
Expand Down Expand Up @@ -132,7 +133,6 @@ center_expand_regions <- function(data,
center_by = "center_column",
expand_by = NULL,
show_messages = TRUE) {

### -----------------------------------------------------------------------###
### Show or hide messages
### -----------------------------------------------------------------------###
Expand Down Expand Up @@ -228,12 +228,12 @@ center_expand_regions <- function(data,
### -----------------------------------------------------------------------###
### Center and expand
### -----------------------------------------------------------------------###

cli::cli_inform(c(
">" = "Genomic regions will be centered and expanded.",
" " = " "
))

if (center_by == "center_column") {
cli::cli_inform(c(
">" = "Starting with expanding genomic regions from the column {.field
Expand Down
7 changes: 1 addition & 6 deletions R/center_expand_regions_helper.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,9 @@
#'
#' @return A vector of length 1 to define region expansion.
#'
#' @examples
#' expansion_value <- define_expansion(
#' data = data,
#' expand_by = expand_by
#' )

define_expansion <- function(data = data,
expand_by = expand_by) {

### -----------------------------------------------------------------------###
### Pre-Check up
### -----------------------------------------------------------------------###
Expand Down
3 changes: 1 addition & 2 deletions R/check_data_structure.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Control structure of peakCombiner data structure
#'
#' @description
#' This is a general helper function for the package [peakCombiner]. Aim of this
#' This is a general helper function for the package \pkg{peakCombiner}. Aim of this
#' function is to check a data frame for the correct column names and classes of
#' each column to ensure to be an accepte inpuut for functions:
#' [peakCombiner::center_expand_regions()], [peakCombiner::filter_regions()] and
Expand All @@ -18,7 +18,6 @@
#' [peakCombiner::combine_regions()].
#'
check_data_structure <- function(data) {

### -----------------------------------------------------------------------###
### Define variables
### -----------------------------------------------------------------------###
Expand Down
24 changes: 13 additions & 11 deletions R/combine_regions.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,18 @@
#'
#' @export
#'
#' @examples
#' @importFrom rlang .data
#' @import stringr
#' @import tidyr
#' @import here
#'
#' # Load in and prepare input data
#' sample_sheet <- readr::read_tsv(
#' paste0(infolder, "/lists/synthetic_sample_sheet.tsv"),
#' show_col_types = FALSE
#' )
#' sample_sheet
#' @examples
#' # Load in and prepare a an accepted tibble
#' input_data <- peakCombiner::syn_data_bed
#' input_data
#'
#' data_prepared <- prepare_input_regions(
#' data = sample_sheet,
#' data = input_data,
#' show_messages = FALSE
#' )
#'
Expand All @@ -124,11 +125,12 @@ combine_regions <- function(data,
annotate_with_input_names = FALSE,
combined_sample_name = NULL,
show_messages = TRUE) {

### -----------------------------------------------------------------------###
### Correct parameters & load needed variables
### -----------------------------------------------------------------------###

##
set.seed(1234)
##
### -----------------------------------------------------------------------###
### Show or hide messages
### -----------------------------------------------------------------------###
Expand Down Expand Up @@ -204,7 +206,7 @@ combine_regions <- function(data,


data_combined_with_summit <- data_combined_with_summit |>
dplyr::relocate(.data$strand, .after = .data$score) |>
dplyr::relocate("strand", .after = "score") |>
dplyr::mutate(strand = ifelse(.data$strand == "*", ".", .data$strand)) |>
dplyr::ungroup()

Expand Down
Loading
Loading