Skip to content

Commit

Permalink
Update condition
Browse files Browse the repository at this point in the history
  • Loading branch information
kalidouBA committed Nov 16, 2023
1 parent 275e24c commit b0fa442
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/SSDRnaSeq.R
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ SSDRnaSeq <- function(reference, bulk, nIteration = 50, methodDeconv = "CSx", me
# Initialize variables to store results and metrics
matrixAbundances <- performs <- performs2plot <- opt <- NULL

for (iterate_ in 0:(nIteration+1)) {
for (iterate_ in 0:nIteration) {
message("Current iteration ++++++++++++++++++++++++++++++++ ", iterate_)

out_Dec <- running_method(bulk, reference, methodDeconv, cibersortx_email, cibersortx_token)
Expand All @@ -107,7 +107,7 @@ SSDRnaSeq <- function(reference, bulk, nIteration = 50, methodDeconv = "CSx", me
((metric == "R2_adj" && performs[iterate_] > 0.99) ||
(metric == "RRMSE" && performs[iterate_-1] - performs[iterate_] < 0 ) ||
iterate_ == nIteration)) {
opt <- iterate_ - 1
opt <- ifelse(iterate_ == nIteration, iterate_, iterate_ - 1)
message("Convergence criteria Done with optimal criteria: ", opt, "\nBreaking the loop.")

break
Expand Down

0 comments on commit b0fa442

Please sign in to comment.