mcanouil / eggla

Early Growth Genetics Longitudinal Analysis.
https://m.canouil.dev/eggla/
Other
2 stars 1 forks source link

Replace slopes_dt with aucs_dt in outlier removal [run_eggla_lmm()] #100

Closed burrowsk closed 1 year ago

burrowsk commented 1 year ago

Bug description

In the code that removes outliers in run_eggla_lmm() [lines 461 to 469], should slopes_dt[["egg_id"]] [line 467] be aucs_dt[["egg_id"]] instead. It doesn't make a difference in my dataset, but may in others?

      if (outlier_exclude && sum(outliers_dt[["Outlier"]]) > 0) {
        outliers_to_exclude <- outliers_dt[Outlier == 1]
        for (icol in unique(outliers_to_exclude[["parameter"]])) {
          if (any(grepl("^auc_", icol))) {
            aucs_dt <- data.table::setDF(aucs_dt)
            aucs_dt[
              slopes_dt[["egg_id"]] %in% outliers_to_exclude[parameter %in% icol, ID],
              icol
            ] <- NA_real_

Thanks!

eggla version output

eggla 0.18.5

Checklist