Git Product home page Git Product logo

Comments (12)

jairideout avatar jairideout commented on August 30, 2024 2

I think it should be pretty easy to extend, FeatureTable[Composition] just needs to be declared as an allowed semantic type on the method registration.

Currently the method only works with FeatureTable[Frequency]. The filtering methods were originally written with the intention of filtering based on integer counts (i.e. frequencies). If all the filtering operations in that method also make sense for compositional data then 👍 for supporting this table type.

from q2-feature-table.

ebolyen avatar ebolyen commented on August 30, 2024 2

This is also why we don't have something like FeatureTable[Any] if a method did not know about a particular variant, then we don't know for sure if that variants expectations are upheld by the method. So our expectation is that when new types come along, some minor annotation maintenance may be needed.

from q2-feature-table.

jairideout avatar jairideout commented on August 30, 2024 2

There isn't an immediate solution, you would have to duplicate the method at the moment.

I think @mortonjt was describing a workaround where you first filter the FeatureTable[Frequency] using the available filtering methods, and then convert that filtered table into FeatureTable[Composition]. I'm in favor of using that workaround for now since we should have this solved in a general way within the next couple of releases.

from q2-feature-table.

mortonjt avatar mortonjt commented on August 30, 2024 1

That makes sense. Since compositional tables are generated from frequency tables, we can perform the filtering beforehand - so there is an immediate solution already in place. Just curious, what is TypeMap?

from q2-feature-table.

gregcaporaso avatar gregcaporaso commented on August 30, 2024

Is it possible to do this currently? The output type in this case would be dependent on the input type (if FeatureTable[Frequency] is input then FeatureTable[Frequency] would be the output, but if FeatureTable[Composition] is input then FeatureTable[Composition] would be the output), and I thought we couldn't support that at the moment.

from q2-feature-table.

jairideout avatar jairideout commented on August 30, 2024

I think you're right -- @ebolyen can you confirm please?

from q2-feature-table.

ebolyen avatar ebolyen commented on August 30, 2024

@gregcaporaso is right, we need TypeMap to handle this correctly.

from q2-feature-table.

jairideout avatar jairideout commented on August 30, 2024

Thanks for confirming! I guess we'll need to wait on typemap support, or have a separate method to specifically filter compositional tables (as a temporary solution). The underlying filtering code can probably be reused since it just operates on biom.Table objects.

from q2-feature-table.

ebolyen avatar ebolyen commented on August 30, 2024

There isn't an immediate solution, you would have to duplicate the method at the moment. (I'm not even sure what I thought I read, but I'm answering a question that never happened... Sorry!)

TypeMap is supposed to be a type-solver such that you could say:

T = TypeMap({
    FeatureTable[Frequency]: FeatureTable[Frequency],
    FeatureTable[Composition]: FeatureTable[Composition]
}) # A shorthand for just plain remapping would be good

plugin.register_function(foo,
inputs: {'bar': T},
outputs: [('foo', T)],
...)

Given we want to handle things like filtering/merging more generically in QIIME 2 with indexes, it's not clear if it is immediately useful, as those operations would become builtins and wouldn't need a TypeMap

from q2-feature-table.

mortonjt avatar mortonjt commented on August 30, 2024

The TypeMap solution sounds like it could be really nice! Might even be able to resolve the some of the semantic issues withPhylogeny and hierarchical clustering.

from q2-feature-table.

antgonza avatar antgonza commented on August 30, 2024

Just ran into this and agree that will be nice to have.

from q2-feature-table.

lizgehret avatar lizgehret commented on August 30, 2024

Closing this as we don't have a clear plan or goal in mind that warrants adding this as an allowed type to filter features. If something comes up for this though, feel free to open up a new issue @mortonjt!

from q2-feature-table.

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.