Closed dmoccia closed 7 years ago
thanks for reporting this looks like something is passing an extra 'd' argument down the road
in the meantime you can define your own custom transformations if you need a workaround
http://eyurtsev.github.io/FlowCytometryTools/gallery.html#custom-transformations
No problem on the report, nice looking library. I will try the custom transforms out.
I believe I figured out why this issue is happening. In your FCMeasurement.tranform method you have the following code
`if isinstance(transform, Transformation): transformer = transform else: if auto_range: # determine transformation range if 'd' in kwargs: warnings.warn( 'Encountered both auto_range=True and user-specified range value in ' 'parameter d.\n Range value specified in parameter d is used.') else: print "in else" channel_meta = self.channels
# (this is fragile code)
ranges = [float(r['$PnR']) for i, r in channel_meta.iterrows() if
self.channel_names[i - 1] in channels]
if not np.allclose(ranges, ranges[0]):
raise Exception("""Not all specified channels have the same data range,
therefore they cannot be transformed together.\n
HINT: Try transforming one channel at a time.
You'll need to provide the name of the channel in the transform.""")
kwargs['d'] = np.log10(ranges[0])`
Specifically the "isinstance" check is not working and therefore everything (linear, hlog, tlog, etc) is falling through to the final line kwargs['d'] = np.log10(ranges[0])
In this case d will always be 'd': 5.4185399219516617
and therefore for hlog, tlog this is not an issue (except if you want to use another d), and linear and glog it is an issue since neither take d as an argument. I do not use isinstance that often unless referring to built in types so I am not familiar with how to properly use it in a custom class. Probably not the most elegant solution but perhaps a simple function in the transforms.py code which allows you to check from a list?
Let me know if you need any more info
Thanks for looking into this... This commit should fix the issue:
https://github.com/eyurtsev/FlowCytometryTools/commit/44e83526e975279bfd61aca58485e95869c4f47b
Not sure if I am calling this incorrectly but I tried the following two transforms:
but I am getting back (after stack trace attached) stacktrace.txt
linear() got an unexpected keyword argument 'd'
I checked the code itself and looked like these were acceptable arguments, can you confirm?Thank you