diff --git a/R/gating-methods.R b/R/gating-methods.R index a6f3a4d..36e6abd 100644 --- a/R/gating-methods.R +++ b/R/gating-methods.R @@ -125,17 +125,6 @@ gt_gating.gatingTemplate <- function(x, y, ...) { gt_node_pop <- gt_get_nodes(gt, node) parent <- gt_get_parent(gt, node) - if(!is.null(stop.at)){ - nodeName <- alias(gt_node_pop) - nodePath <- file.path(parent, nodeName) - matchInd <- grep(stop.pat, nodePath) - if(length(matchInd) == 1) - { - message("stop at: ",stop.at) - break - } - - } # extract gate method from one edge(since multiple edge to the same node is # redudant) this_gate <- gt_get_gate(gt, parent, node) @@ -164,6 +153,17 @@ gt_gating.gatingTemplate <- function(x, y, ...) { nodeData(env_fct$fct, node, "fList")[[1]] <- filterObj } + # terminate gating after stop.at + if(!is.null(stop.at)){ + nodeName <- alias(gt_node_pop) + nodePath <- file.path(parent, nodeName) + matchInd <- grep(stop.pat, nodePath) + if(length(matchInd) == 1) + { + message("stop at: ",stop.at) + break + } + } } message("finished.")