diff --git a/README.md b/README.md index 1ce6cdc..151d883 100644 --- a/README.md +++ b/README.md @@ -12,11 +12,11 @@ conda >= v22 through [Anaconda](https://docs.anaconda.com/free/anaconda/install/ ## Installing -```python +```shell ## Installation # Create and activate virtual environment. This is recommended to avoid conflict in dependencies. -conda create -y -n dissect python=3.8 +conda create -y -n dissect python=3.9 conda activate dissect # Clone DISSECT @@ -37,11 +37,30 @@ cd DISSECT/tutorials ## Launch jupyter lab jupyter notebook +``` +## GPU usage +By default, tensorflow-gpu which is installed while installed DISSECT works as long as appropriate CUDA driver is installed. DISSECT uses tensorflow-gpu version 2.7.0 with CUDA 11.2 and cuDNN 8.1. The available devices to tensorflow can be checked as below. + +```python +import tensorflow as tf +gpus = tf.config.list_physical_devices("GPU") +print(gpus) + +``` +This will output a list of the available GPU devices as the output below where we have 1 GPU available. +``` +[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')] +``` +In case there are multiple GPUs available, a particular GPU can be set by, + +```python +gpu_number = 0 # Using only the first GPU +tf.config.experimental.set_visible_devices(gpus[gpu_number], 'GPU') ``` ## Tutorials Interactive tutorials including required data are available as part of this repository at [Tutorials](https://github.com/imsb-uke/DISSECT/tree/main/tutorials). -1. expanded_tutorial.ipynb: Step by step deconvolution -2. minimal_tutorial.ipynb: Complete deconvolution from a single configuration file using minimal steps of code +1. expanded_tutorial.ipynb: Step by step deconvolution for bulk +2. expanded_tutorial_spatial.ipynb: Step by step deconvolution of spatial transcriptomics data (10x Visium) To get answers quickly for a problem or feature request, please open an issue. diff --git a/dissect/PropsSimulator/simulator.c b/dissect/PropsSimulator/simulator.c index cf30135..05ab7d1 100644 --- a/dissect/PropsSimulator/simulator.c +++ b/dissect/PropsSimulator/simulator.c @@ -1472,6 +1472,7 @@ static const char __pyx_k_MT[] = "MT-"; static const char __pyx_k__4[] = "*"; static const char __pyx_k_ad[] = "ad"; static const char __pyx_k_ax[] = "ax"; +static const char __pyx_k_ha[] = "ha"; static const char __pyx_k_mt[] = "mt"; static const char __pyx_k_np[] = "np"; static const char __pyx_k_os[] = "os"; @@ -1522,7 +1523,6 @@ static const char __pyx_k_test[] = "__test__"; static const char __pyx_k_tmp1[] = "tmp1"; static const char __pyx_k_tqdm[] = "tqdm"; static const char __pyx_k_type[] = "type"; -static const char __pyx_k_Count[] = "Count"; static const char __pyx_k_adata[] = "adata"; static const char __pyx_k_array[] = "array"; static const char __pyx_k_batch[] = "batch"; @@ -1542,6 +1542,7 @@ static const char __pyx_k_numpy[] = "numpy"; static const char __pyx_k_print[] = "print"; static const char __pyx_k_props[] = "props"; static const char __pyx_k_range[] = "range"; +static const char __pyx_k_right[] = "right"; static const char __pyx_k_round[] = "round"; static const char __pyx_k_shape[] = "shape"; static const char __pyx_k_tight[] = "tight"; @@ -1571,6 +1572,7 @@ static const char __pyx_k_scdata[] = "scdata"; static const char __pyx_k_shutil[] = "shutil"; static const char __pyx_k_sparse[] = "sparse"; static const char __pyx_k_unique[] = "unique"; +static const char __pyx_k_xticks[] = "xticks"; static const char __pyx_k_ylabel[] = "ylabel"; static const char __pyx_k_AnnData[] = "AnnData"; static const char __pyx_k_anndata[] = "anndata"; @@ -1598,6 +1600,7 @@ static const char __pyx_k_min_expr[] = "min_expr"; static const char __pyx_k_n_sparse[] = "n_sparse"; static const char __pyx_k_no_keeps[] = "no_keeps"; static const char __pyx_k_qualname[] = "__qualname__"; +static const char __pyx_k_rotation[] = "rotation"; static const char __pyx_k_sc_adata[] = "sc_adata"; static const char __pyx_k_simulate[] = "simulate"; static const char __pyx_k_strftime[] = "strftime"; @@ -1679,15 +1682,12 @@ static const char __pyx_k_Simulate_st_initialize[] = "Simulate_st.initialize"; static const char __pyx_k_Simulate_st_preprocess[] = "Simulate_st.preprocess"; static const char __pyx_k_Simulate_generate_props[] = "Simulate.generate_props"; static const char __pyx_k_boxplot_props_sparse_pdf[] = "boxplot_props_sparse.pdf"; -static const char __pyx_k_boxplot_ncells_sparse_pdf[] = "boxplot_ncells_sparse.pdf"; static const char __pyx_k_Simulate_st_generate_props[] = "Simulate_st.generate_props"; static const char __pyx_k_boxplot_props_complete_pdf[] = "boxplot_props_complete.pdf"; static const char __pyx_k_generate_component_figures[] = "generate_component_figures"; static const char __pyx_k_Simulate_simulate_per_batch[] = "Simulate.simulate_per_batch"; -static const char __pyx_k_boxplot_ncells_complete_pdf[] = "boxplot_ncells_complete.pdf"; static const char __pyx_k_scatterplot_pca_simulated_pdf[] = "scatterplot_pca_simulated.pdf"; static const char __pyx_k_Simulate_st_simulate_per_batch[] = "Simulate_st.simulate_per_batch"; -static const char __pyx_k_Counts_of_cell_types_in_generate[] = "Counts of cell-types in generated samples"; static const char __pyx_k_Number_of_batches_in_single_cell[] = "Number of batches in single-cell data is 1. If this is incorrect, please specify name of the batch column as in the single-cell data object (.obs)"; static const char __pyx_k_Proportions_of_cell_types_in_gen[] = "Proportions of cell-types in generated samples"; static const char __pyx_k_Specified_experiment_folder_alre[] = "Specified experiment_folder {} already exists. Creating a new folder with name {}."; @@ -1696,8 +1696,6 @@ static const char __pyx_k_scatterplot_pca_simulated_cellty[] = "scatterplot_pca_ static const char __pyx_k_dissect_PropsSimulator_simulator_2[] = "dissect/PropsSimulator/simulator.pyx"; static PyObject *__pyx_n_s_AnnData; static PyObject *__pyx_n_s_Celltype; -static PyObject *__pyx_n_s_Count; -static PyObject *__pyx_kp_s_Counts_of_cell_types_in_generate; static PyObject *__pyx_n_s_DataFrame; static PyObject *__pyx_kp_s_MT; static PyObject *__pyx_kp_s_Number_of_batches_in_single_cell; @@ -1737,8 +1735,6 @@ static PyObject *__pyx_n_s_batch_col; static PyObject *__pyx_n_s_batches; static PyObject *__pyx_n_s_bbox_inches; static PyObject *__pyx_n_s_boxplot; -static PyObject *__pyx_kp_s_boxplot_ncells_complete_pdf; -static PyObject *__pyx_kp_s_boxplot_ncells_sparse_pdf; static PyObject *__pyx_kp_s_boxplot_props_complete_pdf; static PyObject *__pyx_kp_s_boxplot_props_sparse_pdf; static PyObject *__pyx_n_s_bulk; @@ -1793,6 +1789,7 @@ static PyObject *__pyx_n_s_fraction; static PyObject *__pyx_n_s_generate_component_figures; static PyObject *__pyx_n_s_generate_props; static PyObject *__pyx_n_s_genes; +static PyObject *__pyx_n_s_ha; static PyObject *__pyx_n_s_heg; static PyObject *__pyx_n_s_highly_variable_genes; static PyObject *__pyx_n_s_i; @@ -1873,6 +1870,8 @@ static PyObject *__pyx_n_s_range; static PyObject *__pyx_n_s_read; static PyObject *__pyx_n_s_reference; static PyObject *__pyx_n_s_replace; +static PyObject *__pyx_n_s_right; +static PyObject *__pyx_n_s_rotation; static PyObject *__pyx_n_s_round; static PyObject *__pyx_n_s_s; static PyObject *__pyx_n_s_sample; @@ -1926,6 +1925,7 @@ static PyObject *__pyx_n_s_var_names; static PyObject *__pyx_n_s_var_names_make_unique; static PyObject *__pyx_n_s_w; static PyObject *__pyx_n_s_write; +static PyObject *__pyx_n_s_xticks; static PyObject *__pyx_n_s_ylabel; static PyObject *__pyx_n_s_zeros; static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate___init__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */ @@ -1949,8 +1949,10 @@ static PyObject *__pyx_int_0; static PyObject *__pyx_int_1; static PyObject *__pyx_int_5; static PyObject *__pyx_int_6; +static PyObject *__pyx_int_10; static PyObject *__pyx_int_12; static PyObject *__pyx_int_42; +static PyObject *__pyx_int_45; static PyObject *__pyx_int_200; static PyObject *__pyx_int_1000; static PyObject *__pyx_slice_; @@ -4383,7 +4385,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_4genera * ax = plt.boxplot(self.props_complete, labels=self.celltypes) # * plt.ylabel("Proportion") # <<<<<<<<<<<<<< * plt.title("Proportions of cell-types in generated samples") - * plt.savefig( + * if self.n_celltypes>10: */ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_plt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); @@ -4411,8 +4413,8 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_4genera * ax = plt.boxplot(self.props_complete, labels=self.celltypes) # * plt.ylabel("Proportion") * plt.title("Proportions of cell-types in generated samples") # <<<<<<<<<<<<<< - * plt.savefig( - * os.path.join(self.simulation_folder, "boxplot_props_complete.pdf") + * if self.n_celltypes>10: + * plt.xticks(rotation=45, ha="right") */ __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_plt); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 110, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); @@ -4439,32 +4441,78 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_4genera /* "dissect/PropsSimulator/simulator.pyx":111 * plt.ylabel("Proportion") * plt.title("Proportions of cell-types in generated samples") + * if self.n_celltypes>10: # <<<<<<<<<<<<<< + * plt.xticks(rotation=45, ha="right") + * plt.savefig( + */ + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_int_10, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_4) { + + /* "dissect/PropsSimulator/simulator.pyx":112 + * plt.title("Proportions of cell-types in generated samples") + * if self.n_celltypes>10: + * plt.xticks(rotation=45, ha="right") # <<<<<<<<<<<<<< + * plt.savefig( + * os.path.join(self.simulation_folder, "boxplot_props_complete.pdf") + */ + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_plt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_xticks); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rotation, __pyx_int_45) < 0) __PYX_ERR(0, 112, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ha, __pyx_n_s_right) < 0) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + + /* "dissect/PropsSimulator/simulator.pyx":111 + * plt.ylabel("Proportion") + * plt.title("Proportions of cell-types in generated samples") + * if self.n_celltypes>10: # <<<<<<<<<<<<<< + * plt.xticks(rotation=45, ha="right") + * plt.savefig( + */ + } + + /* "dissect/PropsSimulator/simulator.pyx":113 + * if self.n_celltypes>10: + * plt.xticks(rotation=45, ha="right") * plt.savefig( # <<<<<<<<<<<<<< * os.path.join(self.simulation_folder, "boxplot_props_complete.pdf") * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_plt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_plt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_savefig); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_savefig); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 113, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":112 - * plt.title("Proportions of cell-types in generated samples") + /* "dissect/PropsSimulator/simulator.pyx":114 + * plt.xticks(rotation=45, ha="right") * plt.savefig( * os.path.join(self.simulation_folder, "boxplot_props_complete.pdf") # <<<<<<<<<<<<<< * ) - * fig = plt.figure() + * */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 112, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; __pyx_t_9 = 0; @@ -4481,7 +4529,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_4genera #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_5, __pyx_kp_s_boxplot_props_complete_pdf}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -4490,14 +4538,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_4genera #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_5, __pyx_kp_s_boxplot_props_complete_pdf}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -4508,324 +4556,108 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_4genera __Pyx_GIVEREF(__pyx_kp_s_boxplot_props_complete_pdf); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_9, __pyx_kp_s_boxplot_props_complete_pdf); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10); + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6); if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); + __Pyx_DECREF_SET(__pyx_t_6, function); } } - __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_2); + __pyx_t_10 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 111, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "dissect/PropsSimulator/simulator.pyx":114 - * os.path.join(self.simulation_folder, "boxplot_props_complete.pdf") - * ) - * fig = plt.figure() # <<<<<<<<<<<<<< - * ax = plt.boxplot(self.cells_complete, labels=self.celltypes) - * plt.ylabel("Count") - */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_plt); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_figure); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 114, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_fig, __pyx_t_6); - __pyx_t_6 = 0; - - /* "dissect/PropsSimulator/simulator.pyx":115 - * ) - * fig = plt.figure() - * ax = plt.boxplot(self.cells_complete, labels=self.celltypes) # <<<<<<<<<<<<<< - * plt.ylabel("Count") - * plt.title("Counts of cell-types in generated samples") - */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_plt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_boxplot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells_complete); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_labels, __pyx_t_7) < 0) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 115, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF_SET(__pyx_v_ax, __pyx_t_7); - __pyx_t_7 = 0; - - /* "dissect/PropsSimulator/simulator.pyx":116 - * fig = plt.figure() - * ax = plt.boxplot(self.cells_complete, labels=self.celltypes) - * plt.ylabel("Count") # <<<<<<<<<<<<<< - * plt.title("Counts of cell-types in generated samples") - * plt.savefig( - */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_plt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ylabel); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 116, __pyx_L1_error) + if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 113, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_6)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_6); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - } - } - __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_6, __pyx_n_s_Count) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_n_s_Count); - __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 116, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "dissect/PropsSimulator/simulator.pyx":117 - * ax = plt.boxplot(self.cells_complete, labels=self.celltypes) - * plt.ylabel("Count") - * plt.title("Counts of cell-types in generated samples") # <<<<<<<<<<<<<< - * plt.savefig( - * os.path.join(self.simulation_folder, "boxplot_ncells_complete.pdf") - */ - __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_plt); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_title); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) { - __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_6); - if (likely(__pyx_t_10)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6); - __Pyx_INCREF(__pyx_t_10); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_6, function); - } - } - __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_10, __pyx_kp_s_Counts_of_cell_types_in_generate) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_s_Counts_of_cell_types_in_generate); - __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 117, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "dissect/PropsSimulator/simulator.pyx":118 - * plt.ylabel("Count") - * plt.title("Counts of cell-types in generated samples") - * plt.savefig( # <<<<<<<<<<<<<< - * os.path.join(self.simulation_folder, "boxplot_ncells_complete.pdf") - * ) - */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_plt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_savefig); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - - /* "dissect/PropsSimulator/simulator.pyx":119 - * plt.title("Counts of cell-types in generated samples") - * plt.savefig( - * os.path.join(self.simulation_folder, "boxplot_ncells_complete.pdf") # <<<<<<<<<<<<<< - * ) - * - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = NULL; - __pyx_t_9 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - __pyx_t_9 = 1; - } - } - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_8, __pyx_kp_s_boxplot_ncells_complete_pdf}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_8, __pyx_kp_s_boxplot_ncells_complete_pdf}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - } else - #endif - { - __pyx_t_1 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_GIVEREF(__pyx_t_8); - PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_9, __pyx_t_8); - __Pyx_INCREF(__pyx_kp_s_boxplot_ncells_complete_pdf); - __Pyx_GIVEREF(__pyx_kp_s_boxplot_ncells_complete_pdf); - PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_9, __pyx_kp_s_boxplot_ncells_complete_pdf); - __pyx_t_8 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 119, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_10); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_10, function); - } - } - __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_6); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 118, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - - /* "dissect/PropsSimulator/simulator.pyx":122 * ) * * self.props = np.concatenate([self.props_complete, self.props_sparse], axis=0) # <<<<<<<<<<<<<< * self.cells = np.concatenate([self.cells_complete, self.cells_sparse], axis=0) * */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props_complete); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props_complete); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GIVEREF(__pyx_t_7); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); - __Pyx_GIVEREF(__pyx_t_6); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_6); - __pyx_t_7 = 0; - __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 122, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); + __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_GIVEREF(__pyx_t_10); + PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_10); __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); + PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_2); + __pyx_t_10 = 0; __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 122, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 122, __pyx_L1_error) + __Pyx_GIVEREF(__pyx_t_7); + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); + __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 117, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 117, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_props, __pyx_t_7) < 0) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_props, __pyx_t_10) < 0) __PYX_ERR(0, 117, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - /* "dissect/PropsSimulator/simulator.pyx":123 + /* "dissect/PropsSimulator/simulator.pyx":118 * * self.props = np.concatenate([self.props_complete, self.props_sparse], axis=0) * self.cells = np.concatenate([self.cells_complete, self.cells_sparse], axis=0) # <<<<<<<<<<<<<< * * def preprocess(self): */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_np); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells_complete); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_10); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells_sparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells_complete); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells_sparse); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_10 = PyList_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_10); - __Pyx_GIVEREF(__pyx_t_7); - PyList_SET_ITEM(__pyx_t_10, 0, __pyx_t_7); + __Pyx_GIVEREF(__pyx_t_10); + PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_10); + __Pyx_GIVEREF(__pyx_t_2); + PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_2); + __pyx_t_10 = 0; + __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_6); - PyList_SET_ITEM(__pyx_t_10, 1, __pyx_t_6); - __pyx_t_7 = 0; + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 123, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GIVEREF(__pyx_t_10); - PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_10); - __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 123, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 118, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); - if (PyDict_SetItem(__pyx_t_10, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 123, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 123, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cells, __pyx_t_10) < 0) __PYX_ERR(0, 118, __pyx_L1_error) __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cells, __pyx_t_7) < 0) __PYX_ERR(0, 123, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; /* "dissect/PropsSimulator/simulator.pyx":29 * self.n_celltypes = len(self.celltypes) @@ -4864,7 +4696,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_4genera return __pyx_r; } -/* "dissect/PropsSimulator/simulator.pyx":125 +/* "dissect/PropsSimulator/simulator.pyx":120 * self.cells = np.concatenate([self.cells_complete, self.cells_sparse], axis=0) * * def preprocess(self): # <<<<<<<<<<<<<< @@ -4901,16 +4733,16 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_6prepro int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preprocess", 0); - /* "dissect/PropsSimulator/simulator.pyx":126 + /* "dissect/PropsSimulator/simulator.pyx":121 * * def preprocess(self): * self.sc_adata.var_names_make_unique() # <<<<<<<<<<<<<< * sc.pp.filter_cells(self.sc_adata, min_genes=self.config["simulation_params"]["filter"]["min_genes"]) * sc.pp.filter_genes(self.sc_adata, min_cells=self.config["simulation_params"]["filter"]["min_cells"]) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_var_names_make_unique); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_var_names_make_unique); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -4925,115 +4757,115 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_6prepro } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":127 + /* "dissect/PropsSimulator/simulator.pyx":122 * def preprocess(self): * self.sc_adata.var_names_make_unique() * sc.pp.filter_cells(self.sc_adata, min_genes=self.config["simulation_params"]["filter"]["min_genes"]) # <<<<<<<<<<<<<< * sc.pp.filter_genes(self.sc_adata, min_cells=self.config["simulation_params"]["filter"]["min_cells"]) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_filter_cells); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_filter_cells); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_filter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_filter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_min_genes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_min_genes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_genes, __pyx_t_5) < 0) __PYX_ERR(0, 127, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_genes, __pyx_t_5) < 0) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 127, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":128 + /* "dissect/PropsSimulator/simulator.pyx":123 * self.sc_adata.var_names_make_unique() * sc.pp.filter_cells(self.sc_adata, min_genes=self.config["simulation_params"]["filter"]["min_genes"]) * sc.pp.filter_genes(self.sc_adata, min_cells=self.config["simulation_params"]["filter"]["min_cells"]) # <<<<<<<<<<<<<< * * self.sc_adata.var["mt"] = self.sc_adata.var_names.str.startswith( */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_filter_genes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_filter_genes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_filter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_filter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_min_cells); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_min_cells); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_cells, __pyx_t_4) < 0) __PYX_ERR(0, 128, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_cells, __pyx_t_4) < 0) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dissect/PropsSimulator/simulator.pyx":130 + /* "dissect/PropsSimulator/simulator.pyx":125 * sc.pp.filter_genes(self.sc_adata, min_cells=self.config["simulation_params"]["filter"]["min_cells"]) * * self.sc_adata.var["mt"] = self.sc_adata.var_names.str.startswith( # <<<<<<<<<<<<<< * "MT-" * ) # annotate the group of mitochondrial genes as 'mt' */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_var_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_var_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -5048,139 +4880,139 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_6prepro } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_MT) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_MT); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 130, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_n_s_mt, __pyx_t_4) < 0)) __PYX_ERR(0, 130, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_n_s_mt, __pyx_t_4) < 0)) __PYX_ERR(0, 125, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dissect/PropsSimulator/simulator.pyx":133 + /* "dissect/PropsSimulator/simulator.pyx":128 * "MT-" * ) # annotate the group of mitochondrial genes as 'mt' * sc.pp.calculate_qc_metrics( # <<<<<<<<<<<<<< * self.sc_adata, qc_vars=["mt"], percent_top=None, log1p=False, inplace=True * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_pp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_pp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_calculate_qc_metrics); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_calculate_qc_metrics); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":134 + /* "dissect/PropsSimulator/simulator.pyx":129 * ) # annotate the group of mitochondrial genes as 'mt' * sc.pp.calculate_qc_metrics( * self.sc_adata, qc_vars=["mt"], percent_top=None, log1p=False, inplace=True # <<<<<<<<<<<<<< * ) * self.sc_adata = self.sc_adata[ */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "dissect/PropsSimulator/simulator.pyx":133 + /* "dissect/PropsSimulator/simulator.pyx":128 * "MT-" * ) # annotate the group of mitochondrial genes as 'mt' * sc.pp.calculate_qc_metrics( # <<<<<<<<<<<<<< * self.sc_adata, qc_vars=["mt"], percent_top=None, log1p=False, inplace=True * ) */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":134 + /* "dissect/PropsSimulator/simulator.pyx":129 * ) # annotate the group of mitochondrial genes as 'mt' * sc.pp.calculate_qc_metrics( * self.sc_adata, qc_vars=["mt"], percent_top=None, log1p=False, inplace=True # <<<<<<<<<<<<<< * ) * self.sc_adata = self.sc_adata[ */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error) + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_n_s_mt); __Pyx_GIVEREF(__pyx_n_s_mt); PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_mt); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_qc_vars, __pyx_t_5) < 0) __PYX_ERR(0, 134, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_qc_vars, __pyx_t_5) < 0) __PYX_ERR(0, 129, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_top, Py_None) < 0) __PYX_ERR(0, 134, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_log1p, Py_False) < 0) __PYX_ERR(0, 134, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_inplace, Py_True) < 0) __PYX_ERR(0, 134, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_top, Py_None) < 0) __PYX_ERR(0, 129, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_log1p, Py_False) < 0) __PYX_ERR(0, 129, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_inplace, Py_True) < 0) __PYX_ERR(0, 129, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":133 + /* "dissect/PropsSimulator/simulator.pyx":128 * "MT-" * ) # annotate the group of mitochondrial genes as 'mt' * sc.pp.calculate_qc_metrics( # <<<<<<<<<<<<<< * self.sc_adata, qc_vars=["mt"], percent_top=None, log1p=False, inplace=True * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 133, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 128, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":136 + /* "dissect/PropsSimulator/simulator.pyx":131 * self.sc_adata, qc_vars=["mt"], percent_top=None, log1p=False, inplace=True * ) * self.sc_adata = self.sc_adata[ # <<<<<<<<<<<<<< * self.sc_adata.obs.pct_counts_mt < self.config["simulation_params"]["filter"]["mt_cutoff"], : * ] */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "dissect/PropsSimulator/simulator.pyx":137 + /* "dissect/PropsSimulator/simulator.pyx":132 * ) * self.sc_adata = self.sc_adata[ * self.sc_adata.obs.pct_counts_mt < self.config["simulation_params"]["filter"]["mt_cutoff"], : # <<<<<<<<<<<<<< * ] * sc.pp.normalize_per_cell(self.sc_adata) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pct_counts_mt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pct_counts_mt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_filter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_filter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_mt_cutoff); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_mt_cutoff); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dissect/PropsSimulator/simulator.pyx":136 + /* "dissect/PropsSimulator/simulator.pyx":131 * self.sc_adata, qc_vars=["mt"], percent_top=None, log1p=False, inplace=True * ) * self.sc_adata = self.sc_adata[ # <<<<<<<<<<<<<< * self.sc_adata.obs.pct_counts_mt < self.config["simulation_params"]["filter"]["mt_cutoff"], : * ] */ - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); @@ -5188,29 +5020,29 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_6prepro __Pyx_GIVEREF(__pyx_slice_); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice_); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata, __pyx_t_2) < 0) __PYX_ERR(0, 136, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata, __pyx_t_2) < 0) __PYX_ERR(0, 131, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":139 + /* "dissect/PropsSimulator/simulator.pyx":134 * self.sc_adata.obs.pct_counts_mt < self.config["simulation_params"]["filter"]["mt_cutoff"], : * ] * sc.pp.normalize_per_cell(self.sc_adata) # <<<<<<<<<<<<<< * * tmp = self.sc_adata.copy() */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_pp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_pp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_normalize_per_cell); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_normalize_per_cell); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -5225,21 +5057,21 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_6prepro __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":141 + /* "dissect/PropsSimulator/simulator.pyx":136 * sc.pp.normalize_per_cell(self.sc_adata) * * tmp = self.sc_adata.copy() # <<<<<<<<<<<<<< * sc.pp.log1p(tmp) * sc.pp.highly_variable_genes(tmp) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 141, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -5254,25 +5086,25 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_6prepro } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 141, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_tmp = __pyx_t_2; __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":142 + /* "dissect/PropsSimulator/simulator.pyx":137 * * tmp = self.sc_adata.copy() * sc.pp.log1p(tmp) # <<<<<<<<<<<<<< * sc.pp.highly_variable_genes(tmp) * heg = tmp.var[tmp.var.means > self.config["simulation_params"]["filter"]["min_expr"]].index */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log1p); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 142, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log1p); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -5287,24 +5119,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_6prepro } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_tmp) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_tmp); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 142, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":143 + /* "dissect/PropsSimulator/simulator.pyx":138 * tmp = self.sc_adata.copy() * sc.pp.log1p(tmp) * sc.pp.highly_variable_genes(tmp) # <<<<<<<<<<<<<< * heg = tmp.var[tmp.var.means > self.config["simulation_params"]["filter"]["min_expr"]].index * self.sc_adata = self.sc_adata[:, heg] */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_highly_variable_genes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_highly_variable_genes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -5319,59 +5151,59 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_6prepro } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_tmp) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_tmp); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":144 + /* "dissect/PropsSimulator/simulator.pyx":139 * sc.pp.log1p(tmp) * sc.pp.highly_variable_genes(tmp) * heg = tmp.var[tmp.var.means > self.config["simulation_params"]["filter"]["min_expr"]].index # <<<<<<<<<<<<<< * self.sc_adata = self.sc_adata[:, heg] * del tmp */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tmp, __pyx_n_s_var); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tmp, __pyx_n_s_var); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tmp, __pyx_n_s_var); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tmp, __pyx_n_s_var); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_means); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_means); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_filter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_filter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_min_expr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_min_expr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 139, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_heg = __pyx_t_5; __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":145 + /* "dissect/PropsSimulator/simulator.pyx":140 * sc.pp.highly_variable_genes(tmp) * heg = tmp.var[tmp.var.means > self.config["simulation_params"]["filter"]["min_expr"]].index * self.sc_adata = self.sc_adata[:, heg] # <<<<<<<<<<<<<< * del tmp * del heg */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); @@ -5379,14 +5211,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_6prepro __Pyx_INCREF(__pyx_v_heg); __Pyx_GIVEREF(__pyx_v_heg); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_heg); - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata, __pyx_t_2) < 0) __PYX_ERR(0, 145, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":146 + /* "dissect/PropsSimulator/simulator.pyx":141 * heg = tmp.var[tmp.var.means > self.config["simulation_params"]["filter"]["min_expr"]].index * self.sc_adata = self.sc_adata[:, heg] * del tmp # <<<<<<<<<<<<<< @@ -5396,7 +5228,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_6prepro __Pyx_DECREF(__pyx_v_tmp); __pyx_v_tmp = NULL; - /* "dissect/PropsSimulator/simulator.pyx":147 + /* "dissect/PropsSimulator/simulator.pyx":142 * self.sc_adata = self.sc_adata[:, heg] * del tmp * del heg # <<<<<<<<<<<<<< @@ -5406,7 +5238,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_6prepro __Pyx_DECREF(__pyx_v_heg); __pyx_v_heg = NULL; - /* "dissect/PropsSimulator/simulator.pyx":125 + /* "dissect/PropsSimulator/simulator.pyx":120 * self.cells = np.concatenate([self.cells_complete, self.cells_sparse], axis=0) * * def preprocess(self): # <<<<<<<<<<<<<< @@ -5433,7 +5265,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_6prepro return __pyx_r; } -/* "dissect/PropsSimulator/simulator.pyx":149 +/* "dissect/PropsSimulator/simulator.pyx":144 * del heg * * def simulate(self, save=True): # <<<<<<<<<<<<<< @@ -5481,7 +5313,7 @@ static PyObject *__pyx_pw_7dissect_14PropsSimulator_9simulator_8Simulate_9simula } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate") < 0)) __PYX_ERR(0, 149, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate") < 0)) __PYX_ERR(0, 144, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -5497,7 +5329,7 @@ static PyObject *__pyx_pw_7dissect_14PropsSimulator_9simulator_8Simulate_9simula } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("simulate", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 149, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("simulate", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 144, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dissect.PropsSimulator.simulator.Simulate.simulate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -5548,49 +5380,49 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula int __pyx_clineno = 0; __Pyx_RefNannySetupContext("simulate", 0); - /* "dissect/PropsSimulator/simulator.pyx":150 + /* "dissect/PropsSimulator/simulator.pyx":145 * * def simulate(self, save=True): * adatas = {} # <<<<<<<<<<<<<< * genes = self.sc_adata.var_names * for celltype in self.celltypes: */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_adatas = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":151 + /* "dissect/PropsSimulator/simulator.pyx":146 * def simulate(self, save=True): * adatas = {} * genes = self.sc_adata.var_names # <<<<<<<<<<<<<< * for celltype in self.celltypes: * adatas[celltype] = np.array( */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_var_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_var_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_genes = __pyx_t_2; __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":152 + /* "dissect/PropsSimulator/simulator.pyx":147 * adatas = {} * genes = self.sc_adata.var_names * for celltype in self.celltypes: # <<<<<<<<<<<<<< * adatas[celltype] = np.array( * self.sc_adata[ */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -5598,17 +5430,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 147, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 147, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 152, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -5618,7 +5450,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 152, __pyx_L1_error) + else __PYX_ERR(0, 147, __pyx_L1_error) } break; } @@ -5627,76 +5459,76 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_XDECREF_SET(__pyx_v_celltype, __pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":153 + /* "dissect/PropsSimulator/simulator.pyx":148 * genes = self.sc_adata.var_names * for celltype in self.celltypes: * adatas[celltype] = np.array( # <<<<<<<<<<<<<< * self.sc_adata[ * self.sc_adata.obs[self.config["simulation_params"]["celltype_col"]] == celltype */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 153, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":154 + /* "dissect/PropsSimulator/simulator.pyx":149 * for celltype in self.celltypes: * adatas[celltype] = np.array( * self.sc_adata[ # <<<<<<<<<<<<<< * self.sc_adata.obs[self.config["simulation_params"]["celltype_col"]] == celltype * ].X */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 154, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "dissect/PropsSimulator/simulator.pyx":155 + /* "dissect/PropsSimulator/simulator.pyx":150 * adatas[celltype] = np.array( * self.sc_adata[ * self.sc_adata.obs[self.config["simulation_params"]["celltype_col"]] == celltype # <<<<<<<<<<<<<< * ].X * ) */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_obs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_obs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_t_7, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_t_7, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_9, __pyx_n_s_celltype_col); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_9, __pyx_n_s_celltype_col); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, __pyx_v_celltype, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 155, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, __pyx_v_celltype, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 150, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":154 + /* "dissect/PropsSimulator/simulator.pyx":149 * for celltype in self.celltypes: * adatas[celltype] = np.array( * self.sc_adata[ # <<<<<<<<<<<<<< * self.sc_adata.obs[self.config["simulation_params"]["celltype_col"]] == celltype * ].X */ - __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 154, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 149, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":156 + /* "dissect/PropsSimulator/simulator.pyx":151 * self.sc_adata[ * self.sc_adata.obs[self.config["simulation_params"]["celltype_col"]] == celltype * ].X # <<<<<<<<<<<<<< * ) * self.sc_adata = None */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_X); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_X); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 151, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -5712,21 +5544,21 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":153 + /* "dissect/PropsSimulator/simulator.pyx":148 * genes = self.sc_adata.var_names * for celltype in self.celltypes: * adatas[celltype] = np.array( # <<<<<<<<<<<<<< * self.sc_adata[ * self.sc_adata.obs[self.config["simulation_params"]["celltype_col"]] == celltype */ - if (unlikely(PyDict_SetItem(__pyx_v_adatas, __pyx_v_celltype, __pyx_t_2) < 0)) __PYX_ERR(0, 153, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_adatas, __pyx_v_celltype, __pyx_t_2) < 0)) __PYX_ERR(0, 148, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":152 + /* "dissect/PropsSimulator/simulator.pyx":147 * adatas = {} * genes = self.sc_adata.var_names * for celltype in self.celltypes: # <<<<<<<<<<<<<< @@ -5736,49 +5568,49 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":158 + /* "dissect/PropsSimulator/simulator.pyx":153 * ].X * ) * self.sc_adata = None # <<<<<<<<<<<<<< * * adata = AnnData( */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata, Py_None) < 0) __PYX_ERR(0, 158, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata, Py_None) < 0) __PYX_ERR(0, 153, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":160 + /* "dissect/PropsSimulator/simulator.pyx":155 * self.sc_adata = None * * adata = AnnData( # <<<<<<<<<<<<<< * np.zeros((self.config["simulation_params"]["n_samples"], len(genes))), * dtype=np.float32, */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AnnData); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AnnData); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "dissect/PropsSimulator/simulator.pyx":161 + /* "dissect/PropsSimulator/simulator.pyx":156 * * adata = AnnData( * np.zeros((self.config["simulation_params"]["n_samples"], len(genes))), # <<<<<<<<<<<<<< * dtype=np.float32, * var=pd.DataFrame(index=genes), */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_9, __pyx_n_s_n_samples); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_9, __pyx_n_s_n_samples); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_3 = PyObject_Length(__pyx_v_genes); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 161, __pyx_L1_error) - __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_genes); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 156, __pyx_L1_error) + __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); @@ -5799,103 +5631,103 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":160 + /* "dissect/PropsSimulator/simulator.pyx":155 * self.sc_adata = None * * adata = AnnData( # <<<<<<<<<<<<<< * np.zeros((self.config["simulation_params"]["n_samples"], len(genes))), * dtype=np.float32, */ - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":162 + /* "dissect/PropsSimulator/simulator.pyx":157 * adata = AnnData( * np.zeros((self.config["simulation_params"]["n_samples"], len(genes))), * dtype=np.float32, # <<<<<<<<<<<<<< * var=pd.DataFrame(index=genes), * obs=pd.DataFrame(self.props, columns=self.celltypes), */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 162, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 162, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 162, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":163 + /* "dissect/PropsSimulator/simulator.pyx":158 * np.zeros((self.config["simulation_params"]["n_samples"], len(genes))), * dtype=np.float32, * var=pd.DataFrame(index=genes), # <<<<<<<<<<<<<< * obs=pd.DataFrame(self.props, columns=self.celltypes), * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_pd); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 163, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_pd); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 163, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_index, __pyx_v_genes) < 0) __PYX_ERR(0, 163, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_index, __pyx_v_genes) < 0) __PYX_ERR(0, 158, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_var, __pyx_t_6) < 0) __PYX_ERR(0, 162, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_var, __pyx_t_6) < 0) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":164 + /* "dissect/PropsSimulator/simulator.pyx":159 * dtype=np.float32, * var=pd.DataFrame(index=genes), * obs=pd.DataFrame(self.props, columns=self.celltypes), # <<<<<<<<<<<<<< * ) * adata.obsm["cells"] = self.cells */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pd); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 164, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pd); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_columns, __pyx_t_8) < 0) __PYX_ERR(0, 164, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_columns, __pyx_t_8) < 0) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 164, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 159, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_obs, __pyx_t_8) < 0) __PYX_ERR(0, 162, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_obs, __pyx_t_8) < 0) __PYX_ERR(0, 157, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":160 + /* "dissect/PropsSimulator/simulator.pyx":155 * self.sc_adata = None * * adata = AnnData( # <<<<<<<<<<<<<< * np.zeros((self.config["simulation_params"]["n_samples"], len(genes))), * dtype=np.float32, */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 160, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 155, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -5903,37 +5735,37 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __pyx_v_adata = __pyx_t_8; __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":166 + /* "dissect/PropsSimulator/simulator.pyx":161 * obs=pd.DataFrame(self.props, columns=self.celltypes), * ) * adata.obsm["cells"] = self.cells # <<<<<<<<<<<<<< * for celltype in self.celltypes: * adata.layers[celltype] = np.zeros(adata.X.shape, dtype=np.float32) */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obsm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obsm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_cells, __pyx_t_8) < 0)) __PYX_ERR(0, 166, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_cells, __pyx_t_8) < 0)) __PYX_ERR(0, 161, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":167 + /* "dissect/PropsSimulator/simulator.pyx":162 * ) * adata.obsm["cells"] = self.cells * for celltype in self.celltypes: # <<<<<<<<<<<<<< * adata.layers[celltype] = np.zeros(adata.X.shape, dtype=np.float32) * for i in tqdm(range(self.cells.shape[0])): */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -5941,17 +5773,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 162, __pyx_L1_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 162, __pyx_L1_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 167, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 162, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } @@ -5961,7 +5793,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 167, __pyx_L1_error) + else __PYX_ERR(0, 162, __pyx_L1_error) } break; } @@ -5970,49 +5802,49 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_XDECREF_SET(__pyx_v_celltype, __pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":168 + /* "dissect/PropsSimulator/simulator.pyx":163 * adata.obsm["cells"] = self.cells * for celltype in self.celltypes: * adata.layers[celltype] = np.zeros(adata.X.shape, dtype=np.float32) # <<<<<<<<<<<<<< * for i in tqdm(range(self.cells.shape[0])): * for j in range(self.n_celltypes): */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_X); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_X); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 168, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 168, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_layers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_layers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_celltype, __pyx_t_5) < 0)) __PYX_ERR(0, 168, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_celltype, __pyx_t_5) < 0)) __PYX_ERR(0, 163, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":167 + /* "dissect/PropsSimulator/simulator.pyx":162 * ) * adata.obsm["cells"] = self.cells * for celltype in self.celltypes: # <<<<<<<<<<<<<< @@ -6022,24 +5854,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":169 + /* "dissect/PropsSimulator/simulator.pyx":164 * for celltype in self.celltypes: * adata.layers[celltype] = np.zeros(adata.X.shape, dtype=np.float32) * for i in tqdm(range(self.cells.shape[0])): # <<<<<<<<<<<<<< * for j in range(self.n_celltypes): * cell_idxs = np.random.choice( */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -6055,16 +5887,16 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 164, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -6072,17 +5904,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 164, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 164, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 164, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -6092,7 +5924,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 169, __pyx_L1_error) + else __PYX_ERR(0, 164, __pyx_L1_error) } break; } @@ -6101,25 +5933,25 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":170 + /* "dissect/PropsSimulator/simulator.pyx":165 * adata.layers[celltype] = np.zeros(adata.X.shape, dtype=np.float32) * for i in tqdm(range(self.cells.shape[0])): * for j in range(self.n_celltypes): # <<<<<<<<<<<<<< * cell_idxs = np.random.choice( * range(adatas[self.celltypes[j]].shape[0]), */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -6127,17 +5959,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 165, __pyx_L1_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 165, __pyx_L1_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 170, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 165, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } @@ -6147,7 +5979,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 170, __pyx_L1_error) + else __PYX_ERR(0, 165, __pyx_L1_error) } break; } @@ -6156,71 +5988,71 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":171 + /* "dissect/PropsSimulator/simulator.pyx":166 * for i in tqdm(range(self.cells.shape[0])): * for j in range(self.n_celltypes): * cell_idxs = np.random.choice( # <<<<<<<<<<<<<< * range(adatas[self.celltypes[j]].shape[0]), * self.cells[i][j], */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 171, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_random); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_random); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_choice); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_choice); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":172 + /* "dissect/PropsSimulator/simulator.pyx":167 * for j in range(self.n_celltypes): * cell_idxs = np.random.choice( * range(adatas[self.celltypes[j]].shape[0]), # <<<<<<<<<<<<<< * self.cells[i][j], * replace=True, */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_j); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_j); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_adatas, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_adatas, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 167, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":173 + /* "dissect/PropsSimulator/simulator.pyx":168 * cell_idxs = np.random.choice( * range(adatas[self.celltypes[j]].shape[0]), * self.cells[i][j], # <<<<<<<<<<<<<< * replace=True, * ) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":171 + /* "dissect/PropsSimulator/simulator.pyx":166 * for i in tqdm(range(self.cells.shape[0])): * for j in range(self.n_celltypes): * cell_idxs = np.random.choice( # <<<<<<<<<<<<<< * range(adatas[self.celltypes[j]].shape[0]), * self.cells[i][j], */ - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); @@ -6229,25 +6061,25 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __pyx_t_7 = 0; __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":174 + /* "dissect/PropsSimulator/simulator.pyx":169 * range(adatas[self.celltypes[j]].shape[0]), * self.cells[i][j], * replace=True, # <<<<<<<<<<<<<< * ) * sample = adatas[self.celltypes[j]][cell_idxs, :].sum(axis=0) */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_replace, Py_True) < 0) __PYX_ERR(0, 174, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_replace, Py_True) < 0) __PYX_ERR(0, 169, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":171 + /* "dissect/PropsSimulator/simulator.pyx":166 * for i in tqdm(range(self.cells.shape[0])): * for j in range(self.n_celltypes): * cell_idxs = np.random.choice( # <<<<<<<<<<<<<< * range(adatas[self.celltypes[j]].shape[0]), * self.cells[i][j], */ - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 166, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -6255,22 +6087,22 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_XDECREF_SET(__pyx_v_cell_idxs, __pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":176 + /* "dissect/PropsSimulator/simulator.pyx":171 * replace=True, * ) * sample = adatas[self.celltypes[j]][cell_idxs, :].sum(axis=0) # <<<<<<<<<<<<<< * adata.layers[self.celltypes[j]][i, :] = sample * if j == 0: */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_adatas, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_adatas, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_cell_idxs); __Pyx_GIVEREF(__pyx_v_cell_idxs); @@ -6278,42 +6110,42 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_INCREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice_); - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 176, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 176, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 171, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_sample, __pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":177 + /* "dissect/PropsSimulator/simulator.pyx":172 * ) * sample = adatas[self.celltypes[j]][cell_idxs, :].sum(axis=0) * adata.layers[self.celltypes[j]][i, :] = sample # <<<<<<<<<<<<<< * if j == 0: * total_sample = sample */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_layers); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_layers); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_i); __Pyx_GIVEREF(__pyx_v_i); @@ -6321,24 +6153,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_INCREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice_); - if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_t_1, __pyx_v_sample) < 0)) __PYX_ERR(0, 177, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_t_1, __pyx_v_sample) < 0)) __PYX_ERR(0, 172, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":178 + /* "dissect/PropsSimulator/simulator.pyx":173 * sample = adatas[self.celltypes[j]][cell_idxs, :].sum(axis=0) * adata.layers[self.celltypes[j]][i, :] = sample * if j == 0: # <<<<<<<<<<<<<< * total_sample = sample * else: */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_j, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_j, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 178, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 173, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_12) { - /* "dissect/PropsSimulator/simulator.pyx":179 + /* "dissect/PropsSimulator/simulator.pyx":174 * adata.layers[self.celltypes[j]][i, :] = sample * if j == 0: * total_sample = sample # <<<<<<<<<<<<<< @@ -6348,7 +6180,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_INCREF(__pyx_v_sample); __Pyx_XDECREF_SET(__pyx_v_total_sample, __pyx_v_sample); - /* "dissect/PropsSimulator/simulator.pyx":178 + /* "dissect/PropsSimulator/simulator.pyx":173 * sample = adatas[self.celltypes[j]][cell_idxs, :].sum(axis=0) * adata.layers[self.celltypes[j]][i, :] = sample * if j == 0: # <<<<<<<<<<<<<< @@ -6358,7 +6190,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula goto __pyx_L11; } - /* "dissect/PropsSimulator/simulator.pyx":181 + /* "dissect/PropsSimulator/simulator.pyx":176 * total_sample = sample * else: * total_sample = total_sample + sample # <<<<<<<<<<<<<< @@ -6366,15 +6198,15 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula * */ /*else*/ { - if (unlikely(!__pyx_v_total_sample)) { __Pyx_RaiseUnboundLocalError("total_sample"); __PYX_ERR(0, 181, __pyx_L1_error) } - __pyx_t_1 = PyNumber_Add(__pyx_v_total_sample, __pyx_v_sample); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) + if (unlikely(!__pyx_v_total_sample)) { __Pyx_RaiseUnboundLocalError("total_sample"); __PYX_ERR(0, 176, __pyx_L1_error) } + __pyx_t_1 = PyNumber_Add(__pyx_v_total_sample, __pyx_v_sample); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 176, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_total_sample, __pyx_t_1); __pyx_t_1 = 0; } __pyx_L11:; - /* "dissect/PropsSimulator/simulator.pyx":170 + /* "dissect/PropsSimulator/simulator.pyx":165 * adata.layers[celltype] = np.zeros(adata.X.shape, dtype=np.float32) * for i in tqdm(range(self.cells.shape[0])): * for j in range(self.n_celltypes): # <<<<<<<<<<<<<< @@ -6384,17 +6216,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":182 + /* "dissect/PropsSimulator/simulator.pyx":177 * else: * total_sample = total_sample + sample * adata.X[i, :] = total_sample # <<<<<<<<<<<<<< * * if save: */ - if (unlikely(!__pyx_v_total_sample)) { __Pyx_RaiseUnboundLocalError("total_sample"); __PYX_ERR(0, 182, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_X); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) + if (unlikely(!__pyx_v_total_sample)) { __Pyx_RaiseUnboundLocalError("total_sample"); __PYX_ERR(0, 177, __pyx_L1_error) } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_X); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 182, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_i); __Pyx_GIVEREF(__pyx_v_i); @@ -6402,11 +6234,11 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_INCREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice_); - if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_1, __pyx_v_total_sample) < 0)) __PYX_ERR(0, 182, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_1, __pyx_v_total_sample) < 0)) __PYX_ERR(0, 177, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":169 + /* "dissect/PropsSimulator/simulator.pyx":164 * for celltype in self.celltypes: * adata.layers[celltype] = np.zeros(adata.X.shape, dtype=np.float32) * for i in tqdm(range(self.cells.shape[0])): # <<<<<<<<<<<<<< @@ -6416,34 +6248,34 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":184 + /* "dissect/PropsSimulator/simulator.pyx":179 * adata.X[i, :] = total_sample * * if save: # <<<<<<<<<<<<<< * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) * sc.set_figure_params(dpi=200) */ - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_save); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 184, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_save); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 179, __pyx_L1_error) if (__pyx_t_12) { - /* "dissect/PropsSimulator/simulator.pyx":185 + /* "dissect/PropsSimulator/simulator.pyx":180 * * if save: * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) # <<<<<<<<<<<<<< * sc.set_figure_params(dpi=200) * tmp = adata.copy() */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_8 = NULL; __pyx_t_13 = 0; @@ -6460,7 +6292,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_kp_s_simulated_h5ad}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -6469,14 +6301,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_7, __pyx_kp_s_simulated_h5ad}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; @@ -6487,7 +6319,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_GIVEREF(__pyx_kp_s_simulated_h5ad); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_13, __pyx_kp_s_simulated_h5ad); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -6505,40 +6337,40 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 185, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 180, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":186 + /* "dissect/PropsSimulator/simulator.pyx":181 * if save: * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) * sc.set_figure_params(dpi=200) # <<<<<<<<<<<<<< * tmp = adata.copy() * sc.pp.normalize_total(tmp, target_sum=1e6) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_set_figure_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_set_figure_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dpi, __pyx_int_200) < 0) __PYX_ERR(0, 186, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dpi, __pyx_int_200) < 0) __PYX_ERR(0, 181, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":187 + /* "dissect/PropsSimulator/simulator.pyx":182 * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) * sc.set_figure_params(dpi=200) * tmp = adata.copy() # <<<<<<<<<<<<<< * sc.pp.normalize_total(tmp, target_sum=1e6) * sc.pp.log1p(tmp) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_1 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -6552,55 +6384,55 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 182, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_tmp = __pyx_t_2; __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":188 + /* "dissect/PropsSimulator/simulator.pyx":183 * sc.set_figure_params(dpi=200) * tmp = adata.copy() * sc.pp.normalize_total(tmp, target_sum=1e6) # <<<<<<<<<<<<<< * sc.pp.log1p(tmp) * sc.tl.pca(tmp) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_tmp); __Pyx_GIVEREF(__pyx_v_tmp); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_tmp); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 188, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 188, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 183, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 183, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":189 + /* "dissect/PropsSimulator/simulator.pyx":184 * tmp = adata.copy() * sc.pp.normalize_total(tmp, target_sum=1e6) * sc.pp.log1p(tmp) # <<<<<<<<<<<<<< * sc.tl.pca(tmp) * sc.pl.pca(tmp, color=adata.obs.columns, show=False) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_log1p); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 189, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_log1p); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -6615,24 +6447,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula } __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_tmp) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_tmp); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 189, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":190 + /* "dissect/PropsSimulator/simulator.pyx":185 * sc.pp.normalize_total(tmp, target_sum=1e6) * sc.pp.log1p(tmp) * sc.tl.pca(tmp) # <<<<<<<<<<<<<< * sc.pl.pca(tmp, color=adata.obs.columns, show=False) * plt.savefig( */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_tl); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_tl); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pca); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pca); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -6647,85 +6479,85 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula } __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v_tmp) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_tmp); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 185, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":191 + /* "dissect/PropsSimulator/simulator.pyx":186 * sc.pp.log1p(tmp) * sc.tl.pca(tmp) * sc.pl.pca(tmp, color=adata.obs.columns, show=False) # <<<<<<<<<<<<<< * plt.savefig( * os.path.join( */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pca); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pca); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_tmp); __Pyx_GIVEREF(__pyx_v_tmp); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tmp); - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_columns); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 191, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_columns); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_color, __pyx_t_9) < 0) __PYX_ERR(0, 191, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_color, __pyx_t_9) < 0) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 191, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 191, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 186, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 186, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":192 + /* "dissect/PropsSimulator/simulator.pyx":187 * sc.tl.pca(tmp) * sc.pl.pca(tmp, color=adata.obs.columns, show=False) * plt.savefig( # <<<<<<<<<<<<<< * os.path.join( * self.simulation_folder, "scatterplot_pca_simulated.pdf" */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_plt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 192, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_plt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_savefig); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 192, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_savefig); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":193 + /* "dissect/PropsSimulator/simulator.pyx":188 * sc.pl.pca(tmp, color=adata.obs.columns, show=False) * plt.savefig( * os.path.join( # <<<<<<<<<<<<<< * self.simulation_folder, "scatterplot_pca_simulated.pdf" * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":194 + /* "dissect/PropsSimulator/simulator.pyx":189 * plt.savefig( * os.path.join( * self.simulation_folder, "scatterplot_pca_simulated.pdf" # <<<<<<<<<<<<<< * ) * ) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 194, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_7 = NULL; __pyx_t_13 = 0; @@ -6742,7 +6574,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_2, __pyx_kp_s_scatterplot_pca_simulated_pdf}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -6751,14 +6583,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_2, __pyx_kp_s_scatterplot_pca_simulated_pdf}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -6769,7 +6601,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_GIVEREF(__pyx_kp_s_scatterplot_pca_simulated_pdf); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_13, __pyx_kp_s_scatterplot_pca_simulated_pdf); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 188, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -6787,73 +6619,73 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __pyx_t_9 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 192, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 187, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":198 + /* "dissect/PropsSimulator/simulator.pyx":193 * ) * * if self.config["simulation_params"]["generate_component_figures"]: # <<<<<<<<<<<<<< * idxs = {} * celltypes_col = [] */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_9, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_9, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_generate_component_figures); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_generate_component_figures); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 198, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 193, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_12) { - /* "dissect/PropsSimulator/simulator.pyx":199 + /* "dissect/PropsSimulator/simulator.pyx":194 * * if self.config["simulation_params"]["generate_component_figures"]: * idxs = {} # <<<<<<<<<<<<<< * celltypes_col = [] * for j in range(self.n_celltypes): */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 199, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 194, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_v_idxs = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":200 + /* "dissect/PropsSimulator/simulator.pyx":195 * if self.config["simulation_params"]["generate_component_figures"]: * idxs = {} * celltypes_col = [] # <<<<<<<<<<<<<< * for j in range(self.n_celltypes): * celltype = self.celltypes[j] */ - __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 200, __pyx_L1_error) + __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 195, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_v_celltypes_col = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":201 + /* "dissect/PropsSimulator/simulator.pyx":196 * idxs = {} * celltypes_col = [] * for j in range(self.n_celltypes): # <<<<<<<<<<<<<< * celltype = self.celltypes[j] * idxs[celltype] = adata.obsm["cells"][:, j] > 0 */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -6861,17 +6693,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula if (likely(PyList_CheckExact(__pyx_t_9))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 196, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 196, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -6881,7 +6713,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 201, __pyx_L1_error) + else __PYX_ERR(0, 196, __pyx_L1_error) } break; } @@ -6890,34 +6722,34 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":202 + /* "dissect/PropsSimulator/simulator.pyx":197 * celltypes_col = [] * for j in range(self.n_celltypes): * celltype = self.celltypes[j] # <<<<<<<<<<<<<< * idxs[celltype] = adata.obsm["cells"][:, j] > 0 * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_XDECREF_SET(__pyx_v_celltype, __pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":203 + /* "dissect/PropsSimulator/simulator.pyx":198 * for j in range(self.n_celltypes): * celltype = self.celltypes[j] * idxs[celltype] = adata.obsm["cells"][:, j] > 0 # <<<<<<<<<<<<<< * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() * X = [ */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obsm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obsm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_cells); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_cells); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); @@ -6925,25 +6757,25 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_INCREF(__pyx_v_j); __Pyx_GIVEREF(__pyx_v_j); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_j); - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 203, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(PyDict_SetItem(__pyx_v_idxs, __pyx_v_celltype, __pyx_t_5) < 0)) __PYX_ERR(0, 203, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_idxs, __pyx_v_celltype, __pyx_t_5) < 0)) __PYX_ERR(0, 198, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":204 + /* "dissect/PropsSimulator/simulator.pyx":199 * celltype = self.celltypes[j] * idxs[celltype] = adata.obsm["cells"][:, j] > 0 * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() # <<<<<<<<<<<<<< * X = [ * adata.layers[celltype][idxs[celltype], :] */ - __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_idxs, __pyx_v_celltype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_idxs, __pyx_v_celltype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -6958,27 +6790,27 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula } __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_celltype); __Pyx_GIVEREF(__pyx_v_celltype); PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_celltype); - { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_temp)) __PYX_ERR(0, 204, __pyx_L1_error) + { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_temp)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_temp); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = __pyx_temp; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_v_celltypes_col, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_v_celltypes_col, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 199, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF_SET(__pyx_v_celltypes_col, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":201 + /* "dissect/PropsSimulator/simulator.pyx":196 * idxs = {} * celltypes_col = [] * for j in range(self.n_celltypes): # <<<<<<<<<<<<<< @@ -6988,32 +6820,32 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":205 + /* "dissect/PropsSimulator/simulator.pyx":200 * idxs[celltype] = adata.obsm["cells"][:, j] > 0 * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() * X = [ # <<<<<<<<<<<<<< * adata.layers[celltype][idxs[celltype], :] * for celltype in self.celltypes */ - __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - /* "dissect/PropsSimulator/simulator.pyx":207 + /* "dissect/PropsSimulator/simulator.pyx":202 * X = [ * adata.layers[celltype][idxs[celltype], :] * for celltype in self.celltypes # <<<<<<<<<<<<<< * ] * tmp1 = AnnData( */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { @@ -7021,17 +6853,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 202, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 202, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 207, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 202, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -7041,7 +6873,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 207, __pyx_L1_error) + else __PYX_ERR(0, 202, __pyx_L1_error) } break; } @@ -7050,21 +6882,21 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_XDECREF_SET(__pyx_v_celltype, __pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":206 + /* "dissect/PropsSimulator/simulator.pyx":201 * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() * X = [ * adata.layers[celltype][idxs[celltype], :] # <<<<<<<<<<<<<< * for celltype in self.celltypes * ] */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_layers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_layers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_celltype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_celltype); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_idxs, __pyx_v_celltype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_idxs, __pyx_v_celltype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); @@ -7072,14 +6904,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_GIVEREF(__pyx_slice_); PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_slice_); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 205, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_9, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 200, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":207 + /* "dissect/PropsSimulator/simulator.pyx":202 * X = [ * adata.layers[celltype][idxs[celltype], :] * for celltype in self.celltypes # <<<<<<<<<<<<<< @@ -7091,99 +6923,99 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __pyx_v_X = ((PyObject*)__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":209 + /* "dissect/PropsSimulator/simulator.pyx":204 * for celltype in self.celltypes * ] * tmp1 = AnnData( # <<<<<<<<<<<<<< * np.concatenate(X, axis=0), * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_AnnData); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 209, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_AnnData); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - /* "dissect/PropsSimulator/simulator.pyx":210 + /* "dissect/PropsSimulator/simulator.pyx":205 * ] * tmp1 = AnnData( * np.concatenate(X, axis=0), # <<<<<<<<<<<<<< * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_X); - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 210, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 205, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":209 + /* "dissect/PropsSimulator/simulator.pyx":204 * for celltype in self.celltypes * ] * tmp1 = AnnData( # <<<<<<<<<<<<<< * np.concatenate(X, axis=0), * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), */ - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":211 + /* "dissect/PropsSimulator/simulator.pyx":206 * tmp1 = AnnData( * np.concatenate(X, axis=0), * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), # <<<<<<<<<<<<<< * ) * */ - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pd); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_celltypes_col); __Pyx_GIVEREF(__pyx_v_celltypes_col); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_celltypes_col); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_n_s_Celltype); __Pyx_GIVEREF(__pyx_n_s_Celltype); PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_Celltype); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_columns, __pyx_t_7) < 0) __PYX_ERR(0, 211, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_columns, __pyx_t_7) < 0) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 211, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_obs, __pyx_t_7) < 0) __PYX_ERR(0, 211, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_obs, __pyx_t_7) < 0) __PYX_ERR(0, 206, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":209 + /* "dissect/PropsSimulator/simulator.pyx":204 * for celltype in self.celltypes * ] * tmp1 = AnnData( # <<<<<<<<<<<<<< * np.concatenate(X, axis=0), * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), */ - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -7191,80 +7023,80 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __pyx_v_tmp1 = __pyx_t_7; __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":214 + /* "dissect/PropsSimulator/simulator.pyx":209 * ) * * sc.pp.subsample(tmp1, fraction=0.5, random_state=42) # <<<<<<<<<<<<<< * sc.pp.normalize_total(tmp1, target_sum=1e6) * sc.pp.log1p(tmp1) */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_sc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 214, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_sc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_pp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_pp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_subsample); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_subsample); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_tmp1); __Pyx_GIVEREF(__pyx_v_tmp1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_tmp1); - __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 214, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_fraction, __pyx_float_0_5) < 0) __PYX_ERR(0, 214, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_random_state, __pyx_int_42) < 0) __PYX_ERR(0, 214, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 214, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_fraction, __pyx_float_0_5) < 0) __PYX_ERR(0, 209, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_random_state, __pyx_int_42) < 0) __PYX_ERR(0, 209, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 209, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":215 + /* "dissect/PropsSimulator/simulator.pyx":210 * * sc.pp.subsample(tmp1, fraction=0.5, random_state=42) * sc.pp.normalize_total(tmp1, target_sum=1e6) # <<<<<<<<<<<<<< * sc.pp.log1p(tmp1) * sc.tl.pca(tmp1) */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sc); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 215, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sc); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_INCREF(__pyx_v_tmp1); __Pyx_GIVEREF(__pyx_v_tmp1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_tmp1); - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 215, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 215, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 210, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 210, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":216 + /* "dissect/PropsSimulator/simulator.pyx":211 * sc.pp.subsample(tmp1, fraction=0.5, random_state=42) * sc.pp.normalize_total(tmp1, target_sum=1e6) * sc.pp.log1p(tmp1) # <<<<<<<<<<<<<< * sc.tl.pca(tmp1) * fig, ax = plt.subplots(nrows=1, ncols=1) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 216, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 216, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_log1p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 216, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_log1p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -7279,24 +7111,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula } __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_v_tmp1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_tmp1); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 216, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 211, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":217 + /* "dissect/PropsSimulator/simulator.pyx":212 * sc.pp.normalize_total(tmp1, target_sum=1e6) * sc.pp.log1p(tmp1) * sc.tl.pca(tmp1) # <<<<<<<<<<<<<< * fig, ax = plt.subplots(nrows=1, ncols=1) * sc.pl.pca( */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 217, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_tl); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_tl); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_pca); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 217, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_pca); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -7311,28 +7143,28 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula } __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_8, __pyx_v_tmp1) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_tmp1); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 217, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":218 + /* "dissect/PropsSimulator/simulator.pyx":213 * sc.pp.log1p(tmp1) * sc.tl.pca(tmp1) * fig, ax = plt.subplots(nrows=1, ncols=1) # <<<<<<<<<<<<<< * sc.pl.pca( * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_plt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_plt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_subplots); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_subplots); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_nrows, __pyx_int_1) < 0) __PYX_ERR(0, 218, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ncols, __pyx_int_1) < 0) __PYX_ERR(0, 218, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 218, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_nrows, __pyx_int_1) < 0) __PYX_ERR(0, 213, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ncols, __pyx_int_1) < 0) __PYX_ERR(0, 213, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -7342,7 +7174,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 218, __pyx_L1_error) + __PYX_ERR(0, 213, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -7355,15 +7187,15 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_6); #else - __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else { Py_ssize_t index = -1; - __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 218, __pyx_L1_error) + __pyx_t_9 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 213, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_14 = Py_TYPE(__pyx_t_9)->tp_iternext; @@ -7371,7 +7203,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_GOTREF(__pyx_t_7); index = 1; __pyx_t_6 = __pyx_t_14(__pyx_t_9); if (unlikely(!__pyx_t_6)) goto __pyx_L18_unpacking_failed; __Pyx_GOTREF(__pyx_t_6); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < 0) __PYX_ERR(0, 218, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_9), 2) < 0) __PYX_ERR(0, 213, __pyx_L1_error) __pyx_t_14 = NULL; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; goto __pyx_L19_unpacking_done; @@ -7379,7 +7211,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 218, __pyx_L1_error) + __PYX_ERR(0, 213, __pyx_L1_error) __pyx_L19_unpacking_done:; } __pyx_v_fig = __pyx_t_7; @@ -7387,92 +7219,92 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __pyx_v_ax = __pyx_t_6; __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":219 + /* "dissect/PropsSimulator/simulator.pyx":214 * sc.tl.pca(tmp1) * fig, ax = plt.subplots(nrows=1, ncols=1) * sc.pl.pca( # <<<<<<<<<<<<<< * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_sc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 219, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_sc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_pl); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_pl); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pca); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pca); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":220 + /* "dissect/PropsSimulator/simulator.pyx":215 * fig, ax = plt.subplots(nrows=1, ncols=1) * sc.pl.pca( * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax # <<<<<<<<<<<<<< * ) * plt.savefig( */ - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_tmp1); __Pyx_GIVEREF(__pyx_v_tmp1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_tmp1); - __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 220, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 215, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_color, __pyx_n_s_Celltype) < 0) __PYX_ERR(0, 220, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 220, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_legend_loc, __pyx_kp_s_on_data) < 0) __PYX_ERR(0, 220, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ax, __pyx_v_ax) < 0) __PYX_ERR(0, 220, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_color, __pyx_n_s_Celltype) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_legend_loc, __pyx_kp_s_on_data) < 0) __PYX_ERR(0, 215, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ax, __pyx_v_ax) < 0) __PYX_ERR(0, 215, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":219 + /* "dissect/PropsSimulator/simulator.pyx":214 * sc.tl.pca(tmp1) * fig, ax = plt.subplots(nrows=1, ncols=1) * sc.pl.pca( # <<<<<<<<<<<<<< * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 219, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 214, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":222 + /* "dissect/PropsSimulator/simulator.pyx":217 * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) * plt.savefig( # <<<<<<<<<<<<<< * os.path.join( * self.simulation_folder, */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_plt); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 222, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_plt); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_savefig); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_savefig); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":223 + /* "dissect/PropsSimulator/simulator.pyx":218 * ) * plt.savefig( * os.path.join( # <<<<<<<<<<<<<< * self.simulation_folder, * "scatterplot_pca_simulated_celltypes.pdf", */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 223, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_os); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_join); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":224 + /* "dissect/PropsSimulator/simulator.pyx":219 * plt.savefig( * os.path.join( * self.simulation_folder, # <<<<<<<<<<<<<< * "scatterplot_pca_simulated_celltypes.pdf", * ), */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 224, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 219, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_2 = NULL; __pyx_t_13 = 0; @@ -7489,7 +7321,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_8, __pyx_kp_s_scatterplot_pca_simulated_cellty}; - __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -7498,14 +7330,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_8, __pyx_kp_s_scatterplot_pca_simulated_cellty}; - __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { - __pyx_t_1 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL; @@ -7516,51 +7348,51 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula __Pyx_GIVEREF(__pyx_kp_s_scatterplot_pca_simulated_cellty); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_13, __pyx_kp_s_scatterplot_pca_simulated_cellty); __pyx_t_8 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 223, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 218, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":222 + /* "dissect/PropsSimulator/simulator.pyx":217 * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) * plt.savefig( # <<<<<<<<<<<<<< * os.path.join( * self.simulation_folder, */ - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":227 + /* "dissect/PropsSimulator/simulator.pyx":222 * "scatterplot_pca_simulated_celltypes.pdf", * ), * bbox_inches="tight", # <<<<<<<<<<<<<< * ) * else: */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 222, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_bbox_inches, __pyx_n_s_tight) < 0) __PYX_ERR(0, 227, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_bbox_inches, __pyx_n_s_tight) < 0) __PYX_ERR(0, 222, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":222 + /* "dissect/PropsSimulator/simulator.pyx":217 * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) * plt.savefig( # <<<<<<<<<<<<<< * os.path.join( * self.simulation_folder, */ - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":198 + /* "dissect/PropsSimulator/simulator.pyx":193 * ) * * if self.config["simulation_params"]["generate_component_figures"]: # <<<<<<<<<<<<<< @@ -7569,7 +7401,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula */ } - /* "dissect/PropsSimulator/simulator.pyx":184 + /* "dissect/PropsSimulator/simulator.pyx":179 * adata.X[i, :] = total_sample * * if save: # <<<<<<<<<<<<<< @@ -7579,7 +7411,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula goto __pyx_L12; } - /* "dissect/PropsSimulator/simulator.pyx":230 + /* "dissect/PropsSimulator/simulator.pyx":225 * ) * else: * return adata # <<<<<<<<<<<<<< @@ -7594,7 +7426,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula } __pyx_L12:; - /* "dissect/PropsSimulator/simulator.pyx":149 + /* "dissect/PropsSimulator/simulator.pyx":144 * del heg * * def simulate(self, save=True): # <<<<<<<<<<<<<< @@ -7637,7 +7469,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_8simula return __pyx_r; } -/* "dissect/PropsSimulator/simulator.pyx":232 +/* "dissect/PropsSimulator/simulator.pyx":227 * return adata * * def simulate_per_batch(self, save=True): # <<<<<<<<<<<<<< @@ -7685,7 +7517,7 @@ static PyObject *__pyx_pw_7dissect_14PropsSimulator_9simulator_8Simulate_11simul } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate_per_batch") < 0)) __PYX_ERR(0, 232, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate_per_batch") < 0)) __PYX_ERR(0, 227, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -7701,7 +7533,7 @@ static PyObject *__pyx_pw_7dissect_14PropsSimulator_9simulator_8Simulate_11simul } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("simulate_per_batch", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 232, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("simulate_per_batch", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 227, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dissect.PropsSimulator.simulator.Simulate.simulate_per_batch", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -7748,16 +7580,16 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul int __pyx_clineno = 0; __Pyx_RefNannySetupContext("simulate_per_batch", 0); - /* "dissect/PropsSimulator/simulator.pyx":233 + /* "dissect/PropsSimulator/simulator.pyx":228 * * def simulate_per_batch(self, save=True): * adata_orig = self.sc_adata.copy() # <<<<<<<<<<<<<< * adatas = [] * for batch in self.batches: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 233, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -7772,40 +7604,40 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 228, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_adata_orig = __pyx_t_1; __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":234 + /* "dissect/PropsSimulator/simulator.pyx":229 * def simulate_per_batch(self, save=True): * adata_orig = self.sc_adata.copy() * adatas = [] # <<<<<<<<<<<<<< * for batch in self.batches: * self.sc_adata = adata_orig[ */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_adatas = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":235 + /* "dissect/PropsSimulator/simulator.pyx":230 * adata_orig = self.sc_adata.copy() * adatas = [] * for batch in self.batches: # <<<<<<<<<<<<<< * self.sc_adata = adata_orig[ * adata_orig.obs[self.config["simulation_params"]["batch_col"]] == batch */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_batches); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_batches); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 230, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -7813,17 +7645,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 230, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 230, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -7833,7 +7665,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 235, __pyx_L1_error) + else __PYX_ERR(0, 230, __pyx_L1_error) } break; } @@ -7842,63 +7674,63 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __Pyx_XDECREF_SET(__pyx_v_batch, __pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":237 + /* "dissect/PropsSimulator/simulator.pyx":232 * for batch in self.batches: * self.sc_adata = adata_orig[ * adata_orig.obs[self.config["simulation_params"]["batch_col"]] == batch # <<<<<<<<<<<<<< * ] * adatas.append(self.simulate(save=False)) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata_orig, __pyx_n_s_obs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata_orig, __pyx_n_s_obs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_s_batch_col); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_s_batch_col); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_batch, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_batch, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":236 + /* "dissect/PropsSimulator/simulator.pyx":231 * adatas = [] * for batch in self.batches: * self.sc_adata = adata_orig[ # <<<<<<<<<<<<<< * adata_orig.obs[self.config["simulation_params"]["batch_col"]] == batch * ] */ - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_adata_orig, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_adata_orig, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata, __pyx_t_6) < 0) __PYX_ERR(0, 236, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata, __pyx_t_6) < 0) __PYX_ERR(0, 231, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":239 + /* "dissect/PropsSimulator/simulator.pyx":234 * adata_orig.obs[self.config["simulation_params"]["batch_col"]] == batch * ] * adatas.append(self.simulate(save=False)) # <<<<<<<<<<<<<< * adata = adatas[0].concatenate(adatas[1:], batch_categories=self.batches) * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_save, Py_False) < 0) __PYX_ERR(0, 239, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_save, Py_False) < 0) __PYX_ERR(0, 234, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_adatas, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 239, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_adatas, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 234, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":235 + /* "dissect/PropsSimulator/simulator.pyx":230 * adata_orig = self.sc_adata.copy() * adatas = [] * for batch in self.batches: # <<<<<<<<<<<<<< @@ -7908,32 +7740,32 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":240 + /* "dissect/PropsSimulator/simulator.pyx":235 * ] * adatas.append(self.simulate(save=False)) * adata = adatas[0].concatenate(adatas[1:], batch_categories=self.batches) # <<<<<<<<<<<<<< * * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) */ - __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_adatas, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_adatas, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyList_GetSlice(__pyx_v_adatas, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetSlice(__pyx_v_adatas, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_batches); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_batches); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_batch_categories, __pyx_t_6) < 0) __PYX_ERR(0, 240, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_batch_categories, __pyx_t_6) < 0) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -7941,24 +7773,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __pyx_v_adata = __pyx_t_6; __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":242 + /* "dissect/PropsSimulator/simulator.pyx":237 * adata = adatas[0].concatenate(adatas[1:], batch_categories=self.batches) * * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) # <<<<<<<<<<<<<< * * if save: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -7975,7 +7807,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_kp_s_simulated_h5ad}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -7984,14 +7816,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_kp_s_simulated_h5ad}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { - __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; @@ -8002,7 +7834,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __Pyx_GIVEREF(__pyx_kp_s_simulated_h5ad); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_kp_s_simulated_h5ad); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } @@ -8020,50 +7852,50 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":244 + /* "dissect/PropsSimulator/simulator.pyx":239 * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) * * if save: # <<<<<<<<<<<<<< * sc.set_figure_params(dpi=200) * tmp = adata.copy() */ - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_save); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 244, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_save); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 239, __pyx_L1_error) if (__pyx_t_12) { - /* "dissect/PropsSimulator/simulator.pyx":245 + /* "dissect/PropsSimulator/simulator.pyx":240 * * if save: * sc.set_figure_params(dpi=200) # <<<<<<<<<<<<<< * tmp = adata.copy() * sc.pp.normalize_total(tmp, target_sum=1e6) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 245, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_set_figure_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_set_figure_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dpi, __pyx_int_200) < 0) __PYX_ERR(0, 245, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dpi, __pyx_int_200) < 0) __PYX_ERR(0, 240, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":246 + /* "dissect/PropsSimulator/simulator.pyx":241 * if save: * sc.set_figure_params(dpi=200) * tmp = adata.copy() # <<<<<<<<<<<<<< * sc.pp.normalize_total(tmp, target_sum=1e6) * sc.pp.log1p(tmp) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 246, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -8077,55 +7909,55 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 246, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_tmp = __pyx_t_2; __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":247 + /* "dissect/PropsSimulator/simulator.pyx":242 * sc.set_figure_params(dpi=200) * tmp = adata.copy() * sc.pp.normalize_total(tmp, target_sum=1e6) # <<<<<<<<<<<<<< * sc.pp.log1p(tmp) * sc.tl.pca(tmp) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_tmp); __Pyx_GIVEREF(__pyx_v_tmp); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_tmp); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 247, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 247, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 242, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":248 + /* "dissect/PropsSimulator/simulator.pyx":243 * tmp = adata.copy() * sc.pp.normalize_total(tmp, target_sum=1e6) * sc.pp.log1p(tmp) # <<<<<<<<<<<<<< * sc.tl.pca(tmp) * sc.pl.pca(tmp, color=adata.obs.columns, show=False) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log1p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log1p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -8140,24 +7972,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_tmp) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_tmp); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 248, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":249 + /* "dissect/PropsSimulator/simulator.pyx":244 * sc.pp.normalize_total(tmp, target_sum=1e6) * sc.pp.log1p(tmp) * sc.tl.pca(tmp) # <<<<<<<<<<<<<< * sc.pl.pca(tmp, color=adata.obs.columns, show=False) * plt.savefig( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tl); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tl); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pca); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pca); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -8172,85 +8004,85 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_tmp) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_tmp); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 249, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":250 + /* "dissect/PropsSimulator/simulator.pyx":245 * sc.pp.log1p(tmp) * sc.tl.pca(tmp) * sc.pl.pca(tmp, color=adata.obs.columns, show=False) # <<<<<<<<<<<<<< * plt.savefig( * os.path.join( */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pl); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pl); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pca); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pca); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_tmp); __Pyx_GIVEREF(__pyx_v_tmp); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tmp); - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_columns); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 250, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_columns); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_color, __pyx_t_11) < 0) __PYX_ERR(0, 250, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_color, __pyx_t_11) < 0) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 250, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 250, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 245, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 245, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "dissect/PropsSimulator/simulator.pyx":251 + /* "dissect/PropsSimulator/simulator.pyx":246 * sc.tl.pca(tmp) * sc.pl.pca(tmp, color=adata.obs.columns, show=False) * plt.savefig( # <<<<<<<<<<<<<< * os.path.join( * self.simulation_folder, "scatterplot_pca_simulated.pdf" */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_plt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_plt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_savefig); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_savefig); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":252 + /* "dissect/PropsSimulator/simulator.pyx":247 * sc.pl.pca(tmp, color=adata.obs.columns, show=False) * plt.savefig( * os.path.join( # <<<<<<<<<<<<<< * self.simulation_folder, "scatterplot_pca_simulated.pdf" * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":253 + /* "dissect/PropsSimulator/simulator.pyx":248 * plt.savefig( * os.path.join( * self.simulation_folder, "scatterplot_pca_simulated.pdf" # <<<<<<<<<<<<<< * ) * ) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = NULL; __pyx_t_10 = 0; @@ -8267,7 +8099,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_2, __pyx_kp_s_scatterplot_pca_simulated_pdf}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -8276,14 +8108,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_2, __pyx_kp_s_scatterplot_pca_simulated_pdf}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; @@ -8294,7 +8126,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __Pyx_GIVEREF(__pyx_kp_s_scatterplot_pca_simulated_pdf); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_10, __pyx_kp_s_scatterplot_pca_simulated_pdf); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 247, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -8312,29 +8144,29 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __pyx_t_11 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 251, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 246, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "dissect/PropsSimulator/simulator.pyx":257 + /* "dissect/PropsSimulator/simulator.pyx":252 * ) * * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) # <<<<<<<<<<<<<< * sc.set_figure_params(dpi=200) * tmp = adata.copy() */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_2 = NULL; __pyx_t_10 = 0; @@ -8351,7 +8183,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_9, __pyx_kp_s_simulated_h5ad}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -8360,14 +8192,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_9, __pyx_kp_s_simulated_h5ad}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __pyx_t_2 = NULL; @@ -8378,7 +8210,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __Pyx_GIVEREF(__pyx_kp_s_simulated_h5ad); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_10, __pyx_kp_s_simulated_h5ad); __pyx_t_9 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -8396,40 +8228,40 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __pyx_t_11 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 257, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 252, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "dissect/PropsSimulator/simulator.pyx":258 + /* "dissect/PropsSimulator/simulator.pyx":253 * * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) * sc.set_figure_params(dpi=200) # <<<<<<<<<<<<<< * tmp = adata.copy() * sc.pp.normalize_total(tmp, target_sum=1e6) */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_sc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 258, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_sc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_set_figure_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_set_figure_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dpi, __pyx_int_200) < 0) __PYX_ERR(0, 258, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dpi, __pyx_int_200) < 0) __PYX_ERR(0, 253, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":259 + /* "dissect/PropsSimulator/simulator.pyx":254 * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) * sc.set_figure_params(dpi=200) * tmp = adata.copy() # <<<<<<<<<<<<<< * sc.pp.normalize_total(tmp, target_sum=1e6) * sc.pp.log1p(tmp) */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_copy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 259, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_copy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { @@ -8443,55 +8275,55 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul } __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_11); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 254, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF_SET(__pyx_v_tmp, __pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":260 + /* "dissect/PropsSimulator/simulator.pyx":255 * sc.set_figure_params(dpi=200) * tmp = adata.copy() * sc.pp.normalize_total(tmp, target_sum=1e6) # <<<<<<<<<<<<<< * sc.pp.log1p(tmp) * sc.tl.pca(tmp) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pp); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 260, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pp); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 260, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_v_tmp); __Pyx_GIVEREF(__pyx_v_tmp); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_tmp); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 260, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 255, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":261 + /* "dissect/PropsSimulator/simulator.pyx":256 * tmp = adata.copy() * sc.pp.normalize_total(tmp, target_sum=1e6) * sc.pp.log1p(tmp) # <<<<<<<<<<<<<< * sc.tl.pca(tmp) * sc.pl.pca(tmp, color=adata.obs.columns, show=False) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pp); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pp); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_log1p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 261, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_log1p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; @@ -8506,24 +8338,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul } __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_11, __pyx_v_tmp) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_tmp); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 261, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":262 + /* "dissect/PropsSimulator/simulator.pyx":257 * sc.pp.normalize_total(tmp, target_sum=1e6) * sc.pp.log1p(tmp) * sc.tl.pca(tmp) # <<<<<<<<<<<<<< * sc.pl.pca(tmp, color=adata.obs.columns, show=False) * plt.savefig( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tl); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tl); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_pca); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 262, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_pca); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; @@ -8538,85 +8370,85 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul } __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_11, __pyx_v_tmp) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_tmp); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 257, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":263 + /* "dissect/PropsSimulator/simulator.pyx":258 * sc.pp.log1p(tmp) * sc.tl.pca(tmp) * sc.pl.pca(tmp, color=adata.obs.columns, show=False) # <<<<<<<<<<<<<< * plt.savefig( * os.path.join( */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pl); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pl); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pca); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pca); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_tmp); __Pyx_GIVEREF(__pyx_v_tmp); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tmp); - __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_columns); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 263, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_columns); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_color, __pyx_t_8) < 0) __PYX_ERR(0, 263, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_color, __pyx_t_8) < 0) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 263, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 263, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 258, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 258, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":264 + /* "dissect/PropsSimulator/simulator.pyx":259 * sc.tl.pca(tmp) * sc.pl.pca(tmp, color=adata.obs.columns, show=False) * plt.savefig( # <<<<<<<<<<<<<< * os.path.join( * self.simulation_folder, "scatterplot_pca_simulated.pdf" */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_plt); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 264, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_plt); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_savefig); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 264, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_savefig); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "dissect/PropsSimulator/simulator.pyx":265 + /* "dissect/PropsSimulator/simulator.pyx":260 * sc.pl.pca(tmp, color=adata.obs.columns, show=False) * plt.savefig( * os.path.join( # <<<<<<<<<<<<<< * self.simulation_folder, "scatterplot_pca_simulated.pdf" * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":266 + /* "dissect/PropsSimulator/simulator.pyx":261 * plt.savefig( * os.path.join( * self.simulation_folder, "scatterplot_pca_simulated.pdf" # <<<<<<<<<<<<<< * ) * ) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -8633,7 +8465,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_6, __pyx_kp_s_scatterplot_pca_simulated_pdf}; - __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -8642,14 +8474,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_6, __pyx_kp_s_scatterplot_pca_simulated_pdf}; - __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_2 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_9); __pyx_t_9 = NULL; @@ -8660,7 +8492,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __Pyx_GIVEREF(__pyx_kp_s_scatterplot_pca_simulated_pdf); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_10, __pyx_kp_s_scatterplot_pca_simulated_pdf); __pyx_t_6 = 0; - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 265, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 260, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -8678,73 +8510,73 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __pyx_t_8 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_11); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 264, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 259, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":270 + /* "dissect/PropsSimulator/simulator.pyx":265 * ) * * if self.config["simulation_params"]["generate_component_figures"]: # <<<<<<<<<<<<<< * idxs = {} * celltypes_col = [] */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_generate_component_figures); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_generate_component_figures); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 270, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 265, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_12) { - /* "dissect/PropsSimulator/simulator.pyx":271 + /* "dissect/PropsSimulator/simulator.pyx":266 * * if self.config["simulation_params"]["generate_component_figures"]: * idxs = {} # <<<<<<<<<<<<<< * celltypes_col = [] * for j in range(self.n_celltypes): */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 271, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 266, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_idxs = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":272 + /* "dissect/PropsSimulator/simulator.pyx":267 * if self.config["simulation_params"]["generate_component_figures"]: * idxs = {} * celltypes_col = [] # <<<<<<<<<<<<<< * for j in range(self.n_celltypes): * celltype = self.celltypes[j] */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 272, __pyx_L1_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 267, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_celltypes_col = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":273 + /* "dissect/PropsSimulator/simulator.pyx":268 * idxs = {} * celltypes_col = [] * for j in range(self.n_celltypes): # <<<<<<<<<<<<<< * celltype = self.celltypes[j] * idxs[celltype] = adata.obsm["cells"][:, j] > 0 */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -8752,17 +8584,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul if (likely(PyList_CheckExact(__pyx_t_8))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 268, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -8772,7 +8604,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 273, __pyx_L1_error) + else __PYX_ERR(0, 268, __pyx_L1_error) } break; } @@ -8781,34 +8613,34 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":274 + /* "dissect/PropsSimulator/simulator.pyx":269 * celltypes_col = [] * for j in range(self.n_celltypes): * celltype = self.celltypes[j] # <<<<<<<<<<<<<< * idxs[celltype] = adata.obsm["cells"][:, j] > 0 * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_j); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 274, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_j); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 269, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_celltype, __pyx_t_11); __pyx_t_11 = 0; - /* "dissect/PropsSimulator/simulator.pyx":275 + /* "dissect/PropsSimulator/simulator.pyx":270 * for j in range(self.n_celltypes): * celltype = self.celltypes[j] * idxs[celltype] = adata.obsm["cells"][:, j] > 0 # <<<<<<<<<<<<<< * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() * X = [ */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obsm); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obsm); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_11, __pyx_n_s_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_11, __pyx_n_s_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); @@ -8816,25 +8648,25 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __Pyx_INCREF(__pyx_v_j); __Pyx_GIVEREF(__pyx_v_j); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_j); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 275, __pyx_L1_error) + __pyx_t_11 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(PyDict_SetItem(__pyx_v_idxs, __pyx_v_celltype, __pyx_t_11) < 0)) __PYX_ERR(0, 275, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_idxs, __pyx_v_celltype, __pyx_t_11) < 0)) __PYX_ERR(0, 270, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "dissect/PropsSimulator/simulator.pyx":276 + /* "dissect/PropsSimulator/simulator.pyx":271 * celltype = self.celltypes[j] * idxs[celltype] = adata.obsm["cells"][:, j] > 0 * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() # <<<<<<<<<<<<<< * X = [ * adata.layers[celltype][idxs[celltype], :] */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_idxs, __pyx_v_celltype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_idxs, __pyx_v_celltype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -8849,27 +8681,27 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul } __pyx_t_11 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 276, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_celltype); __Pyx_GIVEREF(__pyx_v_celltype); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_celltype); - { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_temp)) __PYX_ERR(0, 276, __pyx_L1_error) + { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_temp)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_temp); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_temp; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyNumber_Add(__pyx_v_celltypes_col, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 276, __pyx_L1_error) + __pyx_t_11 = PyNumber_Add(__pyx_v_celltypes_col, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 271, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_celltypes_col, ((PyObject*)__pyx_t_11)); __pyx_t_11 = 0; - /* "dissect/PropsSimulator/simulator.pyx":273 + /* "dissect/PropsSimulator/simulator.pyx":268 * idxs = {} * celltypes_col = [] * for j in range(self.n_celltypes): # <<<<<<<<<<<<<< @@ -8879,32 +8711,32 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":277 + /* "dissect/PropsSimulator/simulator.pyx":272 * idxs[celltype] = adata.obsm["cells"][:, j] > 0 * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() * X = [ # <<<<<<<<<<<<<< * adata.layers[celltype][idxs[celltype], :] * for celltype in self.celltypes */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - /* "dissect/PropsSimulator/simulator.pyx":279 + /* "dissect/PropsSimulator/simulator.pyx":274 * X = [ * adata.layers[celltype][idxs[celltype], :] * for celltype in self.celltypes # <<<<<<<<<<<<<< * ] * tmp1 = AnnData( */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (likely(PyList_CheckExact(__pyx_t_11)) || PyTuple_CheckExact(__pyx_t_11)) { __pyx_t_3 = __pyx_t_11; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 274, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; for (;;) { @@ -8912,17 +8744,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_11 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_11); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_11 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_11); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 274, __pyx_L1_error) #else - __pyx_t_11 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_11 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_11); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_11); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 274, __pyx_L1_error) #else - __pyx_t_11 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 279, __pyx_L1_error) + __pyx_t_11 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 274, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif } @@ -8932,7 +8764,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 279, __pyx_L1_error) + else __PYX_ERR(0, 274, __pyx_L1_error) } break; } @@ -8941,21 +8773,21 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __Pyx_XDECREF_SET(__pyx_v_celltype, __pyx_t_11); __pyx_t_11 = 0; - /* "dissect/PropsSimulator/simulator.pyx":278 + /* "dissect/PropsSimulator/simulator.pyx":273 * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() * X = [ * adata.layers[celltype][idxs[celltype], :] # <<<<<<<<<<<<<< * for celltype in self.celltypes * ] */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_layers); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_layers); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_11, __pyx_v_celltype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_11, __pyx_v_celltype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_idxs, __pyx_v_celltype); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_idxs, __pyx_v_celltype); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_11); @@ -8963,14 +8795,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __Pyx_GIVEREF(__pyx_slice_); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice_); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 278, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 273, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 277, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 272, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "dissect/PropsSimulator/simulator.pyx":279 + /* "dissect/PropsSimulator/simulator.pyx":274 * X = [ * adata.layers[celltype][idxs[celltype], :] * for celltype in self.celltypes # <<<<<<<<<<<<<< @@ -8982,99 +8814,99 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __pyx_v_X = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":281 + /* "dissect/PropsSimulator/simulator.pyx":276 * for celltype in self.celltypes * ] * tmp1 = AnnData( # <<<<<<<<<<<<<< * np.concatenate(X, axis=0), * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_AnnData); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 281, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_AnnData); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - /* "dissect/PropsSimulator/simulator.pyx":282 + /* "dissect/PropsSimulator/simulator.pyx":277 * ] * tmp1 = AnnData( * np.concatenate(X, axis=0), # <<<<<<<<<<<<<< * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_X); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 282, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 277, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":281 + /* "dissect/PropsSimulator/simulator.pyx":276 * for celltype in self.celltypes * ] * tmp1 = AnnData( # <<<<<<<<<<<<<< * np.concatenate(X, axis=0), * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":283 + /* "dissect/PropsSimulator/simulator.pyx":278 * tmp1 = AnnData( * np.concatenate(X, axis=0), * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_celltypes_col); __Pyx_GIVEREF(__pyx_v_celltypes_col); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_celltypes_col); - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_n_s_Celltype); __Pyx_GIVEREF(__pyx_n_s_Celltype); PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_Celltype); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_columns, __pyx_t_9) < 0) __PYX_ERR(0, 283, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_columns, __pyx_t_9) < 0) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 283, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_obs, __pyx_t_9) < 0) __PYX_ERR(0, 283, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_obs, __pyx_t_9) < 0) __PYX_ERR(0, 278, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":281 + /* "dissect/PropsSimulator/simulator.pyx":276 * for celltype in self.celltypes * ] * tmp1 = AnnData( # <<<<<<<<<<<<<< * np.concatenate(X, axis=0), * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 276, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -9082,80 +8914,80 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __pyx_v_tmp1 = __pyx_t_9; __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":286 + /* "dissect/PropsSimulator/simulator.pyx":281 * ) * * sc.pp.subsample(tmp1, fraction=0.5, random_state=42) # <<<<<<<<<<<<<< * sc.pp.normalize_total(tmp1, target_sum=1e6) * sc.pp.log1p(tmp1) */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sc); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 286, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sc); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_subsample); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_subsample); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_tmp1); __Pyx_GIVEREF(__pyx_v_tmp1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tmp1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fraction, __pyx_float_0_5) < 0) __PYX_ERR(0, 286, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_random_state, __pyx_int_42) < 0) __PYX_ERR(0, 286, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 286, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fraction, __pyx_float_0_5) < 0) __PYX_ERR(0, 281, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_random_state, __pyx_int_42) < 0) __PYX_ERR(0, 281, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 281, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":287 + /* "dissect/PropsSimulator/simulator.pyx":282 * * sc.pp.subsample(tmp1, fraction=0.5, random_state=42) * sc.pp.normalize_total(tmp1, target_sum=1e6) # <<<<<<<<<<<<<< * sc.pp.log1p(tmp1) * sc.tl.pca(tmp1) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_sc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_sc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_pp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_pp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 287, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_tmp1); __Pyx_GIVEREF(__pyx_v_tmp1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_tmp1); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 287, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 287, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 282, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 282, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":288 + /* "dissect/PropsSimulator/simulator.pyx":283 * sc.pp.subsample(tmp1, fraction=0.5, random_state=42) * sc.pp.normalize_total(tmp1, target_sum=1e6) * sc.pp.log1p(tmp1) # <<<<<<<<<<<<<< * sc.tl.pca(tmp1) * fig, ax = plt.subplots(nrows=1, ncols=1) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_log1p); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_log1p); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -9170,24 +9002,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul } __pyx_t_9 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_tmp1) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_tmp1); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 288, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 283, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":289 + /* "dissect/PropsSimulator/simulator.pyx":284 * sc.pp.normalize_total(tmp1, target_sum=1e6) * sc.pp.log1p(tmp1) * sc.tl.pca(tmp1) # <<<<<<<<<<<<<< * fig, ax = plt.subplots(nrows=1, ncols=1) * sc.pl.pca( */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_tl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_tl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pca); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pca); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -9202,28 +9034,28 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul } __pyx_t_9 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_tmp1) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_tmp1); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 289, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 284, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":290 + /* "dissect/PropsSimulator/simulator.pyx":285 * sc.pp.log1p(tmp1) * sc.tl.pca(tmp1) * fig, ax = plt.subplots(nrows=1, ncols=1) # <<<<<<<<<<<<<< * sc.pl.pca( * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_plt); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 290, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_plt); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_subplots); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_subplots); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_nrows, __pyx_int_1) < 0) __PYX_ERR(0, 290, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_ncols, __pyx_int_1) < 0) __PYX_ERR(0, 290, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_nrows, __pyx_int_1) < 0) __PYX_ERR(0, 285, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_ncols, __pyx_int_1) < 0) __PYX_ERR(0, 285, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -9233,7 +9065,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 290, __pyx_L1_error) + __PYX_ERR(0, 285, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -9246,15 +9078,15 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_1); #else - __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 285, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_13 = Py_TYPE(__pyx_t_8)->tp_iternext; @@ -9262,7 +9094,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_1 = __pyx_t_13(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_8), 2) < 0) __PYX_ERR(0, 290, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_8), 2) < 0) __PYX_ERR(0, 285, __pyx_L1_error) __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L12_unpacking_done; @@ -9270,7 +9102,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 290, __pyx_L1_error) + __PYX_ERR(0, 285, __pyx_L1_error) __pyx_L12_unpacking_done:; } __pyx_v_fig = __pyx_t_9; @@ -9278,92 +9110,92 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __pyx_v_ax = __pyx_t_1; __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":291 + /* "dissect/PropsSimulator/simulator.pyx":286 * sc.tl.pca(tmp1) * fig, ax = plt.subplots(nrows=1, ncols=1) * sc.pl.pca( # <<<<<<<<<<<<<< * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pca); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pca); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":292 + /* "dissect/PropsSimulator/simulator.pyx":287 * fig, ax = plt.subplots(nrows=1, ncols=1) * sc.pl.pca( * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax # <<<<<<<<<<<<<< * ) * plt.savefig( */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_tmp1); __Pyx_GIVEREF(__pyx_v_tmp1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tmp1); - __pyx_t_9 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 292, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 287, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_color, __pyx_n_s_Celltype) < 0) __PYX_ERR(0, 292, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 292, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_legend_loc, __pyx_kp_s_on_data) < 0) __PYX_ERR(0, 292, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_ax, __pyx_v_ax) < 0) __PYX_ERR(0, 292, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_color, __pyx_n_s_Celltype) < 0) __PYX_ERR(0, 287, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 287, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_legend_loc, __pyx_kp_s_on_data) < 0) __PYX_ERR(0, 287, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_ax, __pyx_v_ax) < 0) __PYX_ERR(0, 287, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":291 + /* "dissect/PropsSimulator/simulator.pyx":286 * sc.tl.pca(tmp1) * fig, ax = plt.subplots(nrows=1, ncols=1) * sc.pl.pca( # <<<<<<<<<<<<<< * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 291, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 286, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":294 + /* "dissect/PropsSimulator/simulator.pyx":289 * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) * plt.savefig( # <<<<<<<<<<<<<< * os.path.join( * self.simulation_folder, */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_plt); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 294, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_plt); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_savefig); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_savefig); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":295 + /* "dissect/PropsSimulator/simulator.pyx":290 * ) * plt.savefig( * os.path.join( # <<<<<<<<<<<<<< * self.simulation_folder, * "scatterplot_pca_simulated_celltypes.pdf", */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":296 + /* "dissect/PropsSimulator/simulator.pyx":291 * plt.savefig( * os.path.join( * self.simulation_folder, # <<<<<<<<<<<<<< * "scatterplot_pca_simulated_celltypes.pdf", * ), */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 291, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_10 = 0; @@ -9380,7 +9212,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_kp_s_scatterplot_pca_simulated_cellty}; - __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -9389,14 +9221,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_kp_s_scatterplot_pca_simulated_cellty}; - __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_3 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -9407,51 +9239,51 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul __Pyx_GIVEREF(__pyx_kp_s_scatterplot_pca_simulated_cellty); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_10, __pyx_kp_s_scatterplot_pca_simulated_cellty); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 295, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 290, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":294 + /* "dissect/PropsSimulator/simulator.pyx":289 * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) * plt.savefig( # <<<<<<<<<<<<<< * os.path.join( * self.simulation_folder, */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":299 + /* "dissect/PropsSimulator/simulator.pyx":294 * "scatterplot_pca_simulated_celltypes.pdf", * ), * bbox_inches="tight", # <<<<<<<<<<<<<< * ) * */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 299, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 294, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_bbox_inches, __pyx_n_s_tight) < 0) __PYX_ERR(0, 299, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_bbox_inches, __pyx_n_s_tight) < 0) __PYX_ERR(0, 294, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":294 + /* "dissect/PropsSimulator/simulator.pyx":289 * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) * plt.savefig( # <<<<<<<<<<<<<< * os.path.join( * self.simulation_folder, */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 294, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 289, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":270 + /* "dissect/PropsSimulator/simulator.pyx":265 * ) * * if self.config["simulation_params"]["generate_component_figures"]: # <<<<<<<<<<<<<< @@ -9460,7 +9292,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul */ } - /* "dissect/PropsSimulator/simulator.pyx":244 + /* "dissect/PropsSimulator/simulator.pyx":239 * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) * * if save: # <<<<<<<<<<<<<< @@ -9469,7 +9301,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul */ } - /* "dissect/PropsSimulator/simulator.pyx":232 + /* "dissect/PropsSimulator/simulator.pyx":227 * return adata * * def simulate_per_batch(self, save=True): # <<<<<<<<<<<<<< @@ -9509,7 +9341,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_8Simulate_10simul return __pyx_r; } -/* "dissect/PropsSimulator/simulator.pyx":303 +/* "dissect/PropsSimulator/simulator.pyx":298 * * class Simulate_st(object): * def __init__(self): # <<<<<<<<<<<<<< @@ -9543,11 +9375,11 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st___i return __pyx_r; } -/* "dissect/PropsSimulator/simulator.pyx":306 +/* "dissect/PropsSimulator/simulator.pyx":301 * pass * * def initialize(self, config): # <<<<<<<<<<<<<< - * self.config["simulation_params"] = config + * self.config = config * self.sc_adata = sc.read(config["simulation_params"]["scdata"]) */ @@ -9586,11 +9418,11 @@ static PyObject *__pyx_pw_7dissect_14PropsSimulator_9simulator_11Simulate_st_3in case 1: if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_config)) != 0)) kw_args--; else { - __Pyx_RaiseArgtupleInvalid("initialize", 1, 2, 2, 1); __PYX_ERR(0, 306, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("initialize", 1, 2, 2, 1); __PYX_ERR(0, 301, __pyx_L3_error) } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "initialize") < 0)) __PYX_ERR(0, 306, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "initialize") < 0)) __PYX_ERR(0, 301, __pyx_L3_error) } } else if (PyTuple_GET_SIZE(__pyx_args) != 2) { goto __pyx_L5_argtuple_error; @@ -9603,7 +9435,7 @@ static PyObject *__pyx_pw_7dissect_14PropsSimulator_9simulator_11Simulate_st_3in } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("initialize", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 306, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("initialize", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 301, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dissect.PropsSimulator.simulator.Simulate_st.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -9635,33 +9467,30 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_2in int __pyx_clineno = 0; __Pyx_RefNannySetupContext("initialize", 0); - /* "dissect/PropsSimulator/simulator.pyx":307 + /* "dissect/PropsSimulator/simulator.pyx":302 * * def initialize(self, config): - * self.config["simulation_params"] = config # <<<<<<<<<<<<<< + * self.config = config # <<<<<<<<<<<<<< * self.sc_adata = sc.read(config["simulation_params"]["scdata"]) * if "sparse" in str(type(self.sc_adata.X)): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_s_simulation_params, __pyx_v_config) < 0)) __PYX_ERR(0, 307, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_config, __pyx_v_config) < 0) __PYX_ERR(0, 302, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":308 + /* "dissect/PropsSimulator/simulator.pyx":303 * def initialize(self, config): - * self.config["simulation_params"] = config + * self.config = config * self.sc_adata = sc.read(config["simulation_params"]["scdata"]) # <<<<<<<<<<<<<< * if "sparse" in str(type(self.sc_adata.X)): * self.sc_adata.X = np.array(self.sc_adata.X.todense()) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_read); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_config, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_v_config, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_scdata); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_scdata); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -9677,50 +9506,50 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_2in __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata, __pyx_t_1) < 0) __PYX_ERR(0, 308, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata, __pyx_t_1) < 0) __PYX_ERR(0, 303, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":309 - * self.config["simulation_params"] = config + /* "dissect/PropsSimulator/simulator.pyx":304 + * self.config = config * self.sc_adata = sc.read(config["simulation_params"]["scdata"]) * if "sparse" in str(type(self.sc_adata.X)): # <<<<<<<<<<<<<< * self.sc_adata.X = np.array(self.sc_adata.X.todense()) * self.celltypes = np.sort( */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_X); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_X); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)Py_TYPE(__pyx_t_3))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)Py_TYPE(__pyx_t_3))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_sparse, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 309, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_sparse, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 304, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { - /* "dissect/PropsSimulator/simulator.pyx":310 + /* "dissect/PropsSimulator/simulator.pyx":305 * self.sc_adata = sc.read(config["simulation_params"]["scdata"]) * if "sparse" in str(type(self.sc_adata.X)): * self.sc_adata.X = np.array(self.sc_adata.X.todense()) # <<<<<<<<<<<<<< * self.celltypes = np.sort( * np.array(self.sc_adata.obs[config["simulation_params"]["celltype_col"]].unique()) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_array); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_X); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_X); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_todense); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_todense); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -9735,7 +9564,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_2in } __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -9751,17 +9580,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_2in __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_n_s_X, __pyx_t_1) < 0) __PYX_ERR(0, 310, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_n_s_X, __pyx_t_1) < 0) __PYX_ERR(0, 305, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dissect/PropsSimulator/simulator.pyx":309 - * self.config["simulation_params"] = config + /* "dissect/PropsSimulator/simulator.pyx":304 + * self.config = config * self.sc_adata = sc.read(config["simulation_params"]["scdata"]) * if "sparse" in str(type(self.sc_adata.X)): # <<<<<<<<<<<<<< * self.sc_adata.X = np.array(self.sc_adata.X.todense()) @@ -9769,46 +9598,46 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_2in */ } - /* "dissect/PropsSimulator/simulator.pyx":311 + /* "dissect/PropsSimulator/simulator.pyx":306 * if "sparse" in str(type(self.sc_adata.X)): * self.sc_adata.X = np.array(self.sc_adata.X.todense()) * self.celltypes = np.sort( # <<<<<<<<<<<<<< * np.array(self.sc_adata.obs[config["simulation_params"]["celltype_col"]].unique()) * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sort); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":312 + /* "dissect/PropsSimulator/simulator.pyx":307 * self.sc_adata.X = np.array(self.sc_adata.X.todense()) * self.celltypes = np.sort( * np.array(self.sc_adata.obs[config["simulation_params"]["celltype_col"]].unique()) # <<<<<<<<<<<<<< * ) * self.n_celltypes = len(self.celltypes) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_array); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_obs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_obs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_config, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_config, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_n_s_celltype_col); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_n_s_celltype_col); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; - __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_unique); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 312, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_unique); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_10); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -9823,7 +9652,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_2in } __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_10); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0; __pyx_t_10 = NULL; @@ -9839,7 +9668,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_2in __pyx_t_1 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_10, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -9855,41 +9684,41 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_2in __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":311 + /* "dissect/PropsSimulator/simulator.pyx":306 * if "sparse" in str(type(self.sc_adata.X)): * self.sc_adata.X = np.array(self.sc_adata.X.todense()) * self.celltypes = np.sort( # <<<<<<<<<<<<<< * np.array(self.sc_adata.obs[config["simulation_params"]["celltype_col"]].unique()) * ) */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_celltypes, __pyx_t_4) < 0) __PYX_ERR(0, 311, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_celltypes, __pyx_t_4) < 0) __PYX_ERR(0, 306, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dissect/PropsSimulator/simulator.pyx":314 + /* "dissect/PropsSimulator/simulator.pyx":309 * np.array(self.sc_adata.obs[config["simulation_params"]["celltype_col"]].unique()) * ) * self.n_celltypes = len(self.celltypes) # <<<<<<<<<<<<<< * * def generate_props(self): */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_11 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_11 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error) + __pyx_t_4 = PyInt_FromSsize_t(__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes, __pyx_t_4) < 0) __PYX_ERR(0, 314, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes, __pyx_t_4) < 0) __PYX_ERR(0, 309, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dissect/PropsSimulator/simulator.pyx":306 + /* "dissect/PropsSimulator/simulator.pyx":301 * pass * * def initialize(self, config): # <<<<<<<<<<<<<< - * self.config["simulation_params"] = config + * self.config = config * self.sc_adata = sc.read(config["simulation_params"]["scdata"]) */ @@ -9913,7 +9742,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_2in return __pyx_r; } -/* "dissect/PropsSimulator/simulator.pyx":316 +/* "dissect/PropsSimulator/simulator.pyx":311 * self.n_celltypes = len(self.celltypes) * * def generate_props(self): # <<<<<<<<<<<<<< @@ -9968,48 +9797,48 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge int __pyx_clineno = 0; __Pyx_RefNannySetupContext("generate_props", 0); - /* "dissect/PropsSimulator/simulator.pyx":317 + /* "dissect/PropsSimulator/simulator.pyx":312 * * def generate_props(self): * if not self.config["simulation_params"]["n_samples"]: # <<<<<<<<<<<<<< * self.config["simulation_params"]["n_samples"] = 1000 * self.n_celltypes * self.n_sparse = self.config["simulation_params"]["n_samples"] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_n_samples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_n_samples); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 317, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 312, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_4 = ((!__pyx_t_3) != 0); if (__pyx_t_4) { - /* "dissect/PropsSimulator/simulator.pyx":318 + /* "dissect/PropsSimulator/simulator.pyx":313 * def generate_props(self): * if not self.config["simulation_params"]["n_samples"]: * self.config["simulation_params"]["n_samples"] = 1000 * self.n_celltypes # <<<<<<<<<<<<<< * self.n_sparse = self.config["simulation_params"]["n_samples"] * ##### Sparse */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = PyNumber_Multiply(__pyx_int_1000, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_2 = PyNumber_Multiply(__pyx_int_1000, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 318, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_s_n_samples, __pyx_t_2) < 0)) __PYX_ERR(0, 318, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_n_s_n_samples, __pyx_t_2) < 0)) __PYX_ERR(0, 313, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":317 + /* "dissect/PropsSimulator/simulator.pyx":312 * * def generate_props(self): * if not self.config["simulation_params"]["n_samples"]: # <<<<<<<<<<<<<< @@ -10018,41 +9847,41 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge */ } - /* "dissect/PropsSimulator/simulator.pyx":319 + /* "dissect/PropsSimulator/simulator.pyx":314 * if not self.config["simulation_params"]["n_samples"]: * self.config["simulation_params"]["n_samples"] = 1000 * self.n_celltypes * self.n_sparse = self.config["simulation_params"]["n_samples"] # <<<<<<<<<<<<<< * ##### Sparse * keep_sparse = np.ones((self.n_sparse, self.n_celltypes), dtype=np.float32) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_n_samples); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_n_samples); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_n_sparse, __pyx_t_2) < 0) __PYX_ERR(0, 319, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_n_sparse, __pyx_t_2) < 0) __PYX_ERR(0, 314, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":321 + /* "dissect/PropsSimulator/simulator.pyx":316 * self.n_sparse = self.config["simulation_params"]["n_samples"] * ##### Sparse * keep_sparse = np.ones((self.n_sparse, self.n_celltypes), dtype=np.float32) # <<<<<<<<<<<<<< * * keep = np.random.randint(1, 6, size=self.n_sparse) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ones); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ones); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_sparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_sparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); @@ -10060,21 +9889,21 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1); __pyx_t_2 = 0; __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 321, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_7) < 0) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 321, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 316, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -10082,47 +9911,47 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __pyx_v_keep_sparse = __pyx_t_7; __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":323 + /* "dissect/PropsSimulator/simulator.pyx":318 * keep_sparse = np.ones((self.n_sparse, self.n_celltypes), dtype=np.float32) * * keep = np.random.randint(1, 6, size=self.n_sparse) # <<<<<<<<<<<<<< * keeps = [] * for i in keep: */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 323, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_random); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_random); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_randint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_randint); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_sparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_sparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_size, __pyx_t_1) < 0) __PYX_ERR(0, 323, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_size, __pyx_t_1) < 0) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__2, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_keep = __pyx_t_1; __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":324 + /* "dissect/PropsSimulator/simulator.pyx":319 * * keep = np.random.randint(1, 6, size=self.n_sparse) * keeps = [] # <<<<<<<<<<<<<< * for i in keep: * keeps.append( */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 324, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 319, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_keeps = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":325 + /* "dissect/PropsSimulator/simulator.pyx":320 * keep = np.random.randint(1, 6, size=self.n_sparse) * keeps = [] * for i in keep: # <<<<<<<<<<<<<< @@ -10133,26 +9962,26 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __pyx_t_1 = __pyx_v_keep; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_keep); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_keep); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 320, __pyx_L1_error) } for (;;) { if (likely(!__pyx_t_9)) { if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 320, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 320, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 320, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } @@ -10162,7 +9991,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 325, __pyx_L1_error) + else __PYX_ERR(0, 320, __pyx_L1_error) } break; } @@ -10171,55 +10000,55 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":327 + /* "dissect/PropsSimulator/simulator.pyx":322 * for i in keep: * keeps.append( * np.random.choice(list(range(self.n_celltypes)), size=i, replace=False) # <<<<<<<<<<<<<< * ) * */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_random); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_random); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_choice); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_choice); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_7 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 327, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_size, __pyx_v_i) < 0) __PYX_ERR(0, 327, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_replace, Py_False) < 0) __PYX_ERR(0, 327, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_size, __pyx_v_i) < 0) __PYX_ERR(0, 322, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_replace, Py_False) < 0) __PYX_ERR(0, 322, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":326 + /* "dissect/PropsSimulator/simulator.pyx":321 * keeps = [] * for i in keep: * keeps.append( # <<<<<<<<<<<<<< * np.random.choice(list(range(self.n_celltypes)), size=i, replace=False) * ) */ - __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_keeps, __pyx_t_2); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 326, __pyx_L1_error) + __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_keeps, __pyx_t_2); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 321, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":325 + /* "dissect/PropsSimulator/simulator.pyx":320 * keep = np.random.randint(1, 6, size=self.n_sparse) * keeps = [] * for i in keep: # <<<<<<<<<<<<<< @@ -10229,26 +10058,26 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":330 + /* "dissect/PropsSimulator/simulator.pyx":325 * ) * * for i in range(len(keep)): # <<<<<<<<<<<<<< * keep_sparse[i, ~keeps[i]] = 1e-6 * */ - __pyx_t_8 = PyObject_Length(__pyx_v_keep); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 330, __pyx_L1_error) - __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_8 = PyObject_Length(__pyx_v_keep); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 325, __pyx_L1_error) + __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 325, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -10256,17 +10085,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 325, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 325, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 330, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -10276,7 +10105,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 330, __pyx_L1_error) + else __PYX_ERR(0, 325, __pyx_L1_error) } break; } @@ -10285,19 +10114,19 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":331 + /* "dissect/PropsSimulator/simulator.pyx":326 * * for i in range(len(keep)): * keep_sparse[i, ~keeps[i]] = 1e-6 # <<<<<<<<<<<<<< * * self.props_sparse = np.zeros( */ - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_keeps, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_keeps, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = PyNumber_Invert(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_7 = PyNumber_Invert(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_i); __Pyx_GIVEREF(__pyx_v_i); @@ -10305,10 +10134,10 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7); __pyx_t_7 = 0; - if (unlikely(PyObject_SetItem(__pyx_v_keep_sparse, __pyx_t_2, __pyx_float_1eneg_6) < 0)) __PYX_ERR(0, 331, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_v_keep_sparse, __pyx_t_2, __pyx_float_1eneg_6) < 0)) __PYX_ERR(0, 326, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":330 + /* "dissect/PropsSimulator/simulator.pyx":325 * ) * * for i in range(len(keep)): # <<<<<<<<<<<<<< @@ -10318,31 +10147,31 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":333 + /* "dissect/PropsSimulator/simulator.pyx":328 * keep_sparse[i, ~keeps[i]] = 1e-6 * * self.props_sparse = np.zeros( # <<<<<<<<<<<<<< * (self.n_sparse, self.n_celltypes), dtype=np.float32 * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":334 + /* "dissect/PropsSimulator/simulator.pyx":329 * * self.props_sparse = np.zeros( * (self.n_sparse, self.n_celltypes), dtype=np.float32 # <<<<<<<<<<<<<< * ) * for i in range(self.n_sparse): */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_sparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_sparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); @@ -10351,70 +10180,70 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __pyx_t_1 = 0; __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":333 + /* "dissect/PropsSimulator/simulator.pyx":328 * keep_sparse[i, ~keeps[i]] = 1e-6 * * self.props_sparse = np.zeros( # <<<<<<<<<<<<<< * (self.n_sparse, self.n_celltypes), dtype=np.float32 * ) */ - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":334 + /* "dissect/PropsSimulator/simulator.pyx":329 * * self.props_sparse = np.zeros( * (self.n_sparse, self.n_celltypes), dtype=np.float32 # <<<<<<<<<<<<<< * ) * for i in range(self.n_sparse): */ - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 334, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 329, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":333 + /* "dissect/PropsSimulator/simulator.pyx":328 * keep_sparse[i, ~keeps[i]] = 1e-6 * * self.props_sparse = np.zeros( # <<<<<<<<<<<<<< * (self.n_sparse, self.n_celltypes), dtype=np.float32 * ) */ - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 333, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse, __pyx_t_6) < 0) __PYX_ERR(0, 333, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse, __pyx_t_6) < 0) __PYX_ERR(0, 328, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":336 + /* "dissect/PropsSimulator/simulator.pyx":331 * (self.n_sparse, self.n_celltypes), dtype=np.float32 * ) * for i in range(self.n_sparse): # <<<<<<<<<<<<<< * self.props_sparse[i, :] = np.random.dirichlet(keep_sparse[i], 1)[0] * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_sparse); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_sparse); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 331, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { @@ -10422,17 +10251,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge if (likely(PyList_CheckExact(__pyx_t_6))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 331, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 331, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } @@ -10442,7 +10271,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 336, __pyx_L1_error) + else __PYX_ERR(0, 331, __pyx_L1_error) } break; } @@ -10451,22 +10280,22 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":337 + /* "dissect/PropsSimulator/simulator.pyx":332 * ) * for i in range(self.n_sparse): * self.props_sparse[i, :] = np.random.dirichlet(keep_sparse[i], 1)[0] # <<<<<<<<<<<<<< * * self.props_sparse = (self.props_sparse.T / self.props_sparse.sum(axis=1)).T */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dirichlet); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dirichlet); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_keep_sparse, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_keep_sparse, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_1 = NULL; __pyx_t_11 = 0; @@ -10483,7 +10312,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_2, __pyx_int_1}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -10492,14 +10321,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_2, __pyx_int_1}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_1) { __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); __pyx_t_1 = NULL; @@ -10510,17 +10339,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __Pyx_GIVEREF(__pyx_int_1); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_int_1); __pyx_t_2 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_INCREF(__pyx_v_i); __Pyx_GIVEREF(__pyx_v_i); @@ -10528,12 +10357,12 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __Pyx_INCREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_slice_); - if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_t_12, __pyx_t_7) < 0)) __PYX_ERR(0, 337, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_5, __pyx_t_12, __pyx_t_7) < 0)) __PYX_ERR(0, 332, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":336 + /* "dissect/PropsSimulator/simulator.pyx":331 * (self.n_sparse, self.n_celltypes), dtype=np.float32 * ) * for i in range(self.n_sparse): # <<<<<<<<<<<<<< @@ -10543,65 +10372,65 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":339 + /* "dissect/PropsSimulator/simulator.pyx":334 * self.props_sparse[i, :] = np.random.dirichlet(keep_sparse[i], 1)[0] * * self.props_sparse = (self.props_sparse.T / self.props_sparse.sum(axis=1)).T # <<<<<<<<<<<<<< * * for i in range(self.props_sparse.shape[0]): */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_T); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_T); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 339, __pyx_L1_error) - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 334, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_T); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_T); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse, __pyx_t_5) < 0) __PYX_ERR(0, 339, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse, __pyx_t_5) < 0) __PYX_ERR(0, 334, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":341 + /* "dissect/PropsSimulator/simulator.pyx":336 * self.props_sparse = (self.props_sparse.T / self.props_sparse.sum(axis=1)).T * * for i in range(self.props_sparse.shape[0]): # <<<<<<<<<<<<<< * n = np.random.choice(list(range(5, 12)), size=1, replace=False) * self.cells_sparse = self.props_sparse * n */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_shape); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) { __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0; __pyx_t_9 = NULL; } else { - __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 336, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; for (;;) { @@ -10609,17 +10438,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge if (likely(PyList_CheckExact(__pyx_t_5))) { if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } else { if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 336, __pyx_L1_error) #else - __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); #endif } @@ -10629,7 +10458,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 341, __pyx_L1_error) + else __PYX_ERR(0, 336, __pyx_L1_error) } break; } @@ -10638,36 +10467,36 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":342 + /* "dissect/PropsSimulator/simulator.pyx":337 * * for i in range(self.props_sparse.shape[0]): * n = np.random.choice(list(range(5, 12)), size=1, replace=False) # <<<<<<<<<<<<<< * self.cells_sparse = self.props_sparse * n * self.cells_sparse = np.round(self.cells_sparse, 0).astype(int) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_random); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_random); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_choice); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_choice); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_12 = PySequence_List(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_12 = PySequence_List(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_size, __pyx_int_1) < 0) __PYX_ERR(0, 342, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_replace, Py_False) < 0) __PYX_ERR(0, 342, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_size, __pyx_int_1) < 0) __PYX_ERR(0, 337, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_replace, Py_False) < 0) __PYX_ERR(0, 337, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_12); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -10675,22 +10504,22 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":343 + /* "dissect/PropsSimulator/simulator.pyx":338 * for i in range(self.props_sparse.shape[0]): * n = np.random.choice(list(range(5, 12)), size=1, replace=False) * self.cells_sparse = self.props_sparse * n # <<<<<<<<<<<<<< * self.cells_sparse = np.round(self.cells_sparse, 0).astype(int) * self.props_sparse = ( */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = PyNumber_Multiply(__pyx_t_2, __pyx_v_n); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 343, __pyx_L1_error) + __pyx_t_12 = PyNumber_Multiply(__pyx_t_2, __pyx_v_n); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cells_sparse, __pyx_t_12) < 0) __PYX_ERR(0, 343, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cells_sparse, __pyx_t_12) < 0) __PYX_ERR(0, 338, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - /* "dissect/PropsSimulator/simulator.pyx":341 + /* "dissect/PropsSimulator/simulator.pyx":336 * self.props_sparse = (self.props_sparse.T / self.props_sparse.sum(axis=1)).T * * for i in range(self.props_sparse.shape[0]): # <<<<<<<<<<<<<< @@ -10700,19 +10529,19 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":344 + /* "dissect/PropsSimulator/simulator.pyx":339 * n = np.random.choice(list(range(5, 12)), size=1, replace=False) * self.cells_sparse = self.props_sparse * n * self.cells_sparse = np.round(self.cells_sparse, 0).astype(int) # <<<<<<<<<<<<<< * self.props_sparse = ( * self.cells_sparse.T / self.cells_sparse.sum(axis=1) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_round); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_round); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells_sparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells_sparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_11 = 0; @@ -10729,7 +10558,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_int_0}; - __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -10738,14 +10567,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_int_0}; - __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_1 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -10756,12 +10585,12 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __Pyx_GIVEREF(__pyx_int_0); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_11, __pyx_int_0); __pyx_t_2 = 0; - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_astype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 344, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_astype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -10776,57 +10605,57 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge } __pyx_t_5 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_12, ((PyObject *)(&PyInt_Type))) : __Pyx_PyObject_CallOneArg(__pyx_t_7, ((PyObject *)(&PyInt_Type))); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 344, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cells_sparse, __pyx_t_5) < 0) __PYX_ERR(0, 344, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cells_sparse, __pyx_t_5) < 0) __PYX_ERR(0, 339, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":346 + /* "dissect/PropsSimulator/simulator.pyx":341 * self.cells_sparse = np.round(self.cells_sparse, 0).astype(int) * self.props_sparse = ( * self.cells_sparse.T / self.cells_sparse.sum(axis=1) # <<<<<<<<<<<<<< * ).T.astype(np.float32) * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells_sparse); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells_sparse); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_T); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_T); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells_sparse); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells_sparse); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 346, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 346, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_axis, __pyx_int_1) < 0) __PYX_ERR(0, 341, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_12, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 346, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_12, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 341, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":347 + /* "dissect/PropsSimulator/simulator.pyx":342 * self.props_sparse = ( * self.cells_sparse.T / self.cells_sparse.sum(axis=1) * ).T.astype(np.float32) # <<<<<<<<<<<<<< * * if not os.path.exists(self.config["experiment_folder"]): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_astype); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 347, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -10842,38 +10671,38 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_2, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_12); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 347, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 342, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":345 + /* "dissect/PropsSimulator/simulator.pyx":340 * self.cells_sparse = self.props_sparse * n * self.cells_sparse = np.round(self.cells_sparse, 0).astype(int) * self.props_sparse = ( # <<<<<<<<<<<<<< * self.cells_sparse.T / self.cells_sparse.sum(axis=1) * ).T.astype(np.float32) */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse, __pyx_t_5) < 0) __PYX_ERR(0, 345, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse, __pyx_t_5) < 0) __PYX_ERR(0, 340, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":349 + /* "dissect/PropsSimulator/simulator.pyx":344 * ).T.astype(np.float32) * * if not os.path.exists(self.config["experiment_folder"]): # <<<<<<<<<<<<<< * os.mkdir(self.config["experiment_folder"]) * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 349, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_path); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_path); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_exists); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_exists); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_12, __pyx_n_s_experiment_folder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_12, __pyx_n_s_experiment_folder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -10889,29 +10718,29 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __pyx_t_5 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_12, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_2); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 349, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 349, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 344, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_3 = ((!__pyx_t_4) != 0); if (__pyx_t_3) { - /* "dissect/PropsSimulator/simulator.pyx":350 + /* "dissect/PropsSimulator/simulator.pyx":345 * * if not os.path.exists(self.config["experiment_folder"]): * os.mkdir(self.config["experiment_folder"]) # <<<<<<<<<<<<<< * else: * from datetime import datetime */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 350, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_mkdir); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_mkdir); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_t_7, __pyx_n_s_experiment_folder); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 350, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Dict_GetItem(__pyx_t_7, __pyx_n_s_experiment_folder); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -10927,12 +10756,12 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_12); __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 345, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":349 + /* "dissect/PropsSimulator/simulator.pyx":344 * ).T.astype(np.float32) * * if not os.path.exists(self.config["experiment_folder"]): # <<<<<<<<<<<<<< @@ -10942,7 +10771,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge goto __pyx_L12; } - /* "dissect/PropsSimulator/simulator.pyx":352 + /* "dissect/PropsSimulator/simulator.pyx":347 * os.mkdir(self.config["experiment_folder"]) * else: * from datetime import datetime # <<<<<<<<<<<<<< @@ -10950,29 +10779,29 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge * now = datetime.now() */ /*else*/ { - __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_n_s_datetime); __Pyx_GIVEREF(__pyx_n_s_datetime); PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_datetime); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_5, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_5, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 352, __pyx_L1_error) + __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 347, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_t_5); __pyx_v_datetime = __pyx_t_5; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":354 + /* "dissect/PropsSimulator/simulator.pyx":349 * from datetime import datetime * * now = datetime.now() # <<<<<<<<<<<<<< * date_time = now.strftime("%m.%d.%Y_%H.%M.%S") * name = "experiment_" + date_time */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_now); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 354, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_datetime, __pyx_n_s_now); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -10986,20 +10815,20 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge } __pyx_t_2 = (__pyx_t_12) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_12) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 354, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 349, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_now = __pyx_t_2; __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":355 + /* "dissect/PropsSimulator/simulator.pyx":350 * * now = datetime.now() * date_time = now.strftime("%m.%d.%Y_%H.%M.%S") # <<<<<<<<<<<<<< * name = "experiment_" + date_time * print( */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_now, __pyx_n_s_strftime); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 355, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_now, __pyx_n_s_strftime); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_12 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -11013,44 +10842,44 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge } __pyx_t_2 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_12, __pyx_kp_s_m_d_Y__H_M_S) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_s_m_d_Y__H_M_S); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_date_time = __pyx_t_2; __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":356 + /* "dissect/PropsSimulator/simulator.pyx":351 * now = datetime.now() * date_time = now.strftime("%m.%d.%Y_%H.%M.%S") * name = "experiment_" + date_time # <<<<<<<<<<<<<< * print( * "Specified experiment_folder {} already exists. Creating a new folder with name {}.".format( */ - __pyx_t_2 = PyNumber_Add(__pyx_n_s_experiment, __pyx_v_date_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 356, __pyx_L1_error) + __pyx_t_2 = PyNumber_Add(__pyx_n_s_experiment, __pyx_v_date_time); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 351, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_v_name = __pyx_t_2; __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":358 + /* "dissect/PropsSimulator/simulator.pyx":353 * name = "experiment_" + date_time * print( * "Specified experiment_folder {} already exists. Creating a new folder with name {}.".format( # <<<<<<<<<<<<<< * self.config["experiment_folder"], name * ) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Specified_experiment_folder_alre, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Specified_experiment_folder_alre, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "dissect/PropsSimulator/simulator.pyx":359 + /* "dissect/PropsSimulator/simulator.pyx":354 * print( * "Specified experiment_folder {} already exists. Creating a new folder with name {}.".format( * self.config["experiment_folder"], name # <<<<<<<<<<<<<< * ) * ) */ - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_12, __pyx_n_s_experiment_folder); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 359, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_12, __pyx_n_s_experiment_folder); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 354, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -11068,7 +10897,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_7, __pyx_v_name}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -11077,14 +10906,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) { PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_7, __pyx_v_name}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { - __pyx_t_1 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (__pyx_t_12) { __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12); __pyx_t_12 = NULL; @@ -11095,41 +10924,41 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __Pyx_GIVEREF(__pyx_v_name); PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_11, __pyx_v_name); __pyx_t_7 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (__Pyx_PrintOne(0, __pyx_t_2) < 0) __PYX_ERR(0, 357, __pyx_L1_error) + if (__Pyx_PrintOne(0, __pyx_t_2) < 0) __PYX_ERR(0, 352, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":362 + /* "dissect/PropsSimulator/simulator.pyx":357 * ) * ) * self.config["experiment_folder"] = name # <<<<<<<<<<<<<< * os.mkdir(self.config["experiment_folder"]) * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_experiment_folder, __pyx_v_name) < 0)) __PYX_ERR(0, 362, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_experiment_folder, __pyx_v_name) < 0)) __PYX_ERR(0, 357, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":363 + /* "dissect/PropsSimulator/simulator.pyx":358 * ) * self.config["experiment_folder"] = name * os.mkdir(self.config["experiment_folder"]) # <<<<<<<<<<<<<< * * self.simulation_folder = os.path.join(self.config["experiment_folder"], "simulation") */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 363, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_mkdir); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_mkdir); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_experiment_folder); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 363, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_experiment_folder); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -11145,31 +10974,31 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 358, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L12:; - /* "dissect/PropsSimulator/simulator.pyx":365 + /* "dissect/PropsSimulator/simulator.pyx":360 * os.mkdir(self.config["experiment_folder"]) * * self.simulation_folder = os.path.join(self.config["experiment_folder"], "simulation") # <<<<<<<<<<<<<< * if not os.path.exists(self.simulation_folder): * os.mkdir(self.simulation_folder) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_7, __pyx_n_s_experiment_folder); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_7, __pyx_n_s_experiment_folder); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_t_7 = NULL; @@ -11187,7 +11016,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_n_s_simulation}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; @@ -11196,14 +11025,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_n_s_simulation}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -11214,30 +11043,30 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __Pyx_GIVEREF(__pyx_n_s_simulation); PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_n_s_simulation); __pyx_t_5 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 365, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder, __pyx_t_2) < 0) __PYX_ERR(0, 365, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder, __pyx_t_2) < 0) __PYX_ERR(0, 360, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":366 + /* "dissect/PropsSimulator/simulator.pyx":361 * * self.simulation_folder = os.path.join(self.config["experiment_folder"], "simulation") * if not os.path.exists(self.simulation_folder): # <<<<<<<<<<<<<< * os.mkdir(self.simulation_folder) * else: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_exists); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_exists); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -11252,27 +11081,27 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_12); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 366, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 361, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = ((!__pyx_t_3) != 0); if (__pyx_t_4) { - /* "dissect/PropsSimulator/simulator.pyx":367 + /* "dissect/PropsSimulator/simulator.pyx":362 * self.simulation_folder = os.path.join(self.config["experiment_folder"], "simulation") * if not os.path.exists(self.simulation_folder): * os.mkdir(self.simulation_folder) # <<<<<<<<<<<<<< * else: * sys.exit(f"folder {self.simulation_folder} already exists.") */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_mkdir); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 367, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_mkdir); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_5 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { @@ -11287,12 +11116,12 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_1); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":366 + /* "dissect/PropsSimulator/simulator.pyx":361 * * self.simulation_folder = os.path.join(self.config["experiment_folder"], "simulation") * if not os.path.exists(self.simulation_folder): # <<<<<<<<<<<<<< @@ -11302,7 +11131,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge goto __pyx_L13; } - /* "dissect/PropsSimulator/simulator.pyx":369 + /* "dissect/PropsSimulator/simulator.pyx":364 * os.mkdir(self.simulation_folder) * else: * sys.exit(f"folder {self.simulation_folder} already exists.") # <<<<<<<<<<<<<< @@ -11310,12 +11139,12 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge * fig = plt.figure() */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_sys); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_sys); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __pyx_t_8 = 0; __pyx_t_13 = 127; @@ -11323,9 +11152,9 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __pyx_t_8 += 7; __Pyx_GIVEREF(__pyx_kp_u_folder); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_kp_u_folder); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_13; @@ -11337,7 +11166,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __pyx_t_8 += 16; __Pyx_GIVEREF(__pyx_kp_u_already_exists); PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_kp_u_already_exists); - __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_12, 3, __pyx_t_8, __pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_12, 3, __pyx_t_8, __pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __pyx_t_12 = NULL; @@ -11353,23 +11182,23 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __pyx_t_2 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_12, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_7); __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 364, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __pyx_L13:; - /* "dissect/PropsSimulator/simulator.pyx":371 + /* "dissect/PropsSimulator/simulator.pyx":366 * sys.exit(f"folder {self.simulation_folder} already exists.") * * fig = plt.figure() # <<<<<<<<<<<<<< * ax = plt.boxplot(self.props_sparse, labels=self.celltypes) # - * plt.ylabel("Proportion") + * if self.n_celltypes>10: */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_plt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_plt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_figure); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 371, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_figure); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -11384,38 +11213,38 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge } __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_7); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 366, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __pyx_v_fig = __pyx_t_2; __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":372 + /* "dissect/PropsSimulator/simulator.pyx":367 * * fig = plt.figure() * ax = plt.boxplot(self.props_sparse, labels=self.celltypes) # # <<<<<<<<<<<<<< - * plt.ylabel("Proportion") - * plt.title("Proportions of cell-types in generated samples") + * if self.n_celltypes>10: + * plt.xticks(rotation=45, ha="right") */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_plt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_plt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_boxplot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_boxplot); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_labels, __pyx_t_12) < 0) __PYX_ERR(0, 372, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_labels, __pyx_t_12) < 0) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 372, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 367, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -11423,406 +11252,230 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge __pyx_v_ax = __pyx_t_12; __pyx_t_12 = 0; - /* "dissect/PropsSimulator/simulator.pyx":373 + /* "dissect/PropsSimulator/simulator.pyx":368 * fig = plt.figure() * ax = plt.boxplot(self.props_sparse, labels=self.celltypes) # - * plt.ylabel("Proportion") # <<<<<<<<<<<<<< - * plt.title("Proportions of cell-types in generated samples") - * plt.savefig( - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_plt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ylabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 373, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_2); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - __pyx_t_12 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_n_s_Proportion) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_n_s_Proportion); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 373, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - - /* "dissect/PropsSimulator/simulator.pyx":374 - * ax = plt.boxplot(self.props_sparse, labels=self.celltypes) # + * if self.n_celltypes>10: # <<<<<<<<<<<<<< + * plt.xticks(rotation=45, ha="right") * plt.ylabel("Proportion") - * plt.title("Proportions of cell-types in generated samples") # <<<<<<<<<<<<<< - * plt.savefig( - * os.path.join(self.config.simulation_folder, "boxplot_props_sparse.pdf") */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_plt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 374, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_title); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 374, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } - } - __pyx_t_12 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_kp_s_Proportions_of_cell_types_in_gen) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_Proportions_of_cell_types_in_gen); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 374, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyObject_RichCompare(__pyx_t_12, __pyx_int_10, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - - /* "dissect/PropsSimulator/simulator.pyx":375 - * plt.ylabel("Proportion") - * plt.title("Proportions of cell-types in generated samples") - * plt.savefig( # <<<<<<<<<<<<<< - * os.path.join(self.config.simulation_folder, "boxplot_props_sparse.pdf") - * ) - */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_plt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_savefig); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 368, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (__pyx_t_4) { - /* "dissect/PropsSimulator/simulator.pyx":376 + /* "dissect/PropsSimulator/simulator.pyx":369 + * ax = plt.boxplot(self.props_sparse, labels=self.celltypes) # + * if self.n_celltypes>10: + * plt.xticks(rotation=45, ha="right") # <<<<<<<<<<<<<< + * plt.ylabel("Proportion") * plt.title("Proportions of cell-types in generated samples") - * plt.savefig( - * os.path.join(self.config.simulation_folder, "boxplot_props_sparse.pdf") # <<<<<<<<<<<<<< - * ) - * fig = plt.figure() */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = NULL; - __pyx_t_11 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { - __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7); - if (likely(__pyx_t_5)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); - __Pyx_INCREF(__pyx_t_5); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_7, function); - __pyx_t_11 = 1; - } - } - #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_7)) { - PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_6, __pyx_kp_s_boxplot_props_sparse_pdf}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else - #endif - #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { - PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_6, __pyx_kp_s_boxplot_props_sparse_pdf}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_plt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - } else - #endif - { - __pyx_t_14 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 376, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - if (__pyx_t_5) { - __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_5); __pyx_t_5 = NULL; - } - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_11, __pyx_t_6); - __Pyx_INCREF(__pyx_kp_s_boxplot_props_sparse_pdf); - __Pyx_GIVEREF(__pyx_kp_s_boxplot_props_sparse_pdf); - PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_11, __pyx_kp_s_boxplot_props_sparse_pdf); - __pyx_t_6 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_xticks); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - } - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_7)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_7); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); - } - } - __pyx_t_12 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); - __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 375, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_rotation, __pyx_int_45) < 0) __PYX_ERR(0, 369, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ha, __pyx_n_s_right) < 0) __PYX_ERR(0, 369, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":378 - * os.path.join(self.config.simulation_folder, "boxplot_props_sparse.pdf") - * ) - * fig = plt.figure() # <<<<<<<<<<<<<< - * ax = plt.boxplot(self.cells_sparse, labels=self.celltypes) - * plt.ylabel("Count") + /* "dissect/PropsSimulator/simulator.pyx":368 + * fig = plt.figure() + * ax = plt.boxplot(self.props_sparse, labels=self.celltypes) # + * if self.n_celltypes>10: # <<<<<<<<<<<<<< + * plt.xticks(rotation=45, ha="right") + * plt.ylabel("Proportion") */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_plt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_figure); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); - } } - __pyx_t_12 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 378, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_fig, __pyx_t_12); - __pyx_t_12 = 0; - /* "dissect/PropsSimulator/simulator.pyx":379 - * ) - * fig = plt.figure() - * ax = plt.boxplot(self.cells_sparse, labels=self.celltypes) # <<<<<<<<<<<<<< - * plt.ylabel("Count") - * plt.title("Counts of cell-types in generated samples") + /* "dissect/PropsSimulator/simulator.pyx":370 + * if self.n_celltypes>10: + * plt.xticks(rotation=45, ha="right") + * plt.ylabel("Proportion") # <<<<<<<<<<<<<< + * plt.title("Proportions of cell-types in generated samples") + * plt.savefig( */ - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_plt); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_boxplot); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_plt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells_sparse); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_GIVEREF(__pyx_t_12); - PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12); - __pyx_t_12 = 0; - __pyx_t_12 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 379, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ylabel); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 370, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_12, __pyx_n_s_labels, __pyx_t_7) < 0) __PYX_ERR(0, 379, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 379, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF_SET(__pyx_v_ax, __pyx_t_7); - __pyx_t_7 = 0; - - /* "dissect/PropsSimulator/simulator.pyx":380 - * fig = plt.figure() - * ax = plt.boxplot(self.cells_sparse, labels=self.celltypes) - * plt.ylabel("Count") # <<<<<<<<<<<<<< - * plt.title("Counts of cell-types in generated samples") - * plt.savefig( - */ - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_plt); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 380, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_ylabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __pyx_t_12 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_12)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_12); + __pyx_t_2 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_2)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_2); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); + __Pyx_DECREF_SET(__pyx_t_12, function); } } - __pyx_t_7 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_12, __pyx_n_s_Count) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_n_s_Count); - __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 380, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); + __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_2, __pyx_n_s_Proportion) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_n_s_Proportion); + __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":381 - * ax = plt.boxplot(self.cells_sparse, labels=self.celltypes) - * plt.ylabel("Count") - * plt.title("Counts of cell-types in generated samples") # <<<<<<<<<<<<<< + /* "dissect/PropsSimulator/simulator.pyx":371 + * plt.xticks(rotation=45, ha="right") + * plt.ylabel("Proportion") + * plt.title("Proportions of cell-types in generated samples") # <<<<<<<<<<<<<< * plt.savefig( - * os.path.join(self.config.simulation_folder, "boxplot_ncells_sparse.pdf") + * os.path.join(self.simulation_folder, "boxplot_props_sparse.pdf") */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_plt); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_title); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_12); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); - __Pyx_INCREF(__pyx_t_1); + __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_plt); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_12); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_title); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __pyx_t_12 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2); + if (likely(__pyx_t_12)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); + __Pyx_INCREF(__pyx_t_12); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_12, function); + __Pyx_DECREF_SET(__pyx_t_2, function); } } - __pyx_t_7 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_1, __pyx_kp_s_Counts_of_cell_types_in_generate) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_kp_s_Counts_of_cell_types_in_generate); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 381, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_12, __pyx_kp_s_Proportions_of_cell_types_in_gen) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_Proportions_of_cell_types_in_gen); + __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":382 - * plt.ylabel("Count") - * plt.title("Counts of cell-types in generated samples") + /* "dissect/PropsSimulator/simulator.pyx":372 + * plt.ylabel("Proportion") + * plt.title("Proportions of cell-types in generated samples") * plt.savefig( # <<<<<<<<<<<<<< - * os.path.join(self.config.simulation_folder, "boxplot_ncells_sparse.pdf") + * os.path.join(self.simulation_folder, "boxplot_props_sparse.pdf") * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_plt); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 382, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_plt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_savefig); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 372, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_12); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_savefig); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 382, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":383 - * plt.title("Counts of cell-types in generated samples") + /* "dissect/PropsSimulator/simulator.pyx":373 + * plt.title("Proportions of cell-types in generated samples") * plt.savefig( - * os.path.join(self.config.simulation_folder, "boxplot_ncells_sparse.pdf") # <<<<<<<<<<<<<< + * os.path.join(self.simulation_folder, "boxplot_props_sparse.pdf") # <<<<<<<<<<<<<< * ) - * + * self.props = self.props_sparse */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_14); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_14, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; - __pyx_t_14 = NULL; + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_os); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_join); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_7); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __pyx_t_6 = NULL; __pyx_t_11 = 0; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { - __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2); - if (likely(__pyx_t_14)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); - __Pyx_INCREF(__pyx_t_14); + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) { + __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7); + if (likely(__pyx_t_6)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7); + __Pyx_INCREF(__pyx_t_6); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_2, function); + __Pyx_DECREF_SET(__pyx_t_7, function); __pyx_t_11 = 1; } } #if CYTHON_FAST_PYCALL - if (PyFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_6, __pyx_kp_s_boxplot_ncells_sparse_pdf}; - __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (PyFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_kp_s_boxplot_props_sparse_pdf}; + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif #if CYTHON_FAST_PYCCALL - if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_6, __pyx_kp_s_boxplot_ncells_sparse_pdf}; - __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0; - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; + if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) { + PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_kp_s_boxplot_props_sparse_pdf}; + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error) + __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; } else #endif { - __pyx_t_5 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - if (__pyx_t_14) { - __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_14); __pyx_t_14 = NULL; + __pyx_t_14 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_14); + if (__pyx_t_6) { + __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_6); __pyx_t_6 = NULL; } - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_11, __pyx_t_6); - __Pyx_INCREF(__pyx_kp_s_boxplot_ncells_sparse_pdf); - __Pyx_GIVEREF(__pyx_kp_s_boxplot_ncells_sparse_pdf); - PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_11, __pyx_kp_s_boxplot_ncells_sparse_pdf); - __pyx_t_6 = 0; - __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 383, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_12); - __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; + __Pyx_GIVEREF(__pyx_t_5); + PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_11, __pyx_t_5); + __Pyx_INCREF(__pyx_kp_s_boxplot_props_sparse_pdf); + __Pyx_GIVEREF(__pyx_kp_s_boxplot_props_sparse_pdf); + PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_11, __pyx_kp_s_boxplot_props_sparse_pdf); + __pyx_t_5 = 0; + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 373, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0; } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = NULL; - if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { - __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1); - if (likely(__pyx_t_2)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1); - __Pyx_INCREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_7 = NULL; + if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) { + __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_12); + if (likely(__pyx_t_7)) { + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12); + __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_1, function); + __Pyx_DECREF_SET(__pyx_t_12, function); } } - __pyx_t_7 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_12); - __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 372, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 382, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":386 + /* "dissect/PropsSimulator/simulator.pyx":375 + * os.path.join(self.simulation_folder, "boxplot_props_sparse.pdf") * ) - * * self.props = self.props_sparse # <<<<<<<<<<<<<< * self.cells = self.cells_sparse * */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 386, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_props, __pyx_t_7) < 0) __PYX_ERR(0, 386, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props_sparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_props, __pyx_t_1) < 0) __PYX_ERR(0, 375, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":387 - * + /* "dissect/PropsSimulator/simulator.pyx":376 + * ) * self.props = self.props_sparse * self.cells = self.cells_sparse # <<<<<<<<<<<<<< * * def preprocess(self): */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells_sparse); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 387, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cells, __pyx_t_7) < 0) __PYX_ERR(0, 387, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells_sparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cells, __pyx_t_1) < 0) __PYX_ERR(0, 376, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":316 + /* "dissect/PropsSimulator/simulator.pyx":311 * self.n_celltypes = len(self.celltypes) * * def generate_props(self): # <<<<<<<<<<<<<< @@ -11860,7 +11513,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_4ge return __pyx_r; } -/* "dissect/PropsSimulator/simulator.pyx":389 +/* "dissect/PropsSimulator/simulator.pyx":378 * self.cells = self.cells_sparse * * def preprocess(self): # <<<<<<<<<<<<<< @@ -11897,16 +11550,16 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_6pr int __pyx_clineno = 0; __Pyx_RefNannySetupContext("preprocess", 0); - /* "dissect/PropsSimulator/simulator.pyx":390 + /* "dissect/PropsSimulator/simulator.pyx":379 * * def preprocess(self): * self.sc_adata.var_names_make_unique() # <<<<<<<<<<<<<< * sc.pp.filter_cells(self.sc_adata, min_genes=self.config["simulation_params"]["filter"]["min_genes"]) * sc.pp.filter_genes(self.sc_adata, min_cells=self.config["simulation_params"]["filter"]["min_cells"]) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_var_names_make_unique); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 390, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_var_names_make_unique); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -11921,115 +11574,115 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_6pr } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 379, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":391 + /* "dissect/PropsSimulator/simulator.pyx":380 * def preprocess(self): * self.sc_adata.var_names_make_unique() * sc.pp.filter_cells(self.sc_adata, min_genes=self.config["simulation_params"]["filter"]["min_genes"]) # <<<<<<<<<<<<<< * sc.pp.filter_genes(self.sc_adata, min_cells=self.config["simulation_params"]["filter"]["min_cells"]) * */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_filter_cells); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_filter_cells); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_filter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_filter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_min_genes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_min_genes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_genes, __pyx_t_5) < 0) __PYX_ERR(0, 391, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_genes, __pyx_t_5) < 0) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":392 + /* "dissect/PropsSimulator/simulator.pyx":381 * self.sc_adata.var_names_make_unique() * sc.pp.filter_cells(self.sc_adata, min_genes=self.config["simulation_params"]["filter"]["min_genes"]) * sc.pp.filter_genes(self.sc_adata, min_cells=self.config["simulation_params"]["filter"]["min_cells"]) # <<<<<<<<<<<<<< * * self.sc_adata.var["mt"] = self.sc_adata.var_names.str.startswith( */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_filter_genes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_filter_genes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_filter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_filter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_min_cells); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_min_cells); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_cells, __pyx_t_4) < 0) __PYX_ERR(0, 392, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_min_cells, __pyx_t_4) < 0) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 381, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dissect/PropsSimulator/simulator.pyx":394 + /* "dissect/PropsSimulator/simulator.pyx":383 * sc.pp.filter_genes(self.sc_adata, min_cells=self.config["simulation_params"]["filter"]["min_cells"]) * * self.sc_adata.var["mt"] = self.sc_adata.var_names.str.startswith( # <<<<<<<<<<<<<< * "MT-" * ) # annotate the group of mitochondrial genes as 'mt' */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_var_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_var_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_startswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -12044,139 +11697,139 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_6pr } __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_MT) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_MT); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L1_error) + if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_var); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_n_s_mt, __pyx_t_4) < 0)) __PYX_ERR(0, 394, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_n_s_mt, __pyx_t_4) < 0)) __PYX_ERR(0, 383, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dissect/PropsSimulator/simulator.pyx":397 + /* "dissect/PropsSimulator/simulator.pyx":386 * "MT-" * ) # annotate the group of mitochondrial genes as 'mt' * sc.pp.calculate_qc_metrics( # <<<<<<<<<<<<<< * self.sc_adata, qc_vars=["mt"], percent_top=None, log1p=False, inplace=True * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_pp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_pp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_calculate_qc_metrics); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_calculate_qc_metrics); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":398 + /* "dissect/PropsSimulator/simulator.pyx":387 * ) # annotate the group of mitochondrial genes as 'mt' * sc.pp.calculate_qc_metrics( * self.sc_adata, qc_vars=["mt"], percent_top=None, log1p=False, inplace=True # <<<<<<<<<<<<<< * ) * self.sc_adata = self.sc_adata[ */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - /* "dissect/PropsSimulator/simulator.pyx":397 + /* "dissect/PropsSimulator/simulator.pyx":386 * "MT-" * ) # annotate the group of mitochondrial genes as 'mt' * sc.pp.calculate_qc_metrics( # <<<<<<<<<<<<<< * self.sc_adata, qc_vars=["mt"], percent_top=None, log1p=False, inplace=True * ) */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":398 + /* "dissect/PropsSimulator/simulator.pyx":387 * ) # annotate the group of mitochondrial genes as 'mt' * sc.pp.calculate_qc_metrics( * self.sc_adata, qc_vars=["mt"], percent_top=None, log1p=False, inplace=True # <<<<<<<<<<<<<< * ) * self.sc_adata = self.sc_adata[ */ - __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 398, __pyx_L1_error) + __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_n_s_mt); __Pyx_GIVEREF(__pyx_n_s_mt); PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_mt); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_qc_vars, __pyx_t_5) < 0) __PYX_ERR(0, 398, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_qc_vars, __pyx_t_5) < 0) __PYX_ERR(0, 387, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_top, Py_None) < 0) __PYX_ERR(0, 398, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_log1p, Py_False) < 0) __PYX_ERR(0, 398, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_inplace, Py_True) < 0) __PYX_ERR(0, 398, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_percent_top, Py_None) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_log1p, Py_False) < 0) __PYX_ERR(0, 387, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_inplace, Py_True) < 0) __PYX_ERR(0, 387, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":397 + /* "dissect/PropsSimulator/simulator.pyx":386 * "MT-" * ) # annotate the group of mitochondrial genes as 'mt' * sc.pp.calculate_qc_metrics( # <<<<<<<<<<<<<< * self.sc_adata, qc_vars=["mt"], percent_top=None, log1p=False, inplace=True * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 386, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":400 + /* "dissect/PropsSimulator/simulator.pyx":389 * self.sc_adata, qc_vars=["mt"], percent_top=None, log1p=False, inplace=True * ) * self.sc_adata = self.sc_adata[ # <<<<<<<<<<<<<< * self.sc_adata.obs.pct_counts_mt < self.config["simulation_params"]["filter"]["mt_cutoff"], : * ] */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "dissect/PropsSimulator/simulator.pyx":401 + /* "dissect/PropsSimulator/simulator.pyx":390 * ) * self.sc_adata = self.sc_adata[ * self.sc_adata.obs.pct_counts_mt < self.config["simulation_params"]["filter"]["mt_cutoff"], : # <<<<<<<<<<<<<< * ] * sc.pp.normalize_per_cell(self.sc_adata) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pct_counts_mt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pct_counts_mt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_filter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_filter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_mt_cutoff); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_mt_cutoff); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - /* "dissect/PropsSimulator/simulator.pyx":400 + /* "dissect/PropsSimulator/simulator.pyx":389 * self.sc_adata, qc_vars=["mt"], percent_top=None, log1p=False, inplace=True * ) * self.sc_adata = self.sc_adata[ # <<<<<<<<<<<<<< * self.sc_adata.obs.pct_counts_mt < self.config["simulation_params"]["filter"]["mt_cutoff"], : * ] */ - __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); @@ -12184,29 +11837,29 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_6pr __Pyx_GIVEREF(__pyx_slice_); PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_slice_); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata, __pyx_t_2) < 0) __PYX_ERR(0, 400, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata, __pyx_t_2) < 0) __PYX_ERR(0, 389, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":403 + /* "dissect/PropsSimulator/simulator.pyx":392 * self.sc_adata.obs.pct_counts_mt < self.config["simulation_params"]["filter"]["mt_cutoff"], : * ] * sc.pp.normalize_per_cell(self.sc_adata) # <<<<<<<<<<<<<< * * tmp = self.sc_adata.copy() */ - __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 403, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_pp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 403, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_pp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_normalize_per_cell); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 403, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_normalize_per_cell); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 403, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) { @@ -12221,21 +11874,21 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_6pr __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 403, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":405 + /* "dissect/PropsSimulator/simulator.pyx":394 * sc.pp.normalize_per_cell(self.sc_adata) * * tmp = self.sc_adata.copy() # <<<<<<<<<<<<<< * sc.pp.log1p(tmp) * sc.pp.highly_variable_genes(tmp) */ - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 405, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -12250,25 +11903,25 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_6pr } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_tmp = __pyx_t_2; __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":406 + /* "dissect/PropsSimulator/simulator.pyx":395 * * tmp = self.sc_adata.copy() * sc.pp.log1p(tmp) # <<<<<<<<<<<<<< * sc.pp.highly_variable_genes(tmp) * heg = tmp.var[tmp.var.means > self.config["simulation_params"]["filter"]["min_expr"]].index */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 406, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log1p); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 406, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_log1p); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -12283,24 +11936,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_6pr } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_tmp) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_tmp); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":407 + /* "dissect/PropsSimulator/simulator.pyx":396 * tmp = self.sc_adata.copy() * sc.pp.log1p(tmp) * sc.pp.highly_variable_genes(tmp) # <<<<<<<<<<<<<< * heg = tmp.var[tmp.var.means > self.config["simulation_params"]["filter"]["min_expr"]].index * self.sc_adata = self.sc_adata[:, heg] */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_highly_variable_genes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_highly_variable_genes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -12315,59 +11968,59 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_6pr } __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_tmp) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_tmp); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 407, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":408 + /* "dissect/PropsSimulator/simulator.pyx":397 * sc.pp.log1p(tmp) * sc.pp.highly_variable_genes(tmp) * heg = tmp.var[tmp.var.means > self.config["simulation_params"]["filter"]["min_expr"]].index # <<<<<<<<<<<<<< * self.sc_adata = self.sc_adata[:, heg] * del tmp */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tmp, __pyx_n_s_var); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tmp, __pyx_n_s_var); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tmp, __pyx_n_s_var); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_tmp, __pyx_n_s_var); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_means); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_means); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_filter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_filter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_min_expr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_min_expr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 408, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_heg = __pyx_t_5; __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":409 + /* "dissect/PropsSimulator/simulator.pyx":398 * sc.pp.highly_variable_genes(tmp) * heg = tmp.var[tmp.var.means > self.config["simulation_params"]["filter"]["min_expr"]].index * self.sc_adata = self.sc_adata[:, heg] # <<<<<<<<<<<<<< * del tmp * del heg */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 409, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); @@ -12375,14 +12028,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_6pr __Pyx_INCREF(__pyx_v_heg); __Pyx_GIVEREF(__pyx_v_heg); PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_heg); - __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 409, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata, __pyx_t_2) < 0) __PYX_ERR(0, 409, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata, __pyx_t_2) < 0) __PYX_ERR(0, 398, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":410 + /* "dissect/PropsSimulator/simulator.pyx":399 * heg = tmp.var[tmp.var.means > self.config["simulation_params"]["filter"]["min_expr"]].index * self.sc_adata = self.sc_adata[:, heg] * del tmp # <<<<<<<<<<<<<< @@ -12392,7 +12045,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_6pr __Pyx_DECREF(__pyx_v_tmp); __pyx_v_tmp = NULL; - /* "dissect/PropsSimulator/simulator.pyx":411 + /* "dissect/PropsSimulator/simulator.pyx":400 * self.sc_adata = self.sc_adata[:, heg] * del tmp * del heg # <<<<<<<<<<<<<< @@ -12402,7 +12055,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_6pr __Pyx_DECREF(__pyx_v_heg); __pyx_v_heg = NULL; - /* "dissect/PropsSimulator/simulator.pyx":389 + /* "dissect/PropsSimulator/simulator.pyx":378 * self.cells = self.cells_sparse * * def preprocess(self): # <<<<<<<<<<<<<< @@ -12429,7 +12082,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_6pr return __pyx_r; } -/* "dissect/PropsSimulator/simulator.pyx":413 +/* "dissect/PropsSimulator/simulator.pyx":402 * del heg * * def simulate(self, save=True): # <<<<<<<<<<<<<< @@ -12477,7 +12130,7 @@ static PyObject *__pyx_pw_7dissect_14PropsSimulator_9simulator_11Simulate_st_9si } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate") < 0)) __PYX_ERR(0, 413, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate") < 0)) __PYX_ERR(0, 402, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -12493,7 +12146,7 @@ static PyObject *__pyx_pw_7dissect_14PropsSimulator_9simulator_11Simulate_st_9si } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("simulate", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 413, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("simulate", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 402, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dissect.PropsSimulator.simulator.Simulate_st.simulate", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -12544,49 +12197,49 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si int __pyx_clineno = 0; __Pyx_RefNannySetupContext("simulate", 0); - /* "dissect/PropsSimulator/simulator.pyx":414 + /* "dissect/PropsSimulator/simulator.pyx":403 * * def simulate(self, save=True): * adatas = {} # <<<<<<<<<<<<<< * genes = self.sc_adata.var_names * for celltype in self.celltypes: */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 403, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_adatas = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":415 + /* "dissect/PropsSimulator/simulator.pyx":404 * def simulate(self, save=True): * adatas = {} * genes = self.sc_adata.var_names # <<<<<<<<<<<<<< * for celltype in self.celltypes: * adatas[celltype] = np.array( */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_var_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_var_names); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_genes = __pyx_t_2; __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":416 + /* "dissect/PropsSimulator/simulator.pyx":405 * adatas = {} * genes = self.sc_adata.var_names * for celltype in self.celltypes: # <<<<<<<<<<<<<< * adatas[celltype] = np.array( * self.sc_adata[ */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -12594,17 +12247,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si if (likely(PyList_CheckExact(__pyx_t_1))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 405, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 405, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 416, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -12614,7 +12267,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 416, __pyx_L1_error) + else __PYX_ERR(0, 405, __pyx_L1_error) } break; } @@ -12623,76 +12276,76 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __Pyx_XDECREF_SET(__pyx_v_celltype, __pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":417 + /* "dissect/PropsSimulator/simulator.pyx":406 * genes = self.sc_adata.var_names * for celltype in self.celltypes: * adatas[celltype] = np.array( # <<<<<<<<<<<<<< * self.sc_adata[ * self.sc_adata.obs[self.config["simulation_params"]["celltype_col"]] == celltype */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 417, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 417, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_array); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":418 + /* "dissect/PropsSimulator/simulator.pyx":407 * for celltype in self.celltypes: * adatas[celltype] = np.array( * self.sc_adata[ # <<<<<<<<<<<<<< * self.sc_adata.obs[self.config["simulation_params"]["celltype_col"]] == celltype * ].X */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - /* "dissect/PropsSimulator/simulator.pyx":419 + /* "dissect/PropsSimulator/simulator.pyx":408 * adatas[celltype] = np.array( * self.sc_adata[ * self.sc_adata.obs[self.config["simulation_params"]["celltype_col"]] == celltype # <<<<<<<<<<<<<< * ].X * ) */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_obs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_obs); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_t_7, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_t_7, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_9, __pyx_n_s_celltype_col); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_9, __pyx_n_s_celltype_col); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, __pyx_v_celltype, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 419, __pyx_L1_error) + __pyx_t_7 = PyObject_RichCompare(__pyx_t_9, __pyx_v_celltype, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 408, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":418 + /* "dissect/PropsSimulator/simulator.pyx":407 * for celltype in self.celltypes: * adatas[celltype] = np.array( * self.sc_adata[ # <<<<<<<<<<<<<< * self.sc_adata.obs[self.config["simulation_params"]["celltype_col"]] == celltype * ].X */ - __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 418, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 407, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":420 + /* "dissect/PropsSimulator/simulator.pyx":409 * self.sc_adata[ * self.sc_adata.obs[self.config["simulation_params"]["celltype_col"]] == celltype * ].X # <<<<<<<<<<<<<< * ) * self.sc_adata = None */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_X); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_X); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 409, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; @@ -12708,21 +12361,21 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":417 + /* "dissect/PropsSimulator/simulator.pyx":406 * genes = self.sc_adata.var_names * for celltype in self.celltypes: * adatas[celltype] = np.array( # <<<<<<<<<<<<<< * self.sc_adata[ * self.sc_adata.obs[self.config["simulation_params"]["celltype_col"]] == celltype */ - if (unlikely(PyDict_SetItem(__pyx_v_adatas, __pyx_v_celltype, __pyx_t_2) < 0)) __PYX_ERR(0, 417, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_adatas, __pyx_v_celltype, __pyx_t_2) < 0)) __PYX_ERR(0, 406, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":416 + /* "dissect/PropsSimulator/simulator.pyx":405 * adatas = {} * genes = self.sc_adata.var_names * for celltype in self.celltypes: # <<<<<<<<<<<<<< @@ -12732,49 +12385,49 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":422 + /* "dissect/PropsSimulator/simulator.pyx":411 * ].X * ) * self.sc_adata = None # <<<<<<<<<<<<<< * * adata = AnnData( */ - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata, Py_None) < 0) __PYX_ERR(0, 422, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata, Py_None) < 0) __PYX_ERR(0, 411, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":424 + /* "dissect/PropsSimulator/simulator.pyx":413 * self.sc_adata = None * * adata = AnnData( # <<<<<<<<<<<<<< * np.zeros((self.config["simulation_params"]["n_samples"], len(genes))), * var=pd.DataFrame(index=genes), */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AnnData); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_AnnData); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "dissect/PropsSimulator/simulator.pyx":425 + /* "dissect/PropsSimulator/simulator.pyx":414 * * adata = AnnData( * np.zeros((self.config["simulation_params"]["n_samples"], len(genes))), # <<<<<<<<<<<<<< * var=pd.DataFrame(index=genes), * obs=pd.DataFrame(self.props, columns=self.celltypes), */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 425, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_9, __pyx_n_s_n_samples); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_9, __pyx_n_s_n_samples); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_3 = PyObject_Length(__pyx_v_genes); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 425, __pyx_L1_error) - __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_3 = PyObject_Length(__pyx_v_genes); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 414, __pyx_L1_error) + __pyx_t_9 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 425, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); @@ -12795,88 +12448,88 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_9, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":424 + /* "dissect/PropsSimulator/simulator.pyx":413 * self.sc_adata = None * * adata = AnnData( # <<<<<<<<<<<<<< * np.zeros((self.config["simulation_params"]["n_samples"], len(genes))), * var=pd.DataFrame(index=genes), */ - __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":426 + /* "dissect/PropsSimulator/simulator.pyx":415 * adata = AnnData( * np.zeros((self.config["simulation_params"]["n_samples"], len(genes))), * var=pd.DataFrame(index=genes), # <<<<<<<<<<<<<< * obs=pd.DataFrame(self.props, columns=self.celltypes), * ) */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pd); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 426, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pd); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 426, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_index, __pyx_v_genes) < 0) __PYX_ERR(0, 426, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_index, __pyx_v_genes) < 0) __PYX_ERR(0, 415, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_var, __pyx_t_6) < 0) __PYX_ERR(0, 426, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_var, __pyx_t_6) < 0) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":427 + /* "dissect/PropsSimulator/simulator.pyx":416 * np.zeros((self.config["simulation_params"]["n_samples"], len(genes))), * var=pd.DataFrame(index=genes), * obs=pd.DataFrame(self.props, columns=self.celltypes), # <<<<<<<<<<<<<< * ) * adata.obsm["cells"] = self.cells */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pd); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 427, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pd); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_props); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_columns, __pyx_t_8) < 0) __PYX_ERR(0, 427, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_columns, __pyx_t_8) < 0) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 427, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 416, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_obs, __pyx_t_8) < 0) __PYX_ERR(0, 426, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_obs, __pyx_t_8) < 0) __PYX_ERR(0, 415, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":424 + /* "dissect/PropsSimulator/simulator.pyx":413 * self.sc_adata = None * * adata = AnnData( # <<<<<<<<<<<<<< * np.zeros((self.config["simulation_params"]["n_samples"], len(genes))), * var=pd.DataFrame(index=genes), */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 424, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 413, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -12884,37 +12537,37 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __pyx_v_adata = __pyx_t_8; __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":429 + /* "dissect/PropsSimulator/simulator.pyx":418 * obs=pd.DataFrame(self.props, columns=self.celltypes), * ) * adata.obsm["cells"] = self.cells # <<<<<<<<<<<<<< * for celltype in self.celltypes: * adata.layers[celltype] = np.zeros(adata.X.shape, dtype=np.float32) */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obsm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 429, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obsm); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_cells, __pyx_t_8) < 0)) __PYX_ERR(0, 429, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_cells, __pyx_t_8) < 0)) __PYX_ERR(0, 418, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":430 + /* "dissect/PropsSimulator/simulator.pyx":419 * ) * adata.obsm["cells"] = self.cells * for celltype in self.celltypes: # <<<<<<<<<<<<<< * adata.layers[celltype] = np.zeros(adata.X.shape, dtype=np.float32) * for i in tqdm(range(self.cells.shape[0])): */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 419, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -12922,17 +12575,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 419, __pyx_L1_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 419, __pyx_L1_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 430, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 419, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } @@ -12942,7 +12595,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 430, __pyx_L1_error) + else __PYX_ERR(0, 419, __pyx_L1_error) } break; } @@ -12951,49 +12604,49 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __Pyx_XDECREF_SET(__pyx_v_celltype, __pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":431 + /* "dissect/PropsSimulator/simulator.pyx":420 * adata.obsm["cells"] = self.cells * for celltype in self.celltypes: * adata.layers[celltype] = np.zeros(adata.X.shape, dtype=np.float32) # <<<<<<<<<<<<<< * for i in tqdm(range(self.cells.shape[0])): * for j in range(self.n_celltypes): */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_X); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_X); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 431, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float32); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 431, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_9) < 0) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_layers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_layers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_celltype, __pyx_t_9) < 0)) __PYX_ERR(0, 431, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_celltype, __pyx_t_9) < 0)) __PYX_ERR(0, 420, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":430 + /* "dissect/PropsSimulator/simulator.pyx":419 * ) * adata.obsm["cells"] = self.cells * for celltype in self.celltypes: # <<<<<<<<<<<<<< @@ -13003,24 +12656,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":432 + /* "dissect/PropsSimulator/simulator.pyx":421 * for celltype in self.celltypes: * adata.layers[celltype] = np.zeros(adata.X.shape, dtype=np.float32) * for i in tqdm(range(self.cells.shape[0])): # <<<<<<<<<<<<<< * for j in range(self.n_celltypes): * cell_idxs = np.random.choice( */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 432, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_tqdm); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -13036,16 +12689,16 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_1, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { __pyx_t_9 = __pyx_t_2; __Pyx_INCREF(__pyx_t_9); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_4 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_4 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 421, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { @@ -13053,17 +12706,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si if (likely(PyList_CheckExact(__pyx_t_9))) { if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 421, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_9, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_9, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } else { if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_9)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 421, __pyx_L1_error) #else - __pyx_t_2 = PySequence_ITEM(__pyx_t_9, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 432, __pyx_L1_error) + __pyx_t_2 = PySequence_ITEM(__pyx_t_9, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); #endif } @@ -13073,7 +12726,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 432, __pyx_L1_error) + else __PYX_ERR(0, 421, __pyx_L1_error) } break; } @@ -13082,25 +12735,25 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":433 + /* "dissect/PropsSimulator/simulator.pyx":422 * adata.layers[celltype] = np.zeros(adata.X.shape, dtype=np.float32) * for i in tqdm(range(self.cells.shape[0])): * for j in range(self.n_celltypes): # <<<<<<<<<<<<<< * cell_idxs = np.random.choice( * range(adatas[self.celltypes[j]].shape[0]), */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); __pyx_t_10 = 0; __pyx_t_11 = NULL; } else { - __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_10 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_11 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 422, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; for (;;) { @@ -13108,17 +12761,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si if (likely(PyList_CheckExact(__pyx_t_2))) { if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 422, __pyx_L1_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } else { if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_10); __Pyx_INCREF(__pyx_t_8); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 422, __pyx_L1_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 433, __pyx_L1_error) + __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 422, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); #endif } @@ -13128,7 +12781,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 433, __pyx_L1_error) + else __PYX_ERR(0, 422, __pyx_L1_error) } break; } @@ -13137,71 +12790,71 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":434 + /* "dissect/PropsSimulator/simulator.pyx":423 * for i in tqdm(range(self.cells.shape[0])): * for j in range(self.n_celltypes): * cell_idxs = np.random.choice( # <<<<<<<<<<<<<< * range(adatas[self.celltypes[j]].shape[0]), * self.cells[i][j], */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 434, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_random); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_random); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_choice); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_choice); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":435 + /* "dissect/PropsSimulator/simulator.pyx":424 * for j in range(self.n_celltypes): * cell_idxs = np.random.choice( * range(adatas[self.celltypes[j]].shape[0]), # <<<<<<<<<<<<<< * self.cells[i][j], * replace=True, */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_j); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_j); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_adatas, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_adatas, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_shape); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 424, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":436 + /* "dissect/PropsSimulator/simulator.pyx":425 * cell_idxs = np.random.choice( * range(adatas[self.celltypes[j]].shape[0]), * self.cells[i][j], # <<<<<<<<<<<<<< * replace=True, * ) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cells); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":434 + /* "dissect/PropsSimulator/simulator.pyx":423 * for i in tqdm(range(self.cells.shape[0])): * for j in range(self.n_celltypes): * cell_idxs = np.random.choice( # <<<<<<<<<<<<<< * range(adatas[self.celltypes[j]].shape[0]), * self.cells[i][j], */ - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); @@ -13210,25 +12863,25 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __pyx_t_7 = 0; __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":437 + /* "dissect/PropsSimulator/simulator.pyx":426 * range(adatas[self.celltypes[j]].shape[0]), * self.cells[i][j], * replace=True, # <<<<<<<<<<<<<< * ) * sample = adatas[self.celltypes[j]][cell_idxs, :].sum(axis=0) */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_replace, Py_True) < 0) __PYX_ERR(0, 437, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_replace, Py_True) < 0) __PYX_ERR(0, 426, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":434 + /* "dissect/PropsSimulator/simulator.pyx":423 * for i in tqdm(range(self.cells.shape[0])): * for j in range(self.n_celltypes): * cell_idxs = np.random.choice( # <<<<<<<<<<<<<< * range(adatas[self.celltypes[j]].shape[0]), * self.cells[i][j], */ - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 434, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 423, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -13236,22 +12889,22 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __Pyx_XDECREF_SET(__pyx_v_cell_idxs, __pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":439 + /* "dissect/PropsSimulator/simulator.pyx":428 * replace=True, * ) * sample = adatas[self.celltypes[j]][cell_idxs, :].sum(axis=0) # <<<<<<<<<<<<<< * adata.layers[self.celltypes[j]][i, :] = sample * if j == 0: */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_adatas, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_adatas, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_cell_idxs); __Pyx_GIVEREF(__pyx_v_cell_idxs); @@ -13259,42 +12912,42 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __Pyx_INCREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice_); - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 439, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 439, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 439, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 428, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 428, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_XDECREF_SET(__pyx_v_sample, __pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":440 + /* "dissect/PropsSimulator/simulator.pyx":429 * ) * sample = adatas[self.celltypes[j]][cell_idxs, :].sum(axis=0) * adata.layers[self.celltypes[j]][i, :] = sample # <<<<<<<<<<<<<< * if j == 0: * total_sample = sample */ - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_layers); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_layers); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 440, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_i); __Pyx_GIVEREF(__pyx_v_i); @@ -13302,24 +12955,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __Pyx_INCREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice_); - if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_t_1, __pyx_v_sample) < 0)) __PYX_ERR(0, 440, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_6, __pyx_t_1, __pyx_v_sample) < 0)) __PYX_ERR(0, 429, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":441 + /* "dissect/PropsSimulator/simulator.pyx":430 * sample = adatas[self.celltypes[j]][cell_idxs, :].sum(axis=0) * adata.layers[self.celltypes[j]][i, :] = sample * if j == 0: # <<<<<<<<<<<<<< * total_sample = sample * else: */ - __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_j, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_j, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 441, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 430, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; if (__pyx_t_12) { - /* "dissect/PropsSimulator/simulator.pyx":442 + /* "dissect/PropsSimulator/simulator.pyx":431 * adata.layers[self.celltypes[j]][i, :] = sample * if j == 0: * total_sample = sample # <<<<<<<<<<<<<< @@ -13329,7 +12982,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __Pyx_INCREF(__pyx_v_sample); __Pyx_XDECREF_SET(__pyx_v_total_sample, __pyx_v_sample); - /* "dissect/PropsSimulator/simulator.pyx":441 + /* "dissect/PropsSimulator/simulator.pyx":430 * sample = adatas[self.celltypes[j]][cell_idxs, :].sum(axis=0) * adata.layers[self.celltypes[j]][i, :] = sample * if j == 0: # <<<<<<<<<<<<<< @@ -13339,7 +12992,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si goto __pyx_L11; } - /* "dissect/PropsSimulator/simulator.pyx":444 + /* "dissect/PropsSimulator/simulator.pyx":433 * total_sample = sample * else: * total_sample = total_sample + sample # <<<<<<<<<<<<<< @@ -13347,15 +13000,15 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si * */ /*else*/ { - if (unlikely(!__pyx_v_total_sample)) { __Pyx_RaiseUnboundLocalError("total_sample"); __PYX_ERR(0, 444, __pyx_L1_error) } - __pyx_t_1 = PyNumber_Add(__pyx_v_total_sample, __pyx_v_sample); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) + if (unlikely(!__pyx_v_total_sample)) { __Pyx_RaiseUnboundLocalError("total_sample"); __PYX_ERR(0, 433, __pyx_L1_error) } + __pyx_t_1 = PyNumber_Add(__pyx_v_total_sample, __pyx_v_sample); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_XDECREF_SET(__pyx_v_total_sample, __pyx_t_1); __pyx_t_1 = 0; } __pyx_L11:; - /* "dissect/PropsSimulator/simulator.pyx":433 + /* "dissect/PropsSimulator/simulator.pyx":422 * adata.layers[celltype] = np.zeros(adata.X.shape, dtype=np.float32) * for i in tqdm(range(self.cells.shape[0])): * for j in range(self.n_celltypes): # <<<<<<<<<<<<<< @@ -13365,17 +13018,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":445 + /* "dissect/PropsSimulator/simulator.pyx":434 * else: * total_sample = total_sample + sample * adata.X[i, :] = total_sample # <<<<<<<<<<<<<< * * if self.config["simulation_params"]["downsample"]: */ - if (unlikely(!__pyx_v_total_sample)) { __Pyx_RaiseUnboundLocalError("total_sample"); __PYX_ERR(0, 445, __pyx_L1_error) } - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_X); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) + if (unlikely(!__pyx_v_total_sample)) { __Pyx_RaiseUnboundLocalError("total_sample"); __PYX_ERR(0, 434, __pyx_L1_error) } + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_X); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 445, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_i); __Pyx_GIVEREF(__pyx_v_i); @@ -13383,11 +13036,11 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __Pyx_INCREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_slice_); - if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_1, __pyx_v_total_sample) < 0)) __PYX_ERR(0, 445, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_t_1, __pyx_v_total_sample) < 0)) __PYX_ERR(0, 434, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":432 + /* "dissect/PropsSimulator/simulator.pyx":421 * for celltype in self.celltypes: * adata.layers[celltype] = np.zeros(adata.X.shape, dtype=np.float32) * for i in tqdm(range(self.cells.shape[0])): # <<<<<<<<<<<<<< @@ -13397,66 +13050,66 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":447 + /* "dissect/PropsSimulator/simulator.pyx":436 * adata.X[i, :] = total_sample * * if self.config["simulation_params"]["downsample"]: # <<<<<<<<<<<<<< * sc.pp.downsample_counts( * adata, counts_per_cell=self.config["simulation_params"]["downsample"] * adata.X.sum(1) */ - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_9, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_9, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_downsample); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_downsample); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 436, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; if (__pyx_t_12) { - /* "dissect/PropsSimulator/simulator.pyx":448 + /* "dissect/PropsSimulator/simulator.pyx":437 * * if self.config["simulation_params"]["downsample"]: * sc.pp.downsample_counts( # <<<<<<<<<<<<<< * adata, counts_per_cell=self.config["simulation_params"]["downsample"] * adata.X.sum(1) * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sc); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 448, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sc); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_downsample_counts); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_downsample_counts); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":449 + /* "dissect/PropsSimulator/simulator.pyx":438 * if self.config["simulation_params"]["downsample"]: * sc.pp.downsample_counts( * adata, counts_per_cell=self.config["simulation_params"]["downsample"] * adata.X.sum(1) # <<<<<<<<<<<<<< * ) * if save: */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_adata); __Pyx_GIVEREF(__pyx_v_adata); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_adata); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_7, __pyx_n_s_downsample); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_7, __pyx_n_s_downsample); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_X); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_X); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_sum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_sum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -13471,31 +13124,31 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si } __pyx_t_7 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_int_1) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_int_1); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 449, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error) + __pyx_t_5 = PyNumber_Multiply(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_counts_per_cell, __pyx_t_5) < 0) __PYX_ERR(0, 449, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_counts_per_cell, __pyx_t_5) < 0) __PYX_ERR(0, 438, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":448 + /* "dissect/PropsSimulator/simulator.pyx":437 * * if self.config["simulation_params"]["downsample"]: * sc.pp.downsample_counts( # <<<<<<<<<<<<<< * adata, counts_per_cell=self.config["simulation_params"]["downsample"] * adata.X.sum(1) * ) */ - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 448, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 437, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":447 + /* "dissect/PropsSimulator/simulator.pyx":436 * adata.X[i, :] = total_sample * * if self.config["simulation_params"]["downsample"]: # <<<<<<<<<<<<<< @@ -13504,34 +13157,34 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si */ } - /* "dissect/PropsSimulator/simulator.pyx":451 + /* "dissect/PropsSimulator/simulator.pyx":440 * adata, counts_per_cell=self.config["simulation_params"]["downsample"] * adata.X.sum(1) * ) * if save: # <<<<<<<<<<<<<< * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) * sc.set_figure_params(dpi=200) */ - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_save); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 451, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_save); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 440, __pyx_L1_error) if (__pyx_t_12) { - /* "dissect/PropsSimulator/simulator.pyx":452 + /* "dissect/PropsSimulator/simulator.pyx":441 * ) * if save: * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) # <<<<<<<<<<<<<< * sc.set_figure_params(dpi=200) * tmp = adata.copy() */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 452, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 452, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_path); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_join); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 452, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_join); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 452, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __pyx_t_6 = NULL; __pyx_t_13 = 0; @@ -13548,7 +13201,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_7, __pyx_kp_s_simulated_h5ad}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -13557,14 +13210,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_7, __pyx_kp_s_simulated_h5ad}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 452, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -13575,7 +13228,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __Pyx_GIVEREF(__pyx_kp_s_simulated_h5ad); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_13, __pyx_kp_s_simulated_h5ad); __pyx_t_7 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -13593,40 +13246,40 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 452, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 441, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":453 + /* "dissect/PropsSimulator/simulator.pyx":442 * if save: * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) * sc.set_figure_params(dpi=200) # <<<<<<<<<<<<<< * tmp = adata.copy() * sc.pp.normalize_total(tmp, target_sum=1e6) */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 453, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_set_figure_params); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_set_figure_params); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 453, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dpi, __pyx_int_200) < 0) __PYX_ERR(0, 453, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dpi, __pyx_int_200) < 0) __PYX_ERR(0, 442, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":454 + /* "dissect/PropsSimulator/simulator.pyx":443 * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) * sc.set_figure_params(dpi=200) * tmp = adata.copy() # <<<<<<<<<<<<<< * sc.pp.normalize_total(tmp, target_sum=1e6) * sc.pp.log1p(tmp) */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 454, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) { @@ -13640,55 +13293,55 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_5); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_v_tmp = __pyx_t_1; __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":455 + /* "dissect/PropsSimulator/simulator.pyx":444 * sc.set_figure_params(dpi=200) * tmp = adata.copy() * sc.pp.normalize_total(tmp, target_sum=1e6) # <<<<<<<<<<<<<< * sc.pp.log1p(tmp) * sc.tl.pca(tmp) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_v_tmp); __Pyx_GIVEREF(__pyx_v_tmp); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_tmp); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 455, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 455, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 444, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 444, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":456 + /* "dissect/PropsSimulator/simulator.pyx":445 * tmp = adata.copy() * sc.pp.normalize_total(tmp, target_sum=1e6) * sc.pp.log1p(tmp) # <<<<<<<<<<<<<< * sc.tl.pca(tmp) * sc.pl.pca(tmp, color=adata.obs.columns, show=False) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_log1p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_log1p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -13703,24 +13356,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si } __pyx_t_9 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_tmp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_tmp); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 456, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 445, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":457 + /* "dissect/PropsSimulator/simulator.pyx":446 * sc.pp.normalize_total(tmp, target_sum=1e6) * sc.pp.log1p(tmp) * sc.tl.pca(tmp) # <<<<<<<<<<<<<< * sc.pl.pca(tmp, color=adata.obs.columns, show=False) * plt.savefig( */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tl); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tl); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pca); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_pca); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = NULL; @@ -13735,85 +13388,85 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si } __pyx_t_9 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_tmp) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_tmp); __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 457, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 446, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":458 + /* "dissect/PropsSimulator/simulator.pyx":447 * sc.pp.log1p(tmp) * sc.tl.pca(tmp) * sc.pl.pca(tmp, color=adata.obs.columns, show=False) # <<<<<<<<<<<<<< * plt.savefig( * os.path.join( */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sc); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 458, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sc); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pca); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pca); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_tmp); __Pyx_GIVEREF(__pyx_v_tmp); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_tmp); - __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_columns); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 458, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_columns); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_color, __pyx_t_8) < 0) __PYX_ERR(0, 458, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_color, __pyx_t_8) < 0) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 458, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 458, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 447, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 447, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":459 + /* "dissect/PropsSimulator/simulator.pyx":448 * sc.tl.pca(tmp) * sc.pl.pca(tmp, color=adata.obs.columns, show=False) * plt.savefig( # <<<<<<<<<<<<<< * os.path.join( * self.simulation_folder, "scatterplot_pca_simulated.pdf" */ - __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_plt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 459, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_plt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_savefig); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_savefig); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":460 + /* "dissect/PropsSimulator/simulator.pyx":449 * sc.pl.pca(tmp, color=adata.obs.columns, show=False) * plt.savefig( * os.path.join( # <<<<<<<<<<<<<< * self.simulation_folder, "scatterplot_pca_simulated.pdf" * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 460, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_join); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_join); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":461 + /* "dissect/PropsSimulator/simulator.pyx":450 * plt.savefig( * os.path.join( * self.simulation_folder, "scatterplot_pca_simulated.pdf" # <<<<<<<<<<<<<< * ) * ) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_7 = NULL; __pyx_t_13 = 0; @@ -13830,7 +13483,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_kp_s_scatterplot_pca_simulated_pdf}; - __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -13839,14 +13492,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_1, __pyx_kp_s_scatterplot_pca_simulated_pdf}; - __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_7) { __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL; @@ -13857,7 +13510,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __Pyx_GIVEREF(__pyx_kp_s_scatterplot_pca_simulated_pdf); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_13, __pyx_kp_s_scatterplot_pca_simulated_pdf); __pyx_t_1 = 0; - __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 460, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } @@ -13875,134 +13528,137 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __pyx_t_8 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 459, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 448, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":465 + /* "dissect/PropsSimulator/simulator.pyx":454 * ) * - * if self.config["generate_component_figures"]: # <<<<<<<<<<<<<< + * if self.config["simulation_params"]["generate_component_figures"]: # <<<<<<<<<<<<<< * idxs = {} * celltypes_col = [] */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_n_s_generate_component_figures); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 465, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_generate_component_figures); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 454, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_12) { - /* "dissect/PropsSimulator/simulator.pyx":466 + /* "dissect/PropsSimulator/simulator.pyx":455 * - * if self.config["generate_component_figures"]: + * if self.config["simulation_params"]["generate_component_figures"]: * idxs = {} # <<<<<<<<<<<<<< * celltypes_col = [] * for j in range(self.n_celltypes): */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_idxs = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 455, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_v_idxs = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":467 - * if self.config["generate_component_figures"]: + /* "dissect/PropsSimulator/simulator.pyx":456 + * if self.config["simulation_params"]["generate_component_figures"]: * idxs = {} * celltypes_col = [] # <<<<<<<<<<<<<< * for j in range(self.n_celltypes): * celltype = self.celltypes[j] */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_v_celltypes_col = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 456, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_v_celltypes_col = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":468 + /* "dissect/PropsSimulator/simulator.pyx":457 * idxs = {} * celltypes_col = [] * for j in range(self.n_celltypes): # <<<<<<<<<<<<<< * celltype = self.celltypes[j] * idxs[celltype] = adata.obsm["cells"][:, j] > 0 */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 457, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (likely(PyList_CheckExact(__pyx_t_8)) || PyTuple_CheckExact(__pyx_t_8)) { - __pyx_t_2 = __pyx_t_8; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; + __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) { + __pyx_t_8 = __pyx_t_2; __Pyx_INCREF(__pyx_t_8); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 457, __pyx_L1_error) } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; for (;;) { if (likely(!__pyx_t_4)) { - if (likely(PyList_CheckExact(__pyx_t_2))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; + if (likely(PyList_CheckExact(__pyx_t_8))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_2 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 457, __pyx_L1_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif } else { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_8); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 468, __pyx_L1_error) + __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 457, __pyx_L1_error) #else - __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 468, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); #endif } } else { - __pyx_t_8 = __pyx_t_4(__pyx_t_2); - if (unlikely(!__pyx_t_8)) { + __pyx_t_2 = __pyx_t_4(__pyx_t_8); + if (unlikely(!__pyx_t_2)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 468, __pyx_L1_error) + else __PYX_ERR(0, 457, __pyx_L1_error) } break; } - __Pyx_GOTREF(__pyx_t_8); + __Pyx_GOTREF(__pyx_t_2); } - __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_8); - __pyx_t_8 = 0; + __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_2); + __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":469 + /* "dissect/PropsSimulator/simulator.pyx":458 * celltypes_col = [] * for j in range(self.n_celltypes): * celltype = self.celltypes[j] # <<<<<<<<<<<<<< * idxs[celltype] = adata.obsm["cells"][:, j] > 0 * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 469, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 469, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 458, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 458, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_XDECREF_SET(__pyx_v_celltype, __pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":470 + /* "dissect/PropsSimulator/simulator.pyx":459 * for j in range(self.n_celltypes): * celltype = self.celltypes[j] * idxs[celltype] = adata.obsm["cells"][:, j] > 0 # <<<<<<<<<<<<<< * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() * X = [ */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obsm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obsm); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_cells); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 470, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_5, __pyx_n_s_cells); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_INCREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); @@ -14010,60 +13666,60 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __Pyx_INCREF(__pyx_v_j); __Pyx_GIVEREF(__pyx_v_j); PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_j); - __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyObject_RichCompare(__pyx_t_9, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_5 = PyObject_RichCompare(__pyx_t_9, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(PyDict_SetItem(__pyx_v_idxs, __pyx_v_celltype, __pyx_t_5) < 0)) __PYX_ERR(0, 470, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_idxs, __pyx_v_celltype, __pyx_t_5) < 0)) __PYX_ERR(0, 459, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":471 + /* "dissect/PropsSimulator/simulator.pyx":460 * celltype = self.celltypes[j] * idxs[celltype] = adata.obsm["cells"][:, j] > 0 * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() # <<<<<<<<<<<<<< * X = [ * adata.layers[celltype][idxs[celltype], :] */ - __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_idxs, __pyx_v_celltype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_GetItem(__pyx_v_idxs, __pyx_v_celltype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_sum); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 471, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_sum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_t_9 = NULL; - if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) { - __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8); + if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { + __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2); if (likely(__pyx_t_9)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8); + PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2); __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_8, function); + __Pyx_DECREF_SET(__pyx_t_2, function); } } - __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_8); + __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; - if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 471, __pyx_L1_error) + if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 471, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_celltype); __Pyx_GIVEREF(__pyx_v_celltype); - PyList_SET_ITEM(__pyx_t_8, 0, __pyx_v_celltype); - { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_8, __pyx_t_5); if (unlikely(!__pyx_temp)) __PYX_ERR(0, 471, __pyx_L1_error) + PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_celltype); + { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_temp)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_temp); - __Pyx_DECREF(__pyx_t_8); - __pyx_t_8 = __pyx_temp; + __Pyx_DECREF(__pyx_t_2); + __pyx_t_2 = __pyx_temp; } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = PyNumber_Add(__pyx_v_celltypes_col, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_5 = PyNumber_Add(__pyx_v_celltypes_col, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 460, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF_SET(__pyx_v_celltypes_col, ((PyObject*)__pyx_t_5)); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":468 + /* "dissect/PropsSimulator/simulator.pyx":457 * idxs = {} * celltypes_col = [] * for j in range(self.n_celltypes): # <<<<<<<<<<<<<< @@ -14071,62 +13727,62 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si * idxs[celltype] = adata.obsm["cells"][:, j] > 0 */ } - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":472 + /* "dissect/PropsSimulator/simulator.pyx":461 * idxs[celltype] = adata.obsm["cells"][:, j] > 0 * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() * X = [ # <<<<<<<<<<<<<< * adata.layers[celltype][idxs[celltype], :] * for celltype in self.celltypes */ - __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 461, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); - /* "dissect/PropsSimulator/simulator.pyx":474 + /* "dissect/PropsSimulator/simulator.pyx":463 * X = [ * adata.layers[celltype][idxs[celltype], :] * for celltype in self.celltypes # <<<<<<<<<<<<<< * ] * tmp1 = AnnData( */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) { - __pyx_t_8 = __pyx_t_5; __Pyx_INCREF(__pyx_t_8); __pyx_t_3 = 0; + __pyx_t_2 = __pyx_t_5; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0; __pyx_t_4 = NULL; } else { - __pyx_t_3 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 474, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_4 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; for (;;) { if (likely(!__pyx_t_4)) { - if (likely(PyList_CheckExact(__pyx_t_8))) { - if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_8)) break; + if (likely(PyList_CheckExact(__pyx_t_2))) { + if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 463, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } else { - if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_8)) break; + if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 463, __pyx_L1_error) #else - __pyx_t_5 = PySequence_ITEM(__pyx_t_8, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); #endif } } else { - __pyx_t_5 = __pyx_t_4(__pyx_t_8); + __pyx_t_5 = __pyx_t_4(__pyx_t_2); if (unlikely(!__pyx_t_5)) { PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 474, __pyx_L1_error) + else __PYX_ERR(0, 463, __pyx_L1_error) } break; } @@ -14135,21 +13791,21 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __Pyx_XDECREF_SET(__pyx_v_celltype, __pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":473 + /* "dissect/PropsSimulator/simulator.pyx":462 * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() * X = [ * adata.layers[celltype][idxs[celltype], :] # <<<<<<<<<<<<<< * for celltype in self.celltypes * ] */ - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_layers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_layers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_celltype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_v_celltype); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_idxs, __pyx_v_celltype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_idxs, __pyx_v_celltype); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); @@ -14157,14 +13813,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __Pyx_GIVEREF(__pyx_slice_); PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_slice_); __pyx_t_5 = 0; - __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 473, __pyx_L1_error) + __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 472, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 461, __pyx_L1_error) __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - /* "dissect/PropsSimulator/simulator.pyx":474 + /* "dissect/PropsSimulator/simulator.pyx":463 * X = [ * adata.layers[celltype][idxs[celltype], :] * for celltype in self.celltypes # <<<<<<<<<<<<<< @@ -14172,184 +13828,184 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si * tmp1 = AnnData( */ } - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_v_X = ((PyObject*)__pyx_t_2); - __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_v_X = ((PyObject*)__pyx_t_8); + __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":476 + /* "dissect/PropsSimulator/simulator.pyx":465 * for celltype in self.celltypes * ] * tmp1 = AnnData( # <<<<<<<<<<<<<< * np.concatenate(X, axis=0), * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_AnnData); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_AnnData); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 465, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); - /* "dissect/PropsSimulator/simulator.pyx":477 + /* "dissect/PropsSimulator/simulator.pyx":466 * ] * tmp1 = AnnData( * np.concatenate(X, axis=0), # <<<<<<<<<<<<<< * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_np); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 477, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_np); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_5); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_X); - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 477, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_X); + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 477, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 477, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 466, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 466, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":476 + /* "dissect/PropsSimulator/simulator.pyx":465 * for celltype in self.celltypes * ] * tmp1 = AnnData( # <<<<<<<<<<<<<< * np.concatenate(X, axis=0), * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), */ - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":478 + /* "dissect/PropsSimulator/simulator.pyx":467 * tmp1 = AnnData( * np.concatenate(X, axis=0), * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), # <<<<<<<<<<<<<< * ) * */ - __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 478, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_pd); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 478, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 478, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_5); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 478, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_celltypes_col); __Pyx_GIVEREF(__pyx_v_celltypes_col); - PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_celltypes_col); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 478, __pyx_L1_error) + PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_celltypes_col); + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 478, __pyx_L1_error) + __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_INCREF(__pyx_n_s_Celltype); __Pyx_GIVEREF(__pyx_n_s_Celltype); PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_Celltype); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_columns, __pyx_t_7) < 0) __PYX_ERR(0, 478, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_columns, __pyx_t_7) < 0) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 478, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_obs, __pyx_t_7) < 0) __PYX_ERR(0, 478, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_obs, __pyx_t_7) < 0) __PYX_ERR(0, 467, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":476 + /* "dissect/PropsSimulator/simulator.pyx":465 * for celltype in self.celltypes * ] * tmp1 = AnnData( # <<<<<<<<<<<<<< * np.concatenate(X, axis=0), * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), */ - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 476, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 465, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __pyx_v_tmp1 = __pyx_t_7; __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":481 + /* "dissect/PropsSimulator/simulator.pyx":470 * ) * * sc.pp.subsample(tmp1, fraction=0.5, random_state=42) # <<<<<<<<<<<<<< * sc.pp.normalize_total(tmp1, target_sum=1e6) * sc.pp.log1p(tmp1) */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_sc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 481, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_sc); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_pp); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_pp); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_subsample); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_subsample); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_tmp1); __Pyx_GIVEREF(__pyx_v_tmp1); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_tmp1); - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 481, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 470, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_fraction, __pyx_float_0_5) < 0) __PYX_ERR(0, 481, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_random_state, __pyx_int_42) < 0) __PYX_ERR(0, 481, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_fraction, __pyx_float_0_5) < 0) __PYX_ERR(0, 470, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_random_state, __pyx_int_42) < 0) __PYX_ERR(0, 470, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 470, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":482 + /* "dissect/PropsSimulator/simulator.pyx":471 * * sc.pp.subsample(tmp1, fraction=0.5, random_state=42) * sc.pp.normalize_total(tmp1, target_sum=1e6) # <<<<<<<<<<<<<< * sc.pp.log1p(tmp1) * sc.tl.pca(tmp1) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 482, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_sc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_pp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 471, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 482, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_tmp1); __Pyx_GIVEREF(__pyx_v_tmp1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_tmp1); - __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 482, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 482, __pyx_L1_error) - __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 482, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 471, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 471, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":483 + /* "dissect/PropsSimulator/simulator.pyx":472 * sc.pp.subsample(tmp1, fraction=0.5, random_state=42) * sc.pp.normalize_total(tmp1, target_sum=1e6) * sc.pp.log1p(tmp1) # <<<<<<<<<<<<<< * sc.tl.pca(tmp1) * fig, ax = plt.subplots(nrows=1, ncols=1) */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sc); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 483, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sc); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log1p); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 483, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log1p); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -14364,24 +14020,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si } __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_6, __pyx_v_tmp1) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_tmp1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 483, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 472, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":484 + /* "dissect/PropsSimulator/simulator.pyx":473 * sc.pp.normalize_total(tmp1, target_sum=1e6) * sc.pp.log1p(tmp1) * sc.tl.pca(tmp1) # <<<<<<<<<<<<<< * fig, ax = plt.subplots(nrows=1, ncols=1) * sc.pl.pca( */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sc); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 484, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sc); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_tl); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 484, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_tl); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pca); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 484, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pca); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -14396,28 +14052,28 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si } __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_6, __pyx_v_tmp1) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_tmp1); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 484, __pyx_L1_error) + if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 473, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "dissect/PropsSimulator/simulator.pyx":485 + /* "dissect/PropsSimulator/simulator.pyx":474 * sc.pp.log1p(tmp1) * sc.tl.pca(tmp1) * fig, ax = plt.subplots(nrows=1, ncols=1) # <<<<<<<<<<<<<< * sc.pl.pca( * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax */ - __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_plt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 485, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_plt); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_subplots); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 485, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_subplots); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 485, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_nrows, __pyx_int_1) < 0) __PYX_ERR(0, 485, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ncols, __pyx_int_1) < 0) __PYX_ERR(0, 485, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 485, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_nrows, __pyx_int_1) < 0) __PYX_ERR(0, 474, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ncols, __pyx_int_1) < 0) __PYX_ERR(0, 474, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; @@ -14427,7 +14083,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 485, __pyx_L1_error) + __PYX_ERR(0, 474, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -14440,31 +14096,31 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __Pyx_INCREF(__pyx_t_7); __Pyx_INCREF(__pyx_t_9); #else - __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 485, __pyx_L1_error) + __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 485, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 474, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); #endif __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else { Py_ssize_t index = -1; - __pyx_t_2 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 485, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 474, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_14 = Py_TYPE(__pyx_t_2)->tp_iternext; - index = 0; __pyx_t_7 = __pyx_t_14(__pyx_t_2); if (unlikely(!__pyx_t_7)) goto __pyx_L19_unpacking_failed; + __pyx_t_14 = Py_TYPE(__pyx_t_8)->tp_iternext; + index = 0; __pyx_t_7 = __pyx_t_14(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_7); - index = 1; __pyx_t_9 = __pyx_t_14(__pyx_t_2); if (unlikely(!__pyx_t_9)) goto __pyx_L19_unpacking_failed; + index = 1; __pyx_t_9 = __pyx_t_14(__pyx_t_8); if (unlikely(!__pyx_t_9)) goto __pyx_L19_unpacking_failed; __Pyx_GOTREF(__pyx_t_9); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_2), 2) < 0) __PYX_ERR(0, 485, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_8), 2) < 0) __PYX_ERR(0, 474, __pyx_L1_error) __pyx_t_14 = NULL; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L20_unpacking_done; __pyx_L19_unpacking_failed:; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_14 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 485, __pyx_L1_error) + __PYX_ERR(0, 474, __pyx_L1_error) __pyx_L20_unpacking_done:; } __pyx_v_fig = __pyx_t_7; @@ -14472,92 +14128,92 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si __pyx_v_ax = __pyx_t_9; __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":486 + /* "dissect/PropsSimulator/simulator.pyx":475 * sc.tl.pca(tmp1) * fig, ax = plt.subplots(nrows=1, ncols=1) * sc.pl.pca( # <<<<<<<<<<<<<< * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 486, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pl); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 486, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pl); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pca); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 486, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pca); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":487 + /* "dissect/PropsSimulator/simulator.pyx":476 * fig, ax = plt.subplots(nrows=1, ncols=1) * sc.pl.pca( * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax # <<<<<<<<<<<<<< * ) * plt.savefig( */ - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 486, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 475, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_v_tmp1); __Pyx_GIVEREF(__pyx_v_tmp1); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_tmp1); - __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 487, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 476, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_color, __pyx_n_s_Celltype) < 0) __PYX_ERR(0, 487, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 487, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_legend_loc, __pyx_kp_s_on_data) < 0) __PYX_ERR(0, 487, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ax, __pyx_v_ax) < 0) __PYX_ERR(0, 487, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_color, __pyx_n_s_Celltype) < 0) __PYX_ERR(0, 476, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 476, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_legend_loc, __pyx_kp_s_on_data) < 0) __PYX_ERR(0, 476, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_ax, __pyx_v_ax) < 0) __PYX_ERR(0, 476, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":486 + /* "dissect/PropsSimulator/simulator.pyx":475 * sc.tl.pca(tmp1) * fig, ax = plt.subplots(nrows=1, ncols=1) * sc.pl.pca( # <<<<<<<<<<<<<< * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) */ - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 475, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":489 + /* "dissect/PropsSimulator/simulator.pyx":478 * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) * plt.savefig( # <<<<<<<<<<<<<< * os.path.join( * self.simulation_folder, */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_plt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_savefig); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 489, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_plt); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 478, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_savefig); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":490 + /* "dissect/PropsSimulator/simulator.pyx":479 * ) * plt.savefig( * os.path.join( # <<<<<<<<<<<<<< * self.simulation_folder, * "scatterplot_pca_simulated_celltypes.pdf", */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 490, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_os); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_join); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_join); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":491 + /* "dissect/PropsSimulator/simulator.pyx":480 * plt.savefig( * os.path.join( * self.simulation_folder, # <<<<<<<<<<<<<< * "scatterplot_pca_simulated_celltypes.pdf", * ), */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 491, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 480, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_1 = NULL; __pyx_t_13 = 0; @@ -14574,87 +14230,87 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_6, __pyx_kp_s_scatterplot_pca_simulated_cellty}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) { PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_t_6, __pyx_kp_s_scatterplot_pca_simulated_cellty}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 479, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_GOTREF(__pyx_t_2); + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 490, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 479, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_1) { - __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1); __pyx_t_1 = NULL; + __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL; } __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_13, __pyx_t_6); + PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_13, __pyx_t_6); __Pyx_INCREF(__pyx_kp_s_scatterplot_pca_simulated_cellty); __Pyx_GIVEREF(__pyx_kp_s_scatterplot_pca_simulated_cellty); - PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_13, __pyx_kp_s_scatterplot_pca_simulated_cellty); + PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_13, __pyx_kp_s_scatterplot_pca_simulated_cellty); __pyx_t_6 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 490, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 479, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":489 + /* "dissect/PropsSimulator/simulator.pyx":478 * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) * plt.savefig( # <<<<<<<<<<<<<< * os.path.join( * self.simulation_folder, */ - __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 489, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 478, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __Pyx_GIVEREF(__pyx_t_2); - PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2); - __pyx_t_2 = 0; + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); + __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":494 + /* "dissect/PropsSimulator/simulator.pyx":483 * "scatterplot_pca_simulated_celltypes.pdf", * ), * bbox_inches="tight", # <<<<<<<<<<<<<< * ) * else: */ - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bbox_inches, __pyx_n_s_tight) < 0) __PYX_ERR(0, 494, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 483, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_bbox_inches, __pyx_n_s_tight) < 0) __PYX_ERR(0, 483, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":489 + /* "dissect/PropsSimulator/simulator.pyx":478 * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) * plt.savefig( # <<<<<<<<<<<<<< * os.path.join( * self.simulation_folder, */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 489, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":465 + /* "dissect/PropsSimulator/simulator.pyx":454 * ) * - * if self.config["generate_component_figures"]: # <<<<<<<<<<<<<< + * if self.config["simulation_params"]["generate_component_figures"]: # <<<<<<<<<<<<<< * idxs = {} * celltypes_col = [] */ } - /* "dissect/PropsSimulator/simulator.pyx":451 + /* "dissect/PropsSimulator/simulator.pyx":440 * adata, counts_per_cell=self.config["simulation_params"]["downsample"] * adata.X.sum(1) * ) * if save: # <<<<<<<<<<<<<< @@ -14664,7 +14320,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si goto __pyx_L13; } - /* "dissect/PropsSimulator/simulator.pyx":497 + /* "dissect/PropsSimulator/simulator.pyx":486 * ) * else: * return adata # <<<<<<<<<<<<<< @@ -14679,7 +14335,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si } __pyx_L13:; - /* "dissect/PropsSimulator/simulator.pyx":413 + /* "dissect/PropsSimulator/simulator.pyx":402 * del heg * * def simulate(self, save=True): # <<<<<<<<<<<<<< @@ -14722,7 +14378,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_8si return __pyx_r; } -/* "dissect/PropsSimulator/simulator.pyx":499 +/* "dissect/PropsSimulator/simulator.pyx":488 * return adata * * def simulate_per_batch(self, save=True): # <<<<<<<<<<<<<< @@ -14770,7 +14426,7 @@ static PyObject *__pyx_pw_7dissect_14PropsSimulator_9simulator_11Simulate_st_11s } } if (unlikely(kw_args > 0)) { - if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate_per_batch") < 0)) __PYX_ERR(0, 499, __pyx_L3_error) + if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "simulate_per_batch") < 0)) __PYX_ERR(0, 488, __pyx_L3_error) } } else { switch (PyTuple_GET_SIZE(__pyx_args)) { @@ -14786,7 +14442,7 @@ static PyObject *__pyx_pw_7dissect_14PropsSimulator_9simulator_11Simulate_st_11s } goto __pyx_L4_argument_unpacking_done; __pyx_L5_argtuple_error:; - __Pyx_RaiseArgtupleInvalid("simulate_per_batch", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 499, __pyx_L3_error) + __Pyx_RaiseArgtupleInvalid("simulate_per_batch", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 488, __pyx_L3_error) __pyx_L3_error:; __Pyx_AddTraceback("dissect.PropsSimulator.simulator.Simulate_st.simulate_per_batch", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); @@ -14833,16 +14489,16 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s int __pyx_clineno = 0; __Pyx_RefNannySetupContext("simulate_per_batch", 0); - /* "dissect/PropsSimulator/simulator.pyx":500 + /* "dissect/PropsSimulator/simulator.pyx":489 * * def simulate_per_batch(self, save=True): * adata_orig = self.sc_adata.copy() # <<<<<<<<<<<<<< * adatas = [] * for batch in self.batches: */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 500, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -14857,40 +14513,40 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s } __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_v_adata_orig = __pyx_t_1; __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":501 + /* "dissect/PropsSimulator/simulator.pyx":490 * def simulate_per_batch(self, save=True): * adata_orig = self.sc_adata.copy() * adatas = [] # <<<<<<<<<<<<<< * for batch in self.batches: * self.sc_adata = adata_orig[ */ - __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_v_adatas = ((PyObject*)__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":502 + /* "dissect/PropsSimulator/simulator.pyx":491 * adata_orig = self.sc_adata.copy() * adatas = [] * for batch in self.batches: # <<<<<<<<<<<<<< * self.sc_adata = adata_orig[ * adata_orig.obs[self.config["simulation_params"]["batch_col"]] == batch */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_batches); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_batches); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) { __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; for (;;) { @@ -14898,17 +14554,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 491, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 491, __pyx_L1_error) #else - __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 491, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif } @@ -14918,7 +14574,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 502, __pyx_L1_error) + else __PYX_ERR(0, 491, __pyx_L1_error) } break; } @@ -14927,63 +14583,63 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __Pyx_XDECREF_SET(__pyx_v_batch, __pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":504 + /* "dissect/PropsSimulator/simulator.pyx":493 * for batch in self.batches: * self.sc_adata = adata_orig[ * adata_orig.obs[self.config["simulation_params"]["batch_col"]] == batch # <<<<<<<<<<<<<< * ] * adatas.append(self.simulate(save=False)) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata_orig, __pyx_n_s_obs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata_orig, __pyx_n_s_obs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_s_batch_col); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_6, __pyx_n_s_batch_col); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_batch, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error) + __pyx_t_2 = PyObject_RichCompare(__pyx_t_6, __pyx_v_batch, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":503 + /* "dissect/PropsSimulator/simulator.pyx":492 * adatas = [] * for batch in self.batches: * self.sc_adata = adata_orig[ # <<<<<<<<<<<<<< * adata_orig.obs[self.config["simulation_params"]["batch_col"]] == batch * ] */ - __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_adata_orig, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_adata_orig, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata, __pyx_t_6) < 0) __PYX_ERR(0, 503, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sc_adata, __pyx_t_6) < 0) __PYX_ERR(0, 492, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":506 + /* "dissect/PropsSimulator/simulator.pyx":495 * adata_orig.obs[self.config["simulation_params"]["batch_col"]] == batch * ] * adatas.append(self.simulate(save=False)) # <<<<<<<<<<<<<< * adata = adatas[0].concatenate(adatas[1:], batch_categories=self.batches) * */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_save, Py_False) < 0) __PYX_ERR(0, 506, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_save, Py_False) < 0) __PYX_ERR(0, 495, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_adatas, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_adatas, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 495, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":502 + /* "dissect/PropsSimulator/simulator.pyx":491 * adata_orig = self.sc_adata.copy() * adatas = [] * for batch in self.batches: # <<<<<<<<<<<<<< @@ -14993,32 +14649,32 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":507 + /* "dissect/PropsSimulator/simulator.pyx":496 * ] * adatas.append(self.simulate(save=False)) * adata = adatas[0].concatenate(adatas[1:], batch_categories=self.batches) # <<<<<<<<<<<<<< * * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) */ - __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_adatas, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_adatas, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyList_GetSlice(__pyx_v_adatas, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyList_GetSlice(__pyx_v_adatas, 1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_batches); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_batches); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_batch_categories, __pyx_t_6) < 0) __PYX_ERR(0, 507, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_batch_categories, __pyx_t_6) < 0) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 496, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -15026,24 +14682,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __pyx_v_adata = __pyx_t_6; __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":509 + /* "dissect/PropsSimulator/simulator.pyx":498 * adata = adatas[0].concatenate(adatas[1:], batch_categories=self.batches) * * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) # <<<<<<<<<<<<<< * * if save: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -15060,7 +14716,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_kp_s_simulated_h5ad}; - __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; @@ -15069,14 +14725,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_8, __pyx_kp_s_simulated_h5ad}; - __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { - __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL; @@ -15087,7 +14743,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __Pyx_GIVEREF(__pyx_kp_s_simulated_h5ad); PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_kp_s_simulated_h5ad); __pyx_t_8 = 0; - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; } @@ -15105,50 +14761,50 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 509, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 498, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":511 + /* "dissect/PropsSimulator/simulator.pyx":500 * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) * * if save: # <<<<<<<<<<<<<< * sc.set_figure_params(dpi=200) * tmp = adata.copy() */ - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_save); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 511, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_save); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 500, __pyx_L1_error) if (__pyx_t_12) { - /* "dissect/PropsSimulator/simulator.pyx":512 + /* "dissect/PropsSimulator/simulator.pyx":501 * * if save: * sc.set_figure_params(dpi=200) # <<<<<<<<<<<<<< * tmp = adata.copy() * sc.pp.normalize_total(tmp, target_sum=1e6) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_set_figure_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_set_figure_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 512, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dpi, __pyx_int_200) < 0) __PYX_ERR(0, 512, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dpi, __pyx_int_200) < 0) __PYX_ERR(0, 501, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":513 + /* "dissect/PropsSimulator/simulator.pyx":502 * if save: * sc.set_figure_params(dpi=200) * tmp = adata.copy() # <<<<<<<<<<<<<< * sc.pp.normalize_total(tmp, target_sum=1e6) * sc.pp.log1p(tmp) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_copy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) { @@ -15162,55 +14818,55 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s } __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_6); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error) + if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_v_tmp = __pyx_t_2; __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":514 + /* "dissect/PropsSimulator/simulator.pyx":503 * sc.set_figure_params(dpi=200) * tmp = adata.copy() * sc.pp.normalize_total(tmp, target_sum=1e6) # <<<<<<<<<<<<<< * sc.pp.log1p(tmp) * sc.tl.pca(tmp) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_INCREF(__pyx_v_tmp); __Pyx_GIVEREF(__pyx_v_tmp); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_tmp); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 514, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 514, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 503, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":515 + /* "dissect/PropsSimulator/simulator.pyx":504 * tmp = adata.copy() * sc.pp.normalize_total(tmp, target_sum=1e6) * sc.pp.log1p(tmp) # <<<<<<<<<<<<<< * sc.tl.pca(tmp) * sc.pl.pca(tmp, color=adata.obs.columns, show=False) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log1p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_log1p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -15225,24 +14881,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_tmp) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_tmp); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":516 + /* "dissect/PropsSimulator/simulator.pyx":505 * sc.pp.normalize_total(tmp, target_sum=1e6) * sc.pp.log1p(tmp) * sc.tl.pca(tmp) # <<<<<<<<<<<<<< * sc.pl.pca(tmp, color=adata.obs.columns, show=False) * plt.savefig( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tl); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tl); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pca); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pca); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __pyx_t_6 = NULL; @@ -15257,85 +14913,85 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_tmp) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_tmp); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":517 + /* "dissect/PropsSimulator/simulator.pyx":506 * sc.pp.log1p(tmp) * sc.tl.pca(tmp) * sc.pl.pca(tmp, color=adata.obs.columns, show=False) # <<<<<<<<<<<<<< * plt.savefig( * os.path.join( */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pl); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pl); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pca); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pca); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_tmp); __Pyx_GIVEREF(__pyx_v_tmp); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tmp); - __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 517, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_columns); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 517, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_columns); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_color, __pyx_t_11) < 0) __PYX_ERR(0, 517, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_color, __pyx_t_11) < 0) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 517, __pyx_L1_error) - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 517, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 506, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 506, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "dissect/PropsSimulator/simulator.pyx":518 + /* "dissect/PropsSimulator/simulator.pyx":507 * sc.tl.pca(tmp) * sc.pl.pca(tmp, color=adata.obs.columns, show=False) * plt.savefig( # <<<<<<<<<<<<<< * os.path.join( * self.simulation_folder, "scatterplot_pca_simulated.pdf" */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_plt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 518, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_plt); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_savefig); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_savefig); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":519 + /* "dissect/PropsSimulator/simulator.pyx":508 * sc.pl.pca(tmp, color=adata.obs.columns, show=False) * plt.savefig( * os.path.join( # <<<<<<<<<<<<<< * self.simulation_folder, "scatterplot_pca_simulated.pdf" * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":520 + /* "dissect/PropsSimulator/simulator.pyx":509 * plt.savefig( * os.path.join( * self.simulation_folder, "scatterplot_pca_simulated.pdf" # <<<<<<<<<<<<<< * ) * ) */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 520, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_8 = NULL; __pyx_t_10 = 0; @@ -15352,7 +15008,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_2, __pyx_kp_s_scatterplot_pca_simulated_pdf}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -15361,14 +15017,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_2, __pyx_kp_s_scatterplot_pca_simulated_pdf}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_9 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_9 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); if (__pyx_t_8) { __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL; @@ -15379,7 +15035,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __Pyx_GIVEREF(__pyx_kp_s_scatterplot_pca_simulated_pdf); PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_10, __pyx_kp_s_scatterplot_pca_simulated_pdf); __pyx_t_2 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 508, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } @@ -15397,29 +15053,29 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __pyx_t_11 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 518, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 507, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "dissect/PropsSimulator/simulator.pyx":524 + /* "dissect/PropsSimulator/simulator.pyx":513 * ) * * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) # <<<<<<<<<<<<<< * sc.set_figure_params(dpi=200) * tmp = adata.copy() */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __pyx_t_2 = NULL; __pyx_t_10 = 0; @@ -15436,7 +15092,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_9, __pyx_kp_s_simulated_h5ad}; - __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -15445,14 +15101,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_9, __pyx_kp_s_simulated_h5ad}; - __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_2) { __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2); __pyx_t_2 = NULL; @@ -15463,7 +15119,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __Pyx_GIVEREF(__pyx_kp_s_simulated_h5ad); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_10, __pyx_kp_s_simulated_h5ad); __pyx_t_9 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 524, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } @@ -15481,40 +15137,40 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __pyx_t_11 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 524, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 513, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "dissect/PropsSimulator/simulator.pyx":525 + /* "dissect/PropsSimulator/simulator.pyx":514 * * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) * sc.set_figure_params(dpi=200) # <<<<<<<<<<<<<< * tmp = adata.copy() * sc.pp.normalize_total(tmp, target_sum=1e6) */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_sc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 525, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_sc); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_set_figure_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_set_figure_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 525, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dpi, __pyx_int_200) < 0) __PYX_ERR(0, 525, __pyx_L1_error) - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 525, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_dpi, __pyx_int_200) < 0) __PYX_ERR(0, 514, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 514, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":526 + /* "dissect/PropsSimulator/simulator.pyx":515 * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) * sc.set_figure_params(dpi=200) * tmp = adata.copy() # <<<<<<<<<<<<<< * sc.pp.normalize_total(tmp, target_sum=1e6) * sc.pp.log1p(tmp) */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_copy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 526, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_copy); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __pyx_t_3 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) { @@ -15528,55 +15184,55 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s } __pyx_t_6 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_11); __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; - if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 526, __pyx_L1_error) + if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 515, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF_SET(__pyx_v_tmp, __pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":527 + /* "dissect/PropsSimulator/simulator.pyx":516 * sc.set_figure_params(dpi=200) * tmp = adata.copy() * sc.pp.normalize_total(tmp, target_sum=1e6) # <<<<<<<<<<<<<< * sc.pp.log1p(tmp) * sc.tl.pca(tmp) */ - __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 527, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_sc); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pp); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_pp); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_v_tmp); __Pyx_GIVEREF(__pyx_v_tmp); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_tmp); - __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 527, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 516, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 516, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":528 + /* "dissect/PropsSimulator/simulator.pyx":517 * tmp = adata.copy() * sc.pp.normalize_total(tmp, target_sum=1e6) * sc.pp.log1p(tmp) # <<<<<<<<<<<<<< * sc.tl.pca(tmp) * sc.pl.pca(tmp, color=adata.obs.columns, show=False) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 528, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pp); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 528, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pp); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_log1p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 528, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_log1p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; @@ -15591,24 +15247,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s } __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_11, __pyx_v_tmp) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_tmp); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":529 + /* "dissect/PropsSimulator/simulator.pyx":518 * sc.pp.normalize_total(tmp, target_sum=1e6) * sc.pp.log1p(tmp) * sc.tl.pca(tmp) # <<<<<<<<<<<<<< * sc.pl.pca(tmp, color=adata.obs.columns, show=False) * plt.savefig( */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tl); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_tl); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_pca); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_pca); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __pyx_t_11 = NULL; @@ -15623,85 +15279,85 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s } __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_11, __pyx_v_tmp) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_tmp); __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":530 + /* "dissect/PropsSimulator/simulator.pyx":519 * sc.pp.log1p(tmp) * sc.tl.pca(tmp) * sc.pl.pca(tmp, color=adata.obs.columns, show=False) # <<<<<<<<<<<<<< * plt.savefig( * os.path.join( */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pl); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pl); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pca); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_pca); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_tmp); __Pyx_GIVEREF(__pyx_v_tmp); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_tmp); - __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_columns); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 530, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_columns); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_color, __pyx_t_8) < 0) __PYX_ERR(0, 530, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_color, __pyx_t_8) < 0) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 530, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 530, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 519, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 519, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":531 + /* "dissect/PropsSimulator/simulator.pyx":520 * sc.tl.pca(tmp) * sc.pl.pca(tmp, color=adata.obs.columns, show=False) * plt.savefig( # <<<<<<<<<<<<<< * os.path.join( * self.simulation_folder, "scatterplot_pca_simulated.pdf" */ - __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_plt); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 531, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_plt); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_savefig); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_savefig); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "dissect/PropsSimulator/simulator.pyx":532 + /* "dissect/PropsSimulator/simulator.pyx":521 * sc.pl.pca(tmp, color=adata.obs.columns, show=False) * plt.savefig( * os.path.join( # <<<<<<<<<<<<<< * self.simulation_folder, "scatterplot_pca_simulated.pdf" * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - /* "dissect/PropsSimulator/simulator.pyx":533 + /* "dissect/PropsSimulator/simulator.pyx":522 * plt.savefig( * os.path.join( * self.simulation_folder, "scatterplot_pca_simulated.pdf" # <<<<<<<<<<<<<< * ) * ) */ - __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 533, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 522, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_9 = NULL; __pyx_t_10 = 0; @@ -15718,7 +15374,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_6, __pyx_kp_s_scatterplot_pca_simulated_pdf}; - __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; @@ -15727,14 +15383,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_6, __pyx_kp_s_scatterplot_pca_simulated_pdf}; - __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } else #endif { - __pyx_t_2 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); if (__pyx_t_9) { __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_9); __pyx_t_9 = NULL; @@ -15745,7 +15401,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __Pyx_GIVEREF(__pyx_kp_s_scatterplot_pca_simulated_pdf); PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_10, __pyx_kp_s_scatterplot_pca_simulated_pdf); __pyx_t_6 = 0; - __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 532, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 521, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } @@ -15763,73 +15419,73 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __pyx_t_8 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_11) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_11); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 531, __pyx_L1_error) + if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 520, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":537 + /* "dissect/PropsSimulator/simulator.pyx":526 * ) * * if self.config["simulation_params"]["generate_component_figures"]: # <<<<<<<<<<<<<< * idxs = {} * celltypes_col = [] */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_generate_component_figures); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_generate_component_figures); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 537, __pyx_L1_error) + __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 526, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (__pyx_t_12) { - /* "dissect/PropsSimulator/simulator.pyx":538 + /* "dissect/PropsSimulator/simulator.pyx":527 * * if self.config["simulation_params"]["generate_component_figures"]: * idxs = {} # <<<<<<<<<<<<<< * celltypes_col = [] * for j in range(self.n_celltypes): */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 527, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_idxs = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":539 + /* "dissect/PropsSimulator/simulator.pyx":528 * if self.config["simulation_params"]["generate_component_figures"]: * idxs = {} * celltypes_col = [] # <<<<<<<<<<<<<< * for j in range(self.n_celltypes): * celltype = self.celltypes[j] */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 539, __pyx_L1_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 528, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __pyx_v_celltypes_col = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":540 + /* "dissect/PropsSimulator/simulator.pyx":529 * idxs = {} * celltypes_col = [] * for j in range(self.n_celltypes): # <<<<<<<<<<<<<< * celltype = self.celltypes[j] * idxs[celltype] = adata.obsm["cells"][:, j] > 0 */ - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_n_celltypes); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) { __pyx_t_8 = __pyx_t_3; __Pyx_INCREF(__pyx_t_8); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_5 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 529, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; for (;;) { @@ -15837,17 +15493,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s if (likely(PyList_CheckExact(__pyx_t_8))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 529, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_8)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 529, __pyx_L1_error) #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 540, __pyx_L1_error) + __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 529, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); #endif } @@ -15857,7 +15513,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 540, __pyx_L1_error) + else __PYX_ERR(0, 529, __pyx_L1_error) } break; } @@ -15866,34 +15522,34 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":541 + /* "dissect/PropsSimulator/simulator.pyx":530 * celltypes_col = [] * for j in range(self.n_celltypes): * celltype = self.celltypes[j] # <<<<<<<<<<<<<< * idxs[celltype] = adata.obsm["cells"][:, j] > 0 * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_j); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 541, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_v_j); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 530, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_XDECREF_SET(__pyx_v_celltype, __pyx_t_11); __pyx_t_11 = 0; - /* "dissect/PropsSimulator/simulator.pyx":542 + /* "dissect/PropsSimulator/simulator.pyx":531 * for j in range(self.n_celltypes): * celltype = self.celltypes[j] * idxs[celltype] = adata.obsm["cells"][:, j] > 0 # <<<<<<<<<<<<<< * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() * X = [ */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obsm); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_obsm); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_11, __pyx_n_s_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_11, __pyx_n_s_cells); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_INCREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); @@ -15901,25 +15557,25 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __Pyx_INCREF(__pyx_v_j); __Pyx_GIVEREF(__pyx_v_j); PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_v_j); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_11 = PyObject_RichCompare(__pyx_t_1, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(PyDict_SetItem(__pyx_v_idxs, __pyx_v_celltype, __pyx_t_11) < 0)) __PYX_ERR(0, 542, __pyx_L1_error) + if (unlikely(PyDict_SetItem(__pyx_v_idxs, __pyx_v_celltype, __pyx_t_11) < 0)) __PYX_ERR(0, 531, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "dissect/PropsSimulator/simulator.pyx":543 + /* "dissect/PropsSimulator/simulator.pyx":532 * celltype = self.celltypes[j] * idxs[celltype] = adata.obsm["cells"][:, j] > 0 * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() # <<<<<<<<<<<<<< * X = [ * adata.layers[celltype][idxs[celltype], :] */ - __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_idxs, __pyx_v_celltype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_idxs, __pyx_v_celltype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = NULL; @@ -15934,27 +15590,27 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s } __pyx_t_11 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3); __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 543, __pyx_L1_error) + if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_celltype); __Pyx_GIVEREF(__pyx_v_celltype); PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_celltype); - { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_temp)) __PYX_ERR(0, 543, __pyx_L1_error) + { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_temp)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_temp); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = __pyx_temp; } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = PyNumber_Add(__pyx_v_celltypes_col, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_11 = PyNumber_Add(__pyx_v_celltypes_col, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 532, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF_SET(__pyx_v_celltypes_col, ((PyObject*)__pyx_t_11)); __pyx_t_11 = 0; - /* "dissect/PropsSimulator/simulator.pyx":540 + /* "dissect/PropsSimulator/simulator.pyx":529 * idxs = {} * celltypes_col = [] * for j in range(self.n_celltypes): # <<<<<<<<<<<<<< @@ -15964,32 +15620,32 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s } __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":544 + /* "dissect/PropsSimulator/simulator.pyx":533 * idxs[celltype] = adata.obsm["cells"][:, j] > 0 * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() * X = [ # <<<<<<<<<<<<<< * adata.layers[celltype][idxs[celltype], :] * for celltype in self.celltypes */ - __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 544, __pyx_L1_error) + __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 533, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - /* "dissect/PropsSimulator/simulator.pyx":546 + /* "dissect/PropsSimulator/simulator.pyx":535 * X = [ * adata.layers[celltype][idxs[celltype], :] * for celltype in self.celltypes # <<<<<<<<<<<<<< * ] * tmp1 = AnnData( */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_celltypes); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); if (likely(PyList_CheckExact(__pyx_t_11)) || PyTuple_CheckExact(__pyx_t_11)) { __pyx_t_3 = __pyx_t_11; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0; __pyx_t_5 = NULL; } else { - __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error) } __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; for (;;) { @@ -15997,17 +15653,17 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s if (likely(PyList_CheckExact(__pyx_t_3))) { if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_11 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_11); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_11 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_11); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 535, __pyx_L1_error) #else - __pyx_t_11 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_11 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif } else { if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break; #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS - __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_11); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_11); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 535, __pyx_L1_error) #else - __pyx_t_11 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_11 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 535, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); #endif } @@ -16017,7 +15673,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s PyObject* exc_type = PyErr_Occurred(); if (exc_type) { if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear(); - else __PYX_ERR(0, 546, __pyx_L1_error) + else __PYX_ERR(0, 535, __pyx_L1_error) } break; } @@ -16026,21 +15682,21 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __Pyx_XDECREF_SET(__pyx_v_celltype, __pyx_t_11); __pyx_t_11 = 0; - /* "dissect/PropsSimulator/simulator.pyx":545 + /* "dissect/PropsSimulator/simulator.pyx":534 * celltypes_col = celltypes_col + [celltype] * idxs[celltype].sum() * X = [ * adata.layers[celltype][idxs[celltype], :] # <<<<<<<<<<<<<< * for celltype in self.celltypes * ] */ - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_layers); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_adata, __pyx_n_s_layers); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_11, __pyx_v_celltype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_11, __pyx_v_celltype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_idxs, __pyx_v_celltype); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_idxs, __pyx_v_celltype); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_11); @@ -16048,14 +15704,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __Pyx_GIVEREF(__pyx_slice_); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_slice_); __pyx_t_11 = 0; - __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 545, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 534, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 544, __pyx_L1_error) + if (unlikely(__Pyx_ListComp_Append(__pyx_t_8, (PyObject*)__pyx_t_11))) __PYX_ERR(0, 533, __pyx_L1_error) __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; - /* "dissect/PropsSimulator/simulator.pyx":546 + /* "dissect/PropsSimulator/simulator.pyx":535 * X = [ * adata.layers[celltype][idxs[celltype], :] * for celltype in self.celltypes # <<<<<<<<<<<<<< @@ -16067,99 +15723,99 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __pyx_v_X = ((PyObject*)__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":548 + /* "dissect/PropsSimulator/simulator.pyx":537 * for celltype in self.celltypes * ] * tmp1 = AnnData( # <<<<<<<<<<<<<< * np.concatenate(X, axis=0), * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_AnnData); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 548, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_AnnData); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - /* "dissect/PropsSimulator/simulator.pyx":549 + /* "dissect/PropsSimulator/simulator.pyx":538 * ] * tmp1 = AnnData( * np.concatenate(X, axis=0), # <<<<<<<<<<<<<< * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_concatenate); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_X); __Pyx_GIVEREF(__pyx_v_X); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_X); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 549, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 549, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_axis, __pyx_int_0) < 0) __PYX_ERR(0, 538, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":548 + /* "dissect/PropsSimulator/simulator.pyx":537 * for celltype in self.celltypes * ] * tmp1 = AnnData( # <<<<<<<<<<<<<< * np.concatenate(X, axis=0), * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":550 + /* "dissect/PropsSimulator/simulator.pyx":539 * tmp1 = AnnData( * np.concatenate(X, axis=0), * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), # <<<<<<<<<<<<<< * ) * */ - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_DataFrame); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_11); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_INCREF(__pyx_v_celltypes_col); __Pyx_GIVEREF(__pyx_v_celltypes_col); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_celltypes_col); - __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); - __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_INCREF(__pyx_n_s_Celltype); __Pyx_GIVEREF(__pyx_n_s_Celltype); PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_Celltype); - if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_columns, __pyx_t_9) < 0) __PYX_ERR(0, 550, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_columns, __pyx_t_9) < 0) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 550, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_obs, __pyx_t_9) < 0) __PYX_ERR(0, 550, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_obs, __pyx_t_9) < 0) __PYX_ERR(0, 539, __pyx_L1_error) __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":548 + /* "dissect/PropsSimulator/simulator.pyx":537 * for celltype in self.celltypes * ] * tmp1 = AnnData( # <<<<<<<<<<<<<< * np.concatenate(X, axis=0), * obs=pd.DataFrame(celltypes_col, columns=["Celltype"]), */ - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 548, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 537, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -16167,80 +15823,80 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __pyx_v_tmp1 = __pyx_t_9; __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":553 + /* "dissect/PropsSimulator/simulator.pyx":542 * ) * * sc.pp.subsample(tmp1, fraction=0.5, random_state=42) # <<<<<<<<<<<<<< * sc.pp.normalize_total(tmp1, target_sum=1e6) * sc.pp.log1p(tmp1) */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sc); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 553, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_sc); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_pp); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_subsample); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_subsample); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_tmp1); __Pyx_GIVEREF(__pyx_v_tmp1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tmp1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fraction, __pyx_float_0_5) < 0) __PYX_ERR(0, 553, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_random_state, __pyx_int_42) < 0) __PYX_ERR(0, 553, __pyx_L1_error) - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_fraction, __pyx_float_0_5) < 0) __PYX_ERR(0, 542, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_random_state, __pyx_int_42) < 0) __PYX_ERR(0, 542, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 542, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":554 + /* "dissect/PropsSimulator/simulator.pyx":543 * * sc.pp.subsample(tmp1, fraction=0.5, random_state=42) * sc.pp.normalize_total(tmp1, target_sum=1e6) # <<<<<<<<<<<<<< * sc.pp.log1p(tmp1) * sc.tl.pca(tmp1) */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_sc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 554, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_sc); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_pp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_pp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_normalize_total); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_INCREF(__pyx_v_tmp1); __Pyx_GIVEREF(__pyx_v_tmp1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_tmp1); - __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 554, __pyx_L1_error) - __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 554, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_target_sum, __pyx_float_1e6) < 0) __PYX_ERR(0, 543, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 543, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":555 + /* "dissect/PropsSimulator/simulator.pyx":544 * sc.pp.subsample(tmp1, fraction=0.5, random_state=42) * sc.pp.normalize_total(tmp1, target_sum=1e6) * sc.pp.log1p(tmp1) # <<<<<<<<<<<<<< * sc.tl.pca(tmp1) * fig, ax = plt.subplots(nrows=1, ncols=1) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_log1p); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_log1p); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -16255,24 +15911,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s } __pyx_t_9 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_tmp1) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_tmp1); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 555, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 544, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":556 + /* "dissect/PropsSimulator/simulator.pyx":545 * sc.pp.normalize_total(tmp1, target_sum=1e6) * sc.pp.log1p(tmp1) * sc.tl.pca(tmp1) # <<<<<<<<<<<<<< * fig, ax = plt.subplots(nrows=1, ncols=1) * sc.pl.pca( */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_tl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_tl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pca); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pca); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = NULL; @@ -16287,28 +15943,28 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s } __pyx_t_9 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_tmp1) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_tmp1); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 556, __pyx_L1_error) + if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 545, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - /* "dissect/PropsSimulator/simulator.pyx":557 + /* "dissect/PropsSimulator/simulator.pyx":546 * sc.pp.log1p(tmp1) * sc.tl.pca(tmp1) * fig, ax = plt.subplots(nrows=1, ncols=1) # <<<<<<<<<<<<<< * sc.pl.pca( * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax */ - __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_plt); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 557, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_plt); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_subplots); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_subplots); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; - __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_nrows, __pyx_int_1) < 0) __PYX_ERR(0, 557, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_ncols, __pyx_int_1) < 0) __PYX_ERR(0, 557, __pyx_L1_error) - __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_nrows, __pyx_int_1) < 0) __PYX_ERR(0, 546, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_ncols, __pyx_int_1) < 0) __PYX_ERR(0, 546, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; @@ -16318,7 +15974,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s if (unlikely(size != 2)) { if (size > 2) __Pyx_RaiseTooManyValuesError(2); else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 557, __pyx_L1_error) + __PYX_ERR(0, 546, __pyx_L1_error) } #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS if (likely(PyTuple_CheckExact(sequence))) { @@ -16331,15 +15987,15 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __Pyx_INCREF(__pyx_t_9); __Pyx_INCREF(__pyx_t_1); #else - __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); #endif __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else { Py_ssize_t index = -1; - __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 557, __pyx_L1_error) + __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 546, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_t_13 = Py_TYPE(__pyx_t_8)->tp_iternext; @@ -16347,7 +16003,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __Pyx_GOTREF(__pyx_t_9); index = 1; __pyx_t_1 = __pyx_t_13(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L11_unpacking_failed; __Pyx_GOTREF(__pyx_t_1); - if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_8), 2) < 0) __PYX_ERR(0, 557, __pyx_L1_error) + if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_8), 2) < 0) __PYX_ERR(0, 546, __pyx_L1_error) __pyx_t_13 = NULL; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; goto __pyx_L12_unpacking_done; @@ -16355,7 +16011,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_13 = NULL; if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); - __PYX_ERR(0, 557, __pyx_L1_error) + __PYX_ERR(0, 546, __pyx_L1_error) __pyx_L12_unpacking_done:; } __pyx_v_fig = __pyx_t_9; @@ -16363,92 +16019,92 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __pyx_v_ax = __pyx_t_1; __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":558 + /* "dissect/PropsSimulator/simulator.pyx":547 * sc.tl.pca(tmp1) * fig, ax = plt.subplots(nrows=1, ncols=1) * sc.pl.pca( # <<<<<<<<<<<<<< * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_pl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pca); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_pca); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":559 + /* "dissect/PropsSimulator/simulator.pyx":548 * fig, ax = plt.subplots(nrows=1, ncols=1) * sc.pl.pca( * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax # <<<<<<<<<<<<<< * ) * plt.savefig( */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_INCREF(__pyx_v_tmp1); __Pyx_GIVEREF(__pyx_v_tmp1); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_tmp1); - __pyx_t_9 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 559, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 548, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_color, __pyx_n_s_Celltype) < 0) __PYX_ERR(0, 559, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 559, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_legend_loc, __pyx_kp_s_on_data) < 0) __PYX_ERR(0, 559, __pyx_L1_error) - if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_ax, __pyx_v_ax) < 0) __PYX_ERR(0, 559, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_color, __pyx_n_s_Celltype) < 0) __PYX_ERR(0, 548, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_show, Py_False) < 0) __PYX_ERR(0, 548, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_legend_loc, __pyx_kp_s_on_data) < 0) __PYX_ERR(0, 548, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_ax, __pyx_v_ax) < 0) __PYX_ERR(0, 548, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":558 + /* "dissect/PropsSimulator/simulator.pyx":547 * sc.tl.pca(tmp1) * fig, ax = plt.subplots(nrows=1, ncols=1) * sc.pl.pca( # <<<<<<<<<<<<<< * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) */ - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 558, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 547, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":561 + /* "dissect/PropsSimulator/simulator.pyx":550 * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) * plt.savefig( # <<<<<<<<<<<<<< * os.path.join( * self.simulation_folder, */ - __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_plt); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 561, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_plt); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_savefig); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 561, __pyx_L1_error) + __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_savefig); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_9); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":562 + /* "dissect/PropsSimulator/simulator.pyx":551 * ) * plt.savefig( * os.path.join( # <<<<<<<<<<<<<< * self.simulation_folder, * "scatterplot_pca_simulated_celltypes.pdf", */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_join); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":563 + /* "dissect/PropsSimulator/simulator.pyx":552 * plt.savefig( * os.path.join( * self.simulation_folder, # <<<<<<<<<<<<<< * "scatterplot_pca_simulated_celltypes.pdf", * ), */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 563, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 552, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; __pyx_t_10 = 0; @@ -16465,7 +16121,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_kp_s_scatterplot_pca_simulated_cellty}; - __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -16474,14 +16130,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) { PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_2, __pyx_kp_s_scatterplot_pca_simulated_cellty}; - __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; } else #endif { - __pyx_t_3 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_6) { __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL; @@ -16492,51 +16148,51 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s __Pyx_GIVEREF(__pyx_kp_s_scatterplot_pca_simulated_cellty); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_10, __pyx_kp_s_scatterplot_pca_simulated_cellty); __pyx_t_2 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 562, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 551, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":561 + /* "dissect/PropsSimulator/simulator.pyx":550 * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) * plt.savefig( # <<<<<<<<<<<<<< * os.path.join( * self.simulation_folder, */ - __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) + __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __pyx_t_8 = 0; - /* "dissect/PropsSimulator/simulator.pyx":566 + /* "dissect/PropsSimulator/simulator.pyx":555 * "scatterplot_pca_simulated_celltypes.pdf", * ), * bbox_inches="tight", # <<<<<<<<<<<<<< * ) * */ - __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 566, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 555, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); - if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_bbox_inches, __pyx_n_s_tight) < 0) __PYX_ERR(0, 566, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_bbox_inches, __pyx_n_s_tight) < 0) __PYX_ERR(0, 555, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":561 + /* "dissect/PropsSimulator/simulator.pyx":550 * tmp1, color="Celltype", show=False, legend_loc="on data", ax=ax * ) * plt.savefig( # <<<<<<<<<<<<<< * os.path.join( * self.simulation_folder, */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 561, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 550, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":537 + /* "dissect/PropsSimulator/simulator.pyx":526 * ) * * if self.config["simulation_params"]["generate_component_figures"]: # <<<<<<<<<<<<<< @@ -16545,7 +16201,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s */ } - /* "dissect/PropsSimulator/simulator.pyx":511 + /* "dissect/PropsSimulator/simulator.pyx":500 * adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) * * if save: # <<<<<<<<<<<<<< @@ -16554,7 +16210,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s */ } - /* "dissect/PropsSimulator/simulator.pyx":499 + /* "dissect/PropsSimulator/simulator.pyx":488 * return adata * * def simulate_per_batch(self, save=True): # <<<<<<<<<<<<<< @@ -16594,7 +16250,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_11Simulate_st_10s return __pyx_r; } -/* "dissect/PropsSimulator/simulator.pyx":569 +/* "dissect/PropsSimulator/simulator.pyx":558 * ) * * def save_dict_to_file(config): # <<<<<<<<<<<<<< @@ -16631,24 +16287,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_save_dict_to_file int __pyx_clineno = 0; __Pyx_RefNannySetupContext("save_dict_to_file", 0); - /* "dissect/PropsSimulator/simulator.pyx":570 + /* "dissect/PropsSimulator/simulator.pyx":559 * * def save_dict_to_file(config): * f = open(os.path.join(config["simulation_params"]["simulation_folder"], "simulation_config.py"), "w") # <<<<<<<<<<<<<< * f.write("config = ") * f.write(str(config)) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_config, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_config, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -16666,7 +16322,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_save_dict_to_file #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_4, __pyx_kp_s_simulation_config_py}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -16675,14 +16331,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_save_dict_to_file #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_4, __pyx_kp_s_simulation_config_py}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -16693,12 +16349,12 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_save_dict_to_file __Pyx_GIVEREF(__pyx_kp_s_simulation_config_py); PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_kp_s_simulation_config_py); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); @@ -16706,20 +16362,20 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_save_dict_to_file __Pyx_GIVEREF(__pyx_n_s_w); PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_w); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_open, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __pyx_v_f = __pyx_t_1; __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":571 + /* "dissect/PropsSimulator/simulator.pyx":560 * def save_dict_to_file(config): * f = open(os.path.join(config["simulation_params"]["simulation_folder"], "simulation_config.py"), "w") * f.write("config = ") # <<<<<<<<<<<<<< * f.write(str(config)) * f.close() */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -16733,21 +16389,21 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_save_dict_to_file } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_kp_s_config_2) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_config_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":572 + /* "dissect/PropsSimulator/simulator.pyx":561 * f = open(os.path.join(config["simulation_params"]["simulation_folder"], "simulation_config.py"), "w") * f.write("config = ") * f.write(str(config)) # <<<<<<<<<<<<<< * f.close() * */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_config); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 572, __pyx_L1_error) + __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_config); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_6); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -16762,19 +16418,19 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_save_dict_to_file __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":573 + /* "dissect/PropsSimulator/simulator.pyx":562 * f.write("config = ") * f.write(str(config)) * f.close() # <<<<<<<<<<<<<< * * def simulate(config): */ - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_close); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_6 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) { @@ -16788,12 +16444,12 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_save_dict_to_file } __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2); __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":569 + /* "dissect/PropsSimulator/simulator.pyx":558 * ) * * def save_dict_to_file(config): # <<<<<<<<<<<<<< @@ -16819,7 +16475,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_save_dict_to_file return __pyx_r; } -/* "dissect/PropsSimulator/simulator.pyx":575 +/* "dissect/PropsSimulator/simulator.pyx":564 * f.close() * * def simulate(config): # <<<<<<<<<<<<<< @@ -16863,7 +16519,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ int __pyx_clineno = 0; __Pyx_RefNannySetupContext("simulate", 0); - /* "dissect/PropsSimulator/simulator.pyx":577 + /* "dissect/PropsSimulator/simulator.pyx":566 * def simulate(config): * * s = 42 # <<<<<<<<<<<<<< @@ -16872,19 +16528,19 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ */ __pyx_v_s = 42; - /* "dissect/PropsSimulator/simulator.pyx":578 + /* "dissect/PropsSimulator/simulator.pyx":567 * * s = 42 * random.seed(s) # <<<<<<<<<<<<<< * np.random.seed(s) * if config["simulation_params"]["type"]=="bulk": */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_seed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 578, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_seed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { @@ -16899,27 +16555,27 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 567, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":579 + /* "dissect/PropsSimulator/simulator.pyx":568 * s = 42 * random.seed(s) * np.random.seed(s) # <<<<<<<<<<<<<< * if config["simulation_params"]["type"]=="bulk": * sim = Simulate() */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_np); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_random); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_seed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_seed); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __pyx_t_4 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) { @@ -16934,35 +16590,35 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 568, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":580 + /* "dissect/PropsSimulator/simulator.pyx":569 * random.seed(s) * np.random.seed(s) * if config["simulation_params"]["type"]=="bulk": # <<<<<<<<<<<<<< * sim = Simulate() * else: */ - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_config, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_config, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_bulk, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 580, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_bulk, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 569, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; if (__pyx_t_5) { - /* "dissect/PropsSimulator/simulator.pyx":581 + /* "dissect/PropsSimulator/simulator.pyx":570 * np.random.seed(s) * if config["simulation_params"]["type"]=="bulk": * sim = Simulate() # <<<<<<<<<<<<<< * else: * sim = Simulate_st() */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Simulate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Simulate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -16976,13 +16632,13 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ } __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 570, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sim = __pyx_t_3; __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":580 + /* "dissect/PropsSimulator/simulator.pyx":569 * random.seed(s) * np.random.seed(s) * if config["simulation_params"]["type"]=="bulk": # <<<<<<<<<<<<<< @@ -16992,7 +16648,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ goto __pyx_L3; } - /* "dissect/PropsSimulator/simulator.pyx":583 + /* "dissect/PropsSimulator/simulator.pyx":572 * sim = Simulate() * else: * sim = Simulate_st() # <<<<<<<<<<<<<< @@ -17000,7 +16656,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ * sim.preprocess() */ /*else*/ { - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Simulate_st); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Simulate_st); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) { @@ -17014,7 +16670,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ } __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_sim = __pyx_t_3; @@ -17022,14 +16678,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ } __pyx_L3:; - /* "dissect/PropsSimulator/simulator.pyx":584 + /* "dissect/PropsSimulator/simulator.pyx":573 * else: * sim = Simulate_st() * sim.initialize(config) # <<<<<<<<<<<<<< * sim.preprocess() * sim.generate_props() */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_initialize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_initialize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -17043,19 +16699,19 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ } __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_config) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_config); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 573, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":585 + /* "dissect/PropsSimulator/simulator.pyx":574 * sim = Simulate_st() * sim.initialize(config) * sim.preprocess() # <<<<<<<<<<<<<< * sim.generate_props() * batch_col = sim.config["simulation_params"]["batch_col"] */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_preprocess); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_preprocess); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -17069,19 +16725,19 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ } __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":586 + /* "dissect/PropsSimulator/simulator.pyx":575 * sim.initialize(config) * sim.preprocess() * sim.generate_props() # <<<<<<<<<<<<<< * batch_col = sim.config["simulation_params"]["batch_col"] * columns = sim.sc_adata.obs.columns */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_generate_props); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_generate_props); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __pyx_t_2 = NULL; if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) { @@ -17095,88 +16751,88 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ } __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1); __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 575, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":587 + /* "dissect/PropsSimulator/simulator.pyx":576 * sim.preprocess() * sim.generate_props() * batch_col = sim.config["simulation_params"]["batch_col"] # <<<<<<<<<<<<<< * columns = sim.sc_adata.obs.columns * # print(batch_col) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_batch_col); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 587, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_batch_col); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 576, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_batch_col = __pyx_t_3; __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":588 + /* "dissect/PropsSimulator/simulator.pyx":577 * sim.generate_props() * batch_col = sim.config["simulation_params"]["batch_col"] * columns = sim.sc_adata.obs.columns # <<<<<<<<<<<<<< * # print(batch_col) * # print(columns) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_obs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_obs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_columns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_columns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 577, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __pyx_v_columns = __pyx_t_3; __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":591 + /* "dissect/PropsSimulator/simulator.pyx":580 * # print(batch_col) * # print(columns) * if batch_col in columns: # <<<<<<<<<<<<<< * sim.batches = np.array(sim.sc_adata.obs[sim.config["simulation_params"]["batch_col"]].unique()) * if len(sim.batches) > 1: */ - __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_batch_col, __pyx_v_columns, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 591, __pyx_L1_error) + __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_batch_col, __pyx_v_columns, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 580, __pyx_L1_error) __pyx_t_6 = (__pyx_t_5 != 0); if (__pyx_t_6) { - /* "dissect/PropsSimulator/simulator.pyx":592 + /* "dissect/PropsSimulator/simulator.pyx":581 * # print(columns) * if batch_col in columns: * sim.batches = np.array(sim.sc_adata.obs[sim.config["simulation_params"]["batch_col"]].unique()) # <<<<<<<<<<<<<< * if len(sim.batches) > 1: * sim.simulate_per_batch(save=True) */ - __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_sc_adata); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_obs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_obs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_config); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_config); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_n_s_batch_col); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_n_s_batch_col); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_unique); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 592, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_unique); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __pyx_t_8 = NULL; @@ -17191,7 +16847,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ } __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_4); __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; - if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; @@ -17207,45 +16863,45 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) + if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__Pyx_PyObject_SetAttrStr(__pyx_v_sim, __pyx_n_s_batches, __pyx_t_3) < 0) __PYX_ERR(0, 592, __pyx_L1_error) + if (__Pyx_PyObject_SetAttrStr(__pyx_v_sim, __pyx_n_s_batches, __pyx_t_3) < 0) __PYX_ERR(0, 581, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":593 + /* "dissect/PropsSimulator/simulator.pyx":582 * if batch_col in columns: * sim.batches = np.array(sim.sc_adata.obs[sim.config["simulation_params"]["batch_col"]].unique()) * if len(sim.batches) > 1: # <<<<<<<<<<<<<< * sim.simulate_per_batch(save=True) * else: */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_batches); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_batches); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_9 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 593, __pyx_L1_error) + __pyx_t_9 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 582, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_6 = ((__pyx_t_9 > 1) != 0); if (__pyx_t_6) { - /* "dissect/PropsSimulator/simulator.pyx":594 + /* "dissect/PropsSimulator/simulator.pyx":583 * sim.batches = np.array(sim.sc_adata.obs[sim.config["simulation_params"]["batch_col"]].unique()) * if len(sim.batches) > 1: * sim.simulate_per_batch(save=True) # <<<<<<<<<<<<<< * else: * sim.simulate(save=True) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_simulate_per_batch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 594, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_simulate_per_batch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_save, Py_True) < 0) __PYX_ERR(0, 594, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_save, Py_True) < 0) __PYX_ERR(0, 583, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":593 + /* "dissect/PropsSimulator/simulator.pyx":582 * if batch_col in columns: * sim.batches = np.array(sim.sc_adata.obs[sim.config["simulation_params"]["batch_col"]].unique()) * if len(sim.batches) > 1: # <<<<<<<<<<<<<< @@ -17255,7 +16911,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ goto __pyx_L5; } - /* "dissect/PropsSimulator/simulator.pyx":596 + /* "dissect/PropsSimulator/simulator.pyx":585 * sim.simulate_per_batch(save=True) * else: * sim.simulate(save=True) # <<<<<<<<<<<<<< @@ -17263,12 +16919,12 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ * print("Number of batches in single-cell data is 1. If this is incorrect, please specify name of the batch column as in the single-cell data object (.obs)") */ /*else*/ { - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_simulate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_simulate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_save, Py_True) < 0) __PYX_ERR(0, 596, __pyx_L1_error) - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_save, Py_True) < 0) __PYX_ERR(0, 585, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 585, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -17276,7 +16932,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ } __pyx_L5:; - /* "dissect/PropsSimulator/simulator.pyx":591 + /* "dissect/PropsSimulator/simulator.pyx":580 * # print(batch_col) * # print(columns) * if batch_col in columns: # <<<<<<<<<<<<<< @@ -17286,7 +16942,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ goto __pyx_L4; } - /* "dissect/PropsSimulator/simulator.pyx":598 + /* "dissect/PropsSimulator/simulator.pyx":587 * sim.simulate(save=True) * else: * print("Number of batches in single-cell data is 1. If this is incorrect, please specify name of the batch column as in the single-cell data object (.obs)") # <<<<<<<<<<<<<< @@ -17294,21 +16950,21 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ * sim.config["simulation_params"]["simulation_folder"] = os.path.join(sim.config["experiment_folder"], "simulation") */ /*else*/ { - if (__Pyx_PrintOne(0, __pyx_kp_s_Number_of_batches_in_single_cell) < 0) __PYX_ERR(0, 598, __pyx_L1_error) + if (__Pyx_PrintOne(0, __pyx_kp_s_Number_of_batches_in_single_cell) < 0) __PYX_ERR(0, 587, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":599 + /* "dissect/PropsSimulator/simulator.pyx":588 * else: * print("Number of batches in single-cell data is 1. If this is incorrect, please specify name of the batch column as in the single-cell data object (.obs)") * sim.simulate(save=True) # <<<<<<<<<<<<<< * sim.config["simulation_params"]["simulation_folder"] = os.path.join(sim.config["experiment_folder"], "simulation") - * sim.config["simulation_params"]["concentration"] = list(sim.config["simulation_params"]["concentration"]) + * if config["simulation_params"]["type"]=="bulk": */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_simulate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_simulate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 599, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_save, Py_True) < 0) __PYX_ERR(0, 599, __pyx_L1_error) - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error) + if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_save, Py_True) < 0) __PYX_ERR(0, 588, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; @@ -17316,24 +16972,24 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ } __pyx_L4:; - /* "dissect/PropsSimulator/simulator.pyx":600 + /* "dissect/PropsSimulator/simulator.pyx":589 * print("Number of batches in single-cell data is 1. If this is incorrect, please specify name of the batch column as in the single-cell data object (.obs)") * sim.simulate(save=True) * sim.config["simulation_params"]["simulation_folder"] = os.path.join(sim.config["experiment_folder"], "simulation") # <<<<<<<<<<<<<< - * sim.config["simulation_params"]["concentration"] = list(sim.config["simulation_params"]["concentration"]) - * sim.config["deconv_params"]["reference"] = os.path.join(sim.config["simulation_params"]["simulation_folder"], "simulated.h5ad") + * if config["simulation_params"]["type"]=="bulk": + * sim.config["simulation_params"]["concentration"] = list(sim.config["simulation_params"]["concentration"]) */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_config); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_experiment_folder); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_3, __pyx_n_s_experiment_folder); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = NULL; @@ -17351,7 +17007,7 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_4, __pyx_n_s_simulation}; - __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; @@ -17360,14 +17016,14 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_4, __pyx_n_s_simulation}; - __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; } else #endif { - __pyx_t_8 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_8 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); if (__pyx_t_3) { __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL; @@ -17378,69 +17034,94 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ __Pyx_GIVEREF(__pyx_n_s_simulation); PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_10, __pyx_n_s_simulation); __pyx_t_4 = 0; - __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 600, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_n_s_simulation_folder, __pyx_t_1) < 0)) __PYX_ERR(0, 600, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_8, __pyx_n_s_simulation_folder, __pyx_t_1) < 0)) __PYX_ERR(0, 589, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":601 + /* "dissect/PropsSimulator/simulator.pyx":590 * sim.simulate(save=True) * sim.config["simulation_params"]["simulation_folder"] = os.path.join(sim.config["experiment_folder"], "simulation") - * sim.config["simulation_params"]["concentration"] = list(sim.config["simulation_params"]["concentration"]) # <<<<<<<<<<<<<< + * if config["simulation_params"]["type"]=="bulk": # <<<<<<<<<<<<<< + * sim.config["simulation_params"]["concentration"] = list(sim.config["simulation_params"]["concentration"]) * sim.config["deconv_params"]["reference"] = os.path.join(sim.config["simulation_params"]["simulation_folder"], "simulated.h5ad") - * save_dict_to_file(sim.config) */ - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_n_s_concentration); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_config, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; - __pyx_t_8 = PySequence_List(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 601, __pyx_L1_error) + __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_type); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_concentration, __pyx_t_8) < 0)) __PYX_ERR(0, 601, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_t_8, __pyx_n_s_bulk, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 590, __pyx_L1_error) __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (__pyx_t_6) { + + /* "dissect/PropsSimulator/simulator.pyx":591 + * sim.config["simulation_params"]["simulation_folder"] = os.path.join(sim.config["experiment_folder"], "simulation") + * if config["simulation_params"]["type"]=="bulk": + * sim.config["simulation_params"]["concentration"] = list(sim.config["simulation_params"]["concentration"]) # <<<<<<<<<<<<<< + * sim.config["deconv_params"]["reference"] = os.path.join(sim.config["simulation_params"]["simulation_folder"], "simulated.h5ad") + * save_dict_to_file(sim.config) + */ + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_config); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_concentration); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = PySequence_List(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_config); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_2); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_n_s_concentration, __pyx_t_1) < 0)) __PYX_ERR(0, 591, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":602 + /* "dissect/PropsSimulator/simulator.pyx":590 + * sim.simulate(save=True) * sim.config["simulation_params"]["simulation_folder"] = os.path.join(sim.config["experiment_folder"], "simulation") - * sim.config["simulation_params"]["concentration"] = list(sim.config["simulation_params"]["concentration"]) + * if config["simulation_params"]["type"]=="bulk": # <<<<<<<<<<<<<< + * sim.config["simulation_params"]["concentration"] = list(sim.config["simulation_params"]["concentration"]) + * sim.config["deconv_params"]["reference"] = os.path.join(sim.config["simulation_params"]["simulation_folder"], "simulated.h5ad") + */ + } + + /* "dissect/PropsSimulator/simulator.pyx":592 + * if config["simulation_params"]["type"]=="bulk": + * sim.config["simulation_params"]["concentration"] = list(sim.config["simulation_params"]["concentration"]) * sim.config["deconv_params"]["reference"] = os.path.join(sim.config["simulation_params"]["simulation_folder"], "simulated.h5ad") # <<<<<<<<<<<<<< * save_dict_to_file(sim.config) * */ - __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error) + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_config); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); + __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_t_8, __pyx_n_s_simulation_params); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_t_4, __pyx_n_s_simulation_folder); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_8); __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; __pyx_t_4 = NULL; __pyx_t_10 = 0; @@ -17456,77 +17137,77 @@ static PyObject *__pyx_pf_7dissect_14PropsSimulator_9simulator_2simulate(CYTHON_ } #if CYTHON_FAST_PYCALL if (PyFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_1, __pyx_kp_s_simulated_h5ad}; - __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __pyx_L1_error) + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_8, __pyx_kp_s_simulated_h5ad}; + __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif #if CYTHON_FAST_PYCCALL if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) { - PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_1, __pyx_kp_s_simulated_h5ad}; - __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __pyx_L1_error) + PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_8, __pyx_kp_s_simulated_h5ad}; + __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_GOTREF(__pyx_t_8); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; + __Pyx_GOTREF(__pyx_t_1); + __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; } else #endif { - __pyx_t_3 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_3 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); if (__pyx_t_4) { __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL; } - __Pyx_GIVEREF(__pyx_t_1); - PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_10, __pyx_t_1); + __Pyx_GIVEREF(__pyx_t_8); + PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_kp_s_simulated_h5ad); __Pyx_GIVEREF(__pyx_kp_s_simulated_h5ad); PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_10, __pyx_kp_s_simulated_h5ad); - __pyx_t_1 = 0; - __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 602, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + __pyx_t_8 = 0; + __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; } __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_deconv_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_s_deconv_params); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_n_s_reference, __pyx_t_8) < 0)) __PYX_ERR(0, 602, __pyx_L1_error) + if (unlikely(PyObject_SetItem(__pyx_t_3, __pyx_n_s_reference, __pyx_t_1) < 0)) __PYX_ERR(0, 592, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":603 - * sim.config["simulation_params"]["concentration"] = list(sim.config["simulation_params"]["concentration"]) + /* "dissect/PropsSimulator/simulator.pyx":593 + * sim.config["simulation_params"]["concentration"] = list(sim.config["simulation_params"]["concentration"]) * sim.config["deconv_params"]["reference"] = os.path.join(sim.config["simulation_params"]["simulation_folder"], "simulated.h5ad") * save_dict_to_file(sim.config) # <<<<<<<<<<<<<< * */ - __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_save_dict_to_file); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 603, __pyx_L1_error) + __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_save_dict_to_file); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 603, __pyx_L1_error) + __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_sim, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 593, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = NULL; + __pyx_t_8 = NULL; if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3); - if (likely(__pyx_t_1)) { + __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3); + if (likely(__pyx_t_8)) { PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3); - __Pyx_INCREF(__pyx_t_1); + __Pyx_INCREF(__pyx_t_8); __Pyx_INCREF(function); __Pyx_DECREF_SET(__pyx_t_3, function); } } - __pyx_t_8 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); - __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0; + __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); + __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_8); + if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 593, __pyx_L1_error) + __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; + __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - /* "dissect/PropsSimulator/simulator.pyx":575 + /* "dissect/PropsSimulator/simulator.pyx":564 * f.close() * * def simulate(config): # <<<<<<<<<<<<<< @@ -17603,8 +17284,6 @@ static struct PyModuleDef __pyx_moduledef = { static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_AnnData, __pyx_k_AnnData, sizeof(__pyx_k_AnnData), 0, 0, 1, 1}, {&__pyx_n_s_Celltype, __pyx_k_Celltype, sizeof(__pyx_k_Celltype), 0, 0, 1, 1}, - {&__pyx_n_s_Count, __pyx_k_Count, sizeof(__pyx_k_Count), 0, 0, 1, 1}, - {&__pyx_kp_s_Counts_of_cell_types_in_generate, __pyx_k_Counts_of_cell_types_in_generate, sizeof(__pyx_k_Counts_of_cell_types_in_generate), 0, 0, 1, 0}, {&__pyx_n_s_DataFrame, __pyx_k_DataFrame, sizeof(__pyx_k_DataFrame), 0, 0, 1, 1}, {&__pyx_kp_s_MT, __pyx_k_MT, sizeof(__pyx_k_MT), 0, 0, 1, 0}, {&__pyx_kp_s_Number_of_batches_in_single_cell, __pyx_k_Number_of_batches_in_single_cell, sizeof(__pyx_k_Number_of_batches_in_single_cell), 0, 0, 1, 0}, @@ -17644,8 +17323,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_batches, __pyx_k_batches, sizeof(__pyx_k_batches), 0, 0, 1, 1}, {&__pyx_n_s_bbox_inches, __pyx_k_bbox_inches, sizeof(__pyx_k_bbox_inches), 0, 0, 1, 1}, {&__pyx_n_s_boxplot, __pyx_k_boxplot, sizeof(__pyx_k_boxplot), 0, 0, 1, 1}, - {&__pyx_kp_s_boxplot_ncells_complete_pdf, __pyx_k_boxplot_ncells_complete_pdf, sizeof(__pyx_k_boxplot_ncells_complete_pdf), 0, 0, 1, 0}, - {&__pyx_kp_s_boxplot_ncells_sparse_pdf, __pyx_k_boxplot_ncells_sparse_pdf, sizeof(__pyx_k_boxplot_ncells_sparse_pdf), 0, 0, 1, 0}, {&__pyx_kp_s_boxplot_props_complete_pdf, __pyx_k_boxplot_props_complete_pdf, sizeof(__pyx_k_boxplot_props_complete_pdf), 0, 0, 1, 0}, {&__pyx_kp_s_boxplot_props_sparse_pdf, __pyx_k_boxplot_props_sparse_pdf, sizeof(__pyx_k_boxplot_props_sparse_pdf), 0, 0, 1, 0}, {&__pyx_n_s_bulk, __pyx_k_bulk, sizeof(__pyx_k_bulk), 0, 0, 1, 1}, @@ -17700,6 +17377,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_generate_component_figures, __pyx_k_generate_component_figures, sizeof(__pyx_k_generate_component_figures), 0, 0, 1, 1}, {&__pyx_n_s_generate_props, __pyx_k_generate_props, sizeof(__pyx_k_generate_props), 0, 0, 1, 1}, {&__pyx_n_s_genes, __pyx_k_genes, sizeof(__pyx_k_genes), 0, 0, 1, 1}, + {&__pyx_n_s_ha, __pyx_k_ha, sizeof(__pyx_k_ha), 0, 0, 1, 1}, {&__pyx_n_s_heg, __pyx_k_heg, sizeof(__pyx_k_heg), 0, 0, 1, 1}, {&__pyx_n_s_highly_variable_genes, __pyx_k_highly_variable_genes, sizeof(__pyx_k_highly_variable_genes), 0, 0, 1, 1}, {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, @@ -17780,6 +17458,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_read, __pyx_k_read, sizeof(__pyx_k_read), 0, 0, 1, 1}, {&__pyx_n_s_reference, __pyx_k_reference, sizeof(__pyx_k_reference), 0, 0, 1, 1}, {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1}, + {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1}, + {&__pyx_n_s_rotation, __pyx_k_rotation, sizeof(__pyx_k_rotation), 0, 0, 1, 1}, {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1}, {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, {&__pyx_n_s_sample, __pyx_k_sample, sizeof(__pyx_k_sample), 0, 0, 1, 1}, @@ -17833,6 +17513,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { {&__pyx_n_s_var_names_make_unique, __pyx_k_var_names_make_unique, sizeof(__pyx_k_var_names_make_unique), 0, 0, 1, 1}, {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1}, {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1}, + {&__pyx_n_s_xticks, __pyx_k_xticks, sizeof(__pyx_k_xticks), 0, 0, 1, 1}, {&__pyx_n_s_ylabel, __pyx_k_ylabel, sizeof(__pyx_k_ylabel), 0, 0, 1, 1}, {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, {0, 0, 0, 0, 0, 0, 0} @@ -17840,7 +17521,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = { static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) { __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 15, __pyx_L1_error) __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 63, __pyx_L1_error) - __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 570, __pyx_L1_error) + __pyx_builtin_open = __Pyx_GetBuiltinName(__pyx_n_s_open); if (!__pyx_builtin_open) __PYX_ERR(0, 559, __pyx_L1_error) return 0; __pyx_L1_error:; return -1; @@ -17861,25 +17542,25 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_slice_); __Pyx_GIVEREF(__pyx_slice_); - /* "dissect/PropsSimulator/simulator.pyx":323 + /* "dissect/PropsSimulator/simulator.pyx":318 * keep_sparse = np.ones((self.n_sparse, self.n_celltypes), dtype=np.float32) * * keep = np.random.randint(1, 6, size=self.n_sparse) # <<<<<<<<<<<<<< * keeps = [] * for i in keep: */ - __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_6); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 323, __pyx_L1_error) + __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_1, __pyx_int_6); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 318, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__2); __Pyx_GIVEREF(__pyx_tuple__2); - /* "dissect/PropsSimulator/simulator.pyx":342 + /* "dissect/PropsSimulator/simulator.pyx":337 * * for i in range(self.props_sparse.shape[0]): * n = np.random.choice(list(range(5, 12)), size=1, replace=False) # <<<<<<<<<<<<<< * self.cells_sparse = self.props_sparse * n * self.cells_sparse = np.round(self.cells_sparse, 0).astype(int) */ - __pyx_tuple__3 = PyTuple_Pack(2, __pyx_int_5, __pyx_int_12); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 342, __pyx_L1_error) + __pyx_tuple__3 = PyTuple_Pack(2, __pyx_int_5, __pyx_int_12); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 337, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__3); __Pyx_GIVEREF(__pyx_tuple__3); @@ -17930,160 +17611,160 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__10); __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_generate_props, 29, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 29, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":125 + /* "dissect/PropsSimulator/simulator.pyx":120 * self.cells = np.concatenate([self.cells_complete, self.cells_sparse], axis=0) * * def preprocess(self): # <<<<<<<<<<<<<< * self.sc_adata.var_names_make_unique() * sc.pp.filter_cells(self.sc_adata, min_genes=self.config["simulation_params"]["filter"]["min_genes"]) */ - __pyx_tuple__12 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tmp, __pyx_n_s_heg); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_tuple__12 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tmp, __pyx_n_s_heg); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__12); __Pyx_GIVEREF(__pyx_tuple__12); - __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_preprocess, 125, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_preprocess, 120, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 120, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":149 + /* "dissect/PropsSimulator/simulator.pyx":144 * del heg * * def simulate(self, save=True): # <<<<<<<<<<<<<< * adatas = {} * genes = self.sc_adata.var_names */ - __pyx_tuple__14 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_save, __pyx_n_s_adatas, __pyx_n_s_genes, __pyx_n_s_celltype, __pyx_n_s_adata, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_cell_idxs, __pyx_n_s_sample, __pyx_n_s_total_sample, __pyx_n_s_tmp, __pyx_n_s_idxs, __pyx_n_s_celltypes_col, __pyx_n_s_X, __pyx_n_s_tmp1, __pyx_n_s_fig, __pyx_n_s_ax); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_tuple__14 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_save, __pyx_n_s_adatas, __pyx_n_s_genes, __pyx_n_s_celltype, __pyx_n_s_adata, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_cell_idxs, __pyx_n_s_sample, __pyx_n_s_total_sample, __pyx_n_s_tmp, __pyx_n_s_idxs, __pyx_n_s_celltypes_col, __pyx_n_s_X, __pyx_n_s_tmp1, __pyx_n_s_fig, __pyx_n_s_ax); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__14); __Pyx_GIVEREF(__pyx_tuple__14); - __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_simulate, 149, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 149, __pyx_L1_error) - __pyx_tuple__16 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_simulate, 144, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 144, __pyx_L1_error) + __pyx_tuple__16 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__16); __Pyx_GIVEREF(__pyx_tuple__16); - /* "dissect/PropsSimulator/simulator.pyx":232 + /* "dissect/PropsSimulator/simulator.pyx":227 * return adata * * def simulate_per_batch(self, save=True): # <<<<<<<<<<<<<< * adata_orig = self.sc_adata.copy() * adatas = [] */ - __pyx_tuple__17 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_save, __pyx_n_s_adata_orig, __pyx_n_s_adatas, __pyx_n_s_batch, __pyx_n_s_adata, __pyx_n_s_tmp, __pyx_n_s_idxs, __pyx_n_s_celltypes_col, __pyx_n_s_j, __pyx_n_s_celltype, __pyx_n_s_X, __pyx_n_s_tmp1, __pyx_n_s_fig, __pyx_n_s_ax); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_tuple__17 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_save, __pyx_n_s_adata_orig, __pyx_n_s_adatas, __pyx_n_s_batch, __pyx_n_s_adata, __pyx_n_s_tmp, __pyx_n_s_idxs, __pyx_n_s_celltypes_col, __pyx_n_s_j, __pyx_n_s_celltype, __pyx_n_s_X, __pyx_n_s_tmp1, __pyx_n_s_fig, __pyx_n_s_ax); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__17); __Pyx_GIVEREF(__pyx_tuple__17); - __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_simulate_per_batch, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 232, __pyx_L1_error) - __pyx_tuple__19 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_simulate_per_batch, 227, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 227, __pyx_L1_error) + __pyx_tuple__19 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__19); __Pyx_GIVEREF(__pyx_tuple__19); - /* "dissect/PropsSimulator/simulator.pyx":302 + /* "dissect/PropsSimulator/simulator.pyx":297 * ) * * class Simulate_st(object): # <<<<<<<<<<<<<< * def __init__(self): * pass */ - __pyx_tuple__20 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_tuple__20 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__20); __Pyx_GIVEREF(__pyx_tuple__20); - /* "dissect/PropsSimulator/simulator.pyx":303 + /* "dissect/PropsSimulator/simulator.pyx":298 * * class Simulate_st(object): * def __init__(self): # <<<<<<<<<<<<<< * pass * */ - __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__21); __Pyx_GIVEREF(__pyx_tuple__21); - __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_init, 303, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_init, 298, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 298, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":306 + /* "dissect/PropsSimulator/simulator.pyx":301 * pass * * def initialize(self, config): # <<<<<<<<<<<<<< - * self.config["simulation_params"] = config + * self.config = config * self.sc_adata = sc.read(config["simulation_params"]["scdata"]) */ - __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_config); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_tuple__23 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_config); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); - __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_initialize, 306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_initialize, 301, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 301, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":316 + /* "dissect/PropsSimulator/simulator.pyx":311 * self.n_celltypes = len(self.celltypes) * * def generate_props(self): # <<<<<<<<<<<<<< * if not self.config["simulation_params"]["n_samples"]: * self.config["simulation_params"]["n_samples"] = 1000 * self.n_celltypes */ - __pyx_tuple__25 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_keep_sparse, __pyx_n_s_keep, __pyx_n_s_keeps, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_datetime, __pyx_n_s_now, __pyx_n_s_date_time, __pyx_n_s_name_2, __pyx_n_s_fig, __pyx_n_s_ax); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_tuple__25 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_keep_sparse, __pyx_n_s_keep, __pyx_n_s_keeps, __pyx_n_s_i, __pyx_n_s_n, __pyx_n_s_datetime, __pyx_n_s_now, __pyx_n_s_date_time, __pyx_n_s_name_2, __pyx_n_s_fig, __pyx_n_s_ax); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__25); __Pyx_GIVEREF(__pyx_tuple__25); - __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_generate_props, 316, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_generate_props, 311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 311, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":389 + /* "dissect/PropsSimulator/simulator.pyx":378 * self.cells = self.cells_sparse * * def preprocess(self): # <<<<<<<<<<<<<< * self.sc_adata.var_names_make_unique() * sc.pp.filter_cells(self.sc_adata, min_genes=self.config["simulation_params"]["filter"]["min_genes"]) */ - __pyx_tuple__27 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tmp, __pyx_n_s_heg); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_tuple__27 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tmp, __pyx_n_s_heg); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__27); __Pyx_GIVEREF(__pyx_tuple__27); - __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_preprocess, 389, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_preprocess, 378, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 378, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":413 + /* "dissect/PropsSimulator/simulator.pyx":402 * del heg * * def simulate(self, save=True): # <<<<<<<<<<<<<< * adatas = {} * genes = self.sc_adata.var_names */ - __pyx_tuple__29 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_save, __pyx_n_s_adatas, __pyx_n_s_genes, __pyx_n_s_celltype, __pyx_n_s_adata, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_cell_idxs, __pyx_n_s_sample, __pyx_n_s_total_sample, __pyx_n_s_tmp, __pyx_n_s_idxs, __pyx_n_s_celltypes_col, __pyx_n_s_X, __pyx_n_s_tmp1, __pyx_n_s_fig, __pyx_n_s_ax); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_tuple__29 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_save, __pyx_n_s_adatas, __pyx_n_s_genes, __pyx_n_s_celltype, __pyx_n_s_adata, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_cell_idxs, __pyx_n_s_sample, __pyx_n_s_total_sample, __pyx_n_s_tmp, __pyx_n_s_idxs, __pyx_n_s_celltypes_col, __pyx_n_s_X, __pyx_n_s_tmp1, __pyx_n_s_fig, __pyx_n_s_ax); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__29); __Pyx_GIVEREF(__pyx_tuple__29); - __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_simulate, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 413, __pyx_L1_error) - __pyx_tuple__31 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_simulate, 402, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 402, __pyx_L1_error) + __pyx_tuple__31 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__31); __Pyx_GIVEREF(__pyx_tuple__31); - /* "dissect/PropsSimulator/simulator.pyx":499 + /* "dissect/PropsSimulator/simulator.pyx":488 * return adata * * def simulate_per_batch(self, save=True): # <<<<<<<<<<<<<< * adata_orig = self.sc_adata.copy() * adatas = [] */ - __pyx_tuple__32 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_save, __pyx_n_s_adata_orig, __pyx_n_s_adatas, __pyx_n_s_batch, __pyx_n_s_adata, __pyx_n_s_tmp, __pyx_n_s_idxs, __pyx_n_s_celltypes_col, __pyx_n_s_j, __pyx_n_s_celltype, __pyx_n_s_X, __pyx_n_s_tmp1, __pyx_n_s_fig, __pyx_n_s_ax); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_tuple__32 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_save, __pyx_n_s_adata_orig, __pyx_n_s_adatas, __pyx_n_s_batch, __pyx_n_s_adata, __pyx_n_s_tmp, __pyx_n_s_idxs, __pyx_n_s_celltypes_col, __pyx_n_s_j, __pyx_n_s_celltype, __pyx_n_s_X, __pyx_n_s_tmp1, __pyx_n_s_fig, __pyx_n_s_ax); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__32); __Pyx_GIVEREF(__pyx_tuple__32); - __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_simulate_per_batch, 499, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 499, __pyx_L1_error) - __pyx_tuple__34 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_simulate_per_batch, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 488, __pyx_L1_error) + __pyx_tuple__34 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__34); __Pyx_GIVEREF(__pyx_tuple__34); - /* "dissect/PropsSimulator/simulator.pyx":569 + /* "dissect/PropsSimulator/simulator.pyx":558 * ) * * def save_dict_to_file(config): # <<<<<<<<<<<<<< * f = open(os.path.join(config["simulation_params"]["simulation_folder"], "simulation_config.py"), "w") * f.write("config = ") */ - __pyx_tuple__35 = PyTuple_Pack(2, __pyx_n_s_config, __pyx_n_s_f); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_tuple__35 = PyTuple_Pack(2, __pyx_n_s_config, __pyx_n_s_f); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__35); __Pyx_GIVEREF(__pyx_tuple__35); - __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_save_dict_to_file, 569, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_save_dict_to_file, 558, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 558, __pyx_L1_error) - /* "dissect/PropsSimulator/simulator.pyx":575 + /* "dissect/PropsSimulator/simulator.pyx":564 * f.close() * * def simulate(config): # <<<<<<<<<<<<<< * * s = 42 */ - __pyx_tuple__37 = PyTuple_Pack(5, __pyx_n_s_config, __pyx_n_s_s, __pyx_n_s_sim, __pyx_n_s_batch_col, __pyx_n_s_columns); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_tuple__37 = PyTuple_Pack(5, __pyx_n_s_config, __pyx_n_s_s, __pyx_n_s_sim, __pyx_n_s_batch_col, __pyx_n_s_columns); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_tuple__37); __Pyx_GIVEREF(__pyx_tuple__37); - __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_simulate, 575, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_dissect_PropsSimulator_simulator_2, __pyx_n_s_simulate, 564, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_RefNannyFinishContext(); return 0; __pyx_L1_error:; @@ -18100,8 +17781,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) { __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_42 = PyInt_FromLong(42); if (unlikely(!__pyx_int_42)) __PYX_ERR(0, 1, __pyx_L1_error) + __pyx_int_45 = PyInt_FromLong(45); if (unlikely(!__pyx_int_45)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_200 = PyInt_FromLong(200); if (unlikely(!__pyx_int_200)) __PYX_ERR(0, 1, __pyx_L1_error) __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) __PYX_ERR(0, 1, __pyx_L1_error) return 0; @@ -18588,42 +18271,42 @@ if (!__Pyx_RefNanny) { if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_generate_props, __pyx_t_3) < 0) __PYX_ERR(0, 29, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":125 + /* "dissect/PropsSimulator/simulator.pyx":120 * self.cells = np.concatenate([self.cells_complete, self.cells_sparse], axis=0) * * def preprocess(self): # <<<<<<<<<<<<<< * self.sc_adata.var_names_make_unique() * sc.pp.filter_cells(self.sc_adata, min_genes=self.config["simulation_params"]["filter"]["min_genes"]) */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_8Simulate_7preprocess, 0, __pyx_n_s_Simulate_preprocess, NULL, __pyx_n_s_dissect_PropsSimulator_simulator, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_8Simulate_7preprocess, 0, __pyx_n_s_Simulate_preprocess, NULL, __pyx_n_s_dissect_PropsSimulator_simulator, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_preprocess, __pyx_t_3) < 0) __PYX_ERR(0, 125, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_preprocess, __pyx_t_3) < 0) __PYX_ERR(0, 120, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":149 + /* "dissect/PropsSimulator/simulator.pyx":144 * del heg * * def simulate(self, save=True): # <<<<<<<<<<<<<< * adatas = {} * genes = self.sc_adata.var_names */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_8Simulate_9simulate, 0, __pyx_n_s_Simulate_simulate, NULL, __pyx_n_s_dissect_PropsSimulator_simulator, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_8Simulate_9simulate, 0, __pyx_n_s_Simulate_simulate, NULL, __pyx_n_s_dissect_PropsSimulator_simulator, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__16); - if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_simulate, __pyx_t_3) < 0) __PYX_ERR(0, 149, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_simulate, __pyx_t_3) < 0) __PYX_ERR(0, 144, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":232 + /* "dissect/PropsSimulator/simulator.pyx":227 * return adata * * def simulate_per_batch(self, save=True): # <<<<<<<<<<<<<< * adata_orig = self.sc_adata.copy() * adatas = [] */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_8Simulate_11simulate_per_batch, 0, __pyx_n_s_Simulate_simulate_per_batch, NULL, __pyx_n_s_dissect_PropsSimulator_simulator, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_8Simulate_11simulate_per_batch, 0, __pyx_n_s_Simulate_simulate_per_batch, NULL, __pyx_n_s_dissect_PropsSimulator_simulator, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__19); - if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_simulate_per_batch, __pyx_t_3) < 0) __PYX_ERR(0, 232, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_simulate_per_batch, __pyx_t_3) < 0) __PYX_ERR(0, 227, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; /* "dissect/PropsSimulator/simulator.pyx":15 @@ -18640,128 +18323,128 @@ if (!__Pyx_RefNanny) { __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":302 + /* "dissect/PropsSimulator/simulator.pyx":297 * ) * * class Simulate_st(object): # <<<<<<<<<<<<<< * def __init__(self): * pass */ - __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__20); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__20); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple__20, __pyx_n_s_Simulate_st, __pyx_n_s_Simulate_st, (PyObject *) NULL, __pyx_n_s_dissect_PropsSimulator_simulator, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_tuple__20, __pyx_n_s_Simulate_st, __pyx_n_s_Simulate_st, (PyObject *) NULL, __pyx_n_s_dissect_PropsSimulator_simulator, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); - /* "dissect/PropsSimulator/simulator.pyx":303 + /* "dissect/PropsSimulator/simulator.pyx":298 * * class Simulate_st(object): * def __init__(self): # <<<<<<<<<<<<<< * pass * */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_11Simulate_st_1__init__, 0, __pyx_n_s_Simulate_st___init, NULL, __pyx_n_s_dissect_PropsSimulator_simulator, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 303, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_11Simulate_st_1__init__, 0, __pyx_n_s_Simulate_st___init, NULL, __pyx_n_s_dissect_PropsSimulator_simulator, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 303, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_3) < 0) __PYX_ERR(0, 298, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":306 + /* "dissect/PropsSimulator/simulator.pyx":301 * pass * * def initialize(self, config): # <<<<<<<<<<<<<< - * self.config["simulation_params"] = config + * self.config = config * self.sc_adata = sc.read(config["simulation_params"]["scdata"]) */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_11Simulate_st_3initialize, 0, __pyx_n_s_Simulate_st_initialize, NULL, __pyx_n_s_dissect_PropsSimulator_simulator, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 306, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_11Simulate_st_3initialize, 0, __pyx_n_s_Simulate_st_initialize, NULL, __pyx_n_s_dissect_PropsSimulator_simulator, __pyx_d, ((PyObject *)__pyx_codeobj__24)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_initialize, __pyx_t_3) < 0) __PYX_ERR(0, 306, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_initialize, __pyx_t_3) < 0) __PYX_ERR(0, 301, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":316 + /* "dissect/PropsSimulator/simulator.pyx":311 * self.n_celltypes = len(self.celltypes) * * def generate_props(self): # <<<<<<<<<<<<<< * if not self.config["simulation_params"]["n_samples"]: * self.config["simulation_params"]["n_samples"] = 1000 * self.n_celltypes */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_11Simulate_st_5generate_props, 0, __pyx_n_s_Simulate_st_generate_props, NULL, __pyx_n_s_dissect_PropsSimulator_simulator, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 316, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_11Simulate_st_5generate_props, 0, __pyx_n_s_Simulate_st_generate_props, NULL, __pyx_n_s_dissect_PropsSimulator_simulator, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_generate_props, __pyx_t_3) < 0) __PYX_ERR(0, 316, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_generate_props, __pyx_t_3) < 0) __PYX_ERR(0, 311, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":389 + /* "dissect/PropsSimulator/simulator.pyx":378 * self.cells = self.cells_sparse * * def preprocess(self): # <<<<<<<<<<<<<< * self.sc_adata.var_names_make_unique() * sc.pp.filter_cells(self.sc_adata, min_genes=self.config["simulation_params"]["filter"]["min_genes"]) */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_11Simulate_st_7preprocess, 0, __pyx_n_s_Simulate_st_preprocess, NULL, __pyx_n_s_dissect_PropsSimulator_simulator, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 389, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_11Simulate_st_7preprocess, 0, __pyx_n_s_Simulate_st_preprocess, NULL, __pyx_n_s_dissect_PropsSimulator_simulator, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_preprocess, __pyx_t_3) < 0) __PYX_ERR(0, 389, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_preprocess, __pyx_t_3) < 0) __PYX_ERR(0, 378, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":413 + /* "dissect/PropsSimulator/simulator.pyx":402 * del heg * * def simulate(self, save=True): # <<<<<<<<<<<<<< * adatas = {} * genes = self.sc_adata.var_names */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_11Simulate_st_9simulate, 0, __pyx_n_s_Simulate_st_simulate, NULL, __pyx_n_s_dissect_PropsSimulator_simulator, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 413, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_11Simulate_st_9simulate, 0, __pyx_n_s_Simulate_st_simulate, NULL, __pyx_n_s_dissect_PropsSimulator_simulator, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__31); - if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_simulate, __pyx_t_3) < 0) __PYX_ERR(0, 413, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_simulate, __pyx_t_3) < 0) __PYX_ERR(0, 402, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":499 + /* "dissect/PropsSimulator/simulator.pyx":488 * return adata * * def simulate_per_batch(self, save=True): # <<<<<<<<<<<<<< * adata_orig = self.sc_adata.copy() * adatas = [] */ - __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_11Simulate_st_11simulate_per_batch, 0, __pyx_n_s_Simulate_st_simulate_per_batch, NULL, __pyx_n_s_dissect_PropsSimulator_simulator, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error) + __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_11Simulate_st_11simulate_per_batch, 0, __pyx_n_s_Simulate_st_simulate_per_batch, NULL, __pyx_n_s_dissect_PropsSimulator_simulator, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__34); - if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_simulate_per_batch, __pyx_t_3) < 0) __PYX_ERR(0, 499, __pyx_L1_error) + if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_simulate_per_batch, __pyx_t_3) < 0) __PYX_ERR(0, 488, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - /* "dissect/PropsSimulator/simulator.pyx":302 + /* "dissect/PropsSimulator/simulator.pyx":297 * ) * * class Simulate_st(object): # <<<<<<<<<<<<<< * def __init__(self): * pass */ - __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Simulate_st, __pyx_tuple__20, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 302, __pyx_L1_error) + __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Simulate_st, __pyx_tuple__20, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Simulate_st, __pyx_t_3) < 0) __PYX_ERR(0, 302, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_Simulate_st, __pyx_t_3) < 0) __PYX_ERR(0, 297, __pyx_L1_error) __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":569 + /* "dissect/PropsSimulator/simulator.pyx":558 * ) * * def save_dict_to_file(config): # <<<<<<<<<<<<<< * f = open(os.path.join(config["simulation_params"]["simulation_folder"], "simulation_config.py"), "w") * f.write("config = ") */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_1save_dict_to_file, NULL, __pyx_n_s_dissect_PropsSimulator_simulator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_1save_dict_to_file, NULL, __pyx_n_s_dissect_PropsSimulator_simulator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_save_dict_to_file, __pyx_t_2) < 0) __PYX_ERR(0, 569, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_save_dict_to_file, __pyx_t_2) < 0) __PYX_ERR(0, 558, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - /* "dissect/PropsSimulator/simulator.pyx":575 + /* "dissect/PropsSimulator/simulator.pyx":564 * f.close() * * def simulate(config): # <<<<<<<<<<<<<< * * s = 42 */ - __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_3simulate, NULL, __pyx_n_s_dissect_PropsSimulator_simulator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error) + __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7dissect_14PropsSimulator_9simulator_3simulate, NULL, __pyx_n_s_dissect_PropsSimulator_simulator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_simulate, __pyx_t_2) < 0) __PYX_ERR(0, 575, __pyx_L1_error) + if (PyDict_SetItem(__pyx_d, __pyx_n_s_simulate, __pyx_t_2) < 0) __PYX_ERR(0, 564, __pyx_L1_error) __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; /* "dissect/PropsSimulator/simulator.pyx":1 diff --git a/dissect/PropsSimulator/simulator.py b/dissect/PropsSimulator/simulator.py index 3a5beb1..af755c7 100644 --- a/dissect/PropsSimulator/simulator.py +++ b/dissect/PropsSimulator/simulator.py @@ -106,6 +106,8 @@ def generate_props(self): fig = plt.figure() ax = plt.boxplot(self.props_complete, labels=self.celltypes) # + if self.n_celltypes>10: + plt.xticks(rotation=45, ha="right") plt.ylabel("Proportion") plt.title("Proportions of cell-types in generated samples") plt.savefig( @@ -319,7 +321,7 @@ def __init__(self): pass def initialize(self, config): - self.config["simulation_params"] = config + self.config = config self.sc_adata = sc.read(config["simulation_params"]["scdata"]) if "sparse" in str(type(self.sc_adata.X)): self.sc_adata.X = np.array(self.sc_adata.X.todense()) @@ -385,18 +387,22 @@ def generate_props(self): fig = plt.figure() ax = plt.boxplot(self.props_sparse, labels=self.celltypes) # + if self.n_celltypes>10: + plt.xticks(rotation=45, ha="right") plt.ylabel("Proportion") plt.title("Proportions of cell-types in generated samples") plt.savefig( - os.path.join(self.config.simulation_folder, "boxplot_props_sparse.pdf") - ) - fig = plt.figure() - ax = plt.boxplot(self.cells_sparse, labels=self.celltypes) - plt.ylabel("Count") - plt.title("Counts of cell-types in generated samples") - plt.savefig( - os.path.join(self.config.simulation_folder, "boxplot_ncells_sparse.pdf") + os.path.join(self.simulation_folder, "boxplot_props_sparse.pdf") ) + # fig = plt.figure() + # ax = plt.boxplot(self.cells_sparse, labels=self.celltypes) + # if self.n_celltypes>10: + # plt.xticks(rotation=45, ha="right") + # plt.ylabel("Count") + # plt.title("Counts of cell-types in generated samples") + # plt.savefig( + # os.path.join(self.simulation_folder, "boxplot_ncells_sparse.pdf") + # ) self.props = self.props_sparse self.cells = self.cells_sparse @@ -477,7 +483,7 @@ def simulate(self, save=True): ) ) - if self.config["generate_component_figures"]: + if self.config["simulation_params"]["generate_component_figures"]: idxs = {} celltypes_col = [] for j in range(self.n_celltypes): @@ -536,19 +542,6 @@ def simulate_per_batch(self, save=True): ) ) - adata.write(os.path.join(self.simulation_folder, "simulated.h5ad")) - sc.set_figure_params(dpi=200) - tmp = adata.copy() - sc.pp.normalize_total(tmp, target_sum=1e6) - sc.pp.log1p(tmp) - sc.tl.pca(tmp) - sc.pl.pca(tmp, color=adata.obs.columns, show=False) - plt.savefig( - os.path.join( - self.simulation_folder, "scatterplot_pca_simulated.pdf" - ) - ) - if self.config["simulation_params"]["generate_component_figures"]: idxs = {} celltypes_col = [] @@ -613,7 +606,8 @@ def simulate(config): print("Number of batches in single-cell data is 1. If this is incorrect, please specify name of the batch column as in the single-cell data object (.obs)") sim.simulate(save=True) sim.config["simulation_params"]["simulation_folder"] = os.path.join(sim.config["experiment_folder"], "simulation") - sim.config["simulation_params"]["concentration"] = list(sim.config["simulation_params"]["concentration"]) + if config["simulation_params"]["type"]=="bulk": + sim.config["simulation_params"]["concentration"] = list(sim.config["simulation_params"]["concentration"]) sim.config["deconv_params"]["reference"] = os.path.join(sim.config["simulation_params"]["simulation_folder"], "simulated.h5ad") save_dict_to_file(sim.config) diff --git a/dissect/PropsSimulator/simulator.pyx b/dissect/PropsSimulator/simulator.pyx index 7ad6927..75d9713 100644 --- a/dissect/PropsSimulator/simulator.pyx +++ b/dissect/PropsSimulator/simulator.pyx @@ -108,16 +108,11 @@ class Simulate(object): ax = plt.boxplot(self.props_complete, labels=self.celltypes) # plt.ylabel("Proportion") plt.title("Proportions of cell-types in generated samples") + if self.n_celltypes>10: + plt.xticks(rotation=45, ha="right") plt.savefig( os.path.join(self.simulation_folder, "boxplot_props_complete.pdf") ) - fig = plt.figure() - ax = plt.boxplot(self.cells_complete, labels=self.celltypes) - plt.ylabel("Count") - plt.title("Counts of cell-types in generated samples") - plt.savefig( - os.path.join(self.simulation_folder, "boxplot_ncells_complete.pdf") - ) self.props = np.concatenate([self.props_complete, self.props_sparse], axis=0) self.cells = np.concatenate([self.cells_complete, self.cells_sparse], axis=0) @@ -304,7 +299,7 @@ class Simulate_st(object): pass def initialize(self, config): - self.config["simulation_params"] = config + self.config = config self.sc_adata = sc.read(config["simulation_params"]["scdata"]) if "sparse" in str(type(self.sc_adata.X)): self.sc_adata.X = np.array(self.sc_adata.X.todense()) @@ -370,19 +365,13 @@ class Simulate_st(object): fig = plt.figure() ax = plt.boxplot(self.props_sparse, labels=self.celltypes) # + if self.n_celltypes>10: + plt.xticks(rotation=45, ha="right") plt.ylabel("Proportion") plt.title("Proportions of cell-types in generated samples") plt.savefig( - os.path.join(self.config.simulation_folder, "boxplot_props_sparse.pdf") + os.path.join(self.simulation_folder, "boxplot_props_sparse.pdf") ) - fig = plt.figure() - ax = plt.boxplot(self.cells_sparse, labels=self.celltypes) - plt.ylabel("Count") - plt.title("Counts of cell-types in generated samples") - plt.savefig( - os.path.join(self.config.simulation_folder, "boxplot_ncells_sparse.pdf") - ) - self.props = self.props_sparse self.cells = self.cells_sparse @@ -462,7 +451,7 @@ class Simulate_st(object): ) ) - if self.config["generate_component_figures"]: + if self.config["simulation_params"]["generate_component_figures"]: idxs = {} celltypes_col = [] for j in range(self.n_celltypes): @@ -598,7 +587,8 @@ def simulate(config): print("Number of batches in single-cell data is 1. If this is incorrect, please specify name of the batch column as in the single-cell data object (.obs)") sim.simulate(save=True) sim.config["simulation_params"]["simulation_folder"] = os.path.join(sim.config["experiment_folder"], "simulation") - sim.config["simulation_params"]["concentration"] = list(sim.config["simulation_params"]["concentration"]) + if config["simulation_params"]["type"]=="bulk": + sim.config["simulation_params"]["concentration"] = list(sim.config["simulation_params"]["concentration"]) sim.config["deconv_params"]["reference"] = os.path.join(sim.config["simulation_params"]["simulation_folder"], "simulated.h5ad") save_dict_to_file(sim.config) - \ No newline at end of file + diff --git a/dissect/configs/config.py b/dissect/configs/config.py index df9661e..552d5c7 100644 --- a/dissect/configs/config.py +++ b/dissect/configs/config.py @@ -4,7 +4,7 @@ "simulation_params": { "scdata": "/home/user/experiment/data.h5ad", # Path to sc/snRNA-seq data, should be anndata "n_samples": None, # Number of samples to generate. Default: 1000 times the number of celltypes, - "type": "bulk", + "type": "bulk", # bulk or st to simulate bulk and spatial transcriptomics respectively "celltype_col": "celltype", # Name of the column corresponding to cell-type labels in adata.obs "batch_col": None, # If more than one batches are present, name of the column corrsponding to batch labels in adata.obs "cells_per_sample": None, # Number of cells to sample to generate one sample. @@ -31,7 +31,7 @@ "deconv_params": { "test_dataset": "../bulk.txt", "test_dataset_format": "txt", # Either tab-delimited txt file with genes in rows or h5ad file compatible with Scanpy. - "test_dataset_type": "bulk", # bulk, microarray or spatial + "test_dataset_type": "bulk", # bulk or microarray. For spatial, set it to bulk as similar training procedure is used. "duplicated": "first", # In case, there are duplicated genes in the test_dataset. To use the first occuring gene, write first. To sum the duplicated genes, write sum. To take average, write mean "normalize_simulated": "cpm", # "cpm", # Only CPM and None is supported. Write CPM if not already TPM/CPM. "normalize_test": "cpm", # Write CPM if not already TPM/CPM @@ -39,7 +39,7 @@ "test_in_mix": None, # Number of test samples to use in the generation of online mixtures. None uses all samples. "simulated": True, # True if dataset is already simulated. False, if it is a single-cell dataset. "sig_matrix": False, - "mix": "srm", + "mix": "srm", # srm for bulk and spatial data, rrm for microarray data "save_config": True, "network_params": { "n_hidden_layers": 4, # Number of hidden layers diff --git a/dissect/prepare_data.py b/dissect/prepare_data.py index 63d2320..f12907a 100644 --- a/dissect/prepare_data.py +++ b/dissect/prepare_data.py @@ -39,6 +39,8 @@ def dataset(config): X_real = pd.read_table(config["deconv_params"]["test_dataset"], index_col=0) elif config["deconv_params"]["test_dataset_format"] == "h5ad": X_real = sc.read(config["deconv_params"]["test_dataset"]) + if "parse" in str(type(X_real.X)): + X_real.X = np.array(X_real.X.todense()) X_real = pd.DataFrame( X_real.X, index=X_real.obs.index.tolist(), columns=X_real.var_names.tolist() ).T @@ -127,9 +129,11 @@ def dataset(config): # Simulated if not simulated if config["deconv_params"]["simulated"]: X_sim = X_sc + else: X_sim = simulate(X_sc, config["deconv_params"]["simulation_params"]) - + if "parse" in str(type(X_sim.X)): + X_sim = np.array(X_sim.X.todense()) # Normalization if config["deconv_params"]["normalize_simulated"] == "cpm": sc.pp.normalize_total(X_sim, target_sum=1e6) diff --git a/docs/index.html b/docs/index.html index 701a92d..75194bf 100644 --- a/docs/index.html +++ b/docs/index.html @@ -50,7 +50,7 @@

Installing

## Installation
 
 # Create and activate virtual environment
-conda create -y -n dissect python=3.8
+conda create -y -n dissect python=3.9
 conda activate dissect
 
 # Clone DISSECT
@@ -68,12 +68,34 @@ 

Installing

# Go to tutorials directory within DISSECT cd DISSECT/tutorials
+

GPU usage

+ +

By default, tensorflow-gpu which is installed while installed DISSECT works as long as appropriate CUDA driver is installed. DISSECT uses tensorflow-gpu version 2.7.0 with CUDA 11.2 and cuDNN 8.1. The available devices to tensorflow can be checked as below.

+ +

+import tensorflow as tf
+gpus = tf.config.list_physical_devices("GPU")
+print(gpus)
+
+

This will output a list of the available GPU devices as the output below where we have 1 GPU available.

+

+[PhysicalDevice(name='/physical_device:GPU:0', device_type='GPU')] 
+
+

In case there are multiple GPUs available, a particular GPU can be set by,

+ +

+gpu_number = 0 # Using only the first GPU
+tf.config.experimental.set_visible_devices(gpus[gpu_number], 'GPU')
+
+ + +

Tutorials

Interactive tutorials including required data are available as part of this repository at Tutorials.

Below are the static versions of these tutorials.

To get answers quickly for a problem or feature request, please open an issue on GitHub.

diff --git a/docs/minimal_tutorial.html b/docs/minimal_tutorial.html deleted file mode 100644 index c839e53..0000000 --- a/docs/minimal_tutorial.html +++ /dev/null @@ -1,8030 +0,0 @@ - - - - - -minimal_tutorial - - - - - - - - - - - - -
-
- -
- -
- -
- - -
- - -
- -
-
- -
- - -
-
- -
- - -
-
- -
- - -
-
- -
-
- -
- -
- - -
- -
-
- - diff --git a/docs/expanded_tutorial.html b/docs/tutorial.html similarity index 84% rename from docs/expanded_tutorial.html rename to docs/tutorial.html index 7ff5326..17663aa 100644 --- a/docs/expanded_tutorial.html +++ b/docs/tutorial.html @@ -3,7 +3,7 @@ -expanded_tutorial +tutorial + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
cell_type
cell_7406CD4Tcells
cell_4119CD4Tcells
cell_3032CD4Tcells
cell_3795NK
cell_318Monocytes
......
cell_6912CD4Tcells
cell_5269CD8Tcells
cell_7541Monocytes
cell_4880Monocytes
cell_3135Bcells
+

1000 rows × 1 columns

+ + + + + + +
+
+ + +
+
+
+
+ + +
+
+
+ + +
+
+ + +
@@ -7758,7 +7902,7 @@

Import DISSECT module

- +