Skip to content

Commit 002e187

Browse files
committed
final test for v1.5.1
1 parent 53bb9c2 commit 002e187

4 files changed

Lines changed: 57 additions & 109 deletions

File tree

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@
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.1 - [2026-02-27]
7+
8+
### `Added`
9+
- Extended unit-tests to uncovered code sections.
10+
11+
### `Changed`
12+
- Added error handling when none `SAMPLE_ID`s are matching during `private$sync`
13+
14+
### `Fixed`
15+
- [#31](https://github.com/agusinac/OmicFlow/issues/31#issue-3962339783) `colormap` doesn't return any NAs.
16+
- [#30](https://github.com/agusinac/OmicFlow/issues/30#issue-3930823920) Placed `FEATURE_ID` as first column.
17+
- [#29](https://github.com/agusinac/OmicFlow/issues/29#issue-3930786231) replaced `position_nudge` with `position_jitter`
18+
- foldchange was matching sub-strings, fixed by changing it to exact matching.
19+
620
## v1.5.0 - [2026-01-26]
721

822
### `Added`

DESCRIPTION

Lines changed: 1 addition & 1 deletion
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
33
Version: 1.5.1
4-
Date: 2026-02-23
4+
Date: 2026-02-27
55
Authors@R: c(
66
person(
77
"Alem", "Gusinac",

R/foldchange.R

Lines changed: 23 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -15,49 +15,35 @@
1515
#' #-------------------------#
1616
#' ## NON-PAIRED ##
1717
#' #-------------------------#
18-
#' # Load required library
1918
#' library(data.table)
20-
#'
19+
#'
2120
#' # Define parameters and variables
22-
#' sample_ids <- c("S1_A", "S2_A", "S3_A", "S4_B", "S5_B", "S6_B")
21+
#' sample_ids <- c("S1", "S2", "S3", "S4", "S5", "S6")
22+
#' groups <- c("A", "A", "B", "B", "C", "C")
2323
#' feature_ids <- c("Feature1", "Feature2", "Feature3")
24-
#'
24+
#'
2525
#' # Simulated abundance matrix (features x samples)
2626
#' abundances <- matrix(
2727
#' c(
28-
#' # Feature1 (e.g. GenusA)
29-
#' 100, 120, 110, 55, 60, 65,
30-
#' # Feature2 (e.g. GenusB)
31-
#' 50, 65, 60, 130, 120, 125,
32-
#' # Feature3 (e.g. GenusC)
33-
#' 80, 85, 90, 80, 85, 90
28+
#' 100, 120, 110, 55, 60, 65,
29+
#' 50, 65, 60, 130, 120, 125,
30+
#' 80, 85, 90, 80, 85, 90
3431
#' ),
3532
#' nrow = 3, byrow = TRUE,
3633
#' dimnames = list(feature_ids, sample_ids)
3734
#' )
38-
#'
39-
#' # A wide table with columns as samples, rows as features
40-
#' # And an additional column as the feature_rank, a column for feature comparison.
41-
#' mock_data <- data.table(
42-
#' Genus = feature_ids, # feature_rank column (e.g. "Genus")
43-
#' S1_A = abundances[ , 1],
44-
#' S2_A = abundances[ , 2],
45-
#' S3_A = abundances[ , 3],
46-
#' S4_B = abundances[ , 4],
47-
#' S5_B = abundances[ , 5],
48-
#' S6_B = abundances[ , 6]
49-
#' )
50-
#' print(mock_data)
51-
#'
52-
#' # It uses substring matching, and multiple conditions can be used
35+
#'
36+
#' # Convert to a data.table
37+
#' mock_data <- OmicFlow::matrix_to_dtable(abundances)
38+
#' mock_data$Genus <- feature_ids
39+
#'
40+
#' # It uses exact matching and multiple conditions are allowed.
5341
#' res <- foldchange(
5442
#' data = mock_data,
5543
#' feature_rank = "Genus",
56-
#' condition_A = c("_A", "_B"),
57-
#' condition_B = c("_B", "_A"),
58-
#'
59-
#' # This can also be a column wherein, conditions A and B are present
60-
#' condition_labels = sample_ids,
44+
#' condition_A = c("A", "B"),
45+
#' condition_B = c("B", "C"),
46+
#' condition_labels = groups,
6147
#' paired = FALSE
6248
#' )
6349
#' print(res)
@@ -67,35 +53,16 @@
6753
#' #---------------------#
6854
#' library(data.table)
6955
#'
70-
#' # Define paired sample ids for 3 pairs:
71-
#' paired_ids <- paste0("Pair", 1:3)
72-
#'
73-
#' # Features:
74-
#' feature_ids <- c("Feature1", "Feature2", "Feature3")
75-
#'
76-
#' # Simulate abundances for each paired sample:
77-
#' # For each pair, we have two samples: condition A and condition B.
78-
#' # Make sure the length of condition A and condition B are the same!
79-
#'
80-
#' # Construct the data.table with features as rows
81-
#' mock_data_paired <- data.table(
82-
#' Genus = feature_ids,
83-
#' Pair1_A = c(100, 50, 80),
84-
#' Pair1_B = c(60, 130, 75),
85-
#' Pair2_A = c(120, 65, 85),
86-
#' Pair2_B = c(60, 120, 90),
87-
#' Pair3_A = c(110, 60, 90),
88-
#' Pair3_B = c(65, 125, 85)
89-
#' )
56+
#' # In the paired case both conditions A and B must be of the same length!
57+
#' # We re-use the above mock_data and only change group labels
58+
#' groups <- c("A", "A", "B", "B", "A", "B")
9059
#'
9160
#' res <- foldchange(
92-
#' data = mock_data_paired,
61+
#' data = mock_data,
9362
#' feature_rank = "Genus",
94-
#' condition_A = c("_A", "_B"),
95-
#' condition_B = c("_B", "_A"),
96-
#'
97-
#' # This can also be a column wherein, conditions A and B are present
98-
#' condition_labels = names(mock_data_paired)[-1],
63+
#' condition_A = c("A"),
64+
#' condition_B = c("B"),
65+
#' condition_labels = groups,
9966
#' paired = TRUE
10067
#' )
10168
#' print(res)

man/foldchange.Rd

Lines changed: 19 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)