jcrozum / pystablemotifs

Python library for attractor identification and control in Boolean networks
MIT License
28 stars 7 forks source link

Exclude target node in the interventions #91

Closed priyambial123 closed 9 months ago

priyambial123 commented 2 years ago

Hello

I posted this question sometime back, but, I couldn't find the post. How to exclude the target node been updated in the interventions?

For example in the below post, I want to find the conditions which upregulate DCAF5 gene, without being included in the interventions.

import pystablemotifs as sm
import networkx as nx
from timeit import default_timer

relative_path_to_model = r'''D:\Users\Labor\attractors\prenatal_clusters\control_tragets\org_clus1_prenatal.txt'''
primes = sm.format.import_primes(relative_path_to_model,remove_constants=True)
sm.format.pretty_print_prime_rules(primes)

ar = sm.AttractorRepertoire.from_primes(primes)
ar.summary()

target = {'DCAF5':1}

start=default_timer()
interventions = sm.drivers.knock_to_partial_state(target,primes,max_drivers=14)
end=default_timer()
print("Time running method:",end-start)
print("Sets found:")
for x in interventions: 
    print({k:v for k,v in sorted(x.items())})

Thanks

priyambial123 commented 2 years ago

I could find from the previous post to edit as follows: interventions = sm.drivers.knock_to_partial_state(target,primes,max_drivers=14, forbidden=DCAF5)

I have another similar question, if I want to find interventions which lead to oscillatory state of the target. Then, we specify as target = {'DCAF5':0.5}. Is this right?

Thanks

jcrozum commented 2 years ago

Unfortunately, there is not currently any way to specify oscillation as a target, and there are no plans to implement such a feature in the near future.

Instead, it is best to identify an attractor in which the target node oscillates, and use the attractor control methods to fix all the nodes that do not oscillate in that attractor.

jcrozum commented 9 months ago

closing this as out-of-scope