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

After cytoqc, error in CytoML::flowjo_to_gatingset (missing compensation parameter) #6

Open
PedroMilanezAlmeida opened this issue Apr 19, 2021 · 5 comments

Comments

@PedroMilanezAlmeida
Copy link

PedroMilanezAlmeida commented Apr 19, 2021

@gfinak and @mikejiang, great package, thanks for making it publicly available!

Our wet-lab collaborators acquired some samples with and others without an open autofluorescence channel.

I was able to clean up the dataset with cytoqc (amazing btw!) but now when I try to open their FlowJo workspace, I get the following error:

gs <- CytoML::flowjo_to_gatingset(ws,
                                   name = 1,
                                   subset = basename(sampleFCS_path),
                                   extend_val = -Inf,
                                   cytoset = cs,
                                   additional.sampleID = TRUE)

Error in (function (ws, group_id, subset, execute, path, cytoset, backend_dir,  : 
  compensation parameter 'AF-A' not found in cytoframe parameters!

How would you guys go about editing the compensation matrices now?

Any help would be much appreciated, thanks in advance!

@mikejiang
Copy link
Member

You can pass a custom compensation through compensation argument to skip flowjo's compensation.
see details from ?flowjo_to_gatingset

@PedroMilanezAlmeida
Copy link
Author

Sounds good, thank you!

@Biomiha
Copy link

Biomiha commented Jun 25, 2022

Hi @mikejiang,

Can I hijack this issue please since I am getting the same error? I think the cause of my issue is that I have got a discrepancy between the channel names in my cytoframe and my workspace. After running cytoqc to match the channels, I have the following:

cs <- cytoset(cqc_data)
cytoqc::cf_get_panel(cs[[16]])
# A tibble: 36 × 2
   channel    marker      
   <chr>      <chr>       
 1 FSC-A      NA          
 2 FSC-H      NA          
 3 FSC-W      NA          
 4 SSC-A      NA          
 5 SSC-H      NA          
 6 SSC-W      NA          
 7 V 431/28-A CD1 BV421
 8 V 525/50-A CD2 BV480  
 9 V 586/15-A CD3 V575    
10 V 605/40-A CD4 BV605 
# … with 26 more rows

Note that the channel names contain a / (slash).
If I try to parse the flowjo workspace to a gatingSet I still get the following error:

flowjo_to_gatingset(ws, 7, cytoset = cs, compensation = comp) # *see below for details on how I obtained `comp`

Error in (function (ws, group_id, subset, execute, path, cytoset, backend_dir,  : 
  compensation parameter 'B 530_30-A' not found in cytoframe parameters!

Note that here the parameter contains an _ (underscore). I presume flowjo automatically corrected the illegal character / to a _ in the worskpace creating the discrepancy.

If I change the execute argument to FALSE I can parse it just fine but obviously this doesn't transform and compensate properly.

gs <- flowjo_to_gatingset(ws, 7, cytoset = cs, execute = FALSE)
gs
A GatingSet with 6 samples

* I used this gs to extract the compensation matrix comp

comp <- gs_get_compensations(gs)

What would be the easiest / quickest way to correct the illegal characters in the channel names?

Many thanks in advance and thanks again for both the really useful packages and the prompt responses to the issues.
Best wishes,
Miha

@mikejiang
Copy link
Member

how about colnames(cs) <- gsub("/", "_", colnames(cs))

@Biomiha
Copy link

Biomiha commented Jun 27, 2022

Thanks @mikejiang. That now works!

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