-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cell_limit to vector of cell references #30
Comments
I did something similar recently, using
Anyway, this was the code. unrange <- function(x) {
limits <- cellranger::as.cell_limits(x)
rows <- seq(limits$ul[1], limits$lr[1])
cols <- seq(limits$ul[2], limits$lr[2])
rowcol <- expand.grid(rows, cols)
cell_addrs <- cellranger::cell_addr(rowcol[[1]], rowcol[[2]])
cellranger::to_string(cell_addrs, fo = "A1", strict = FALSE)
}
unrange("A121:A122")
#> [1] "A121" "A122" |
Looks nice despite the shortcomings. Do make a PR! |
I note you can also do this: reprex::reprex_info()
#> Created by the reprex package v0.1.1.9000 on 2017-10-24
library(magrittr)
library(cellranger)
cell_addr(1, 1:9) %>%
to_string(fo = "A1", strict = FALSE)
#> [1] "A1" "B1" "C1" "D1" "E1" "F1" "G1" "H1" "I1" I haven't looked at the package in a long time! The But I agree, it seems like there's some missing piece here that would be useful. |
That's neat. It works on single-row or single-column ranges, but for rectangles library(magrittr)
library(cellranger)
cell_addr(1:2, 1:9) %>%
to_string(fo = "A1", strict = FALSE)
#> Error: length(row) == length(col) is not TRUE @jennybc if you get a chance to revisit those ideas, I'd love to hear more. |
What is the recommended way of obtaining a vector of individual cell references from a
cell_limit
object? When dealing with columns < AA (which is my case since I'm actually parsing coordinates on A1:H12 PCR plates), one can do:Is there a lightweight generic solution?
The text was updated successfully, but these errors were encountered: