RGLab / flowWorkspace

flowWorkspace
GNU Affero General Public License v3.0
45 stars 21 forks source link

add convenient gs accessors to the underlying cytodata #338

Closed mikejiang closed 4 years ago

mikejiang commented 4 years ago

Here are some new gs APIs added ,mainly by forwarding to the underlying cytoset's APIs as the shortcut to the xxx(gs_cyto_data(gs))

Get the backend dir

> gs <- GatingSet(GvHD[1:2])
> gs_get_uri(gs)
[1] "/tmp/RtmpS8EsEy/file15a03c516747/bc114227-bfc8-42d5-86df-d15b7f767bba"

return the cell counts

> nrow(gs)
$s5a01
[1] 3420

$s5a02
[1] 3405

Extract the individual cytoframe

> gs_get_cytoframe(gs, 1)
cytoframe object 's5a01.fcs'
with 3420 cells and 8 observables:
     name              desc range minRange maxRange
$P1 FSC-H        FSC-Height  1022        0     1022
$P2 SSC-H        SSC-Height  1022        0     1022
...

row-wise subsetting

> Subset(gs, sampleFilter(10))
A GatingSet with 2 samples
> gs <- Subset(gs, sampleFilter(10))
> nrow(gs)
$s5a01
[1] 10

$s5a02
[1] 10