RGLab / CytoML

A GatingML Interface for Cross Platform Cytometry Data Sharing
GNU Affero General Public License v3.0
29 stars 14 forks source link

"Not the same x,y dimensions in spillover matrix!" error #124

Open timdohm opened 3 years ago

timdohm commented 3 years ago

When trying to load a gating set

> print(my_wsp)
[1] "/Users/timdohm/sci/raw_data/TC001V2/TC001V2_Tfh.wsp"
> test_ws <- open_flowjo_xml(my_wsp)
> print(test_ws)
File location:  /Users/timdohm/sci/raw_data/TC001V2/TC001V2_Tfh.wsp 

Groups in Workspace
         Name Num.Samples
1 All Samples           1
> test_gs <- flowjo_to_gatingset(test_ws, name="All Samples")
Error in (function (ws, group_id, subset, execute, path, cytoset, backend_dir,  : 
  not the same x,y dimensions in spillover matrix!

I get this error. There does not appear to be anything malformed in my workspace, which only contains one sample. 33 other samples (in their own .wsp) load without issue. What is the meaning of this error?

mikejiang commented 3 years ago

It would be helpful to share a reproducible example for troubleshooting.

timdohm commented 3 years ago

Here is a dropbox link: https://www.dropbox.com/s/zt4a4wtve6yzz7a/TC001V2.zip?dl=1 TC001V2_Tfh.wsp, TC001V2_Tcells_sk.wsp, and TC001V2_Th17.wsp all exhibit this behavior when trying to load the gating set.

jacobpwagner commented 3 years ago

@mikejiang, you probably already realized this, but this is possibly related to the issue of adding support for spectral (non-square) compensation matrices that was addressed in the spectral_comp branches across cytolib, flowCore, flowWorkspace, and CytoML. Those were never merged in because they were still experimental.

mikejiang commented 3 years ago

Thanks, @jacobpwagner! Yeah, I was in the process of testing it. Let me know if there is anything that I need to be ware of.

jacobpwagner commented 3 years ago

It was working well in my testing, but I had limited test cases. Compensation sort of stands alone, so hopefully it's not too hard to merge those in even after more recent changes. Otherwise, the real core calculation changes are in this commit, while the rest were mostly just removing the square matrix assumption downstream, so I suppose those parts could be reworked.

Feel free to reach out if you run in to issues. I'd be happy to take a look.

mikejiang commented 3 years ago

Now it should support the non-squared compensation.

> library(CytoML)
> ws <- open_flowjo_xml("~/Downloads/TC001V2/TC001V2_Tfh.wsp")
> gs <- flowjo_to_gatingset(ws, name = 1)
> gs
A GatingSet with 1 samples

You will need to have a clean rebuild (through remote::install_github) the following packages from master branch RProtobufLib cytolib flowWorkspace CytoML