Skip to content

Commit

Permalink
Added check for cl = 1
Browse files Browse the repository at this point in the history
  • Loading branch information
ludvigla committed Aug 15, 2024
1 parent d6ff95f commit d6e89ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions R/differential_colocalization_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ RunDCA.data.frame <- function(
chunks <- cut(seq_along(test_groups), length(cl))
}
} else if (is.numeric(cl)) {
# Use sequential processing when cl is 1
if (cl == 1) {
chunks <- seq_along(test_groups)
}
# Parallel processing when cl is the number of child processes
if ((length(test_groups) * cl) > (cl * 100)) {
# Cut into even chunks of 100 values in each chunk
Expand Down
4 changes: 4 additions & 0 deletions R/differential_polarity_analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ RunDPA.data.frame <- function(
# Parallel processing on cluster
chunks <- cut(seq_along(test_groups), length(cl))
} else if (is.numeric(cl)) {
# Use sequential processing when cl is 1
if (cl == 1) {
chunks <- seq_along(test_groups)
}
# Parallel processing when cl is the number of child processes
chunks <- cut(seq_along(test_groups), cl)
} else {
Expand Down

0 comments on commit d6e89ae

Please sign in to comment.