DillonHammill / CytoExploreR

Interactive Cytometry Data Analysis
60 stars 13 forks source link

cyto_plot_gating_scheme.R #158

Open baj12 opened 1 year ago

baj12 commented 1 year ago

The index "x" is not referencing the same object within the function as it is supposed to be. unique(gt_gates[, c("xchannel", "channel")]) is not the same as unique(gt_gates[, "xchannel"])

cyto_plot_gating_scheme.R

around line 384

should be:

      # Parent may have gates in different channels
      # construct a plot for each channel set
      lapply(seq(1, nrow(unique(gt_gates[, c("xchannel", "ychannel")]))), 
             function(x) {
        parent <- as.character(parents)
        xchannel <- as.character(unique(gt_gates[, c("xchannel", "ychannel")])[x,1])
        ychannel <- as.character(unique(gt_gates[, c("xchannel", "ychannel")])[x,2])

is now:

      # Parent may have gates in different channels
      # construct a plot for each channel set
      lapply(seq(1, nrow(unique(gt_gates[, c("xchannel", "ychannel")]))), 
             function(x) {
        parent <- as.character(parents)
        xchannel <- as.character(unique(gt_gates[, "xchannel"])[x])
        ychannel <- as.character(unique(gt_gates[, "ychannel"])[x])