Git Product home page Git Product logo

Comments (7)

marvinvanaalst avatar marvinvanaalst commented on May 29, 2024 1

I've implemented two variants for this, one working on the model itself, and one as a callback only acting on the optimization model. So far I think both might have their merits, depending on their use context.

This version here acts on the model and will delete reactions in-place:
function knockout!(model::StandardModel, gene_id::String)
function knockout!(model::StandardModel, gene_ids::Array{String})

The other one uses the callback scheme and just sets the upper and lower bound of the corresponding reactions to 0.
function knockout_callback(gene_id::String)
function knockout_callback(gene_ids::Array{String,1})

You can check them both out in d58ef65

from cobrexa.jl.

marvinvanaalst avatar marvinvanaalst commented on May 29, 2024 1

I'm in no way clingy to the name knockout_callback by the way. It could also just be knockout for example, but I get too easily confused when working with similar-sounding functions, so for development I named them like this

from cobrexa.jl.

stelmo avatar stelmo commented on May 29, 2024

I'm in no way clingy to the name knockout_callback by the way. It could also just be knockout for example, but I get too easily confused when working with similar-sounding functions, so for development I named them like this

No problem, but in the merge iteration they should be called knockout! since dispatch will take care of the thinking for you :)

from cobrexa.jl.

marvinvanaalst avatar marvinvanaalst commented on May 29, 2024

But it's not an inplace operation. It returns a function, just like the other callbacks. In all of these cases (change_sense, change_objective, ..), we also (correctly) did not use the !, so I think this would lead to confusion at best.

from cobrexa.jl.

stelmo avatar stelmo commented on May 29, 2024

But it's not an inplace operation. It returns a function, just like the other callbacks. In all of these cases (change_sense, change_objective, ..), we also (correctly) did not use the !, so I think this would lead to confusion at best.

yeah without the ! is better :)

from cobrexa.jl.

exaexa avatar exaexa commented on May 29, 2024

@marvinvanaalst I guess this is now done by merging the knockouts?

from cobrexa.jl.

stelmo avatar stelmo commented on May 29, 2024

@marvinvanaalst I guess this is now done by merging the knockouts?

yes, I think so. Closing!

from cobrexa.jl.

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.