Commit 48687051 authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

Add method to generate a formula whith combinations: negate explicitly other elements in the set

parent 8ef40598
......@@ -32,7 +32,7 @@ t1:
t2:
$(CMD_PYTHON) script_mac.py -vv debug compute_macs bio_models/pid_and_clock.bcx SRP9 --steps 7 --output p2
t3:
$(CMD_PYTHON) script_mac.py -vv debug compute_macs bio_models/pid_or_clock.bcx SRP9 --steps 10 --output p3
$(CMD_PYTHON) script_mac.py -vv debug compute_macs "bio_models/Whole NCI-PID database translated into CADBIOM formalism(and).bcx" SRP9 --all_macs --steps 10 --output p3
t3bis:
$(CMD_PYTHON) script_mac.py -vv info compute_macs "bio_models/Whole NCI-PID database translated into CADBIOM formalism(and).bcx" SRP9 --steps 10 --output p3bis
t4:
......@@ -44,7 +44,7 @@ t6:
t7:
$(CMD_PYTHON) script_mac.py -vv debug compute_macs bio_models/pid_or_clock.bcx CCR5 --steps 7 --output p7
real_study:
$(CMD_PYTHON) script_mac.py -vv info compute_macs "bio_models/Whole NCI-PID database translated into CADBIOM formalism(and).bcx" --input_file --steps 7 --all_macs --input_file bio_models/input_places.txt --combinations
$(CMD_PYTHON) script_mac.py -vv info compute_macs "bio_models/Whole NCI-PID database translated into CADBIOM formalism(and).bcx" --steps 7 --all_macs --input_file bio_models/input_places.txt --combinations
version:
......
......@@ -5,19 +5,14 @@
#$ -cwd
#$ -N cadbiom_analysis_dyliss
#$ -j yes
#$ -pe make 10
# Demande de noeud sur le cluster
#qrsh
# Chargement de python 2
. /softs/local/env/envpython-2.7.sh
. /softs/local/env/envswig.sh
. /softs/local/env/envgcc-5.2.0.sh
. /softs/local/env/envcmake-3.4.3.sh
#. /softs/local/env/envswig.sh
#. /softs/local/env/envcmake-3.4.3.sh
# Chargement de la tâche
......@@ -119,7 +119,7 @@ def main2(chart_file, cam_file, cam_step_file, cam_complete_file, cam_strong_fil
:param arg7: Formula: Property that the solver looks for.
:param arg8: Formula: Original property (constraint) for the solver.
:param arg9: Formula: ???
:param arg10: If set to True (not default), search allways macs with
:param arg10: If set to True (not default), search all macs with
less or equal steps than previous, by limiting steps.
:type arg1: <str>
:type arg2: <str>
......@@ -434,10 +434,26 @@ def compute_combinations(final_properties):
:rtype: <list <str>>
"""
final_properties = set(final_properties)
def get_formula(data):
"""Include all elements in the combinations and exclude explicitely,
all other elements.
"""
negated_places = ' and not '.join(final_properties - data)
return "{}{}{}".format(
' and '.join(data),
' and not ' if negated_places != '' else '',
negated_places
)
all_combinations = list()
for i in range(1, len(final_properties) + 1):
all_combinations.append(
[' and '.join(comb) for comb in it.combinations(final_properties, i)]
{get_formula(set(comb)) for comb in it.combinations(final_properties, i)}
)
# Unpack combinations
......@@ -449,6 +465,7 @@ def compute_combinations(final_properties):
)
LOGGER.info("Number of computed combinations: " + \
str(len(all_combinations)))
return all_combinations
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment