diff --git a/runs.ipynb b/runs.ipynb index ace7c58df..df7e78d1d 100644 --- a/runs.ipynb +++ b/runs.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 99, "metadata": {}, "outputs": [], "source": [ @@ -2154,117 +2154,100 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 92, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "/tmp/ipykernel_247612/1517971497.py:5: FutureWarning: The default of observed=False is deprecated and will be changed to True in a future version of pandas. Pass observed=False to retain current behavior or observed=True to adopt the future default and silence this warning.\n", - " adata_df.groupby(['cell_type','donor_id']).apply(lambda df: create_meta_cells(df) )\n", - "/tmp/ipykernel_247612/1517971497.py:5: DeprecationWarning: DataFrameGroupBy.apply operated on the grouping columns. This behavior is deprecated, and in a future version of pandas the grouping columns will be excluded from the operation. Either pass `include_groups=False` to exclude the groupings or explicitly select the grouping columns after groupby to silence this warning.\n", - " adata_df.groupby(['cell_type','donor_id']).apply(lambda df: create_meta_cells(df) )\n" + "/tmp/ipykernel_247612/3835466291.py:11: FutureWarning: The default of observed=False is deprecated and will be changed to True in a future version of pandas. Pass observed=False to retain current behavior or observed=True to adopt the future default and silence this warning.\n", + " df = adata_df.groupby(['cell_type','donor_id']).apply(lambda df: create_meta_cells(df))\n", + "/root/anaconda3/envs/py10/lib/python3.10/site-packages/anndata/_core/aligned_df.py:67: ImplicitModificationWarning: Transforming to str index.\n", + " warnings.warn(\"Transforming to str index.\", ImplicitModificationWarning)\n" ] - }, + } + ], + "source": [ + "def create_meta_cells(df, n_cells=15):\n", + " meta_x = []\n", + " for i in range(0, df.shape[0], n_cells):\n", + " meta_x.append(df.iloc[i:i+n_cells, :].sum(axis=0).values)\n", + " df = pd.DataFrame(meta_x, columns=df.columns)\n", + " return df\n", + " \n", + "adata_df = pd.DataFrame(multiomics_rna.X.todense(), columns=multiomics_rna.var_names)\n", + "adata_df['cell_type'] = multiomics_rna.obs['cell_type'].values\n", + "adata_df['donor_id'] = multiomics_rna.obs['donor_id'].values\n", + "df = adata_df.groupby(['cell_type','donor_id']).apply(lambda df: create_meta_cells(df))\n", + "X = df.values\n", + "var = pd.DataFrame(index=df.columns)\n", + "obs = df.reset_index()[['cell_type','donor_id']]\n", + "adata = ad.AnnData(X=X, obs=obs, var=var)" + ] + }, + { + "cell_type": "code", + "execution_count": 98, + "metadata": {}, + "outputs": [ { "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
locationAL627309.1AL627309.5AL627309.4LINC01409LINC01128LINC00115FAM41CAL645608.6SAMD11NOC2L...AC145212.1MAFIPAC011043.1AL354822.1AL592183.1AC240274.1AC004556.3AC007325.4cell_typedonor_id
cell_typedonor_id
\n", - "

0 rows × 22789 columns

\n", - "
" - ], "text/plain": [ - "Empty DataFrame\n", - "Columns: [AL627309.1, AL627309.5, AL627309.4, LINC01409, LINC01128, LINC00115, FAM41C, AL645608.6, SAMD11, NOC2L, KLHL17, PLEKHN1, HES4, ISG15, AL645608.1, AGRN, C1orf159, AL390719.3, LINC01342, TTLL10, TNFRSF18, TNFRSF4, SDF4, B3GALT6, C1QTNF12, UBE2J2, LINC01786, SCNN1D, ACAP3, PUSL1, INTS11, CPTP, TAS1R3, DVL1, MXRA8, AURKAIP1, CCNL2, MRPL20-AS1, MRPL20, AL391244.2, ATAD3C, ATAD3B, ATAD3A, TMEM240, SSU72, AL645728.1, FNDC10, AL691432.4, AL691432.2, MIB2, MMP23B, CDK11B, FO704657.1, SLC35E2B, CDK11A, SLC35E2A, NADK, GNB1, AL109917.1, CFAP74, PRKCZ, AL590822.2, PRKCZ-AS1, FAAP20, AL590822.1, SKI, AL590822.3, MORN1, AL513477.2, RER1, PEX10, PLCH2, PANK4, AL139246.5, TNFRSF14-AS1, TNFRSF14, AL139246.3, PRXL2B, MMEL1, TTC34, PRDM16, MEGF6, AL513320.1, TPRG1L, WRAP73, TP73, CCDC27, SMIM1, LRRC47, CEP104, DFFB, C1orf174, LINC01134, AL805961.1, AJAP1, AL365255.1, NPHP4, KCNAB2, CHD5, RPL22, ...]\n", - "Index: []\n", - "\n", - "[0 rows x 22789 columns]" + "0.9265477230460478" ] }, - "execution_count": 37, + "execution_count": 98, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "def create_meta_cells(df, n_cells=15):\n", - " meta_x = []\n", - " for i in range(0, df.shape[0], n_cells):\n", - " meta_x.append(df.iloc[i:n_cells, :].sum(axis=0))\n", - " \n", - "adata_df = pd.DataFrame(multiomics_rna.X, columns=multiomics_rna.var_names)\n", - "adata_df[['cell_type','donor_id']] = multiomics_rna.obs[['cell_type', 'donor_id']]\n", - "adata_df.groupby(['cell_type','donor_id']).apply(lambda df: create_meta_cells(df))" + "# (adata.X==0).sum()/adata.X.size\n", + "(multiomics_rna.X.todense()==0).sum()/multiomics_rna.X.todense().size" + ] + }, + { + "cell_type": "code", + "execution_count": 66, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "array([ 1., 1., 1., ..., 6., 3., 18.], dtype=float32)" + ] + }, + "execution_count": 66, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "# multiomics_rna = ad.read('resources/grn-benchmark/multiomics_rna.h5ad')\n", + "# multiomics_rna.X.data" + ] + }, + { + "cell_type": "code", + "execution_count": 75, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAh8AAAGeCAYAAAA0WWMxAAAAOXRFWHR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xr776qpFktm/fbvbt2xdq3377reXK45fTOTHGmF/84hcmMzPTVFdXm/r6evP222+bf/7znxarjm9O52T//v1hn4+GhgYzYsQIs3TpUruFxzmn8/LGG2+Yo446yjzwwANm586d5o033jDjxo0zl19+ueXK45fTOVm5cqVJSkoyGzZsMJ9++ql58sknzTHHHGOef/55y5XHjrgIH+eff76ZP39+WN9pp51mlixZ0u34Q+GjqanJQnUDk9M5efHFF01KSor58ssvbZQ3IDmdk8Nt3LjRuFwus2vXrmiUN2A5nZff//735pRTTgnre/DBB83IkSOjVuNA43ROJk+ebG6//fawvoULF5opU6ZErcZYF/Nfu3R2dmrz5s3Kzc0N68/NzVVtbe3/fO4555yj1NRUXXzxxXr11VejWeaA0pM5ef755zVp0iSVlJTopJNO0pgxY3T77bervb3dRslxrzefk0PWrl2radOmadSoUdEocUDqybxkZWVp7969+tvf/iZjjD7//HM9/fTTmjFjho2S415P5qSjo0NDhw4N60tISNA777yjb775Jmq1xrKYDx9ffPGFDhw40GXTOo/H02Vzu0NSU1O1evVqPfPMM3r22Wc1duxYXXzxxXr99ddtlBz3ejInO3fu1JtvvqkPPvhAGzduVFlZmZ5++mktWLDARslxrydz8n379u3Tiy++qLlz50arxAGpJ/OSlZWlJ554QldffbWGDBkir9er4cOH66GHHrJRctzryZxccskl+tOf/qTNmzfLGKNNmzZp3bp1+uabb/TFF1/YKDvmRGVvl77gcrnCHhtjuvQdMnbsWI0dOzb0ePLkyWpoaNB9993HLeAjyMmcHDx4UC6XS0888URoS+bS0lJdeeWVevjhh5WQkBD1egcCJ3PyfY888oiGDx+uyy+/PEqVDWxO5mXbtm267bbbdPfdd+uSSy7Rvn37dMcdd2j+/Plau3atjXIHBCdzctdddykYDOqCCy6QMUYej0c33nijSkpKNGjQIBvlxpyYX/k4/vjjNWjQoC6JtLGxsUty/V8uuOACffzxx5Eub0DqyZykpqbqpJNOCgUPSTr99NNljNHevXujWu9A0JvPiTFG69at0w033KAhQ4ZEs8wBpyfzUlxcrClTpuiOO+7QhAkTdMkll2jlypVat26d9u3bZ6PsuNaTOUlISNC6devU1tamXbt2ac+ePRo9erSSkpJ0/PHH2yg75sR8+BgyZIgmTpyo6urqsP7q6mplZWUd8eu89957Sk1NjXR5A1JP5mTKlCn67LPP9NVXX4X6duzYoaOOOkojR46Mar0DQW8+JzU1Nfrkk090yy23RLPEAakn89LW1qajjgr/T/eh/3dt2Kqr13rzWTn66KM1cuRIDRo0SBs2bNDMmTO7zBX+vz660DWiDv0sau3atWbbtm2moKDADBs2LHRV/pIlS8wNN9wQGn///febjRs3mh07dpgPPvjALFmyxEgyzzzzTF+dQtxxOietra1m5MiR5sorrzRbt241NTU1xufzmblz5/bVKcQdp3NyyPXXX28yMzNtlztgOJ2X9evXm8GDB5uVK1eaTz/91Lz55ptm0qRJ5vzzz++rU4g7Tudk+/bt5rHHHjM7duwwb7/9trn66qvNiBEjTH19fR+dQf8XF+HDGGMefvhhM2rUKDNkyBBz7rnnmpqamtCxOXPmmOzs7NDjFStWmFNPPdUMHTrUHHvssebCCy80L7zwQh9UHd+czIkxxnz44Ydm2rRpJiEhwYwcOdIsWrTItLW1Wa46vjmdk/3795uEhASzevVqy5UOLE7n5cEHHzRnnHGGSUhIMKmpqea6664ze/futVx1fHMyJ9u2bTNnn322SUhIMMnJyeayyy4zH330UR9UHTtcxrBOBwAA7OHLKAAAYBXhAwAAWEX4AAAAVhE+AACAVYQPAABgFeEDAABYRfgAAABWET4AAIBVhA8AAGAV4QMAAFhF+AAAAFb9P5lDUwjY4DOeAAAAAElFTkSuQmCC", + "text/plain": [ + "
" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "\n", + "import matplotlib.pyplot as plt\n", + "aa = plt.hist((df_==0).sum(axis=1)/df.shape[1], bins=100)" ] }, { @@ -2609,392 +2592,347 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 104, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "download: s3://openproblems-data/resources/grn/results/grn_evaluation_so_all_ridge/scores.yaml to resources/results/grn_evaluation_so_all_ridge/scores.yaml\n", - "download: s3://openproblems-data/resources/grn/results/grn_evaluation_so_all_ridge/state.yaml to resources/results/grn_evaluation_so_all_ridge/state.yaml\n", - "download: s3://openproblems-data/resources/grn/results/grn_evaluation_so_all_ridge/trace.txt to resources/results/grn_evaluation_so_all_ridge/trace.txt\n", - "download: s3://openproblems-data/resources/grn/results/grn_evaluation_so_all_ridge/metric_configs.yaml to resources/results/grn_evaluation_so_all_ridge/metric_configs.yaml\n" + "download: s3://openproblems-data/resources/grn/results/grn_evaluation_all_ridge/scores.yaml to resources/results/grn_evaluation_all_ridge/scores.yaml\n", + "download: s3://openproblems-data/resources/grn/results/grn_evaluation_all_ridge/trace.txt to resources/results/grn_evaluation_all_ridge/trace.txt\n" ] } ], "source": [ - "!aws s3 sync s3://openproblems-data/resources/grn/results/grn_evaluation_so_all_ridge resources/results/grn_evaluation_so_all_ridge" + "!aws s3 sync s3://openproblems-data/resources/grn/results/grn_evaluation_all_ridge resources/results/grn_evaluation_all_ridge" ] }, { "cell_type": "code", - "execution_count": 7, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "download: s3://openproblems-data/resources_test/grn/results/single_omics_try2/trace.txt to resources/results/single_omics_try2/trace.txt\n", - "download: s3://openproblems-data/resources_test/grn/results/single_omics_try2/state.yaml to resources/results/single_omics_try2/state.yaml\n", - "download: s3://openproblems-data/resources_test/grn/results/single_omics_try2/scores.yaml to resources/results/single_omics_try2/scores.yaml\n", - "download: s3://openproblems-data/resources_test/grn/results/single_omics_try2/output/prediction.csv to resources/results/single_omics_try2/output/prediction.csv\n" - ] - } - ], - "source": [ - "!aws s3 sync s3://openproblems-data/resources_test/grn/results/single_omics_try2 resources/results/single_omics_try2" - ] - }, - { - "cell_type": "code", - "execution_count": 6, + "execution_count": 106, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", - "\n", + "
\n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", + " \n", + " \n", + " \n", + " \n", + " \n", " \n", " \n", "
 ex(False)_tf(-1)ex(True)_tf(-1)static-theta-0.0static-theta-0.5Meanex(False)_tf(-1)ex(True)_tf(-1)static-theta-0.0static-theta-0.5
negative_control0.0000000.0000000.0000000.0000000.000000negative_control-0.035493-0.0347790.3794160.504639
baseline_pearson-0.100238-0.2111820.4893160.514896
baseline_dotproduct-0.100238-0.2111820.4893160.514896
baseline_pearson_causal0.0000000.0000000.0000000.000000
baseline_dotproduct_causal0.0000000.0000000.0000000.000000
baseline_corr0.3931250.4080440.4974010.7495630.512033baseline_dotproduct_causal_cell_type0.0000000.0000000.0000000.000000
baseline_corr_causal0.7261720.7562890.6360120.8155510.733506baseline_dotproduct_causal_metacell0.0000000.0000000.0000000.000000
positive_control1.0000001.0000000.8228051.0000000.955701positive_control0.6283030.6299640.6832440.741396
collectri0.0000000.0000000.5892650.6944950.320940collectri-0.100238-0.2111820.4893160.514896
granie0.1716870.3344640.4296620.7094830.411324granie0.1085540.2091250.3567840.526008
figr0.2422690.3434720.8198390.7630560.542159figr0.1540440.2202250.6807810.565727
celloracle0.3279200.4051120.5209840.7236810.494424celloracle0.2082490.2586020.4326170.536534
scglue0.3724050.4269230.9759200.8082950.645886scglue0.2456700.2899340.8103890.599267
scenicplus0.4807440.6230560.8406850.8051980.687421scenicplus0.3018340.3924520.6980920.596971
portia0.0200740.0492690.5922610.7254730.346769portia0.0137370.0332670.4918040.537863
ppcor0.0475830.0295180.2703730.7099200.264348ppcor0.0270290.0182070.2245140.526332
grnboost20.4206620.6794481.0000000.7881070.722054grnboost20.2645380.4264110.8303840.584299
genie30.3316270.5571450.9960560.7852690.667524genie30.2001460.3354310.8271090.582196
\n" ], "text/plain": [ - "" + "" ] }, - "execution_count": 6, + "execution_count": 106, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "models_all = ['negative_control', 'baseline_corr', 'baseline_corr_causal', 'positive_control', 'collectri','granie', 'figr', 'celloracle', 'scglue', 'scenicplus', 'portia','ppcor', 'grnboost2', 'genie3']\n", + "models_all = ['negative_control', 'baseline_pearson', 'baseline_dotproduct', 'baseline_pearson_causal', 'baseline_dotproduct_causal', 'baseline_dotproduct_causal_cell_type', 'baseline_dotproduct_causal_metacell', 'positive_control', 'collectri','granie', 'figr', 'celloracle', 'scglue', 'scenicplus', 'portia','ppcor', 'grnboost2', 'genie3']\n", "def extract_data(data, reg='reg1', dataset_id='scgen_pearson'):\n", " i = 0\n", " for entry in data:\n", @@ -3019,7 +2957,7 @@ " return df_reg\n", "import yaml\n", "import pandas as pd\n", - "base_folder = 'resources/results/grn_evaluation_so_all_ridge/'\n", + "base_folder = 'resources/results/grn_evaluation_all_ridge/'\n", "\n", "result_file = f'{base_folder}/scores.yaml'\n", "with open(result_file, 'r') as file:\n", @@ -3027,9 +2965,9 @@ "df_reg1 = extract_data(data, reg='reg1').reindex(models_all).drop(columns=['Mean'])\n", "df_reg2 = extract_data(data, reg='reg2').reindex(models_all).drop(columns=['Mean'])\n", "df_all = pd.concat([df_reg1, df_reg2], axis=1).fillna(0)\n", - "df_all[df_all<0]=0\n", - "df_all = (df_all-df_all.min(axis=0))/(df_all.max(axis=0)-df_all.min(axis=0))\n", - "df_all['Mean'] = df_all.mean(axis=1)\n", + "# df_all[df_all<0]=0\n", + "# df_all = (df_all-df_all.min(axis=0))/(df_all.max(axis=0)-df_all.min(axis=0))\n", + "# df_all['Mean'] = df_all.mean(axis=1)\n", "df_all.style.background_gradient()" ] }, diff --git a/scripts/run_grn_evaluation.sh b/scripts/run_grn_evaluation.sh index 44e506f2b..24d71eb88 100644 --- a/scripts/run_grn_evaluation.sh +++ b/scripts/run_grn_evaluation.sh @@ -13,7 +13,7 @@ grn_models_folder="${resources_dir}/grn_models" subsample=-2 max_workers=10 layer=scgen_pearson -metric_ids="[regression_1, regression_2]" +metric_ids="[regression_1]" param_file="./params/${RUN_ID}.yaml" @@ -67,19 +67,14 @@ append_entry_control() { causal: ${2} corr_method: ${3} prediction: ${resources_dir}/grn_models/collectri.csv + cell_type_specific: ${4} + metacell: ${5} + impute: ${6} HERE - if [ -n "$4" ]; then - echo " cell_type_specific: ${4}" >> $param_file - fi - if [ -n "$5" ]; then - echo " metacell: ${5}" >> $param_file - fi - if [ -n "$6" ]; then - echo " impute: ${6}" >> $param_file - fi + } -# #Loop through grn_names and layers +#Loop through grn_names and layers # for grn_name in "${grn_names[@]}"; do # append_entry "$grn_name" # done @@ -88,12 +83,12 @@ HERE # append_entry_control "negative_control" "False" "" # append_entry_control "positive_control" "False" "" # append_entry_control "baseline_pearson" "False" "pearson" -# append_entry_control "baseline_dotproduct" "False" "dotproduct" +append_entry_control "baseline_dotproduct" "False" "dotproduct" "false" "false" "false" # append_entry_control "baseline_pearson_causal" "True" "pearson" -append_entry_control "baseline_dotproduct_causal" "True" "dotproduct" +append_entry_control "baseline_dotproduct_causal" "True" "dotproduct" "false" "false" "false" # append_entry_control "baseline_dotproduct_causal_cell_type" "True" "dotproduct" "true" # append_entry_control "baseline_dotproduct_causal_metacell" "True" "dotproduct" "false" "true" -append_entry_control "baseline_dotproduct_causal_impute" "True" "dotproduct" "false" "false" "true" +# append_entry_control "baseline_dotproduct_causal_impute" "True" "dotproduct" "false" "false" "true" # append_entry_control "baseline_corr_causal_spearman" "True" "spearman" diff --git a/src/api/comp_control_method.yaml b/src/api/comp_control_method.yaml deleted file mode 100644 index 4e409d910..000000000 --- a/src/api/comp_control_method.yaml +++ /dev/null @@ -1,36 +0,0 @@ - -functionality: - namespace: "control_methods" - info: - type: control_method - type_info: - label: Control Method - summary: A control method. - description: | - A control method to serve as a quality control for the GRN inference benchmark. - arguments: - - name: --layer - type: string - direction: input - default: scgen_pearson - description: Which layer of pertubation data to use to find tf-gene relationships. - required: false - - name: --prediction - __merge__: file_prediction.yaml - required: false - direction: output - - name: --tf_all - type: file - required: true - direction: input - example: resources_test/prior/tf_all.csv - - - - test_resources: - - type: python_script - path: /src/common/component_tests/run_and_check_output.py - - path: /resources_test/grn-benchmark - dest: resources_test/grn-benchmark - - path: /resources_test/prior - dest: resources_test/prior \ No newline at end of file diff --git a/src/api/comp_method.yaml b/src/api/comp_method.yaml index 56bf37867..764ed3c23 100644 --- a/src/api/comp_method.yaml +++ b/src/api/comp_method.yaml @@ -10,37 +10,38 @@ functionality: arguments: - name: --multiomics_rna __merge__: file_multiomics_rna_h5ad.yaml - required: false + required: true direction: input - default: resources/grn-benchmark/multiomics_rna.h5ad - - name: --multiomics_atac - __merge__: file_multiomics_atac_h5ad.yaml - required: false - direction: input - must_exist: false - default: resources/grn-benchmark/multiomics_atac.h5ad + example: resources_test/grn-benchmark/multiomics_rna.h5ad - name: --prediction __merge__: file_prediction.yaml - required: false + required: true direction: output - example: output/prediction.csv - default: output/prediction.csv - - name: --temp_dir - type: string + example: resources_test/grn_models/collectri.csv + - name: --tf_all + type: file + required: true direction: input - default: output/temdir + example: resources_test/prior/tf_all.csv + - name: --max_n_links + type: integer + default: 50000 - name: --num_workers type: integer direction: input default: 4 - - name: --tf_all - type: file - example: resources/prior/tf_all.csv - default: resources/prior/tf_all.csv - required: false - - name: --max_n_links + - name: --temp_dir + type: string + direction: input + default: output/temdir + - name: --seed type: integer - default: 50000 + direction: input + default: 32 + + + + test_resources: - type: python_script diff --git a/src/api/comp_method_mo.yaml b/src/api/comp_method_mo.yaml new file mode 100644 index 000000000..bd8e1c843 --- /dev/null +++ b/src/api/comp_method_mo.yaml @@ -0,0 +1,17 @@ +__merge__: comp_method.yaml + +functionality: + info: + type: methods + type_info: + label: Method + summary: A GRN inference method for multiomics grn + description: | + A method for inferring GRN from atac and rna data. + arguments: + - name: --multiomics_atac + __merge__: file_multiomics_atac_h5ad.yaml + required: true + direction: input + must_exist: false + example: resources_test/grn-benchmark/multiomics_atac.h5ad diff --git a/src/api/comp_method_r.yaml b/src/api/comp_method_r.yaml index 55ce2593f..10748d821 100644 --- a/src/api/comp_method_r.yaml +++ b/src/api/comp_method_r.yaml @@ -1,5 +1,5 @@ functionality: - namespace: "methods_r" + namespace: "methods" info: type: methods_r type_info: diff --git a/src/api/comp_metric.yaml b/src/api/comp_metric.yaml index beb9b046c..99a468348 100644 --- a/src/api/comp_metric.yaml +++ b/src/api/comp_metric.yaml @@ -12,17 +12,19 @@ functionality: __merge__: file_perturbation_h5ad.yaml required: false direction: input - default: resources/grn-benchmark/perturbation_data.h5ad - name: --prediction __merge__: file_prediction.yaml required: true direction: input - - name: --score __merge__: file_score.yaml required: false direction: output - default: output/score.h5ad + - name: --tf_all + type: file + direction: input + required: true + example: resources_test/prior/tf_all.csv - name: --reg_type type: string direction: input @@ -43,11 +45,6 @@ functionality: direction: input required: false example: collectri - - name: --tf_all - type: file - direction: input - example: resources_test/prior/tf_all.csv - default: resources/prior/tf_all.csv - name: --apply_tf type: boolean required: false @@ -57,6 +54,11 @@ functionality: required: false default: true description: clips the r2 scores for each gene to make them within [0, 1] + - name: --layer + type: string + direction: input + required: false + default: scgen_pearson diff --git a/src/control_methods/baseline_corr/config.vsh.yaml b/src/control_methods/baseline_corr/config.vsh.yaml index f3675be13..9ad3db556 100644 --- a/src/control_methods/baseline_corr/config.vsh.yaml +++ b/src/control_methods/baseline_corr/config.vsh.yaml @@ -1,24 +1,17 @@ -__merge__: ../../api/comp_control_method.yaml +__merge__: ../../api/comp_method.yaml functionality: name: baseline_corr + namespace: control_methods info: label: baseline_corr - summary: "Baseline based on Pearson corr" + summary: "Baseline based on correlation" arguments: - name: --causal type: boolean direction: input default: false - - name: --seed - type: integer - direction: input - - name: --multiomics_rna - type: file - required: true - direction: input - example: resources_test/grn-benchmark/multiomics_rna.h5ad - name: --corr_method type: string required: false @@ -50,7 +43,8 @@ platforms: image: ghcr.io/openproblems-bio/base_python:1.0.4 setup: - type: python - packages: [ magic-impute ] + # packages: [ magic-impute ] + packages: [ ] - type: native - type: nextflow directives: diff --git a/src/control_methods/baseline_corr/script.py b/src/control_methods/baseline_corr/script.py index d08033528..760335b11 100644 --- a/src/control_methods/baseline_corr/script.py +++ b/src/control_methods/baseline_corr/script.py @@ -47,7 +47,7 @@ def create_corr_net(X: np.ndarray, groups: np.ndarray, method="pearson"): return grn print('Read data') multiomics_rna = ad.read_h5ad(par["multiomics_rna"]) -# multiomics_rna = multiomics_rna[:,:2000] #TODO: togo +multiomics_rna = multiomics_rna[:,:2000] #TODO: togo if par['metacell']: print('metacell') diff --git a/src/control_methods/negative_control/config.vsh.yaml b/src/control_methods/negative_control/config.vsh.yaml index 599844f50..8ff514e20 100644 --- a/src/control_methods/negative_control/config.vsh.yaml +++ b/src/control_methods/negative_control/config.vsh.yaml @@ -1,6 +1,7 @@ -__merge__: ../../api/comp_control_method.yaml +__merge__: ../../api/comp_method.yaml functionality: name: negative_control + namespace: control_methods info: label: Negative control summary: Source-target links based on random assignment @@ -9,9 +10,9 @@ functionality: arguments: - name: --perturbation_data type: file - required: false + required: true direction: input - default: resources/grn-benchmark/perturbation_data.h5ad + example: resources_test/grn-benchmark/perturbation_data.h5ad resources: - type: python_script diff --git a/src/control_methods/positive_control/config.vsh.yaml b/src/control_methods/positive_control/config.vsh.yaml index 4add99379..5a3c237c7 100644 --- a/src/control_methods/positive_control/config.vsh.yaml +++ b/src/control_methods/positive_control/config.vsh.yaml @@ -1,6 +1,7 @@ -__merge__: ../../api/comp_control_method.yaml +__merge__: ../../api/comp_method.yaml functionality: name: positive_control + namespace: control_methods info: label: Positive control summary: Source-target links based on perturbation data @@ -9,9 +10,9 @@ functionality: arguments: - name: --perturbation_data type: file - required: false + required: true direction: input - default: resources/grn-benchmark/perturbation_data.h5ad + example: resources_test/grn-benchmark/perturbation_data.h5ad resources: - type: python_script diff --git a/src/methods/dummy/config.vsh.yaml b/src/methods/dummy/config.vsh.yaml deleted file mode 100644 index 3b38332dd..000000000 --- a/src/methods/dummy/config.vsh.yaml +++ /dev/null @@ -1,39 +0,0 @@ - -functionality: - name: dummy - namespace: "grn_methods" - info: - label: dummy - summary: "FILL IN: A one sentence summary of this method." - description: | - A dummy method that contains the format of a real GRN inference method. - documentation_url: https://url.to/the/documentation - repository_url: https://github.com/organisation/repository - arguments: - - name: --multiomics_rna - type: file - required: True - direction: input - - name: --multiomics_atac - type: file - required: True - direction: input - - name: --prediction - type: file - required: true - direction: output - resources: - - type: python_script - path: script.py - -platforms: - - type: docker - image: ghcr.io/openproblems-bio/base_python:1.0.4 - setup: - - type: python - packages: [ ] - - - type: native - - type: nextflow - directives: - label: [midtime,midmem,midcpu] diff --git a/src/methods/dummy/run.sh b/src/methods/dummy/run.sh deleted file mode 100644 index c482c6427..000000000 --- a/src/methods/dummy/run.sh +++ /dev/null @@ -1,3 +0,0 @@ -viash run src/methods/dummy/config.vsh.yaml -- --multiomics_rna resources_test/grn-benchmark/multiomics_rna.h5ad \ - --multiomics_atac resources_test/grn-benchmark/multiomics_atac.h5ad \ - --prediction output/prediction.csv diff --git a/src/methods/dummy/script.py b/src/methods/dummy/script.py deleted file mode 100644 index 986b90152..000000000 --- a/src/methods/dummy/script.py +++ /dev/null @@ -1,36 +0,0 @@ -import pandas as pd -import anndata as ad - -## VIASH START -par = { - "multiomics_rna": "resources/grn-benchmark/multiomics_rna.h5ad", - "multiomics_atac": "resources/grn-benchmark/multiomics_atac.h5ad", - "annotation_file": "resources/grn-benchmark/annotation_file", - "motif_file": "resources/grn-benchmark/motif_file", - "prediction": "output/prediction.csv", -} -## VIASH END - -print('Reading input files', flush=True) -multiomics_rna = ad.read_h5ad(par["multiomics_rna"]) -multiomics_atac = ad.read_h5ad(par["multiomics_atac"]) - - - -print('Preprocess data', flush=True) -# ... preprocessing ... - -print('Train model', flush=True) -# ... train model ... - -print('Generate predictions', flush=True) -# ... generate predictions ... - -print('Write output to file', flush=True) -output = pd.DataFrame( - data = {'source':['tf1'], 'target':['g1'], 'weight':[1]} - # columns=['source', 'target', 'weight'] -) -output.to_csv(par["prediction"]) - - diff --git a/src/methods/multi_omics/celloracle/config.vsh.yaml b/src/methods/multi_omics/celloracle/config.novsh.yaml similarity index 94% rename from src/methods/multi_omics/celloracle/config.vsh.yaml rename to src/methods/multi_omics/celloracle/config.novsh.yaml index bc976fe5f..f5fcc416c 100644 --- a/src/methods/multi_omics/celloracle/config.vsh.yaml +++ b/src/methods/multi_omics/celloracle/config.novsh.yaml @@ -1,4 +1,4 @@ -__merge__: ../../../api/comp_method.yaml +__merge__: ../../../api/comp_method_mo.yaml functionality: name: celloracle diff --git a/src/methods/multi_omics/celloracle_ns/config.vsh.yaml b/src/methods/multi_omics/celloracle_ns/config.novsh.yaml similarity index 100% rename from src/methods/multi_omics/celloracle_ns/config.vsh.yaml rename to src/methods/multi_omics/celloracle_ns/config.novsh.yaml diff --git a/src/methods/multi_omics/granie/config.vsh.yaml b/src/methods/multi_omics/granie/config.novsh.yaml similarity index 100% rename from src/methods/multi_omics/granie/config.vsh.yaml rename to src/methods/multi_omics/granie/config.novsh.yaml diff --git a/src/methods/multi_omics/granie_ns/config.vsh.yaml b/src/methods/multi_omics/granie_ns/config.novsh.yaml similarity index 100% rename from src/methods/multi_omics/granie_ns/config.vsh.yaml rename to src/methods/multi_omics/granie_ns/config.novsh.yaml diff --git a/src/methods/multi_omics/scenicplus/config.vsh.yaml b/src/methods/multi_omics/scenicplus/config.novsh.yaml similarity index 96% rename from src/methods/multi_omics/scenicplus/config.vsh.yaml rename to src/methods/multi_omics/scenicplus/config.novsh.yaml index 3f8d92aad..021f1309c 100644 --- a/src/methods/multi_omics/scenicplus/config.vsh.yaml +++ b/src/methods/multi_omics/scenicplus/config.novsh.yaml @@ -1,4 +1,4 @@ -__merge__: ../../../api/comp_method.yaml +__merge__: ../../../api/comp_method_mo.yaml functionality: diff --git a/src/methods/multi_omics/scenicplus_ns/config.vsh.yaml b/src/methods/multi_omics/scenicplus_ns/config.novsh.yaml similarity index 100% rename from src/methods/multi_omics/scenicplus_ns/config.vsh.yaml rename to src/methods/multi_omics/scenicplus_ns/config.novsh.yaml diff --git a/src/methods/multi_omics/scglue/config.vsh.yaml b/src/methods/multi_omics/scglue/config.novsh.yaml similarity index 96% rename from src/methods/multi_omics/scglue/config.vsh.yaml rename to src/methods/multi_omics/scglue/config.novsh.yaml index 8b9d3f33e..8861ce342 100644 --- a/src/methods/multi_omics/scglue/config.vsh.yaml +++ b/src/methods/multi_omics/scglue/config.novsh.yaml @@ -1,4 +1,4 @@ -__merge__: ../../../api/comp_method.yaml +__merge__: ../../../api/comp_method_mo.yaml functionality: diff --git a/src/methods/multi_omics/scglue_ns/config.vsh.yaml b/src/methods/multi_omics/scglue_ns/config.novsh.yaml similarity index 100% rename from src/methods/multi_omics/scglue_ns/config.vsh.yaml rename to src/methods/multi_omics/scglue_ns/config.novsh.yaml diff --git a/src/metrics/regression_1/config.vsh.yaml b/src/metrics/regression_1/config.vsh.yaml index 1cd6c1be6..a6fefcba0 100644 --- a/src/metrics/regression_1/config.vsh.yaml +++ b/src/metrics/regression_1/config.vsh.yaml @@ -8,11 +8,6 @@ functionality: description: | Calculates R2 score using regression approach 1. arguments: - - name: --layer - type: string - direction: input - required: false - default: scgen_pearson - name: --min_tf type: integer direction: input diff --git a/src/metrics/regression_2/config.vsh.yaml b/src/metrics/regression_2/config.vsh.yaml index 2298f12f1..c5ef8a094 100644 --- a/src/metrics/regression_2/config.vsh.yaml +++ b/src/metrics/regression_2/config.vsh.yaml @@ -14,17 +14,14 @@ functionality: - name: --consensus type: file direction: input - must_exist: true - default: 'resources/prior/consensus-num-regulators.json' + must_exist: false + required: true example: 'resources_test/prior/consensus-num-regulators.json' - name: --static_only + direction: input type: boolean default: true - - name: --layer - type: string - direction: input - required: false - default: scgen_pearson + platforms: - type: docker image: ghcr.io/openproblems-bio/base_python:1.0.4 diff --git a/src/process_data/explanatory_analysis/hvgs/config.novsh.yaml b/src/process_data/explanatory_analysis/hvgs/config.novsh.yaml deleted file mode 100644 index 684dafa0c..000000000 --- a/src/process_data/explanatory_analysis/hvgs/config.novsh.yaml +++ /dev/null @@ -1,46 +0,0 @@ - -functionality: - name: hvgs - info: - label: hvgs - summary: "Determining HVGs based on perturbation data" - - arguments: - - name: --perturbation_data - __merge__: ../../../api/file_perturbation_h5ad.yaml - direction: input - required: true - - name: --multiomics_rna - __merge__: ../../../api/file_multiomics_rna_h5ad.yaml - direction: input - required: true - - name: --n_hvgs - type: integer - direction: input - required: false - default: 3000 - - name: --hvgs - type: file - direction: output - required: true - default: resources/grn-benchmark/supp/hvgs.csv - - resources: - - type: r_script - path: script.R - - -platforms: - - type: docker - image: openproblems/base_r:1.0.0 - setup: - - type: r - bioc: [scry] - packages: [zellkonverter] - - - - - type: native - - type: nextflow - directives: - label: [midtime,midmem,midcpu] diff --git a/src/process_data/explanatory_analysis/hvgs/run.sh b/src/process_data/explanatory_analysis/hvgs/run.sh deleted file mode 100644 index 78d5fc6e3..000000000 --- a/src/process_data/explanatory_analysis/hvgs/run.sh +++ /dev/null @@ -1,7 +0,0 @@ -viash run src/process_data/explanatory_analysis/hvgs/config.novsh.yaml -- --perturbation_data resources/grn-benchmark/perturbation_data.h5ad \ - --multiomics_rna resources/grn-benchmark/multiomics_rna.h5ad \ - --hvgs resources/grn-benchmark/supp/hvgs.csv - - - - diff --git a/src/process_data/explanatory_analysis/hvgs/script.R b/src/process_data/explanatory_analysis/hvgs/script.R deleted file mode 100644 index 49caffade..000000000 --- a/src/process_data/explanatory_analysis/hvgs/script.R +++ /dev/null @@ -1,47 +0,0 @@ - -library(scry) -library(zellkonverter) -library(SingleCellExperiment) -options(digits=5, max.print=100) # Adjust numbers as needed - - - -## VIASH START -par <- list( - perturbation_data = "resources/grn-benchmark/perturbation_data.h5ad", - multiomics_rna = "resources/grn-benchmark/multiomics_rna.h5ad", - hvgs = "resources/grn-benchmark/supp/hvgs.txt", - n_hvgs = 3000 -) -## VIASH END - -print(par) - - -adata = readH5AD(par$perturbation_data) # raw counts -multiomics_rna <- readH5AD(par$multiomics_rna) - -# Extract the gene names from multiomics_rna -multiomics_genes <- rownames(multiomics_rna) - -# Subset adata to keep only the genes present in multiomics_rna -adata <- adata[rownames(adata) %in% multiomics_genes, ] - -adata_sce = devianceFeatureSelection(adata, assay="X", batch=colData(adata)$plate_name) - -binomial_deviance <- rowData(adata_sce)$binomial_deviance - -# Sort the indices of binomial deviance in decreasing order and select the top `n_hvgs` -indices <- order(binomial_deviance, decreasing = TRUE)[1:par$n_hvgs] - -# Create a mask -mask <- rep(FALSE, length(binomial_deviance)) -mask[indices] <- TRUE - -# Select the highly variable genes -hvgs_sce <- rownames(adata_sce)[mask] - -# Save the highly variable genes to a text file -print(dim(hvgs_sce)) - -write(hvgs_sce, file = par$hvgs) \ No newline at end of file diff --git a/src/process_data/perturbation/batch_correction_evaluation/config.vsh.yaml b/src/process_data/perturbation/batch_correction_evaluation/config.vsh.yaml index 1f50f5ad9..41d7a7a92 100644 --- a/src/process_data/perturbation/batch_correction_evaluation/config.vsh.yaml +++ b/src/process_data/perturbation/batch_correction_evaluation/config.vsh.yaml @@ -8,14 +8,13 @@ functionality: arguments: - name: --perturbation_data __merge__: ../../../api/file_perturbation_h5ad.yaml - required: false + required: true direction: input - default: resources/grn-benchmark/perturbation_data.h5ad - name: --output type: file - required: true + required: false direction: output - default: output/batch_correction_metrics.csv + example: resources_test/results/batch_correction_metrics.csv resources: - type: python_script diff --git a/src/process_data/perturbation/batch_correction_scgen/config.vsh.yaml b/src/process_data/perturbation/batch_correction_scgen/config.vsh.yaml index f61b32495..525787bbc 100644 --- a/src/process_data/perturbation/batch_correction_scgen/config.vsh.yaml +++ b/src/process_data/perturbation/batch_correction_scgen/config.vsh.yaml @@ -30,7 +30,6 @@ functionality: required: true required: true direction: input - default: resources/grn-benchmark/perturbation_data.h5ad example: resources_test/grn-benchmark/perturbation_data.h5ad - name: --perturbation_data_bc type: file @@ -60,9 +59,8 @@ functionality: type: double description: "Batch correction using scgen on pearson data" required: true - required: true + required: false direction: output - default: resources/grn-benchmark/perturbation_data.h5ad example: resources_test/grn-benchmark/perturbation_data.h5ad resources: diff --git a/src/process_data/perturbation/batch_correction_seurat/config.vsh.yaml b/src/process_data/perturbation/batch_correction_seurat/config.vsh.yaml index 07494e407..6bc6a7752 100644 --- a/src/process_data/perturbation/batch_correction_seurat/config.vsh.yaml +++ b/src/process_data/perturbation/batch_correction_seurat/config.vsh.yaml @@ -32,14 +32,9 @@ functionality: direction: input example: resources_test/grn-benchmark/perturbation_data.h5ad - name: --perturbation_data_bc - type: file - info: - label: perturbation - summary: "Perturbation dataset for benchmarking." - __merge__: ../../../api/file_perturbation_h5ad.yaml + __merge__: ../../../api/file_perturbation_h5ad.yaml required: false direction: output - example: resources_test/grn-benchmark/perturbation_data.h5ad resources: diff --git a/src/process_data/perturbation/normalization/config.vsh.yaml b/src/process_data/perturbation/normalization/config.vsh.yaml index 9d45aaf66..6e51e5f22 100644 --- a/src/process_data/perturbation/normalization/config.vsh.yaml +++ b/src/process_data/perturbation/normalization/config.vsh.yaml @@ -7,7 +7,6 @@ functionality: label: normalization summary: "Normalize pseudobulked data" - arguments: - name: --pseudobulked_data_f @@ -25,7 +24,6 @@ functionality: required: true direction: input - default: resources_local/pseudobulked_data_f example: resources_test/grn-benchmark/perturbation_data.h5ad - name: --perturbation_data_n @@ -48,9 +46,8 @@ functionality: type: double description: "Normalized values using shifted logarithm " required: true - required: true + required: false direction: output - default: resources/grn-benchmark/perturbation_data.h5ad example: resources_test/grn-benchmark/perturbation_data.h5ad diff --git a/src/process_data/perturbation/sc_counts/config.vsh.yaml b/src/process_data/perturbation/sc_counts/config.vsh.yaml index 0198f38a2..9554d8b1e 100644 --- a/src/process_data/perturbation/sc_counts/config.vsh.yaml +++ b/src/process_data/perturbation/sc_counts/config.vsh.yaml @@ -16,7 +16,6 @@ functionality: type: file required: true direction: input - default: resources/datasets_raw/perturbation_counts.h5ad example: resources_test/datasets_raw/perturbation_counts.h5ad - name: --pseudobulked_data @@ -25,9 +24,8 @@ functionality: label: pseudobulked_data summary: "Pseudobulked perturbation dataset for benchmarking." file_type: h5ad - required: true + required: false direction: output - default: resources_local/pseudobulked_data.h5ad example: resources_test/grn-benchmark/perturbation_data.h5ad - name: --pseudobulked_data_f @@ -42,9 +40,8 @@ functionality: type: double description: "Pseudobulked values using mean approach" required: true - required: true + required: false direction: output - default: resources_local/pseudobulked_data_f.h5ad example: resources_test/grn-benchmark/perturbation_data.h5ad diff --git a/src/workflows/run_grn_evaluation/main.nf b/src/workflows/run_grn_evaluation/main.nf index 26e74a3b5..f82b13994 100644 --- a/src/workflows/run_grn_evaluation/main.nf +++ b/src/workflows/run_grn_evaluation/main.nf @@ -41,99 +41,9 @@ workflow run_wf { ] } ) - - | baseline_corr.run( - runIf: { id, state -> - state.method_id == 'baseline_pearson_causal' - }, - fromState: [ - multiomics_rna: "multiomics_rna", - layer: "layer", - tf_all: "tf_all", - causal: "causal", - corr_method: "corr_method" - ], - toState: {id, output, state -> - state + [ - prediction: output.prediction - ] - } - ) - | baseline_corr.run( - runIf: { id, state -> - state.method_id == 'baseline_dotproduct_causal' - }, - fromState: [ - multiomics_rna: "multiomics_rna", - layer: "layer", - tf_all: "tf_all", - causal: "causal", - corr_method: "corr_method" - ], - toState: {id, output, state -> - state + [ - prediction: output.prediction - ] - } - ) - | baseline_corr.run( - runIf: { id, state -> - state.method_id == 'baseline_dotproduct_causal_cell_type' - }, - fromState: [ - multiomics_rna: "multiomics_rna", - layer: "layer", - tf_all: "tf_all", - causal: "causal", - corr_method: "corr_method", - cell_type_specific: "cell_type_specific" - ], - toState: {id, output, state -> - state + [ - prediction: output.prediction - ] - } - ) - | baseline_corr.run( - runIf: { id, state -> - state.method_id == 'baseline_dotproduct_causal_metacell' - }, - fromState: [ - multiomics_rna: "multiomics_rna", - layer: "layer", - tf_all: "tf_all", - causal: "causal", - corr_method: "corr_method", - metacell: "metacell" - ], - toState: {id, output, state -> - state + [ - prediction: output.prediction - ] - } - ) | baseline_corr.run( runIf: { id, state -> - state.method_id == 'baseline_dotproduct_causal_impute' - }, - fromState: [ - multiomics_rna: "multiomics_rna", - layer: "layer", - tf_all: "tf_all", - causal: "causal", - corr_method: "corr_method", - metacell: "metacell", - impute: "impute" - ], - toState: {id, output, state -> - state + [ - prediction: output.prediction - ] - } - ) - | baseline_corr.run( - runIf: { id, state -> - state.method_id == 'baseline_corr_causal_spearman' + ['baseline_pearson', 'baseline_dotproduct_causal'].contains(state.method_id) }, fromState: [ multiomics_rna: "multiomics_rna", @@ -148,24 +58,114 @@ workflow run_wf { ] } ) + // | baseline_corr.run( + // runIf: { id, state -> + // state.method_id == 'baseline_dotproduct' + // }, + // fromState: [ + // multiomics_rna: "multiomics_rna", + // layer: "layer", + // tf_all: "tf_all", + // causal: "causal", + // corr_method: "corr_method" + // ], + // toState: {id, output, state -> + // state + [ + // prediction: output.prediction + // ] + // } + // ) + + // | baseline_corr.run( + // runIf: { id, state -> + // state.method_id == 'baseline_pearson_causal' + // }, + // fromState: [ + // multiomics_rna: "multiomics_rna", + // layer: "layer", + // tf_all: "tf_all", + // causal: "causal", + // corr_method: "corr_method" + // ], + // toState: {id, output, state -> + // state + [ + // prediction: output.prediction + // ] + // } + // ) + // | baseline_corr.run( + // runIf: { id, state -> + // state.method_id == 'baseline_dotproduct_causal' + // }, + // fromState: [ + // multiomics_rna: "multiomics_rna", + // layer: "layer", + // tf_all: "tf_all", + // causal: "causal", + // corr_method: "corr_method" + // ], + // toState: {id, output, state -> + // state + [ + // prediction: output.prediction + // ] + // } + // ) + // | baseline_corr.run( + // runIf: { id, state -> + // state.method_id == 'baseline_dotproduct_causal_cell_type' + // }, + // fromState: [ + // multiomics_rna: "multiomics_rna", + // layer: "layer", + // tf_all: "tf_all", + // causal: "causal", + // corr_method: "corr_method", + // cell_type_specific: "cell_type_specific" + // ], + // toState: {id, output, state -> + // state + [ + // prediction: output.prediction + // ] + // } + // ) + // | baseline_corr.run( + // runIf: { id, state -> + // state.method_id == 'baseline_dotproduct_causal_metacell' + // }, + // fromState: [ + // multiomics_rna: "multiomics_rna", + // layer: "layer", + // tf_all: "tf_all", + // causal: "causal", + // corr_method: "corr_method", + // metacell: "metacell" + // ], + // toState: {id, output, state -> + // state + [ + // prediction: output.prediction + // ] + // } + // ) + // | baseline_corr.run( + // runIf: { id, state -> + // state.method_id == 'baseline_dotproduct_causal_impute' + // }, + // fromState: [ + // multiomics_rna: "multiomics_rna", + // layer: "layer", + // tf_all: "tf_all", + // causal: "causal", + // corr_method: "corr_method", + // metacell: "metacell", + // impute: "impute" + // ], + // toState: {id, output, state -> + // state + [ + // prediction: output.prediction + // ] + // } + // ) - | baseline_corr.run( - runIf: { id, state -> - state.method_id == 'baseline_corr' - }, - fromState: [ - multiomics_rna: "multiomics_rna", - layer: "layer", - tf_all: "tf_all", - causal: "causal", - seed: "seed" - ], - toState: {id, output, state -> - state + [ - prediction: output.prediction - ] - } - ) | negative_control.run( runIf: { id, state -> state.method_id == 'negative_control'