Proposal to migrate `DelayedMask` to the DelayedArray package
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Bioconductor/DelayedArray
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
Bioconductor/DelayedArray#129 · 11 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Bioconductor/DelayedArray#127 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Bioconductor/DelayedArray#125 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Bioconductor/DelayedArray#123 ·
-
`base::cbind()` Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Bioconductor/DelayedArray#116 · 3 comments ·
All issues in Bioconductor/DelayedArray
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
easystats/performance#950 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
briandconnelly/airnow#9 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
OHDSI/CohortConstructor#774 ·
-
pre-review R TeX Track: 5 (DSAIS)
Difficulty 1/5 Under an hour Newbie friendliness 60/100
openjournals/joss-reviews#11330 · 7 comments ·