pandas-dev / pandas

Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
https://pandas.pydata.org
BSD 3-Clause "New" or "Revised" License
43.45k stars 17.86k forks source link

Support for FCS files #40192

Closed njbradley closed 3 years ago

njbradley commented 3 years ago

Hello! I am working in the scientific community with pandas, and I use it especially with fcs files, a more specialized scientific file format. I have been using my own scripts to convert from fcs to csv, but it would be much easier if I could load and export them directly. I was wondering, if I made a pull request that added this support, would it be accepted? If you guys think it wouldn't fit or be worth adding, then I understand.

Describe the solution you'd like

I was imagining:

pandas.read_fcs(filepath_or_buffer) that returns a new DataFrame DataFrame.to_fcs(filepath_or_buffer) that writes it to the file or buffer.

API breaking implications

I don't see how this would break anything, as it is only adding new functions.

Describe alternatives you've considered

There are other libraries that support fcs files, but all the ones I looked at seem to be pretty big and don't work well with pandas or other libraries. I feel like it would be useful to have it as part of pandas.

Additional context

Again, I am willing to do all of the programming and changes to add this, I just wanted to see if it is a good idea and if it would be accepted.

jreback commented 3 years ago

can u point to something that shows was fcs is?

njbradley commented 3 years ago

Here's a page about fcs files, https://isac-net.org/page/Data-Standards Basically, they are used for the results of flow cytometry experiments and any processing that happens afterwards.

jreback commented 3 years ago

thanks

this is a quite niche format among the ones we support

we rejected adding root quite some time ago

beat to create a package that has your implementation and just exposes read / functions