eyurtsev / FlowCytometryTools

A python package for visualization and analysis of high-throughput flow cytometry data
https://eyurtsev.github.io/FlowCytometryTools/
MIT License
113 stars 46 forks source link

Subsampling function not working #27

Closed b-robison closed 3 years ago

b-robison commented 3 years ago

Hello,

I'm struggling to figure out what to provide the subsampling method. From the API documentation it looks like there should be three items fed to the method:

image

However in the source it looks like it wants four items.

image

I'm starting with a 20,000 event FCMeasurement object and I want to subsample 1000 events randomly.

image

Following the API documentation I try:

tsample.subsample(1000, order='random', auto_resize=False)

But I get a TypeError: TypeError: Population must be a sequence or set. For dicts, use list(d).

So trying the four inputs implied by the source code, I get the following error:

image

Would love to get this subsampling feature working. Thanks!

eyurtsev commented 3 years ago

Hi!

As far as I can tell sub-sampling is working properly. (Though the documentation isn't amazing I must admit.)

image

My guess is that there's something else that's wrong in the code...

Regarding 3 vs. 4 parameters -- you should google for what "self" does in python. There are a lot of excellent articles that will explain it better than I can. :) (but you only need to pass 3 parameters, theself` parameter is "auto-filled")