Skip to content

Commit

Permalink
Update gs_cyto_data<- to support replacement with flowSet objects. (#383
Browse files Browse the repository at this point in the history
)

* Update gs_cyto_data<- to support replacement with flowSet objects.

* Add additional type checks to gs_cyto_data<-.
  • Loading branch information
djhammill committed Jun 14, 2023
1 parent beda368 commit 8d75837
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions R/GatingSet_Methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,15 @@ setReplaceMethod("flowData",signature(x="GatingSet"),function(x,value){
#' @rdname gs_cyto_data
#' @export
setReplaceMethod("gs_cyto_data",signature(x="GatingSet"),function(x,value){
if(class(value) != "cytoset") {
if(inherits(value, "flowSet")) {
value <- flowSet_to_cytoset(value)
} else {
stop(
"Data to replace in GatingSet must be either a flowSet or cytoset!"
)
}
}
set_cytoset(x@pointer, value@pointer)
x
})
Expand Down

0 comments on commit 8d75837

Please sign in to comment.