RGLab / flowWorkspace

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

gs_get_singlecell_expression_by_gate error #329

Closed mikejiang closed 4 years ago

mikejiang commented 4 years ago

I’m currently working with flowWorkspace and I’m trying to use gs_get_singlecell_expression_by_gate

nodes1<- c("mono", "gran", "B", "NK","CD4+", "CD8+", "CD45+") gs_get_singlecell_expression_by_gate(gs[1],nodes1)

Error in .cpp_getSingleCellExpressionByGate(x@pointer, sample, markers_pops, : NA not found!

Margaret Cui

mikejiang commented 4 years ago

It is because gs_get_singlecell_expression_by_gate tries to retrieve the markers that are associated with the gates. And CD45+ gate is defined on SSC-A, which doesn't have marker.

gh_pop_get_gate(gs[[1]], "CD45+")
Polygonal gate 'CD45+' with 5 vertices in dimensions Alexa Fluor 405-A and SSC-A

This why it reports NA error.

mlcui commented 4 years ago

Does this mean there is another method to retrieve SSC-A and FSC-A data? It would be useful to help differentiate cell populations with size and granularity on a tSNE plot.

gfinak commented 4 years ago

A workaround is to put a markername in the SSC-A channel.

mikejiang commented 4 years ago

We can probably do that automatically within the gs_get_singlecell_expression_by_gate call

mikejiang commented 4 years ago

Here is the result after the patch,

 testData<-gs_get_singlecell_expression_by_gate(gs[1],nodes1)
.
> head(testData[[1]])
          CD14    CD11b     CD16     CD20 CD4 CD8     CD45     SSC-A
[1,] 0.0000000 0.000000 0.000000 0.000000   0   0 3.984200  12014.69
[2,] 0.0000000 0.000000 0.000000 0.000000   0   0 3.801033  34185.41
[3,] 0.0000000 0.000000 1.039903 2.586087   0   0 3.737607  71270.02
mlcui commented 4 years ago

Thanks Mike!