whitews/FlowKit

Counts between analyze_sample and FlowJo output are different

mgratigny opened this issue · 5 comments

Describe the bug
Hi,
I’m trying to a FlowJo workspace to extract counts and relative abundances (fréquemment of parents) as it can be done with FlowJo.
I load a given workspace with associated FCS sample and I execute the tutorial to analyze results as describe in flowkit-tutorial-part06-workspace-class.ipynb on my data.
When I do that, if I compare the count column and results obtains by the biologist, the results are slightly different. Sometime I have the exact value and sometime it is different.
When I look for the content directly inside the .wsp file I show some « count » item inside the « Population » elements.
And example here:

  <Population name="Leukocytes"  annotation=""  owningGroup="All Samples"  expanded="1"  sortPriority="10"  count="90001" >

The Count observe in the XML is the same that FlowJo can export.

Is there a way to collect these counts and associated « frequency of parents » from these Count items ?
Do you know why I observe some differences when I use the « analyze_sample » method ?
Than you very much for your help

Best regards

Code To Reproduce
Code to reproduce the behavior:

import os
import flowkit as fk

sample_path = "./path_to_dir"
wsp_path = os.path.join(sample_path, "file.wsp")
wsp = fk.Workspace(wsp_path, fcs_samples=sample_path)
sample_group='All Samples'
sample_id = "one_sample_selected"
wsp.analyze_samples(sample_group, verbose=True)
results_report = wsp.get_analysis_report(sample_group)
sample_results = wsp.get_gating_results(sample_id)
sample_results.report...

Expected behavior
Is there a way to collect these counts and associated « frequency of parents » from these Count items ?

Desktop (please complete the following information):

  • OS: Mac OS ventura 13.5.1
  • Python 3.11.4
  • FlowIO 1.1.1
  • FlowKit 1.0.1
  • FlowUtils 1.0.0

Hi,

Yes there are differences in some gates between FlowJo & FlowKit as FlowJo processes gates on binned event data. I wrote a more detailed response explaining this here:

#113 (comment)

Hope that helps to explain what is happening,
Scott

Thank you very much for your answer.
Is there a way to extract FlowJo count value from "count" easily using flowkit ?

No, afraid not. The best way to get that data would be from an export of the statistics from FlowJo.

Thank you for your answer and for Flowkit ! It is a great tool !

Thanks for using it and please submit any issues you may find in the future.