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

Perform Automatic Compensation #19

Closed
NTNguyen13 opened this issue Feb 18, 2019 · 7 comments
Closed

Perform Automatic Compensation #19

NTNguyen13 opened this issue Feb 18, 2019 · 7 comments

Comments

@NTNguyen13
Copy link

Good morning, I have the FCS files from FlowCAP-II AML: https://flowrepository.org/id/FR-FCM-ZZYA

I wonder how can I perform automatic compensation by using FlowKit, I have tried the Flowultils compensate method but it didn't work

@whitews
Copy link
Owner

whitews commented Feb 18, 2019

Hi,

By automatic, do you mean using the embedded spillover matrix in each file?

@NTNguyen13
Copy link
Author

Yes, I mean so.

I found that when I read the FCS file by FlowKit and check the _raw_events and _comp_events, they are the same, so I think the data is not compensated. And also this value is different comparing with the data parsed from flowCore(R) or FlowCytometryTools(Python)

@whitews
Copy link
Owner

whitews commented Mar 1, 2019

Hi, sorry for the delay on this, I caught a bad cold and have been MIA.

So I downloaded 0001.FCS from the flow repository you linked to, but the FCS file doesn't appear to have an internal compensation matrix. There are a lot of files in that repo, can you list a few of the files that do have spill values? I'll grab those and test. Thanks!

@NTNguyen13
Copy link
Author

So sorry for late reply. I have checked the files from the repo, they don't contain the spillover matrix :( But I still wonder why the data have different values compare with the values from other packages

@whitews
Copy link
Owner

whitews commented Mar 12, 2019

No worries. One possibility for the difference is that FlowKit takes into account the gain and display metadata for each channel. When developing this library I use the GatingML 2.0 compliance data for testing and validation, ensuring that the results exactly match the compliance data ground truth. This is the only pre-processing the Sample performs on an FCS file.

So, the _raw_events are not the actual original list mode values stored in the FCS file. Perhaps this should be changed to allow users to get the unprocessed data as well? I'll think about that some more.

To check whether this is the case, let's use 0001.FCS as an example. Debugging the Sample constructor prior to the correction, the first event has these original values:

[427., 402., 0., 149., 660., 59., 0.]

After correction, the raw event data for this first event becomes:

[85.4, 3.8072593, 0.1024, 0.39113908, 38.76367615, 0.17408795, 0.1024]

Can you check this first event's values in the other libraries you are using and see if they match the original values I extracted?

@NTNguyen13
Copy link
Author

Yes, the data that I got from other libraries matched with the values prior to correction

@whitews
Copy link
Owner

whitews commented Apr 17, 2019

@NTNguyen13

Latest commit allows retrieval of original FCS events via get_orig_events method in Sample class. Closing this issue.

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

2 participants