Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_singlecell_expression and pop.MFI no longer working #390

Open
bilalmoiz93 opened this issue Aug 19, 2023 · 7 comments
Open

get_singlecell_expression and pop.MFI no longer working #390

bilalmoiz93 opened this issue Aug 19, 2023 · 7 comments

Comments

@bilalmoiz93
Copy link

Hello,

I recently had to reinstall all my R packages. I noticed that with the new Flowcore installation, "get_singlecell_expression" no longer works. In fact, it returns

expression = gs_get_singlecell_expression_by_gate(gs,gateg) # get single cell expression values

.Error: Expected string vector of length 1

likewise
gs_pop_get_stats(gs,gateg,type=pop.MFI)

returns
Null data.table (0 rows and 0 cols)

@DillonHammill
Copy link
Contributor

@bilalmoiz93 can please provide more context on the structure of gateg for troubleshooting? It should be the path of a node contained within the GatingSet and not a gate object.

@bilalmoiz93
Copy link
Author

Yes. Here is an example of my gateg object:

gateg
[1] "/Live/FITC"

It is just the string detailing the node path

@mikejiang
Copy link
Member

mikejiang commented Aug 19, 2023

I can reproduce gs_get_singlecell_expression_by_gate error, gs_pop_get_stats seems to work fine to me though

> library(flowWorkspace)
> dataDir <- system.file("extdata",package="flowWorkspaceData")
> gs_dir <- list.files(dataDir, pattern = "gs_manual",full = TRUE)
> gs <- load_gs(gs_dir)
> gs_pop_get_stats(gs,"CD3+",type=pop.MFI)
                    sample  pop CD4 PcpCy55 CD38 APC CD8 APCH7 CD3 V450 HLA-DR V500  CCR7 PE CD45RA PECy7
1: CytoTrol_CytoTrol_1.fcs CD3+    2956.116 1799.201  1423.677 2621.537    1632.492 2089.478     2178.737
> mat <- gs_get_singlecell_expression_by_gate(gs, "CD3+")
.Error: Expected string vector of length 1

@bilalmoiz93
Copy link
Author

Thank you. I was also able to get the gs_pop_get_stats to work with the example you provided.

I dug into the code a bit more and it looks like my desc column is null whereas this is filled out for the relevant fields in your gating set. I think this might be the issue with my pop.MFI return. I will try it after adding descriptions and report back shortly.

@bilalmoiz93
Copy link
Author

bilalmoiz93 commented Aug 19, 2023

actually i'm not sure how to edit the description. Is there a quick way to do this retroactively after importing the flow set/building gating set?

@bilalmoiz93
Copy link
Author

Ok that appeared to be the issue. I'm not sure why there is no description when reading it in. I tried reading it in

fs <- read.flowSet(path=folder,pattern=".fcs",alter.names=T,description = desc)

but that did not work.

Instead, I used the following code to remove all non-flourescent channels and then manually alter the description parameter. This worked for me and I was able to get MFI values when using gs_pop_get_stats(gs,gateg,pop.MFI)

desc = colnames(fs)
desc = replace(desc,grepl('SSC',desc,fixed=TRUE),NA)
desc = replace(desc,grepl('FSC',desc,fixed=TRUE),NA)
desc = replace(desc,grepl('Time',desc,fixed=TRUE),NA)

for (f in 1:length(fs)){
pData(parameters(fs[[f]]))$desc = desc

}

mikejiang pushed a commit that referenced this issue Aug 20, 2023
mikejiang added a commit that referenced this issue Aug 20, 2023
* re store test

* fix cpp11 string conversion #390

* comment out broken test

* bump

---------

Co-authored-by: mikejiang <mike@ozette.ai>
@mikejiang
Copy link
Member

fixed by #391
install latest devel branch and give it a try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants