select_compass_pops {COMPASS} | R Documentation |
Returns a boolean vector indexing cell populations in cellpops
that match
the pattern for boolean combinations of markers
.
select_compass_pops(cellpops, markers)
cellpops |
|
markers |
|
If markers A, B, C, D make up the population names in cellpops
and they
the names match the pattern e.g. "A+B-C+D+,Count" (typical of exports from some gating tools),
then markers
should be a vector of markers in the same order they appear in cellpops
.
A boolean vector indexing cellpops
with TRUE
for populations matchin
the pattern.
translate_marker_names
#Generate some population names markers = LETTERS[1:4] pos = c("+","-") popnames = apply(expand.grid(pos,pos,pos,pos),1, function(x)paste(paste(paste(markers,x,sep=""), collapse=""),",Count",sep="")) popnames = sample(c(popnames,paste(paste(markers,sample(c("+","-"), length(markers),replace=TRUE),sep=""),",Count",sep=""))) popnames[select_compass_pops(popnames,LETTERS[1:4])]