diff --git a/notebooks/25_sensitivity_peak_2.ipynb b/notebooks/25_sensitivity_peak_2.ipynb index bda7084c..92442019 100644 --- a/notebooks/25_sensitivity_peak_2.ipynb +++ b/notebooks/25_sensitivity_peak_2.ipynb @@ -26,7 +26,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -43,7 +43,6 @@ "from synbio_morpher.utils.misc.units import per_mol_to_per_molecule\n", "from synbio_morpher.utils.common.setup import prepare_config, construct_circuit_from_cfg\n", "from synbio_morpher.utils.data.data_format_tools.common import load_json_as_dict\n", - "from synbio_morpher.utils.circuit.agnostic_circuits.circuit_manager import CircuitModeller\n", "from synbio_morpher.srv.io.manage.script_manager import script_preamble\n", "from synbio_morpher.utils.circuit.agnostic_circuits.circuit_manager import CircuitModeller\n", "from synbio_morpher.utils.misc.type_handling import flatten_listlike\n", diff --git a/run_main.py b/run_main.py index 33dcf410..4f20f588 100644 --- a/run_main.py +++ b/run_main.py @@ -11,7 +11,7 @@ # from synbio_morpher.scripts.ensemble_generate_circuits.run_ensemble_generate_circuits import main # from synbio_morpher.scripts.gather_interaction_stats.run_gather_interaction_stats import main # from synbio_morpher.scripts.mutation_effect_on_interactions_signal.run_mutation_effect_on_interactions_signal import main -# from synbio_morpher.scripts.summarise_simulation.run_summarise_simulation import main +from synbio_morpher.scripts.summarise_simulation.run_summarise_simulation import main # from synbio_morpher.scripts.analyse_mutated_templates.run_analyse_mutated_templates import main # from synbio_morpher.scripts.vis_0_histplots.run_vis_0_histplots import main # from synbio_morpher.scripts.vis_0_histplots_nosig.run_vis_0_histplots_nosig import main @@ -22,7 +22,7 @@ # from synbio_morpher.scripts.vis_3_mutation_types_positions_2.run_vis_3_mutation_types_positions_2 import main # from synbio_morpher.scripts.vis_4_histplots_thresholded.run_vis_4_histplots_thresholded import main # from synbio_morpher.scripts.vis_5_means_analytics.run_vis_5_means_analytics import main -from synbio_morpher.scripts.ensemble_mutation_effect_analysis.run_ensemble_mutation_effect_analysis import main +# from synbio_morpher.scripts.ensemble_mutation_effect_analysis.run_ensemble_mutation_effect_analysis import main # from synbio_morpher.scripts.ensemble_visualisation.run_ensemble_visualisation import main # from synbio_morpher.scripts.parameter_based_simulation.run_parameter_based_simulation import main # from synbio_morpher.scripts.stitch_parameter_grid.run_stitch_parameter_grid import main diff --git a/synbio_morpher/scripts/ensemble_mutation_effect_analysis/configs/test_large_scale.json b/synbio_morpher/scripts/ensemble_mutation_effect_analysis/configs/test_large_scale.json index 2695c36f..776a407a 100644 --- a/synbio_morpher/scripts/ensemble_mutation_effect_analysis/configs/test_large_scale.json +++ b/synbio_morpher/scripts/ensemble_mutation_effect_analysis/configs/test_large_scale.json @@ -62,7 +62,7 @@ "min_num_interacting": 0, "min_num_self_interacting": 0, "max_self_interacting": null, - "max_total": 10000, + "max_total": 20000, "not_in_dirs": [] }, "mutations_args": { @@ -92,7 +92,7 @@ "solver": "diffrax", "use_batch_mutations": true, "interaction_factor": 1, - "batch_size": 1000, + "batch_size": 3000, "max_circuits": 60000, "device": "gpu", "threshold_steady_states": 0.05, diff --git a/synbio_morpher/scripts/ensemble_mutation_effect_analysis/configs/test_small.json b/synbio_morpher/scripts/ensemble_mutation_effect_analysis/configs/test_small.json index 8e56cf03..cc078e82 100644 --- a/synbio_morpher/scripts/ensemble_mutation_effect_analysis/configs/test_small.json +++ b/synbio_morpher/scripts/ensemble_mutation_effect_analysis/configs/test_small.json @@ -16,7 +16,7 @@ }, "molecular_params": "./synbio_morpher/utils/common/configs/RNA_circuit/molecular_params.json", "circuit_generation": { - "repetitions": 300, + "repetitions": 500, "species_count": 3, "sequence_length": 20, "generator_protocol": "random", @@ -94,7 +94,7 @@ "interaction_factor": 1, "batch_size": 800, "max_circuits": 60000, - "device": "cpu", + "device": "gpu", "threshold_steady_states": 0.05, "use_initial_to_add_signal": false, "use_rate_scaling": true, diff --git a/synbio_morpher/scripts/summarise_simulation/configs/base_config.json b/synbio_morpher/scripts/summarise_simulation/configs/base_config.json index f5d9e04b..ef3b916f 100644 --- a/synbio_morpher/scripts/summarise_simulation/configs/base_config.json +++ b/synbio_morpher/scripts/summarise_simulation/configs/base_config.json @@ -4,7 +4,7 @@ }, "source_dirs": { "is_source_dir_incomplete": false, - "source_dir": ["./data/ensemble_mutation_effect_analysis/2023_07_17_105328/mutation_effect_on_interactions_signal"], + "source_dir": ["./data/ensemble_mutation_effect_analysis/2024_11_20_224946/mutation_effect_on_interactions_signal"], "purpose_to_get_source_dir_from": null, "source_dir_actually_used_POSTERITY": null }, diff --git a/synbio_morpher/utils/circuit/agnostic_circuits/circuit_manager.py b/synbio_morpher/utils/circuit/agnostic_circuits/circuit_manager.py index 9b4196ab..35bfef83 100644 --- a/synbio_morpher/utils/circuit/agnostic_circuits/circuit_manager.py +++ b/synbio_morpher/utils/circuit/agnostic_circuits/circuit_manager.py @@ -74,8 +74,13 @@ def __init__(self, result_writer=None, config: dict = {}) -> None: self.debug_mode = config.get('experiment', {}).get('debug_mode', False) self.sim_func = None - jax.config.update('jax_platform_name', config.get( - 'simulation', {}).get('device', 'cpu')) + try: + jax.config.update('jax_platform_name', config.get( + 'simulation', {}).get('device', 'gpu')) + except: + jax.config.update('jax_platform_name', 'cpu') + logging.warning( + 'Could not set device to GPU, defaulting to CPU.') if self.debug_mode: jax.config.update("jax_disable_jit", True) @@ -145,6 +150,7 @@ def write_interactions(self, circuit): return circuit def compute_interactions_batch(self, circuits: List[Circuit], batch=True): + """ This will not work with GPU """ # Make sure multi-threading is on if self.simulator_args['name'] == 'IntaRNA': if self.simulator_args['simulator_kwargs']['threads'] > 1: diff --git a/x_pyproject.toml b/x_pyproject.toml deleted file mode 100644 index 996efb10..00000000 --- a/x_pyproject.toml +++ /dev/null @@ -1,44 +0,0 @@ -[build-system] -requires = ["setuptools>=61.0", "wheel"] -build-backend = "setuptools.build_meta" - -[project] -name = "synbio_morpher" -version = "0.0.886" -# license = LICENSE -authors = [ - { name="Olivia Gallup", email="olivia.gallup@gmail.com" }, -] -description = "Build, simulate, and analyse genetic circuits and the effect of mutations." -readme = "README.md" -requires-python = ">=3.7" -classifiers = [ - "Programming Language :: Python :: 3", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", -] - -[project.urls] -"Homepage" = "https://github.com/olive004/synbio_morpher" -"Bug Tracker" = "https://github.com/olive004/synbio_morpher/issues" - -# [tool.setuptools] -# include-package-data = true -# -# [tool.setuptools.packages.find] -# where = ["synbio_morpher*"] # "synbio_morpher", "utils", "srv", "scripts"] -# include = ["*.py", ".sh", "*.json", "*.md", "*.csv", "*.fasta"] -# exclude = ["__pycache__"] - -# [tool.setuptools.package-data] -# scripts = ["*.md"] #, "*.sh", "*.csv", "*.fasta"] -# utils = ["*.csv", "*.json"] - -[tool.setuptools] -include-package-data = true - -[tool.setuptools.package-data] -synbio_morpher = ["*.py", ".sh", "*.json", "*.md", "*.csv", "*.fasta", ".txt"] -scripts = ["*.py", ".sh", "*.json", "*.md", "*.csv", "*.fasta", ".txt"] -utils = ["*.py", ".sh", "*.json", "*.md", "*.csv", "*.fasta", ".txt"] -srv = ["*.py", ".sh", "*.json", "*.md", "*.csv", "*.fasta", ".txt"] \ No newline at end of file