|
@ -233,9 +233,10 @@ LMD2FCS<-function(files, output.dir=NULL){ |
|
|
print("Conversión completada") |
|
|
print("Conversión completada") |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
gates_save<-function(gs, file="gates.rds", save=T){ |
|
|
|
|
|
|
|
|
gates_save<-function(gs, file="gates.rds", save=T, include=NULL){ |
|
|
gates.list<-list() |
|
|
gates.list<-list() |
|
|
pop_paths<-gs_get_pop_paths(gs)[gs_get_pop_paths(gs) != "root"] |
|
|
pop_paths<-gs_get_pop_paths(gs)[gs_get_pop_paths(gs) != "root"] |
|
|
|
|
|
if(!is.null(include)){pop_paths<-pop_paths[pop_paths %in% include]} |
|
|
pop_paths<-lapply(pop_paths, function(x) rev(rev(strsplit(x, "/")[[1]])[1:2])) |
|
|
pop_paths<-lapply(pop_paths, function(x) rev(rev(strsplit(x, "/")[[1]])[1:2])) |
|
|
for (gate in pop_paths){ |
|
|
for (gate in pop_paths){ |
|
|
parent<-if (gate[1] == ""){"root"}else{gate[1]} |
|
|
parent<-if (gate[1] == ""){"root"}else{gate[1]} |
|
@ -265,3 +266,36 @@ gates_apply<-function(gs, gates, exact=T){ |
|
|
recompute(gs) |
|
|
recompute(gs) |
|
|
return(gs) |
|
|
return(gs) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
gs_pop_get_children_recursive<-function(gs, pop){ |
|
|
|
|
|
childrens<-c() |
|
|
|
|
|
n<-0 |
|
|
|
|
|
childrens<-c(childrens, gs_pop_get_children(gs, pop)) |
|
|
|
|
|
while(n != length(childrens)){ |
|
|
|
|
|
n<-length(childrens) |
|
|
|
|
|
for (i in 1:length(childrens)){ |
|
|
|
|
|
childrens<-c(childrens, gs_pop_get_children(gs, childrens[i])) |
|
|
|
|
|
} |
|
|
|
|
|
childrens<-unique(childrens) |
|
|
|
|
|
} |
|
|
|
|
|
return(childrens) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
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]) |
|
|
|
|
|
childrens<-gs_pop_get_children_recursive(gs, filterId) |
|
|
|
|
|
childrens_gate<-gates_save(gs, save=F, include=childrens) |
|
|
|
|
|
|
|
|
|
|
|
gs_pop_add(gs, gs_pop_get_gate(gs, filterId), parent=subset, name="duplicated") |
|
|
|
|
|
|
|
|
|
|
|
gs_gate_interactive(gs, |
|
|
|
|
|
subset = subset, |
|
|
|
|
|
filterId = filterId, |
|
|
|
|
|
sample=sample, |
|
|
|
|
|
dims = dims, regate=T, overlayGates = "duplicated") |
|
|
|
|
|
|
|
|
|
|
|
gs_pop_remove(gs, "duplicated") |
|
|
|
|
|
|
|
|
|
|
|
gates_apply(gs, childrens_gate) |
|
|
|
|
|
} |