Skip to content

Commit 3dad472

Browse files
authored
Merge pull request #28 from agusinac/dev
v1.5
2 parents 5fba201 + 7fd5b3e commit 3dad472

70 files changed

Lines changed: 2404 additions & 1617 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/R-CMD-check.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
33
on:
44
push:
5-
branches: [main]
5+
branches: [dev]
66
pull_request:
7-
branches: [main]
7+
branches: [dev]
88

99
name: R-CMD-check.yaml
1010

@@ -22,9 +22,7 @@ jobs:
2222
config:
2323
- {os: macos-latest, r: 'release'}
2424
- {os: windows-latest, r: 'release'}
25-
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
2625
- {os: ubuntu-latest, r: 'release'}
27-
- {os: ubuntu-latest, r: 'oldrel-1'}
2826

2927
env:
3028
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/docker-build-push.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,31 @@
33
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
44
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6+
## v1.5.0 - [2026-01-26]
7+
8+
### `Added`
9+
- [#23](https://github.com/agusinac/OmicFlow/issues/23) active bindings on data types, in place modification and automatic synchronisation between other data types by default via private function `sync`.
10+
- [#23](https://github.com/agusinac/OmicFlow/issues/23) `featureData` is now always created as placeholder.
11+
12+
### `Changed`
13+
- [#23](https://github.com/agusinac/OmicFlow/issues/23) omics classes are now cloneable.
14+
- [#23](https://github.com/agusinac/OmicFlow/issues/23) `removeZeros()` function is now private.
15+
- [#26](https://github.com/agusinac/OmicFlow/issues/26) clarified `initialize` and field tags.
16+
- [#27](https://github.com/agusinac/OmicFlow/issues/27) Both `denseMatrix` as `sparseMatrix` are converted to `CsparseMatrix`, compatible to `omics$normalize`, `omics$feature_merge`, `diversity`, `hill_taxa` and `C-functions`.
17+
- Replaced `tmp_link` and `tmp_restore` with inline code. Seems like `private$.countData` doesn't work with a private function.
18+
- Improved the `cli` formatting and visualisation of different arguments.
19+
- `print()` inherited for each sub-class from `omics` and uses `cli::cli_inform` instead of `cat`
20+
- [#21](https://github.com/agusinac/OmicFlow/issues/21) introduced custom half boxplot/point in `diversity_plot`, now also added `group_by` to perform grouped statistical tests.
21+
- Replaced `read_rarefraction_qiime` by `check_table` from private function of class `omics.`
22+
- `autoFlow` compatible to denseMatrix formats, applies fdr correction in other omics layers, report can be set to False, removed `nmds`.
23+
24+
### `Fixed`
25+
- [#25](https://github.com/agusinac/OmicFlow/issues/25) changed default value of `initialize` function.
26+
27+
### `Deprecated`
28+
- Removed `tmp_restore` and `tmp_link`
29+
- Utils function `read_rarefraction_qiime`
30+
631
## v1.4.2 - [2025-11-30]
732

833
### `Fixed`
@@ -17,7 +42,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1742
- [#22](https://github.com/agusinac/OmicFlow/issues/22) `private$check_matrix` checks if any zero's are present before creating a `sparseMatrix`.
1843
- [#20](https://github.com/agusinac/OmicFlow/issues/20) `omics$compositon` Doesn't show `Others` when there are none.
1944
- [#24](https://github.com/agusinac/OmicFlow/issues/24) `volcano_plot` only sizes the points if there are significant features found.
20-
45+
2146
### `Deprecated`
2247
- [#21](https://github.com/agusinac/OmicFlow/issues/21) Removed `gghalves` in `diversity_plot`
2348

DESCRIPTION

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: OmicFlow
22
Title: Fast and Efficient (Automated) Analysis of Sparse Omics Data
3-
Version: 1.4.2
4-
Date: 2025-11-30
3+
Version: 1.5.0
4+
Date: 2026-01-26
55
Authors@R: c(
66
person(
77
"Alem", "Gusinac",
@@ -52,12 +52,12 @@ Imports:
5252
tools,
5353
utils,
5454
vegan,
55-
yyjsonr
55+
yyjsonr,
56+
cli
5657
Suggests:
5758
DT,
5859
downloadthis,
5960
rmarkdown,
60-
cli,
6161
testthat (>= 3.0.0)
6262
LinkingTo:
6363
Rcpp,

NAMESPACE

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ export(hill_taxa)
1313
export(jaccard)
1414
export(jsd)
1515
export(manhattan)
16+
export(matrix_to_dtable)
1617
export(metagenomics)
1718
export(omics)
1819
export(ordination_plot)
1920
export(pairwise_adonis)
2021
export(pairwise_anosim)
2122
export(plot_pairwise_stats)
2223
export(proteomics)
23-
export(read_rarefraction_qiime)
24-
export(sparse_to_dtable)
2524
export(unifrac)
2625
export(volcano_plot)
2726
import(Matrix)
@@ -39,19 +38,23 @@ importFrom(ggplot2,aes)
3938
importFrom(ggplot2,coord_flip)
4039
importFrom(ggplot2,element_rect)
4140
importFrom(ggplot2,element_text)
41+
importFrom(ggplot2,facet_wrap)
4242
importFrom(ggplot2,geom_bar)
4343
importFrom(ggplot2,geom_boxplot)
4444
importFrom(ggplot2,geom_hline)
4545
importFrom(ggplot2,geom_label)
4646
importFrom(ggplot2,geom_point)
47+
importFrom(ggplot2,geom_segment)
4748
importFrom(ggplot2,geom_vline)
4849
importFrom(ggplot2,ggplot)
4950
importFrom(ggplot2,ggtitle)
5051
importFrom(ggplot2,labs)
52+
importFrom(ggplot2,position_nudge)
5153
importFrom(ggplot2,scale_color_gradient2)
5254
importFrom(ggplot2,scale_colour_manual)
5355
importFrom(ggplot2,scale_fill_manual)
5456
importFrom(ggplot2,scale_size_continuous)
57+
importFrom(ggplot2,scale_x_continuous)
5558
importFrom(ggplot2,scale_x_discrete)
5659
importFrom(ggplot2,stat_ellipse)
5760
importFrom(ggplot2,theme)
@@ -64,9 +67,12 @@ importFrom(methods,as)
6467
importFrom(patchwork,plot_layout)
6568
importFrom(patchwork,wrap_plots)
6669
importFrom(stats,as.dist)
70+
importFrom(stats,median)
6771
importFrom(stats,na.omit)
6872
importFrom(stats,p.adjust)
6973
importFrom(stats,p.adjust.methods)
74+
importFrom(stats,quantile)
7075
importFrom(tools,file_ext)
76+
importFrom(utils,globalVariables)
7177
importFrom(yyjsonr,validate_json_file)
7278
useDynLib(OmicFlow, .registration = TRUE)

R/OmicFlow-package.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,8 @@
77
#' @importFrom stats na.omit p.adjust
88
#' @useDynLib OmicFlow, .registration = TRUE
99
#' @importFrom Rcpp sourceCpp
10+
#' @importFrom utils globalVariables
1011
## usethis namespace: end
12+
13+
utils::globalVariables(c(".", "group_col"))
1114
NULL

R/bray.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#' Compute Bray-Curtis Dissimilarity from a Sparse Matrix.
1+
#' Compute Bray-Curtis Dissimilarity from a Dense or Sparse Matrix.
22
#'
33
#' @description
4-
#' Calculates the Bray-Curtis dissimilarity of a \link[Matrix]{sparseMatrix} pairwise for each column.
4+
#' Calculates the Bray-Curtis dissimilarity of a Matrix pairwise for each column.
55
#'
66
#' @details
77
#' The Bray-Curtis dissimilarity between two samples \eqn{A} and \eqn{B}, each of length \eqn{n}, is defined as:
@@ -11,7 +11,7 @@
1111
#' where \eqn{A_i} and \eqn{B_i} are the abundances of the \eqn{i}-th feature in sample \eqn{A} and \eqn{B}, respectively.
1212
#' When weighted is set to FALSE, counts are replaced by presence/absence data.
1313
#'
14-
#' @param x A \link[Matrix]{sparseMatrix}.
14+
#' @param x A \link[base]{matrix}, \link[Matrix]{sparseMatrix} or \link[Matrix]{Matrix}.
1515
#' @param weighted A boolean value, to use abundances (\code{weighted = TRUE}) or absence/presence (\code{weighted=FALSE}) (default: TRUE).
1616
#' @param threads A wholenumber, the number of threads to use in \link[RcppParallel]{setThreadOptions} (default: 1).
1717
#' @return A column x column \link[stats]{dist} object.
@@ -45,15 +45,15 @@ bray <- function(x, weighted = TRUE, threads = 1) {
4545

4646
## Error handling
4747
#--------------------------------------------------------------------#
48-
if (is.vector(x))
49-
cli::cli_abort("Input must a matrix of class matrix or Matrix, not a vector.")
48+
if (inherits(x, "denseMatrix") || inherits(x, "matrix") || inherits(x, "sparseMatrix")) {
49+
x <- as(x, "CsparseMatrix")
50+
} else cli::cli_abort("Input isn't a {.cls matrix}, {.cls denseMatrix} or {.cls sparseMatrix}.")
5051

51-
x <- drop(as(x, "sparseMatrix"))
5252
if (!is.numeric(x@x))
5353
cli::cli_abort("Input data must be numeric.")
5454

5555
if (!is.wholenumber(threads))
56-
cli::cli_abort("{threads} must be a whole number.")
56+
cli::cli_abort("{.val {threads}} must be a whole number.")
5757

5858
## MAIN
5959
#--------------------------------------------------------------------#

R/canberra.R

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#' Compute Canberra Dissimilarity from a Sparse Matrix.
1+
#' Compute Canberra Dissimilarity from a from a Dense or Sparse Matrix.
22
#'
33
#' @description
4-
#' Calculates the Canberra dissimilarity of a \link[Matrix]{sparseMatrix} pairwise for each column.
4+
#' Calculates the Canberra dissimilarity of a Matrix pairwise for each column.
55
#'
66
#' @details
77
#' The Canberra dissimilarity between two samples \eqn{A} and \eqn{B}, each of length \eqn{n}, is defined as:
@@ -11,7 +11,7 @@
1111
#' where \eqn{A_i} and \eqn{B_i} are the abundances of the \eqn{i}-th feature in sample \eqn{A} and \eqn{B}, respectively. NZ are the number of non-zero entries.
1212
#' When weighted is set to FALSE, counts are replaced by presence/absence data.
1313
#'
14-
#' @param x A \link[Matrix]{sparseMatrix}.
14+
#' @param x A \link[base]{matrix}, \link[Matrix]{sparseMatrix} or \link[Matrix]{Matrix}.
1515
#' @param weighted A boolean value, to use abundances (\code{weighted = TRUE}) or absence/presence (\code{weighted=FALSE}) (default: TRUE).
1616
#' @param threads A wholenumber, the number of threads to use in \link[RcppParallel]{setThreadOptions} (default: 1).
1717
#' @return A column x column \link[stats]{dist} object.
@@ -48,12 +48,15 @@ canberra <- function(x, weighted = TRUE, threads = 1) {
4848
if (is.vector(x))
4949
cli::cli_abort("Input must a matrix of class matrix or Matrix, not a vector.")
5050

51-
x <- drop(as(x, "sparseMatrix"))
51+
if (inherits(x, "denseMatrix") || inherits(x, "matrix") || inherits(x, "sparseMatrix")) {
52+
x <- as(x, "CsparseMatrix")
53+
} else cli::cli_abort("Input isn't a {.cls matrix}, {.cls denseMatrix} or {.cls sparseMatrix}.")
54+
5255
if (!is.numeric(x@x))
5356
cli::cli_abort("Input data must be numeric.")
5457

5558
if (!is.wholenumber(threads))
56-
cli::cli_abort("{threads} must be a whole number.")
59+
cli::cli_abort("{.val {threads}} must be a whole number.")
5760

5861
## MAIN
5962
#--------------------------------------------------------------------#

R/colormap.R

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,24 @@ colormap <- function(data,
2828
#--------------------------------------------------------------------#
2929

3030
if (!inherits(data, "data.frame") && !inherits(data, "data.table"))
31-
cli::cli_abort("Data must be a data.frame or data.table.")
31+
cli::cli_abort("Data must be a {.cls data.frame} or {.cls data.table}.")
3232

3333
if (!is.character(col_name) && length(col_name) != 1) {
34-
cli::cli_abort("Column name: {col_name} needs to contain characters with length of 1.")
34+
cli::cli_abort("{.val {col_name}} needs to contain characters with length of 1.")
3535
} else if (!column_exists(col_name, data)) {
36-
cli::cli_abort("The {col_name} column does not exist in the provided data.")
36+
cli::cli_abort("The {.val {col_name}} column does not exist in the provided data.")
3737
}
3838

3939
if (!is.character(Brewer.palID) && length(Brewer.palID) != 1)
40-
cli::cli_abort("The {Brewer.palID} needs to contain characters with length of 1.")
40+
cli::cli_abort("The {.val {Brewer.palID}} needs to contain characters with length of 1.")
4141

4242
## MAIN
4343
#--------------------------------------------------------------------#
4444

4545
unique_groups <- unique(data[[col_name]])
46-
chosen_palette <- RColorBrewer::brewer.pal(length(unique_groups), Brewer.palID)
46+
suppressWarnings(
47+
chosen_palette <- RColorBrewer::brewer.pal(length(unique_groups), Brewer.palID)
48+
)
4749
colors <- stats::setNames(chosen_palette, unique_groups)
4850
return(colors)
4951
}

R/composition_plot.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,27 +78,27 @@ composition_plot <- function(data,
7878
#--------------------------------------------------------------------#
7979

8080
if (!inherits(data, "data.frame") && !inherits(data, "data.table"))
81-
cli::cli_abort("Data must be a data.frame or data.table.")
81+
cli::cli_abort("Data must be a {.cls data.frame} or {.cls data.table}.")
8282

8383
if (!is.character(palette))
84-
cli::cli_abort("{palette} needs to contain characters.")
84+
cli::cli_abort("{.val {palette}} needs to contain characters.")
8585

8686
if (!is.character(feature_rank) && length(feature_rank) != 1)
87-
cli::cli_abort("{feature_rank} needs to contain characters with length of 1.")
87+
cli::cli_abort("{.val {feature_rank}} needs to contain characters with length of 1.")
8888

8989
if (!is.null(title_name) && !is.character(title_name))
90-
cli::cli_abort("{title_name} needs to be of type character.")
90+
cli::cli_abort("{.val {title_name}} needs to be of type character.")
9191

9292
if (!is.null(group_by)) {
9393
if (!is.character(group_by) && length(group_by) != 1) {
94-
cli::cli_abort("{group_by} must be a character and of length 1")
94+
cli::cli_abort("{.val {group_by}} must be a character and of length 1")
9595
} else if (!column_exists(group_by, data)) {
96-
cli::cli_abort("The specified {group_by} does not exist in the metaData.")
96+
cli::cli_abort("The specified {.val {group_by}} does not exist in the provided {.arg data}.")
9797
}
9898
}
9999

100100
if (!column_exists("SAMPLE_ID", data))
101-
cli::cli_abort("SAMPLE_ID needs to exist within the provided data.frame/data.table.")
101+
cli::cli_abort("{.arg SAMPLE_ID} needs to exist within the provided {.arg data}.")
102102

103103
## MAIN
104104
#--------------------------------------------------------------------#

0 commit comments

Comments
 (0)