You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When exporting samples with the newish export(..., include_metadata=True) we sometimes experience Exception: REPORT BUG: error calculating text offset.
Code To Reproduce
We take one big FCS files and split it into multiple smaller ones. Every now and then we get the above error. I pickled two affected (sub)samples for a reproducible minimal working example.
In [1]: import pickle
In [2]: import flowkit as fk
In [3]: with open("SDBB030_210_ATVQGQNLK.pkl", 'rb') as fh:
...: sample = pickle.load(fh)
In [4]: sample
Out[4]: Sample(v3.1, None, 60 channels, 6 events)
In [5]: sample.export(export_fcs, source='raw', include_metadata=True)
---------------------------------------------------------------------------
Exception Traceback (most recent call last)
<ipython-input-28-4a3b1964e193> in <module>
----> 1 sample.export(export_fcs, source='raw', include_metadata=True)
~/miniconda3/envs/tetdecon-test/lib/python3.9/site-packages/flowkit/_models/sample.py in export(self, filename, source, exclude_neg_scatter, exclude_flagged, exclude_normal, subsample, include_metadata, directory)
1102 fh = open(output_path, 'wb')
1103
-> 1104 flowio.create_fcs(
1105 fh,
1106 events.flatten().tolist(),
~/miniconda3/envs/tetdecon-test/lib/python3.9/site-packages/flowio/create_fcs.py in create_fcs(file_handle, event_data, channel_names, opt_channel_names, metadata_dict)
312 # verify the final BEGINDATA value == text start position + length of the text string
313 if text_start + len(text_string) != int(text['BEGINDATA']):
--> 314 raise Exception("REPORT BUG: error calculating text offset")
315
316 #
Exception: REPORT BUG: error calculating text offset
Expected behavior
Exporting should work (as it does in most cases)
Desktop (please complete the following information):
Reproduced in multiple OS
OS: Mac OS 12.3.1
Python version 3.9.12
FlowKit version 0.9.0
Additional context
Happy to provide pkl files with affected samples via PM.
The text was updated successfully, but these errors were encountered:
Yep, send me an example and I'll try to figure out what's going on. I put that tripwire exception in there b/c I suspected there may be additional edge cases where the offset needs to be adjusted.
I think I've fixed this in FlowIO. Can you try uninstalling FlowIO and clone the latest master branch of FlowIO to replace it (should be version 1.0.1b0)?
Describe the bug
When exporting samples with the newish
export(..., include_metadata=True)
we sometimes experienceException: REPORT BUG: error calculating text offset
.Code To Reproduce
We take one big FCS files and split it into multiple smaller ones. Every now and then we get the above error. I pickled two affected (sub)samples for a reproducible minimal working example.
Expected behavior
Exporting should work (as it does in most cases)
Desktop (please complete the following information):
Reproduced in multiple OS
Additional context
Happy to provide pkl files with affected samples via PM.
The text was updated successfully, but these errors were encountered: