Skip to content

Commit

Permalink
Add namespace for nrow for barcodes
Browse files Browse the repository at this point in the history
  • Loading branch information
elliothershberg committed May 11, 2021
1 parent 813ee1b commit acf591a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions PaintSHOP/barcode.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ collect_indices <- function(barcode) {
# side or 3' side gets 2 instead of 1 is also random.
add_bridges <- function(probes, bridges, indices) {
# choose which bridge won't be used, "randomly" for each probe
dropped_bridge <- sample(c(1, 2, 3, 4), nrow(probes), replace = TRUE)
dropped_bridge <- sample(c(1, 2, 3, 4), base::nrow(probes), replace = TRUE)

# loop over probes, adding bridges based on indices derived from barcode
for (i in 1:nrow(probes)) {
for (i in 1:base::nrow(probes)) {
# drop the bridge
curr_indices <- indices[-dropped_bridge[i]]

Expand Down Expand Up @@ -99,7 +99,7 @@ append_barcodes <- function(probes, bridges, barcodes) {

# Check to make sure that there are enough barcodes
validate(
need(nrow(barcodes) >= length(unique_IDs),
need(base::nrow(barcodes) >= length(unique_IDs),
"There are not enough barcodes for the number of targets with probes.")
)

Expand Down

0 comments on commit acf591a

Please sign in to comment.