Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Proposal to migrate `DelayedMask` to the DelayedArray package

Open
#122 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
r
Domain
data, performance

Research direction

Start by reviewing the DelayedMask implementation in alabaster.matrix and DelayedArray's delayed [<- handling, including DelayedNaryIsoOp and extract_*_array() calls. Determine whether migration or generalized masking belongs in DelayedArray and document the proposed behavior and efficiency trade-offs; completion requires an agreed implementation scope or maintainer decision.

Written by the indexing model from the issue text.

Description

My alabaster.matrix package has a DelayedMask class that replaces all instances of a placeholder with an NA value during extract_*_array() calls. Essentially, it is equivalent to:

library(DelayedArray)
y <- DelayedArray(matrix(rbinom(100, 1, 0.2), ncol=5))
placeholder <- 1

z <- y
z[z == placeholder] <- NA

# Gives the same (abstract) matrix contents as:
alabaster.matrix::DelayedMask(y, placeholder)

AFAICT the DelayedMask approach should be more efficient as the DelayedMask only realizes one matrix while the delayed [<- requires realization of both z and z == placeholder. (Currently DelayedMask is literally for masking NAs but it could be generalized to handle more boolean operations, e.g., so z[z > cap] <- cap could be used to upper-bound the contents of the matrix.)

Would this be of interest to the DelayedArray package? Perhaps there might be an easy way that we can detect that the logical subset is generated from the same matrix that it is operating on in [<-, and switch from creating a DelayedNaryIsoOp to a DelayedMask.

Dominant language
R
Stars
29
Forks
12
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Bioconductor/DelayedArray

All issues in Bioconductor/DelayedArray

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.