{ "cells": [ { "cell_type": "markdown", "id": "05b7b43f", "metadata": {}, "source": [ "# Predicting Gene Expression with Decima" ] }, { "cell_type": "markdown", "id": "42034677", "metadata": {}, "source": [ "Decima allows prediction of gene expression at the cell type level, and this tutorial demonstrates how to leverage the prediction API for both genes in the training data and custom genes." ] }, { "cell_type": "markdown", "id": "1898aff7", "metadata": { "vscode": { "languageId": "plaintext" } }, "source": [ "### Precomputed Predictions" ] }, { "cell_type": "markdown", "id": "f4634c23", "metadata": {}, "source": [ "Scores for all genes in the training data are precomputed and saved to metadata h5ad object for each model replicate and are available under the `DecimaResult` class. `predicted_expression_matrix` class returns predicted average gene expression across the replicates." ] }, { "cell_type": "code", "execution_count": 1, "id": "6b76abce", "metadata": { "execution": { "iopub.execute_input": "2025-11-21T06:24:54.170009Z", "iopub.status.busy": "2025-11-21T06:24:54.169485Z", "iopub.status.idle": "2025-11-21T06:25:32.182146Z", "shell.execute_reply": "2025-11-21T06:25:32.181240Z" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/celikm5/miniforge3/envs/decima2/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py:2249: UnsupportedFieldAttributeWarning: The 'repr' attribute with value False was provided to the `Field()` function, which has no effect in the context it was used. 'repr' is field-specific metadata, and can only be attached to a model field using `Annotated` metadata or by assignment. This may have happened because an `Annotated` type alias using the `type` statement was used, or if the `Field()` function was attached to a single member of a union type.\n", " warnings.warn(\n", "/home/celikm5/miniforge3/envs/decima2/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py:2249: UnsupportedFieldAttributeWarning: The 'frozen' attribute with value True was provided to the `Field()` function, which has no effect in the context it was used. 'frozen' is field-specific metadata, and can only be attached to a model field using `Annotated` metadata or by assignment. This may have happened because an `Annotated` type alias using the `type` statement was used, or if the `Field()` function was attached to a single member of a union type.\n", " warnings.warn(\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: Currently logged in as: \u001b[33mmhcelik\u001b[0m (\u001b[33mmhcw\u001b[0m) to \u001b[32mhttps://api.wandb.ai\u001b[0m. Use \u001b[1m`wandb login --relogin`\u001b[0m to force relogin\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: Downloading large artifact 'metadata:latest', 3122.32MB. 1 files...\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: 1 of 1 files downloaded. \n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Done. 00:00:08.3 (375.3MB/s)\n" ] }, { "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", " \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", "
STRADAETV4USP25ZSWIM5C21orf58MIR497HGCFAP74GSE1LPPCLK1...STRIP2TNFRSF1ARBM14-RBM4C1orf21LINC00639NPDC1ZNF425COL5A1BRD3EVI5L
agg_02.9734381.8455654.5925315.0998021.7748790.3568122.5908364.6297744.8971713.326940...2.8360600.2970151.8838494.2935931.4635653.1835342.3402022.3749422.9119163.230072
agg_12.9542131.8967264.6885575.5104401.6669290.3527252.2926254.4595354.9152863.192858...3.1257040.2425431.9081774.4394241.2367393.4948242.4256722.0545682.7134083.491463
agg_22.9388512.1972474.8614105.6175201.7733810.3808672.3949174.4150384.8363993.390717...3.0820980.2632852.0064564.3834551.2085904.0138192.4083812.2973432.8922223.695785
agg_33.0459722.1385734.8637915.2736041.7600970.4635552.3917023.9409754.8577633.410926...2.8828900.2903271.9229634.5501891.4305203.6931182.2971032.1218872.6261173.223912
agg_43.0255182.0190964.6029485.2570011.7553380.3821902.4328104.3924804.9594883.250500...3.0822960.2585402.0382774.4648071.2490433.6658002.4008202.2558622.9256193.471005
..................................................................
agg_95332.3335620.6333224.6758252.7930230.7520300.6920830.5035314.3279486.9031933.695593...0.5497952.2701811.5632184.3954220.5500881.3302521.0444713.7593692.4913461.872717
agg_95350.8350370.3587731.9648960.3074490.3372400.8341960.0938851.8537943.7007904.467302...0.1768851.3708981.0227083.4002670.0521621.9088700.2534171.4481111.6220331.064292
agg_95363.0080391.2093244.7983923.9318701.4013281.6385550.9697204.7792016.6319314.127797...1.1742981.8705302.5068745.1517760.9676441.8099472.2053564.2440052.9744672.659873
agg_95371.2419360.4550592.9199950.5716720.4864481.1755860.1453972.4121484.7591184.913945...0.3710351.3610731.6680854.0057380.0786111.5717500.5081872.0671502.3237641.429850
agg_95381.7155070.7009553.0447320.8586960.9034061.7631680.2153042.6044784.5497084.839124...0.5943101.8012982.0759963.9338600.1655901.9702680.9935212.2323472.4733881.902884
\n", "

8856 rows Γ— 18457 columns

\n", "
" ], "text/plain": [ " STRADA ETV4 USP25 ZSWIM5 C21orf58 MIR497HG \\\n", "agg_0 2.973438 1.845565 4.592531 5.099802 1.774879 0.356812 \n", "agg_1 2.954213 1.896726 4.688557 5.510440 1.666929 0.352725 \n", "agg_2 2.938851 2.197247 4.861410 5.617520 1.773381 0.380867 \n", "agg_3 3.045972 2.138573 4.863791 5.273604 1.760097 0.463555 \n", "agg_4 3.025518 2.019096 4.602948 5.257001 1.755338 0.382190 \n", "... ... ... ... ... ... ... \n", "agg_9533 2.333562 0.633322 4.675825 2.793023 0.752030 0.692083 \n", "agg_9535 0.835037 0.358773 1.964896 0.307449 0.337240 0.834196 \n", "agg_9536 3.008039 1.209324 4.798392 3.931870 1.401328 1.638555 \n", "agg_9537 1.241936 0.455059 2.919995 0.571672 0.486448 1.175586 \n", "agg_9538 1.715507 0.700955 3.044732 0.858696 0.903406 1.763168 \n", "\n", " CFAP74 GSE1 LPP CLK1 ... STRIP2 TNFRSF1A \\\n", "agg_0 2.590836 4.629774 4.897171 3.326940 ... 2.836060 0.297015 \n", "agg_1 2.292625 4.459535 4.915286 3.192858 ... 3.125704 0.242543 \n", "agg_2 2.394917 4.415038 4.836399 3.390717 ... 3.082098 0.263285 \n", "agg_3 2.391702 3.940975 4.857763 3.410926 ... 2.882890 0.290327 \n", "agg_4 2.432810 4.392480 4.959488 3.250500 ... 3.082296 0.258540 \n", "... ... ... ... ... ... ... ... \n", "agg_9533 0.503531 4.327948 6.903193 3.695593 ... 0.549795 2.270181 \n", "agg_9535 0.093885 1.853794 3.700790 4.467302 ... 0.176885 1.370898 \n", "agg_9536 0.969720 4.779201 6.631931 4.127797 ... 1.174298 1.870530 \n", "agg_9537 0.145397 2.412148 4.759118 4.913945 ... 0.371035 1.361073 \n", "agg_9538 0.215304 2.604478 4.549708 4.839124 ... 0.594310 1.801298 \n", "\n", " RBM14-RBM4 C1orf21 LINC00639 NPDC1 ZNF425 COL5A1 \\\n", "agg_0 1.883849 4.293593 1.463565 3.183534 2.340202 2.374942 \n", "agg_1 1.908177 4.439424 1.236739 3.494824 2.425672 2.054568 \n", "agg_2 2.006456 4.383455 1.208590 4.013819 2.408381 2.297343 \n", "agg_3 1.922963 4.550189 1.430520 3.693118 2.297103 2.121887 \n", "agg_4 2.038277 4.464807 1.249043 3.665800 2.400820 2.255862 \n", "... ... ... ... ... ... ... \n", "agg_9533 1.563218 4.395422 0.550088 1.330252 1.044471 3.759369 \n", "agg_9535 1.022708 3.400267 0.052162 1.908870 0.253417 1.448111 \n", "agg_9536 2.506874 5.151776 0.967644 1.809947 2.205356 4.244005 \n", "agg_9537 1.668085 4.005738 0.078611 1.571750 0.508187 2.067150 \n", "agg_9538 2.075996 3.933860 0.165590 1.970268 0.993521 2.232347 \n", "\n", " BRD3 EVI5L \n", "agg_0 2.911916 3.230072 \n", "agg_1 2.713408 3.491463 \n", "agg_2 2.892222 3.695785 \n", "agg_3 2.626117 3.223912 \n", "agg_4 2.925619 3.471005 \n", "... ... ... \n", "agg_9533 2.491346 1.872717 \n", "agg_9535 1.622033 1.064292 \n", "agg_9536 2.974467 2.659873 \n", "agg_9537 2.323764 1.429850 \n", "agg_9538 2.473388 1.902884 \n", "\n", "[8856 rows x 18457 columns]" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from decima import DecimaResult\n", "\n", "result = DecimaResult.load()\n", "result.predicted_expression_matrix()" ] }, { "cell_type": "markdown", "id": "802943e2", "metadata": {}, "source": [ "To access the predicted expression matrix for a specific model, you can use the `model_name` parameter. In this example, we obtain the predicted gene expression for first model replicate." ] }, { "cell_type": "code", "execution_count": 2, "id": "acbb140a", "metadata": { "execution": { "iopub.execute_input": "2025-11-21T06:25:32.184513Z", "iopub.status.busy": "2025-11-21T06:25:32.183699Z", "iopub.status.idle": "2025-11-21T06:25:32.199071Z", "shell.execute_reply": "2025-11-21T06:25:32.198367Z" } }, "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", " \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", "
STRADAETV4USP25ZSWIM5C21orf58MIR497HGCFAP74GSE1LPPCLK1...STRIP2TNFRSF1ARBM14-RBM4C1orf21LINC00639NPDC1ZNF425COL5A1BRD3EVI5L
agg_02.9734381.8455654.5925315.0998021.7748790.3568122.5908364.6297744.8971713.326940...2.8360600.2970151.8838494.2935931.4635653.1835342.3402022.3749422.9119163.230072
agg_12.9542131.8967264.6885575.5104401.6669290.3527252.2926254.4595354.9152863.192858...3.1257040.2425431.9081774.4394241.2367393.4948242.4256722.0545682.7134083.491463
agg_22.9388512.1972474.8614105.6175201.7733810.3808672.3949174.4150384.8363993.390717...3.0820980.2632852.0064564.3834551.2085904.0138192.4083812.2973432.8922223.695785
agg_33.0459722.1385734.8637915.2736041.7600970.4635552.3917023.9409754.8577633.410926...2.8828900.2903271.9229634.5501891.4305203.6931182.2971032.1218872.6261173.223912
agg_43.0255182.0190964.6029485.2570011.7553380.3821902.4328104.3924804.9594883.250500...3.0822960.2585402.0382774.4648071.2490433.6658002.4008202.2558622.9256193.471005
..................................................................
agg_95332.3335620.6333224.6758252.7930230.7520300.6920830.5035314.3279486.9031933.695593...0.5497952.2701811.5632184.3954220.5500881.3302521.0444713.7593692.4913461.872717
agg_95350.8350370.3587731.9648960.3074490.3372400.8341960.0938851.8537943.7007904.467302...0.1768851.3708981.0227083.4002670.0521621.9088700.2534171.4481111.6220331.064292
agg_95363.0080391.2093244.7983923.9318701.4013281.6385550.9697204.7792016.6319314.127797...1.1742981.8705302.5068745.1517760.9676441.8099472.2053564.2440052.9744672.659873
agg_95371.2419360.4550592.9199950.5716720.4864481.1755860.1453972.4121484.7591184.913945...0.3710351.3610731.6680854.0057380.0786111.5717500.5081872.0671502.3237641.429850
agg_95381.7155070.7009553.0447320.8586960.9034061.7631680.2153042.6044784.5497084.839124...0.5943101.8012982.0759963.9338600.1655901.9702680.9935212.2323472.4733881.902884
\n", "

8856 rows Γ— 18457 columns

\n", "
" ], "text/plain": [ " STRADA ETV4 USP25 ZSWIM5 C21orf58 MIR497HG \\\n", "agg_0 2.973438 1.845565 4.592531 5.099802 1.774879 0.356812 \n", "agg_1 2.954213 1.896726 4.688557 5.510440 1.666929 0.352725 \n", "agg_2 2.938851 2.197247 4.861410 5.617520 1.773381 0.380867 \n", "agg_3 3.045972 2.138573 4.863791 5.273604 1.760097 0.463555 \n", "agg_4 3.025518 2.019096 4.602948 5.257001 1.755338 0.382190 \n", "... ... ... ... ... ... ... \n", "agg_9533 2.333562 0.633322 4.675825 2.793023 0.752030 0.692083 \n", "agg_9535 0.835037 0.358773 1.964896 0.307449 0.337240 0.834196 \n", "agg_9536 3.008039 1.209324 4.798392 3.931870 1.401328 1.638555 \n", "agg_9537 1.241936 0.455059 2.919995 0.571672 0.486448 1.175586 \n", "agg_9538 1.715507 0.700955 3.044732 0.858696 0.903406 1.763168 \n", "\n", " CFAP74 GSE1 LPP CLK1 ... STRIP2 TNFRSF1A \\\n", "agg_0 2.590836 4.629774 4.897171 3.326940 ... 2.836060 0.297015 \n", "agg_1 2.292625 4.459535 4.915286 3.192858 ... 3.125704 0.242543 \n", "agg_2 2.394917 4.415038 4.836399 3.390717 ... 3.082098 0.263285 \n", "agg_3 2.391702 3.940975 4.857763 3.410926 ... 2.882890 0.290327 \n", "agg_4 2.432810 4.392480 4.959488 3.250500 ... 3.082296 0.258540 \n", "... ... ... ... ... ... ... ... \n", "agg_9533 0.503531 4.327948 6.903193 3.695593 ... 0.549795 2.270181 \n", "agg_9535 0.093885 1.853794 3.700790 4.467302 ... 0.176885 1.370898 \n", "agg_9536 0.969720 4.779201 6.631931 4.127797 ... 1.174298 1.870530 \n", "agg_9537 0.145397 2.412148 4.759118 4.913945 ... 0.371035 1.361073 \n", "agg_9538 0.215304 2.604478 4.549708 4.839124 ... 0.594310 1.801298 \n", "\n", " RBM14-RBM4 C1orf21 LINC00639 NPDC1 ZNF425 COL5A1 \\\n", "agg_0 1.883849 4.293593 1.463565 3.183534 2.340202 2.374942 \n", "agg_1 1.908177 4.439424 1.236739 3.494824 2.425672 2.054568 \n", "agg_2 2.006456 4.383455 1.208590 4.013819 2.408381 2.297343 \n", "agg_3 1.922963 4.550189 1.430520 3.693118 2.297103 2.121887 \n", "agg_4 2.038277 4.464807 1.249043 3.665800 2.400820 2.255862 \n", "... ... ... ... ... ... ... \n", "agg_9533 1.563218 4.395422 0.550088 1.330252 1.044471 3.759369 \n", "agg_9535 1.022708 3.400267 0.052162 1.908870 0.253417 1.448111 \n", "agg_9536 2.506874 5.151776 0.967644 1.809947 2.205356 4.244005 \n", "agg_9537 1.668085 4.005738 0.078611 1.571750 0.508187 2.067150 \n", "agg_9538 2.075996 3.933860 0.165590 1.970268 0.993521 2.232347 \n", "\n", " BRD3 EVI5L \n", "agg_0 2.911916 3.230072 \n", "agg_1 2.713408 3.491463 \n", "agg_2 2.892222 3.695785 \n", "agg_3 2.626117 3.223912 \n", "agg_4 2.925619 3.471005 \n", "... ... ... \n", "agg_9533 2.491346 1.872717 \n", "agg_9535 1.622033 1.064292 \n", "agg_9536 2.974467 2.659873 \n", "agg_9537 2.323764 1.429850 \n", "agg_9538 2.473388 1.902884 \n", "\n", "[8856 rows x 18457 columns]" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "result.predicted_expression_matrix(model_name=\"v1_rep0\")" ] }, { "cell_type": "markdown", "id": "74b7cd00", "metadata": {}, "source": [ "and for the second model replicate." ] }, { "cell_type": "code", "execution_count": 3, "id": "95ebbd2f", "metadata": { "execution": { "iopub.execute_input": "2025-11-21T06:25:32.200797Z", "iopub.status.busy": "2025-11-21T06:25:32.200269Z", "iopub.status.idle": "2025-11-21T06:25:32.214579Z", "shell.execute_reply": "2025-11-21T06:25:32.213871Z" } }, "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", " \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", "
STRADAETV4USP25ZSWIM5C21orf58MIR497HGCFAP74GSE1LPPCLK1...STRIP2TNFRSF1ARBM14-RBM4C1orf21LINC00639NPDC1ZNF425COL5A1BRD3EVI5L
agg_02.9734381.8455654.5925315.0998021.7748790.3568122.5908364.6297744.8971713.326940...2.8360600.2970151.8838494.2935931.4635653.1835342.3402022.3749422.9119163.230072
agg_12.9542131.8967264.6885575.5104401.6669290.3527252.2926254.4595354.9152863.192858...3.1257040.2425431.9081774.4394241.2367393.4948242.4256722.0545682.7134083.491463
agg_22.9388512.1972474.8614105.6175201.7733810.3808672.3949174.4150384.8363993.390717...3.0820980.2632852.0064564.3834551.2085904.0138192.4083812.2973432.8922223.695785
agg_33.0459722.1385734.8637915.2736041.7600970.4635552.3917023.9409754.8577633.410926...2.8828900.2903271.9229634.5501891.4305203.6931182.2971032.1218872.6261173.223912
agg_43.0255182.0190964.6029485.2570011.7553380.3821902.4328104.3924804.9594883.250500...3.0822960.2585402.0382774.4648071.2490433.6658002.4008202.2558622.9256193.471005
..................................................................
agg_95332.3335620.6333224.6758252.7930230.7520300.6920830.5035314.3279486.9031933.695593...0.5497952.2701811.5632184.3954220.5500881.3302521.0444713.7593692.4913461.872717
agg_95350.8350370.3587731.9648960.3074490.3372400.8341960.0938851.8537943.7007904.467302...0.1768851.3708981.0227083.4002670.0521621.9088700.2534171.4481111.6220331.064292
agg_95363.0080391.2093244.7983923.9318701.4013281.6385550.9697204.7792016.6319314.127797...1.1742981.8705302.5068745.1517760.9676441.8099472.2053564.2440052.9744672.659873
agg_95371.2419360.4550592.9199950.5716720.4864481.1755860.1453972.4121484.7591184.913945...0.3710351.3610731.6680854.0057380.0786111.5717500.5081872.0671502.3237641.429850
agg_95381.7155070.7009553.0447320.8586960.9034061.7631680.2153042.6044784.5497084.839124...0.5943101.8012982.0759963.9338600.1655901.9702680.9935212.2323472.4733881.902884
\n", "

8856 rows Γ— 18457 columns

\n", "
" ], "text/plain": [ " STRADA ETV4 USP25 ZSWIM5 C21orf58 MIR497HG \\\n", "agg_0 2.973438 1.845565 4.592531 5.099802 1.774879 0.356812 \n", "agg_1 2.954213 1.896726 4.688557 5.510440 1.666929 0.352725 \n", "agg_2 2.938851 2.197247 4.861410 5.617520 1.773381 0.380867 \n", "agg_3 3.045972 2.138573 4.863791 5.273604 1.760097 0.463555 \n", "agg_4 3.025518 2.019096 4.602948 5.257001 1.755338 0.382190 \n", "... ... ... ... ... ... ... \n", "agg_9533 2.333562 0.633322 4.675825 2.793023 0.752030 0.692083 \n", "agg_9535 0.835037 0.358773 1.964896 0.307449 0.337240 0.834196 \n", "agg_9536 3.008039 1.209324 4.798392 3.931870 1.401328 1.638555 \n", "agg_9537 1.241936 0.455059 2.919995 0.571672 0.486448 1.175586 \n", "agg_9538 1.715507 0.700955 3.044732 0.858696 0.903406 1.763168 \n", "\n", " CFAP74 GSE1 LPP CLK1 ... STRIP2 TNFRSF1A \\\n", "agg_0 2.590836 4.629774 4.897171 3.326940 ... 2.836060 0.297015 \n", "agg_1 2.292625 4.459535 4.915286 3.192858 ... 3.125704 0.242543 \n", "agg_2 2.394917 4.415038 4.836399 3.390717 ... 3.082098 0.263285 \n", "agg_3 2.391702 3.940975 4.857763 3.410926 ... 2.882890 0.290327 \n", "agg_4 2.432810 4.392480 4.959488 3.250500 ... 3.082296 0.258540 \n", "... ... ... ... ... ... ... ... \n", "agg_9533 0.503531 4.327948 6.903193 3.695593 ... 0.549795 2.270181 \n", "agg_9535 0.093885 1.853794 3.700790 4.467302 ... 0.176885 1.370898 \n", "agg_9536 0.969720 4.779201 6.631931 4.127797 ... 1.174298 1.870530 \n", "agg_9537 0.145397 2.412148 4.759118 4.913945 ... 0.371035 1.361073 \n", "agg_9538 0.215304 2.604478 4.549708 4.839124 ... 0.594310 1.801298 \n", "\n", " RBM14-RBM4 C1orf21 LINC00639 NPDC1 ZNF425 COL5A1 \\\n", "agg_0 1.883849 4.293593 1.463565 3.183534 2.340202 2.374942 \n", "agg_1 1.908177 4.439424 1.236739 3.494824 2.425672 2.054568 \n", "agg_2 2.006456 4.383455 1.208590 4.013819 2.408381 2.297343 \n", "agg_3 1.922963 4.550189 1.430520 3.693118 2.297103 2.121887 \n", "agg_4 2.038277 4.464807 1.249043 3.665800 2.400820 2.255862 \n", "... ... ... ... ... ... ... \n", "agg_9533 1.563218 4.395422 0.550088 1.330252 1.044471 3.759369 \n", "agg_9535 1.022708 3.400267 0.052162 1.908870 0.253417 1.448111 \n", "agg_9536 2.506874 5.151776 0.967644 1.809947 2.205356 4.244005 \n", "agg_9537 1.668085 4.005738 0.078611 1.571750 0.508187 2.067150 \n", "agg_9538 2.075996 3.933860 0.165590 1.970268 0.993521 2.232347 \n", "\n", " BRD3 EVI5L \n", "agg_0 2.911916 3.230072 \n", "agg_1 2.713408 3.491463 \n", "agg_2 2.892222 3.695785 \n", "agg_3 2.626117 3.223912 \n", "agg_4 2.925619 3.471005 \n", "... ... ... \n", "agg_9533 2.491346 1.872717 \n", "agg_9535 1.622033 1.064292 \n", "agg_9536 2.974467 2.659873 \n", "agg_9537 2.323764 1.429850 \n", "agg_9538 2.473388 1.902884 \n", "\n", "[8856 rows x 18457 columns]" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "result.predicted_expression_matrix(model_name=\"v1_rep1\")" ] }, { "cell_type": "code", "execution_count": 4, "id": "3435f5fc", "metadata": { "execution": { "iopub.execute_input": "2025-11-21T06:25:32.216226Z", "iopub.status.busy": "2025-11-21T06:25:32.215688Z", "iopub.status.idle": "2025-11-21T06:25:32.219914Z", "shell.execute_reply": "2025-11-21T06:25:32.219213Z" } }, "outputs": [ { "data": { "text/plain": [ "Layers with keys: preds, v1_rep0, v1_rep1, v1_rep2, v1_rep3" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "result.anndata.layers" ] }, { "cell_type": "markdown", "id": "345ff486", "metadata": { "vscode": { "languageId": "plaintext" } }, "source": [ "### CLI API" ] }, { "cell_type": "markdown", "id": "86e9f055", "metadata": {}, "source": [ "If you want to perform gene expression prediction again, rather than using the precomputed scores, you can use the Decima command-line interface (CLI) to generate new predictions for any set of genes you specify. For example, you can run the `decima predict-genes` command with the `--genes` argument to provide a comma-separated list of gene names (such as \"STRADA,ETV4,USP25\") if no gene provided it will perform expression predictions for all genes, select the prediction model with the `--model` option (for instance, \"ensemble\" or a specific replicate like \"0\"), and use `--save-replicates` to save predictions for each replicate. The `-o` flag lets you specify the output file path for the predictions in `.h5ad` format. " ] }, { "cell_type": "code", "execution_count": 5, "id": "6715257c", "metadata": { "execution": { "iopub.execute_input": "2025-11-21T06:25:32.221652Z", "iopub.status.busy": "2025-11-21T06:25:32.221116Z", "iopub.status.idle": "2025-11-21T06:26:16.929651Z", "shell.execute_reply": "2025-11-21T06:26:16.928993Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "/home/celikm5/miniforge3/envs/decima2/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py:2249: UnsupportedFieldAttributeWarning: The 'repr' attribute with value False was provided to the `Field()` function, which has no effect in the context it was used. 'repr' is field-specific metadata, and can only be attached to a model field using `Annotated` metadata or by assignment. This may have happened because an `Annotated` type alias using the `type` statement was used, or if the `Field()` function was attached to a single member of a union type.\r\n", " warnings.warn(\r\n", "/home/celikm5/miniforge3/envs/decima2/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py:2249: UnsupportedFieldAttributeWarning: The 'frozen' attribute with value True was provided to the `Field()` function, which has no effect in the context it was used. 'frozen' is field-specific metadata, and can only be attached to a model field using `Annotated` metadata or by assignment. This may have happened because an `Annotated` type alias using the `type` statement was used, or if the `Field()` function was attached to a single member of a union type.\r\n", " warnings.warn(\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "decima - INFO - Using device: 0 and genome: hg38 for prediction.\r\n", "decima - INFO - Loading model ensemble...\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: Currently logged in as: \u001b[33mmhcelik\u001b[0m (\u001b[33mmhcw\u001b[0m) to \u001b[32mhttps://api.wandb.ai\u001b[0m. Use \u001b[1m`wandb login --relogin`\u001b[0m to force relogin\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: Downloading large artifact 'rep0:latest', 720.03MB. 1 files...\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: 1 of 1 files downloaded. \r\n", "Done. 00:00:02.6 (272.9MB/s)\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: Downloading large artifact 'rep1:latest', 720.03MB. 1 files...\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: 1 of 1 files downloaded. \r\n", "Done. 00:00:01.8 (405.6MB/s)\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: Downloading large artifact 'rep2:latest', 720.03MB. 1 files...\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: 1 of 1 files downloaded. \r\n", "Done. 00:00:02.0 (359.5MB/s)\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: Downloading large artifact 'rep3:latest', 720.03MB. 1 files...\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: 1 of 1 files downloaded. \r\n", "Done. 00:00:01.8 (400.1MB/s)\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "decima - INFO - Making predictions\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: Downloading large artifact 'metadata:latest', 3122.32MB. 1 files...\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: 1 of 1 files downloaded. \r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Done. 00:00:01.9 (1645.5MB/s)\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "/home/celikm5/miniforge3/envs/decima2/lib/python3.11/site-packages/torch/__init__.py:1617: UserWarning: Please use the new API settings to control TF32 behavior, such as torch.backends.cudnn.conv.fp32_precision = 'tf32' or torch.backends.cuda.matmul.fp32_precision = 'ieee'. Old settings, e.g, torch.backends.cuda.matmul.allow_tf32 = True, torch.backends.cudnn.allow_tf32 = True, allowTF32CuDNN() and allowTF32CuBLAS() will be deprecated after Pytorch 2.9. Please see https://pytorch.org/docs/main/notes/cuda.html#tensorfloat-32-tf32-on-ampere-and-later-devices (Triggered internally at /pytorch/aten/src/ATen/Context.cpp:80.)\r\n", "πŸ’‘ Tip: For seamless cloud uploads and versioning, try installing [litmodels](https://pypi.org/project/litmodels/) to enable LitModelCheckpoint, which syncs automatically with the Lightning model registry.\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "GPU available: True (cuda), used: True\r\n", "TPU available: False, using: 0 TPU cores\r\n", "HPU available: False, using: 0 HPUs\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "SLURM auto-requeueing enabled. Setting signal handlers.\r\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\r", "Predicting: | | 0/? [00:00\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", "
STRADAETV4USP25
agg_03.0605612.8821003.469085
agg_13.1177022.8257383.596372
agg_23.1566423.1223813.718749
agg_33.2140473.2046703.629874
agg_43.1035703.0320283.512117
............
agg_95332.3132202.1735973.156157
agg_95350.9521120.9567201.250005
agg_95362.7794942.7059453.530610
agg_95371.3426941.4074071.867070
agg_95381.7450801.6333142.082985
\n", "

8856 rows Γ— 3 columns

\n", "" ], "text/plain": [ " STRADA ETV4 USP25\n", "agg_0 3.060561 2.882100 3.469085\n", "agg_1 3.117702 2.825738 3.596372\n", "agg_2 3.156642 3.122381 3.718749\n", "agg_3 3.214047 3.204670 3.629874\n", "agg_4 3.103570 3.032028 3.512117\n", "... ... ... ...\n", "agg_9533 2.313220 2.173597 3.156157\n", "agg_9535 0.952112 0.956720 1.250005\n", "agg_9536 2.779494 2.705945 3.530610\n", "agg_9537 1.342694 1.407407 1.867070\n", "agg_9538 1.745080 1.633314 2.082985\n", "\n", "[8856 rows x 3 columns]" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "result = DecimaResult.load(\"example/predict_genes/predictions.h5ad\")\n", "result.predicted_expression_matrix()" ] }, { "cell_type": "markdown", "id": "1da2ab16", "metadata": {}, "source": [ "or for a specific replicate:" ] }, { "cell_type": "code", "execution_count": 7, "id": "ce3884f4", "metadata": { "execution": { "iopub.execute_input": "2025-11-21T06:26:16.981009Z", "iopub.status.busy": "2025-11-21T06:26:16.980750Z", "iopub.status.idle": "2025-11-21T06:26:16.986183Z", "shell.execute_reply": "2025-11-21T06:26:16.985726Z" } }, "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", "
STRADAETV4USP25
agg_02.9330172.8929342.858879
agg_12.8167782.8129643.058485
agg_22.7431202.9713662.950323
agg_32.8046923.3466892.837382
agg_42.8160303.0886202.973081
............
agg_95332.5106052.7604461.965776
agg_95351.2460221.1925240.407104
agg_95362.8092293.3699572.927355
agg_95371.5803341.5334670.879179
agg_95382.0142242.0781251.374325
\n", "

8856 rows Γ— 3 columns

\n", "
" ], "text/plain": [ " STRADA ETV4 USP25\n", "agg_0 2.933017 2.892934 2.858879\n", "agg_1 2.816778 2.812964 3.058485\n", "agg_2 2.743120 2.971366 2.950323\n", "agg_3 2.804692 3.346689 2.837382\n", "agg_4 2.816030 3.088620 2.973081\n", "... ... ... ...\n", "agg_9533 2.510605 2.760446 1.965776\n", "agg_9535 1.246022 1.192524 0.407104\n", "agg_9536 2.809229 3.369957 2.927355\n", "agg_9537 1.580334 1.533467 0.879179\n", "agg_9538 2.014224 2.078125 1.374325\n", "\n", "[8856 rows x 3 columns]" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "result.predicted_expression_matrix(model_name=\"preds_v1_rep0\")" ] }, { "cell_type": "markdown", "id": "316629fe", "metadata": { "vscode": { "languageId": "plaintext" } }, "source": [ "### Python API" ] }, { "cell_type": "markdown", "id": "552b7245", "metadata": {}, "source": [ "The same functionality is available through the Python API, allowing you to perform gene expression prediction programmatically. You can specify the genes, model, and other options directly in your Python code using the provided classes and functions." ] }, { "cell_type": "code", "execution_count": 8, "id": "3a0dba6e", "metadata": { "execution": { "iopub.execute_input": "2025-11-21T06:26:16.987569Z", "iopub.status.busy": "2025-11-21T06:26:16.987310Z", "iopub.status.idle": "2025-11-21T06:26:50.087684Z", "shell.execute_reply": "2025-11-21T06:26:50.087076Z" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: Downloading large artifact 'rep0:latest', 720.03MB. 1 files...\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: 1 of 1 files downloaded. \n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Done. 00:00:01.3 (539.8MB/s)\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: Downloading large artifact 'rep1:latest', 720.03MB. 1 files...\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: 1 of 1 files downloaded. \n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Done. 00:00:01.4 (529.6MB/s)\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: Downloading large artifact 'rep2:latest', 720.03MB. 1 files...\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: 1 of 1 files downloaded. \n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Done. 00:00:00.6 (1166.2MB/s)\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: Downloading large artifact 'rep3:latest', 720.03MB. 1 files...\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: 1 of 1 files downloaded. \n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Done. 00:00:00.6 (1242.4MB/s)\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: Downloading large artifact 'metadata:latest', 3122.32MB. 1 files...\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\u001b[34m\u001b[1mwandb\u001b[0m: 1 of 1 files downloaded. \n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Done. 00:00:05.1 (613.2MB/s)\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/home/celikm5/miniforge3/envs/decima2/lib/python3.11/site-packages/torch/__init__.py:1617: UserWarning: Please use the new API settings to control TF32 behavior, such as torch.backends.cudnn.conv.fp32_precision = 'tf32' or torch.backends.cuda.matmul.fp32_precision = 'ieee'. Old settings, e.g, torch.backends.cuda.matmul.allow_tf32 = True, torch.backends.cudnn.allow_tf32 = True, allowTF32CuDNN() and allowTF32CuBLAS() will be deprecated after Pytorch 2.9. Please see https://pytorch.org/docs/main/notes/cuda.html#tensorfloat-32-tf32-on-ampere-and-later-devices (Triggered internally at /pytorch/aten/src/ATen/Context.cpp:80.)\n", "πŸ’‘ Tip: For seamless cloud uploads and versioning, try installing [litmodels](https://pypi.org/project/litmodels/) to enable LitModelCheckpoint, which syncs automatically with the Lightning model registry.\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "GPU available: True (cuda), used: True\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "TPU available: False, using: 0 TPU cores\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "HPU available: False, using: 0 HPUs\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "SLURM auto-requeueing enabled. Setting signal handlers.\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "ff694bb6902a480b87789da9b1bb0156", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Predicting: | | 0/? [00:00gene_name|gene_mask_start=X|gene_mask_end=Y`\n", " where `X` and `Y` specify the start and end positions (0-based, inclusive) of the gene region within the sequence. The gene mask indicates which region of the sequence corresponds to the gene for which expression will be predicted.\n", "\n", "For example, seqs.fasta contains these information:" ] }, { "cell_type": "code", "execution_count": 10, "id": "2dfbdb1a", "metadata": { "execution": { "iopub.execute_input": "2025-11-21T06:27:05.814176Z", "iopub.status.busy": "2025-11-21T06:27:05.813919Z", "iopub.status.idle": "2025-11-21T06:27:06.136436Z", "shell.execute_reply": "2025-11-21T06:27:06.135810Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "cat: ../tests/data/seqs.fasta: No such file or directory\r\n" ] } ], "source": [ "! cat ../tests/data/seqs.fasta | cut -c 1-200" ] }, { "cell_type": "code", "execution_count": 11, "id": "0d15ea9e", "metadata": { "execution": { "iopub.execute_input": "2025-11-21T06:27:06.137832Z", "iopub.status.busy": "2025-11-21T06:27:06.137668Z", "iopub.status.idle": "2025-11-21T06:27:07.257212Z", "shell.execute_reply": "2025-11-21T06:27:07.256619Z" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "πŸ’‘ Tip: For seamless cloud uploads and versioning, try installing [litmodels](https://pypi.org/project/litmodels/) to enable LitModelCheckpoint, which syncs automatically with the Lightning model registry.\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "GPU available: True (cuda), used: True\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "TPU available: False, using: 0 TPU cores\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "HPU available: False, using: 0 HPUs\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "LOCAL_RANK: 0 - CUDA_VISIBLE_DEVICES: [0]\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "SLURM auto-requeueing enabled. Setting signal handlers.\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "b0c2854b5b1145a28d069646a54109b5", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Predicting: | | 0/? [00:00