whitews / FlowKit

A Python toolkit for flow cytometry analysis supporting GatingML and FlowJo workspaces
https://flowkit.readthedocs.io
BSD 3-Clause "New" or "Revised" License
153 stars 38 forks source link

Load custom keywords from FlowJo .wsp file #210

Open hclnyrk opened 1 month ago

hclnyrk commented 1 month ago

First of all, thank you for providing this amazing tool!

To help preserve keywords that have been applied to samples within FlowJo, for example Donor Number, Condition, it would very useful if these could be accessed from the imported workspace file via flowkit.workspace() and some function workspace.get_keywords.

The samples could then been grouped based on these keywords in any downstream analysis.

This functionality would offer something similar to CytoML's flowjo_to_gatingset() function in R which allows you to specify keywords.

whitews commented 1 month ago

Hi @hclnyrk,

This functionality is in a standalone function named extract_wsp_sample_data. See the docs for the description and arguments. It's not part of the Workspace class directly but I might add this as an attribute in the next release. Let me know if that's what you are looking for.

Thanks, Scott

hclnyrk commented 1 month ago

Thanks a lot for getting back to me. Yes, that's really helpful!

whitews commented 1 month ago

No problem, happy to help. I'll leave this issue open until the next release. Thinking about it some more, there's no reason this shouldn't be available directly from the Workspace class...it avoids the time-consuming step of having to parse the .wsp file twice. Thanks for your input and for using FlowKit!