{ "cells": [ { "cell_type": "markdown", "id": "2f04eee0-5928-4e74-a754-6dc2e528810c", "metadata": {}, "source": [ "# DNAmFitAgeGaitM" ] }, { "cell_type": "markdown", "id": "a3f514a3-772c-4a14-afdf-5a8376851ff4", "metadata": {}, "source": [ "## Index\n", "1. [Instantiate model class](#Instantiate-model-class)\n", "2. [Define clock metadata](#Define-clock-metadata)\n", "3. [Download clock dependencies](#Download-clock-dependencies)\n", "5. [Load features](#Load-features)\n", "6. [Load weights into base model](#Load-weights-into-base-model)\n", "7. [Load reference values](#Load-reference-values)\n", "8. [Load preprocess and postprocess objects](#Load-preprocess-and-postprocess-objects)\n", "10. [Check all clock parameters](#Check-all-clock-parameters)\n", "10. [Basic test](#Basic-test)\n", "11. [Save torch model](#Save-torch-model)\n", "12. [Clear directory](#Clear-directory)" ] }, { "cell_type": "markdown", "id": "d95fafdc-643a-40ea-a689-200bd132e90c", "metadata": {}, "source": [ "Let's first import some packages:" ] }, { "cell_type": "code", "execution_count": 18, "id": "4adfb4de-cd79-4913-a1af-9e23e9e236c9", "metadata": { "execution": { "iopub.execute_input": "2025-04-07T17:50:23.621657Z", "iopub.status.busy": "2025-04-07T17:50:23.621346Z", "iopub.status.idle": "2025-04-07T17:50:25.088787Z", "shell.execute_reply": "2025-04-07T17:50:25.088401Z" } }, "outputs": [], "source": [ "import os\n", "import inspect\n", "import shutil\n", "import json\n", "import torch\n", "import pandas as pd\n", "import numpy as np\n", "import pyaging as pya" ] }, { "cell_type": "markdown", "id": "145082e5-ced4-47ae-88c0-cb69773e3c5a", "metadata": {}, "source": [ "## Instantiate model class" ] }, { "cell_type": "code", "execution_count": 19, "id": "8aa77372-7ed3-4da7-abc9-d30372106139", "metadata": { "execution": { "iopub.execute_input": "2025-04-07T17:50:25.090492Z", "iopub.status.busy": "2025-04-07T17:50:25.090265Z", "iopub.status.idle": "2025-04-07T17:50:25.101917Z", "shell.execute_reply": "2025-04-07T17:50:25.101643Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "class DNAmFitAgeGaitM(pyagingModel):\n", " def __init__(self):\n", " super().__init__()\n", "\n", " def preprocess(self, x):\n", " return x\n", " \n", " def postprocess(self, x):\n", " return x\n", "\n" ] } ], "source": [ "def print_entire_class(cls):\n", " source = inspect.getsource(cls)\n", " print(source)\n", "\n", "print_entire_class(pya.models.DNAmFitAgeGaitM)" ] }, { "cell_type": "code", "execution_count": 20, "id": "914a94cf-bf6c-4b9d-862a-a2787842e07e", "metadata": { "execution": { "iopub.execute_input": "2025-04-07T17:50:25.103160Z", "iopub.status.busy": "2025-04-07T17:50:25.103071Z", "iopub.status.idle": "2025-04-07T17:50:25.104710Z", "shell.execute_reply": "2025-04-07T17:50:25.104466Z" } }, "outputs": [], "source": [ "model = pya.models.DNAmFitAgeGaitM()" ] }, { "cell_type": "markdown", "id": "51f8615e-01fa-4aa5-b196-3ee2b35d261c", "metadata": {}, "source": [ "## Define clock metadata" ] }, { "cell_type": "code", "execution_count": 21, "id": "6609d6dc-c0a0-4137-bdf5-9fb31ea85281", "metadata": { "execution": { "iopub.execute_input": "2025-04-07T17:50:25.105997Z", "iopub.status.busy": "2025-04-07T17:50:25.105908Z", "iopub.status.idle": "2025-04-07T17:50:25.107874Z", "shell.execute_reply": "2025-04-07T17:50:25.107633Z" } }, "outputs": [], "source": [ "model.metadata[\"clock_name\"] = \"dnamfitagegaitm\"\n", "model.metadata[\"data_type\"] = \"DNA methylation\" # Paper: Blood DNA methylation was used to develop the fitness biomarkers.\n", "model.metadata[\"species\"] = \"Homo sapiens\" # Paper: The development cohorts were human adult studies (FHS, BLSA, and Budapest).\n", "model.metadata[\"year\"] = 2023\n", "model.metadata[\"approved_by_author\"] = \"⌛\"\n", "model.metadata[\"citation\"] = \"McGreevy, K. M., et al. “DNAmFitAge: biological age indicator incorporating physical fitness.” Aging 15(10): 3904–3938 (2023).\"\n", "model.metadata[\"doi\"] = \"https://doi.org/10.18632/aging.204538\"\n", "model.metadata[\"notes\"] = \"Male-specific blood DNAm gait-speed estimator without chronological age as an input.\"\n", "model.metadata[\"research_only\"] = None\n", "model.metadata[\"tissue\"] = [\"whole blood\"] # Paper: The biomarkers were developed from blood DNAm data.\n", "model.metadata[\"predicts\"] = [\"gait speed\"] # Paper: The algorithms generate DNAmGaitspeed, DNAmGripmax, or DNAmVO2max estimates in the corresponding physical-fitness scale.\n", "model.metadata[\"training_target\"] = [\"gait speed\"] # Paper: The directly measured fitness parameter was the dependent variable in LASSO regression.\n", "model.metadata[\"unit\"] = [\"meters per second\"] # Paper: Gait speed is measured in m/s, grip force in kg, and VO2max in mL/kg/min.\n", "model.metadata[\"model_type\"] = \"LASSO regression\" # Paper: Each fitness DNAm biomarker was developed using LASSO penalized regression with ten-fold cross-validation.\n", "model.metadata[\"platform\"] = [\"Illumina 450K\"] # Paper: The reported fitness CpG background and fitted loci were on the 450K array.\n", "model.metadata[\"population\"] = \"adult men\" # Paper: The male gait-speed model was fit separately in adult men from the FHS, BLSA, and Budapest development cohorts.\n", "model.metadata[\"journal\"] = \"Aging\"\n", "model.metadata[\"last_author\"] = \"Steve Horvath\"\n", "model.metadata[\"n_features\"] = 59\n", "model.metadata[\"citations\"] = 99\n", "model.metadata[\"citations_date\"] = \"2026-07-05\"\n" ] }, { "cell_type": "markdown", "id": "74492239-5aae-4026-9d90-6bc9c574c110", "metadata": {}, "source": [ "## Download clock dependencies" ] }, { "cell_type": "markdown", "id": "7bec474f-80ce-4884-9472-30c193327117", "metadata": {}, "source": [ "#### Download GitHub repository" ] }, { "cell_type": "code", "execution_count": 22, "id": "aa4a1b59-dda3-4ea8-8f34-b3c53ecbc310", "metadata": { "execution": { "iopub.execute_input": "2025-04-07T17:50:25.109229Z", "iopub.status.busy": "2025-04-07T17:50:25.109147Z", "iopub.status.idle": "2025-04-07T17:50:25.651487Z", "shell.execute_reply": "2025-04-07T17:50:25.650965Z" } }, "outputs": [ { "data": { "text/plain": [ "0" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "github_url = \"https://github.com/kristenmcgreevy/DNAmFitAge.git\"\n", "github_folder_name = github_url.split('/')[-1].split('.')[0]\n", "os.system(f\"git clone {github_url}\")" ] }, { "cell_type": "markdown", "id": "6bd15521-363f-4029-99ff-9f0b2ae0ed2e", "metadata": {}, "source": [ "#### Download from R package" ] }, { "cell_type": "code", "execution_count": 23, "id": "f1f9bbe4-cfc8-494c-b910-c96da88afb2b", "metadata": { "execution": { "iopub.execute_input": "2025-04-07T17:50:25.653928Z", "iopub.status.busy": "2025-04-07T17:50:25.653723Z", "iopub.status.idle": "2025-04-07T17:50:25.657586Z", "shell.execute_reply": "2025-04-07T17:50:25.657192Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Writing download.r\n" ] } ], "source": [ "%%writefile download.r\n", "\n", "options(repos = c(CRAN = \"https://cloud.r-project.org/\"))\n", "library(jsonlite)\n", "\n", "DNAmFitnessModels <- readRDS(\"DNAmFitAge/DNAmFitnessModelsandFitAge_Oct2022.rds\")\n", "\n", "AllCpGs <- DNAmFitnessModels$AllCpGs\n", "write_json(AllCpGs, \"AllCpGs.json\")\n", "\n", "MaleMedians <- DNAmFitnessModels$Male_Medians_All\n", "write.csv(MaleMedians, \"MaleMedians.csv\")\n", "FemaleMedians <- DNAmFitnessModels$Female_Medians_All\n", "write.csv(FemaleMedians, \"FemaleMedians.csv\")\n", "\n", "Gait_noAge_Females <- DNAmFitnessModels$Gait_noAge_Females\n", "Gait_noAge_Males <- DNAmFitnessModels$Gait_noAge_Males\n", "Grip_noAge_Females <- DNAmFitnessModels$Grip_noAge_Females\n", "Grip_noAge_Males <- DNAmFitnessModels$Grip_noAge_Males\n", "VO2maxModel <- DNAmFitnessModels$VO2maxModel\n", "write.csv(Gait_noAge_Females, \"Gait_noAge_Females.csv\")\n", "write.csv(Gait_noAge_Males, \"Gait_noAge_Males.csv\")\n", "write.csv(Grip_noAge_Females, \"Grip_noAge_Females.csv\")\n", "write.csv(Grip_noAge_Males, \"Grip_noAge_Males.csv\")\n", "write.csv(VO2maxModel, \"VO2maxModel.csv\")" ] }, { "cell_type": "code", "execution_count": 24, "id": "f1965587-a6ac-47ce-bd7a-bb98ca1d91b5", "metadata": { "execution": { "iopub.execute_input": "2025-04-07T17:50:25.659496Z", "iopub.status.busy": "2025-04-07T17:50:25.659322Z", "iopub.status.idle": "2025-04-07T17:50:27.279878Z", "shell.execute_reply": "2025-04-07T17:50:27.279562Z" } }, "outputs": [ { "data": { "text/plain": [ "0" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "os.system(\"Rscript download.r\")" ] }, { "cell_type": "markdown", "id": "5035b180-3d1b-4432-8ebe-b9c92bd93a7f", "metadata": {}, "source": [ "## Load features" ] }, { "cell_type": "markdown", "id": "d8025ed7-0013-419b-8cb5-1a2db98f9eba", "metadata": {}, "source": [ "#### From JSON file" ] }, { "cell_type": "code", "execution_count": 25, "id": "c0b63afa", "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", "
termstepestimatelambdadev.ratiofeaturecoefficient
1(Intercept)13.1825280.050.291034(Intercept)3.182528
2cg0488588110.1023600.050.291034cg048858810.102360
3cg0313272910.0875350.050.291034cg031327290.087535
4cg2202661610.3124900.050.291034cg220266160.312490
5cg188159431-0.2812000.050.291034cg18815943-0.281200
\n", "
" ], "text/plain": [ " term step estimate lambda dev.ratio feature coefficient\n", "1 (Intercept) 1 3.182528 0.05 0.291034 (Intercept) 3.182528\n", "2 cg04885881 1 0.102360 0.05 0.291034 cg04885881 0.102360\n", "3 cg03132729 1 0.087535 0.05 0.291034 cg03132729 0.087535\n", "4 cg22026616 1 0.312490 0.05 0.291034 cg22026616 0.312490\n", "5 cg18815943 1 -0.281200 0.05 0.291034 cg18815943 -0.281200" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df = pd.read_csv('Gait_noAge_Males.csv', index_col=0)\n", "df['feature'] = df['term']\n", "df['coefficient'] = df['estimate']\n", "model.features = df['feature'][1:].tolist()\n", "df.head()" ] }, { "cell_type": "markdown", "id": "ee6d8fa0-4767-4c45-9717-eb1c95e2ddc0", "metadata": {}, "source": [ "## Load weights into base model" ] }, { "cell_type": "code", "execution_count": 27, "id": "8d58875d", "metadata": {}, "outputs": [], "source": [ "weights = torch.tensor(df['coefficient'][1:].tolist()).unsqueeze(0)\n", "intercept = torch.tensor([df['coefficient'].iloc[0]])" ] }, { "cell_type": "markdown", "id": "69901c2b-9584-4de3-a642-ddb6b43d923a", "metadata": {}, "source": [ "#### Linear model" ] }, { "cell_type": "code", "execution_count": 28, "id": "5fb10110-a89a-4caa-a62a-59899ebccd23", "metadata": { "execution": { "iopub.execute_input": "2025-04-07T17:50:27.292804Z", "iopub.status.busy": "2025-04-07T17:50:27.292717Z", "iopub.status.idle": "2025-04-07T17:50:27.302996Z", "shell.execute_reply": "2025-04-07T17:50:27.302732Z" } }, "outputs": [], "source": [ "base_model = pya.models.LinearModel(input_dim=len(model.features))\n", "\n", "base_model.linear.weight.data = weights.float()\n", "base_model.linear.bias.data = intercept.float()\n", "\n", "model.base_model = base_model" ] }, { "cell_type": "markdown", "id": "ad8b4c1d-9d57-48b7-9a30-bcfea7b747b1", "metadata": {}, "source": [ "## Load reference values" ] }, { "cell_type": "markdown", "id": "f7fdae64-096a-4640-ade7-6a17b78a01d5", "metadata": {}, "source": [ "#### From CSV file" ] }, { "cell_type": "code", "execution_count": 29, "id": "e1dc004f-06b7-4e24-a937-00736e93765f", "metadata": { "execution": { "iopub.execute_input": "2025-04-07T17:50:27.308644Z", "iopub.status.busy": "2025-04-07T17:50:27.308553Z", "iopub.status.idle": "2025-04-07T17:50:27.323332Z", "shell.execute_reply": "2025-04-07T17:50:27.323061Z" } }, "outputs": [], "source": [ "reference_df = pd.read_csv('MaleMedians.csv', index_col=0)\n", "model.reference_values = list(reference_df.loc[1, model.features])" ] }, { "cell_type": "markdown", "id": "af3bcf7b-74a8-4d21-9ccb-4de0c2b0516b", "metadata": {}, "source": [ "## Load preprocess and postprocess objects" ] }, { "cell_type": "code", "execution_count": 30, "id": "79a1b3a2-00f1-42b1-9fcd-f919343391d7", "metadata": { "execution": { "iopub.execute_input": "2025-04-07T17:50:27.324794Z", "iopub.status.busy": "2025-04-07T17:50:27.324706Z", "iopub.status.idle": "2025-04-07T17:50:27.326219Z", "shell.execute_reply": "2025-04-07T17:50:27.325910Z" } }, "outputs": [], "source": [ "model.preprocess_name = None\n", "model.preprocess_dependencies = None" ] }, { "cell_type": "code", "execution_count": 31, "id": "ff4a21cb-cf41-44dc-9ed1-95cf8aa15772", "metadata": { "execution": { "iopub.execute_input": "2025-04-07T17:50:27.327714Z", "iopub.status.busy": "2025-04-07T17:50:27.327614Z", "iopub.status.idle": "2025-04-07T17:50:27.329350Z", "shell.execute_reply": "2025-04-07T17:50:27.329050Z" } }, "outputs": [], "source": [ "model.postprocess_name = None\n", "model.postprocess_dependencies = None" ] }, { "cell_type": "markdown", "id": "86e3d6b1-e67e-4f3d-bd39-0ebec5726c3c", "metadata": {}, "source": [ "## Check all clock parameters" ] }, { "cell_type": "code", "execution_count": 32, "id": "2168355c-47d9-475d-b816-49f65e74887c", "metadata": { "execution": { "iopub.execute_input": "2025-04-07T17:50:27.330820Z", "iopub.status.busy": "2025-04-07T17:50:27.330730Z", "iopub.status.idle": "2025-04-07T17:50:27.336089Z", "shell.execute_reply": "2025-04-07T17:50:27.335809Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "%==================================== Model Details ====================================%\n", "Model Attributes:\n", "\n", "training: True\n", "metadata: {'approved_by_author': '⌛',\n", " 'citation': 'McGreevy, Kristen M., et al. \"DNAmFitAge: biological age '\n", " 'indicator incorporating physical fitness.\" Aging (Albany NY) '\n", " '15.10 (2023): 3904.',\n", " 'clock_name': 'dnamfitagegaitm',\n", " 'data_type': 'methylation',\n", " 'doi': 'https://doi.org/10.18632/aging.204538',\n", " 'notes': 'Reference values is mean between male and female training medians',\n", " 'research_only': None,\n", " 'species': 'Homo sapiens',\n", " 'version': None,\n", " 'year': 2023}\n", "reference_values: [0.42897495438465, 0.427655899021578, 0.129543495979192, 0.0316529198839327, 0.891633191357651, 0.0510565986500869, 0.396680844434307, 0.0754576359559242, 0.0777325149718022, 0.57735864652422, 0.461950512034599, 0.640052611552163, 0.0357628260832642, 0.24380932807525, 0.347401519318085, 0.0242175139352825, 0.752622910167749, 0.106453050021963, 0.184161373839444, 0.351499719560921, 0.0852183694652447, 0.135559493498925, 0.199226615813068, 0.923895962305445, 0.0153839328933658, 0.497078652018113, 0.267884547076273, 0.610592457564437, 0.935811367138778, 0.784755049673597]... [Total elements: 59]\n", "preprocess_name: None\n", "preprocess_dependencies: None\n", "postprocess_name: None\n", "postprocess_dependencies: None\n", "features: ['cg04885881', 'cg03132729', 'cg22026616', 'cg18815943', 'cg21912203', 'cg14508615', 'cg18933331', 'cg06975196', 'cg14514751', 'cg24361098', 'cg25705148', 'cg22454769', 'ch.2.105901354F', 'cg00481951', 'cg02699218', 'cg03135515', 'cg16867657', 'cg04424621', 'cg12753631', 'cg25325512', 'cg17722319', 'cg18568843', 'cg18691434', 'cg18537063', 'cg21186299', 'cg00716277', 'cg13337658', 'cg14837598', 'cg15276922', 'cg18148156']... [Total elements: 59]\n", "base_model_features: None\n", "\n", "%==================================== Model Details ====================================%\n", "Model Structure:\n", "\n", "base_model: LinearModel(\n", " (linear): Linear(in_features=59, out_features=1, bias=True)\n", ")\n", "\n", "%==================================== Model Details ====================================%\n", "Model Parameters and Weights:\n", "\n", "base_model.linear.weight: [0.10235995799303055, 0.08753516525030136, 0.3124901354312897, -0.28120002150535583, -0.3208324611186981, 0.24479524791240692, 0.05682919919490814, 0.21363066136837006, -0.3853186368942261, -0.038501303642988205, -0.0023554968647658825, -0.17415688931941986, 0.05159717798233032, -0.5185700058937073, -0.04655730724334717, -0.19074112176895142, -0.21096128225326538, 0.011959427036345005, 0.1078566312789917, 0.0770212784409523, 0.18820391595363617, 0.43347951769828796, -0.13240143656730652, 0.021351546049118042, -0.12319610267877579, -0.010150707326829433, -0.007736711762845516, 0.13240836560726166, -1.1829639673233032, -0.10984379798173904]... [Tensor of shape torch.Size([1, 59])]\n", "base_model.linear.bias: tensor([3.1825])\n", "\n", "%==================================== Model Details ====================================%\n", "\n" ] } ], "source": [ "pya.utils.print_model_details(model)" ] }, { "cell_type": "markdown", "id": "986d0262-e0c7-4036-b687-dee53ba392fb", "metadata": {}, "source": [ "## Basic test" ] }, { "cell_type": "code", "execution_count": 33, "id": "352cffb0-c5a8-4c82-8f61-fce35baf5a22", "metadata": { "execution": { "iopub.execute_input": "2025-04-07T17:50:27.337690Z", "iopub.status.busy": "2025-04-07T17:50:27.337490Z", "iopub.status.idle": "2025-04-07T17:50:27.346106Z", "shell.execute_reply": "2025-04-07T17:50:27.345820Z" } }, "outputs": [ { "data": { "text/plain": [ "tensor([[4.2823],\n", " [2.2886],\n", " [5.0413],\n", " [6.9544],\n", " [4.7673],\n", " [3.0174],\n", " [2.6717],\n", " [2.2410],\n", " [3.8598],\n", " [2.9635]], dtype=torch.float64, grad_fn=)" ] }, "execution_count": 33, "metadata": {}, "output_type": "execute_result" } ], "source": [ "torch.manual_seed(42)\n", "input = torch.randn(10, len(model.features), dtype=float)\n", "model.eval()\n", "model.to(float)\n", "pred = model(input)\n", "pred" ] }, { "cell_type": "markdown", "id": "fe8299d7-9285-4e22-82fd-b664434b4369", "metadata": {}, "source": [ "## Save torch model" ] }, { "cell_type": "code", "execution_count": 34, "id": "0c3a2d80-1b5f-458a-926c-cbc0aa9416e1", "metadata": { "execution": { "iopub.execute_input": "2025-04-07T17:50:27.347459Z", "iopub.status.busy": "2025-04-07T17:50:27.347364Z", "iopub.status.idle": "2025-04-07T17:50:27.350847Z", "shell.execute_reply": "2025-04-07T17:50:27.350573Z" } }, "outputs": [], "source": [ "torch.save(model, f\"../weights/{model.metadata['clock_name']}.pt\")" ] }, { "cell_type": "markdown", "id": "bac6257b-8d08-4a90-8d0b-7f745dc11ac1", "metadata": {}, "source": [ "## Clear directory\n", "" ] }, { "cell_type": "code", "execution_count": 35, "id": "11aeaa70-44c0-42f9-86d7-740e3849a7a6", "metadata": { "execution": { "iopub.execute_input": "2025-04-07T17:50:27.352136Z", "iopub.status.busy": "2025-04-07T17:50:27.352040Z", "iopub.status.idle": "2025-04-07T17:50:27.360420Z", "shell.execute_reply": "2025-04-07T17:50:27.360132Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Deleted file: Grip_noAge_Females.csv\n", "Deleted file: Grip_noAge_Males.csv\n", "Deleted file: Gait_noAge_Females.csv\n", "Deleted file: VO2maxModel.csv\n", "Deleted file: AllCpGs.json\n", "Deleted file: Gait_noAge_Males.csv\n", "Deleted folder: DNAmFitAge\n", "Deleted file: download.r\n", "Deleted file: FemaleMedians.csv\n", "Deleted file: MaleMedians.csv\n" ] } ], "source": [ "# Function to remove a folder and all its contents\n", "def remove_folder(path):\n", " try:\n", " shutil.rmtree(path)\n", " print(f\"Deleted folder: {path}\")\n", " except Exception as e:\n", " print(f\"Error deleting folder {path}: {e}\")\n", "\n", "# Get a list of all files and folders in the current directory\n", "all_items = os.listdir('.')\n", "\n", "# Loop through the items\n", "for item in all_items:\n", " # Check if it's a file and does not end with .ipynb\n", " if os.path.isfile(item) and not item.endswith('.ipynb'):\n", " os.remove(item)\n", " print(f\"Deleted file: {item}\")\n", " # Check if it's a folder\n", " elif os.path.isdir(item):\n", " remove_folder(item)" ] } ], "metadata": { "kernelspec": { "display_name": "research", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.7" } }, "nbformat": 4, "nbformat_minor": 5 }