Giter Site home page Giter Site logo

Comments (4)

eyurtsev avatar eyurtsev commented on August 20, 2024

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

from flowcytometrytools.

dmoccia avatar dmoccia commented on August 20, 2024

No problem on the report, nice looking library. I will try the custom transforms out.

from flowcytometrytools.

dmoccia avatar dmoccia commented on August 20, 2024

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 # the -1 below because the channel numbers begin from 1 instead of 0 # (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

from flowcytometrytools.

eyurtsev avatar eyurtsev commented on August 20, 2024

Thanks for looking into this... This commit should fix the issue:

44e8352

from flowcytometrytools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.