diff --git a/functionsCyto.R b/functionsCyto.R index ac7c54a..b03e6bb 100644 --- a/functionsCyto.R +++ b/functionsCyto.R @@ -284,9 +284,11 @@ gs_pop_get_children_recursive<-function(gs, pop){ gs_gate_interactive_regate2<-function(gs, filterId, sample=1, subset="root", ...){ dims<-list(names(gs_pop_get_gate(gs, filterId)[[1]]@parameters)[1], - names(gs_pop_get_gate(gs, filterId)[[1]]@parameters)[2]) + names(gs_pop_get_gate(gs, filterId)[[1]]@parameters)[2]) childrens<-gs_pop_get_children_recursive(gs, filterId) - childrens_gate<-gates_save(gs, save=F, include=childrens) + if (length(childrens)>0){ + childrens_gate<-gates_save(gs, save=F, include=childrens) + } gs_pop_add(gs, gs_pop_get_gate(gs, filterId), parent=subset, name="duplicated") @@ -297,6 +299,7 @@ gs_gate_interactive_regate2<-function(gs, filterId, sample=1, subset="root", ... dims = dims, regate=T, overlayGates = "duplicated") gs_pop_remove(gs, "duplicated") - - gates_apply(gs, childrens_gate) + if (length(childrens)>0){ + gates_apply(gs, childrens_gate) + } }