Murali-group / BoolODE

Git Repo for simulating Boolean Models
GNU General Public License v3.0
32 stars 15 forks source link

Simulate Perturbations #20

Open aminjaber opened 1 year ago

aminjaber commented 1 year ago

Let me start by congratulating you on this great simulation tool! So as the title suggests, is there a way to simulate a knockdown or knockout in BoolODE? In a related fashion, is there a way to set the boolean function of a gene to True or False and not make it a function of the other genes?

amoghpj commented 1 year ago

Thank you for using BoolODE and for your feedback! I apologize for the late reply, I was traveling.

Your suggestion is very interesting, and I'll start by answering your second question: we currently do not support "constitutive" genes that are always ON or OFF. The purpose of BoolODE was to simply generate expression datasets for BEELINE. What you are suggesting allows for a deeper exploration of the effects of network perturbation. @tmmurali this can be an interesting standalone project if anyone is interested.

Some notes on simulating knockout-knockdowns in the current framework:

  1. The major challenge to having constitutive nodes in BoolODE is the assumption that each node is "regulated" by at least one node. We can achieve this right now by imposing a fake self interaction x -> x, and then setting the initial condition of that variable to 1 (constitutive ON), or 0 (constitutive OFF or knockout). This will ensure that the node does not respond to any other node in the network. The advantage of this method is that a user can generate all possible "knockouts" or constitutive genes automatically by simply reading in the rule file and generating a series of altered networks programmatically. I can spell this out in more detail if required.
  2. Knockdowns need to be investigated carefully. By default, BoolODE allows for the definition of "strengths" of interaction in the model definition. This parameter alters the regulatory strength of interaction between two transcription factors. However, this definition is only applicable to a single "edge" in the Boolean network. A true knockdown will have the effect of affecting all edges from a given node. Currently, this can only be achieved by specifying strengths for each target of the gene that is knocked-down. It is possible to automate this as well by reading in the rule file, parsing the list of targets, and then automatically creating a _strength file to reflect those interactions.

I am happy to help guide anyone who is interested in pursuing these directions! Please feel free to add on to this discussion with more thoughts/suggestions.

aminjaber commented 1 year ago

Thank you for your response! I've been going through the code and the various configuration options in "config-files/example-config.yaml" during the past two weeks, and I came across the configuration option "parameter_inputs" which according to the documentation:

A Parameter input is some node in the Boolean network that has a fixed value, say constitutively ON or OFF. These are identified as the nodes with no corresponding Boolean rules

This seems like an exact implementation of a gene knockout unless I'm mistaken. I also tracked the code and there is a routine to parse such an option and read the parameter inputs. Running this option did not work initially but then it did after fixing the following two bugs:

1- The code (run_experiment.py -- line 229) uses parameter_inputs_path instead of parameter_inputs to access the configuration option.

2- The if condition in line 115 of model_generator.py always evaluates to false. A quick fix is to have n in self.parameterInputsDF['Input'].unique() instead of n in self.parameterInputsDF['Input']

I would appreciate your feedback on the above, especially if you think I misundertood this configuration option.

amoghpj commented 1 year ago

Ah I misunderstood your question. Yes, if a given gene network has nodes that do not have inputs, they are treated as you noted. My understanding of a "perturbation" is to take a given defined network and then systematically set each gene ON or OFF. To clarify, as long as you can produce the relevant input model files, you can use this feature to model knockouts and constitutive genes.

1- The code (run_experiment.py -- line 229) uses parameter_inputs_path instead of parameter_inputs to access the configuration option.

2- The if condition in line 115 of model_generator.py always evaluates to false. A quick fix is to have n in self.parameterInputsDF['Input'].unique() instead of n in self.parameterInputsDF['Input']

Thanks for your help with fixing these issues! Could you please create a pull request with the modifications? That way I can attribute the bug fixes to you. Thanks again for this!

Can you provide some more details on how you hope to use the gene perturbations? I am curious about the size of the networks you are simulating, and your overall strategy to interrogate systematic perturbations.