Modificar gates_save para que no de error de ambiguedad
This commit is contained in:
+6
-5
@@ -235,13 +235,14 @@ LMD2FCS<-function(files, output.dir=NULL){
|
||||
|
||||
gates_save<-function(gs, file="gates.rds", save=T, include=NULL){
|
||||
gates.list<-list()
|
||||
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]))
|
||||
for (gate in pop_paths){
|
||||
pop_paths_full<-gs_get_pop_paths(gs)[gs_get_pop_paths(gs) != "root"]
|
||||
if(!is.null(include)){pop_paths_full<-pop_paths_full[pop_paths %in% include]}
|
||||
pop_paths<-lapply(pop_paths_full, function(x) rev(rev(strsplit(x, "/")[[1]])[1:2]))
|
||||
for (gate.in in 1:length(pop_paths)){
|
||||
gate<-pop_paths[[gate.in]]
|
||||
parent<-if (gate[1] == ""){"root"}else{gate[1]}
|
||||
gated_pop<-gate[2]
|
||||
gates.list[[paste0(parent,"/",gated_pop)]]<-gs_pop_get_gate(gs, gated_pop)
|
||||
gates.list[[paste0(parent,"/",gated_pop)]]<-gs_pop_get_gate(gs, pop_paths_full[gate.in])
|
||||
}
|
||||
if(save){saveRDS(gates.list, file)}
|
||||
return(gates.list)
|
||||
|
||||
Reference in New Issue
Block a user