Skip to content

161 distributed fails at some nset values - #162

Merged
dimalvovs merged 3 commits into
masterfrom
161-distributed-fails-at-some-nset-values
Aug 12, 2026
Merged

161 distributed fails at some nset values#162
dimalvovs merged 3 commits into
masterfrom
161-distributed-fails-at-some-nset-values

Conversation

@dimalvovs

Copy link
Copy Markdown
Contributor

This pull request addresses a bug in the stitchTogether function that could cause loss of matrix dimension names when handling single-pattern distributed runs. The fix ensures that matrices retain their dimensions and names, preventing downstream errors. Additionally, a new test is added to verify this behavior. The package version is incremented to reflect the update.

Bug fix for matrix dimension handling in distributed runs:

  • Updated the stitchTogether function in R/DistributedCogaps.R to use drop=FALSE when subsetting matrices (Amean, Asd, Pmean, Psd). This prevents 1-column matrices from being converted to vectors, which previously resulted in the loss of row names and downstream errors. [1] [2]

Testing improvements:

  • Added a new test in tests/testthat/test_DistributedCogaps.R to ensure that running a distributed CoGAPS analysis with a single pattern retains matrix dimensions and row names, guarding against regression of this bug.

Version update:

  • Incremented the package version in DESCRIPTION from 3.33.1 to 3.33.2 to reflect the bug fix.

@dimalvovs dimalvovs linked an issue Aug 12, 2026 that may be closed by this pull request
@dimalvovs
dimalvovs requested a lite review from Copilot August 12, 2026 11:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a distributed-run edge case in stitchTogether() where subsetting a 1-column matrix could drop dimensions (turning it into a vector), causing loss of dimnames and downstream initialization failures (e.g., missing gene/sample names). It also adds a regression test and bumps the package version to reflect the bug fix.

Changes:

  • Preserve matrix dimensions/dimnames during reordering in stitchTogether() by subsetting with drop = FALSE.
  • Add a test covering single-pattern distributed runs (both genome-wide and single-cell) to prevent regression.
  • Bump package version from 3.33.1 to 3.33.2.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
R/DistributedCogaps.R Prevents 1-column matrices from being dropped to vectors during reordering in stitchTogether().
tests/testthat/test_DistributedCogaps.R Adds a regression test ensuring dimnames are retained for one-pattern distributed runs.
DESCRIPTION Increments package version to reflect the bug fix.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@dimalvovs
dimalvovs merged commit f907509 into master Aug 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Distributed fails at some nSet values

2 participants