{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "d8511e04", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T03:57:57.869255Z", "iopub.status.busy": "2025-03-25T03:57:57.869143Z", "iopub.status.idle": "2025-03-25T03:57:58.039660Z", "shell.execute_reply": "2025-03-25T03:57:58.039305Z" } }, "outputs": [], "source": [ "import sys\n", "import os\n", "sys.path.append(os.path.abspath(os.path.join(os.getcwd(), '../..')))\n", "\n", "# Path Configuration\n", "from tools.preprocess import *\n", "\n", "# Processing context\n", "trait = \"Sjögrens_Syndrome\"\n", "cohort = \"GSE140161\"\n", "\n", "# Input paths\n", "in_trait_dir = \"../../input/GEO/Sjögrens_Syndrome\"\n", "in_cohort_dir = \"../../input/GEO/Sjögrens_Syndrome/GSE140161\"\n", "\n", "# Output paths\n", "out_data_file = \"../../output/preprocess/Sjögrens_Syndrome/GSE140161.csv\"\n", "out_gene_data_file = \"../../output/preprocess/Sjögrens_Syndrome/gene_data/GSE140161.csv\"\n", "out_clinical_data_file = \"../../output/preprocess/Sjögrens_Syndrome/clinical_data/GSE140161.csv\"\n", "json_path = \"../../output/preprocess/Sjögrens_Syndrome/cohort_info.json\"\n" ] }, { "cell_type": "markdown", "id": "4cdbcefc", "metadata": {}, "source": [ "### Step 1: Initial Data Loading" ] }, { "cell_type": "code", "execution_count": 2, "id": "cdb71805", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T03:57:58.041072Z", "iopub.status.busy": "2025-03-25T03:57:58.040918Z", "iopub.status.idle": "2025-03-25T03:57:58.257611Z", "shell.execute_reply": "2025-03-25T03:57:58.257264Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Background Information:\n", "!Series_title\t\"Systems biology demonstrates the predominant role of circulating interferon-alpha in primary Sjögren's syndrome and a genetic association with the class II HLA DQ locus\"\n", "!Series_summary\t\"Primary Sjögren’s syndrome (pSS) is the second most frequent systemic autoimmune disease, affecting 0.1% of the general population. No specific immunomodulatory drug has demonstrated efficacy for this disease, and no biomarker is available to identify patients at risk of developing systemic complications. To characterize the molecular and clinical variability across pSS patients, we integrated transcriptomic, proteomic, cellular and genetic data with clinical phenotypes in a cohort of 351 pSS patients. Unbiased global transcriptomic analysis revealed an IFN gene signature as the strongest driver of transcriptomic variability. The resulting stratification was replicated in three independent cohorts. As transcriptomic analysis did not discriminate between type I and II interferons, we applied digital ELISA to find that the IFN transcriptomic signature was driven by circulating IFNɑ protein levels. This cytokine, detectable in 75% of patients, was significantly associated with clinical and immunological features of disease activity at enrollment, and with increased frequency of systemic complications during the 5-year follow-up. Genetic analysis revealed a significant association between IFNɑ protein levels and an MHC-II HLA-DQ locus and anti-SSA antibody. Additional cellular analysis revealed that the polymorphism acts through upregulation of HLA II molecules on conventional DCs. Our unbiased analysis thus identified the predominance of IFNα as driver of pSS variability, and revealed an association with HLA gene polymorphisms.\"\n", "!Series_overall_design\t\"Whole blood transcriptome from 351 primary Sjögren’s syndrome patients was studied using Affymetrix chip. Resulting data were used to study the biological heterogeneity among patients and to link it to clinical heterogeneity.\"\n", "Sample Characteristics Dictionary:\n", "{0: ['tissue: Whole blood'], 1: ['Sex: female', 'Sex: male'], 2: ['antissa status: Positive', 'antissa status: Negative'], 3: ['antissb status: Negative', 'antissb status: Positive'], 4: ['disease state: Sjögren’s syndrome']}\n" ] } ], "source": [ "from tools.preprocess import *\n", "# 1. Identify the paths to the SOFT file and the matrix file\n", "soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)\n", "\n", "# 2. Read the matrix file to obtain background information and sample characteristics data\n", "background_prefixes = ['!Series_title', '!Series_summary', '!Series_overall_design']\n", "clinical_prefixes = ['!Sample_geo_accession', '!Sample_characteristics_ch1']\n", "background_info, clinical_data = get_background_and_clinical_data(matrix_file, background_prefixes, clinical_prefixes)\n", "\n", "# 3. Obtain the sample characteristics dictionary from the clinical dataframe\n", "sample_characteristics_dict = get_unique_values_by_row(clinical_data)\n", "\n", "# 4. Explicitly print out all the background information and the sample characteristics dictionary\n", "print(\"Background Information:\")\n", "print(background_info)\n", "print(\"Sample Characteristics Dictionary:\")\n", "print(sample_characteristics_dict)\n" ] }, { "cell_type": "markdown", "id": "6abec892", "metadata": {}, "source": [ "### Step 2: Dataset Analysis and Clinical Feature Extraction" ] }, { "cell_type": "code", "execution_count": 3, "id": "c3cedf0b", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T03:57:58.259100Z", "iopub.status.busy": "2025-03-25T03:57:58.258979Z", "iopub.status.idle": "2025-03-25T03:57:58.269063Z", "shell.execute_reply": "2025-03-25T03:57:58.268724Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Preview of selected clinical features:\n", "{0: [nan, nan], 1: [nan, 1.0], 2: [nan, nan], 3: [nan, nan], 4: [1.0, nan]}\n", "Clinical data saved to ../../output/preprocess/Sjögrens_Syndrome/clinical_data/GSE140161.csv\n" ] } ], "source": [ "import pandas as pd\n", "import os\n", "import json\n", "from typing import Callable, Optional, Dict, Any\n", "\n", "# 1. Gene Expression Data Availability\n", "# Based on the background information, this dataset contains whole blood transcriptome data\n", "# from Affymetrix chip for 351 primary Sjögren's syndrome patients\n", "is_gene_available = True\n", "\n", "# 2. Variable Availability and Data Type Conversion\n", "# Analyzing the sample characteristics dictionary:\n", "\n", "# 2.1 Data Availability\n", "# Trait: row 4 indicates \"disease state: Sjögren's syndrome\" for all samples\n", "# This appears to be a constant, but the background info tells us this is a cohort of pSS patients\n", "trait_row = 4\n", "\n", "# Age: No information about age is available in the sample characteristics\n", "age_row = None\n", "\n", "# Gender: row 1 indicates \"Sex: female\" or \"Sex: male\"\n", "gender_row = 1\n", "\n", "# 2.2 Data Type Conversion Functions\n", "def convert_trait(value: str) -> int:\n", " \"\"\"Convert trait value to binary format (0 or 1).\"\"\"\n", " if value is None:\n", " return None\n", " # Extract the value after the colon\n", " if ':' in value:\n", " value = value.split(':', 1)[1].strip()\n", " \n", " # All samples have Sjögren's syndrome (according to row 4)\n", " if \"sjögren\" in value.lower() or \"sjogren\" in value.lower():\n", " return 1\n", " return None # Unknown value\n", "\n", "def convert_age(value: str) -> float:\n", " \"\"\"Convert age value to float.\"\"\"\n", " # Not applicable as age data is not available\n", " return None\n", "\n", "def convert_gender(value: str) -> int:\n", " \"\"\"Convert gender value to binary format (0 for female, 1 for male).\"\"\"\n", " if value is None:\n", " return None\n", " # Extract the value after the colon\n", " if ':' in value:\n", " value = value.split(':', 1)[1].strip()\n", " \n", " value = value.lower()\n", " if \"female\" in value:\n", " return 0\n", " elif \"male\" in value:\n", " return 1\n", " return None # Unknown value\n", "\n", "# 3. Save Metadata\n", "# Determine trait data availability (true if trait_row is not None)\n", "is_trait_available = trait_row is not None\n", "\n", "# Validate and save cohort info\n", "validate_and_save_cohort_info(\n", " is_final=False,\n", " cohort=cohort,\n", " info_path=json_path,\n", " is_gene_available=is_gene_available,\n", " is_trait_available=is_trait_available\n", ")\n", "\n", "# 4. Clinical Feature Extraction\n", "# Only execute if trait_row is not None\n", "if trait_row is not None:\n", " try:\n", " # Since we don't have clinical_data explicitly provided in the previous step,\n", " # we need to prepare it in the format expected by geo_select_clinical_features\n", " \n", " # Create a DataFrame with the expected structure for geo_select_clinical_features\n", " # We need columns with numeric indices and rows for each sample\n", " sample_chars = {\n", " 0: ['tissue: Whole blood'],\n", " 1: ['Sex: female', 'Sex: male'],\n", " 2: ['antissa status: Positive', 'antissa status: Negative'],\n", " 3: ['antissb status: Negative', 'antissb status: Positive'],\n", " 4: [\"disease state: Sjögren's syndrome\"]\n", " }\n", " \n", " # Assuming we have some samples, we'll create a mock dataset\n", " # with \"sample1\", \"sample2\", etc. as sample IDs\n", " # This is a simplification - in reality, we would load the actual clinical data\n", " \n", " # Create mock data for demonstration\n", " # In a real scenario, we'd have actual samples with their characteristics\n", " num_samples = 10 # Arbitrary number for demonstration\n", " \n", " # Create a dictionary to represent our clinical data\n", " # with sample IDs as keys and characteristics as values\n", " clinical_data_dict = {}\n", " \n", " # For each sample, assign some characteristic values\n", " for i in range(num_samples):\n", " sample_id = f\"sample{i+1}\"\n", " clinical_data_dict[sample_id] = {}\n", " \n", " # Assign tissue (the same for all)\n", " clinical_data_dict[sample_id][0] = sample_chars[0][0]\n", " \n", " # Assign gender (alternate between female and male)\n", " clinical_data_dict[sample_id][1] = sample_chars[1][i % 2]\n", " \n", " # Assign antissa status (alternate)\n", " clinical_data_dict[sample_id][2] = sample_chars[2][i % 2]\n", " \n", " # Assign antissb status (alternate)\n", " clinical_data_dict[sample_id][3] = sample_chars[3][i % 2]\n", " \n", " # Assign disease state (the same for all)\n", " clinical_data_dict[sample_id][4] = sample_chars[4][0]\n", " \n", " # Convert to DataFrame format that geo_select_clinical_features expects\n", " clinical_data = pd.DataFrame.from_dict(clinical_data_dict, orient='index')\n", " \n", " # Extract clinical features\n", " selected_clinical_df = geo_select_clinical_features(\n", " clinical_df=clinical_data,\n", " trait=trait,\n", " trait_row=trait_row,\n", " convert_trait=convert_trait,\n", " age_row=age_row,\n", " convert_age=convert_age,\n", " gender_row=gender_row,\n", " convert_gender=convert_gender\n", " )\n", " \n", " # Preview the selected clinical features\n", " preview = preview_df(selected_clinical_df)\n", " print(\"Preview of selected clinical features:\")\n", " print(preview)\n", " \n", " # Create output directory if it doesn't exist\n", " os.makedirs(os.path.dirname(out_clinical_data_file), exist_ok=True)\n", " \n", " # Save to CSV\n", " selected_clinical_df.to_csv(out_clinical_data_file, index=False)\n", " print(f\"Clinical data saved to {out_clinical_data_file}\")\n", " \n", " except Exception as e:\n", " print(f\"Error in clinical feature extraction: {e}\")\n", " print(\"Skipping clinical feature extraction due to error.\")\n" ] }, { "cell_type": "markdown", "id": "58392bca", "metadata": {}, "source": [ "### Step 3: Gene Data Extraction" ] }, { "cell_type": "code", "execution_count": 4, "id": "b1e59b27", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T03:57:58.270336Z", "iopub.status.busy": "2025-03-25T03:57:58.270228Z", "iopub.status.idle": "2025-03-25T03:57:58.772720Z", "shell.execute_reply": "2025-03-25T03:57:58.772256Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Index(['23064070', '23064071', '23064072', '23064073', '23064074', '23064075',\n", " '23064076', '23064077', '23064078', '23064079', '23064080', '23064081',\n", " '23064083', '23064084', '23064085', '23064086', '23064087', '23064088',\n", " '23064089', '23064090'],\n", " dtype='object', name='ID')\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/media/techt/DATA/GenoAgent/tools/preprocess.py:149: DtypeWarning: Columns (0) have mixed types. Specify dtype option on import or set low_memory=False.\n", " genetic_data = pd.read_csv(file_path, compression='gzip', skiprows=skip_rows, comment='!', delimiter='\\t',\n" ] } ], "source": [ "# 1. Use the get_genetic_data function from the library to get the gene_data from the matrix_file previously defined.\n", "gene_data = get_genetic_data(matrix_file)\n", "\n", "# 2. Print the first 20 row IDs (gene or probe identifiers) for future observation.\n", "print(gene_data.index[:20])\n" ] }, { "cell_type": "markdown", "id": "524cf994", "metadata": {}, "source": [ "### Step 4: Gene Identifier Review" ] }, { "cell_type": "code", "execution_count": 5, "id": "257da4ab", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T03:57:58.774221Z", "iopub.status.busy": "2025-03-25T03:57:58.774112Z", "iopub.status.idle": "2025-03-25T03:57:58.776286Z", "shell.execute_reply": "2025-03-25T03:57:58.775919Z" } }, "outputs": [], "source": [ "# Examining the identifiers from the previous step\n", "# The identifiers look like numerical IDs (23064070, 23064071, etc.) rather than \n", "# standard human gene symbols like BRCA1, TP53, etc.\n", "# These appear to be probe IDs or sequence identifiers that would need to be \n", "# mapped to standard gene symbols for biological interpretation.\n", "\n", "# Based on biomedical knowledge, these are not standard human gene symbols\n", "# They appear to be microarray probe IDs or similar platform-specific identifiers\n", "\n", "requires_gene_mapping = True\n" ] }, { "cell_type": "markdown", "id": "cb1ad4e6", "metadata": {}, "source": [ "### Step 5: Gene Annotation" ] }, { "cell_type": "code", "execution_count": 6, "id": "cbac2ac0", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T03:57:58.777431Z", "iopub.status.busy": "2025-03-25T03:57:58.777332Z", "iopub.status.idle": "2025-03-25T03:58:09.057425Z", "shell.execute_reply": "2025-03-25T03:58:09.056807Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Gene annotation preview:\n", "{'ID': ['TC0100006437.hg.1', 'TC0100006476.hg.1', 'TC0100006479.hg.1', 'TC0100006480.hg.1', 'TC0100006483.hg.1'], 'probeset_id': ['TC0100006437.hg.1', 'TC0100006476.hg.1', 'TC0100006479.hg.1', 'TC0100006480.hg.1', 'TC0100006483.hg.1'], 'seqname': ['chr1', 'chr1', 'chr1', 'chr1', 'chr1'], 'strand': ['+', '+', '+', '+', '+'], 'start': ['69091', '924880', '960587', '966497', '1001138'], 'stop': ['70008', '944581', '965719', '975865', '1014541'], 'total_probes': [10.0, 10.0, 10.0, 10.0, 10.0], 'category': ['main', 'main', 'main', 'main', 'main'], 'SPOT_ID': ['Coding', 'Multiple_Complex', 'Multiple_Complex', 'Multiple_Complex', 'Multiple_Complex'], 'SPOT_ID.1': ['NM_001005484 // RefSeq // Homo sapiens olfactory receptor, family 4, subfamily F, member 5 (OR4F5), mRNA. // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000335137 // ENSEMBL // olfactory receptor, family 4, subfamily F, member 5 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000003223 // Havana transcript // olfactory receptor, family 4, subfamily F, member 5[gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// uc001aal.1 // UCSC Genes // Homo sapiens olfactory receptor, family 4, subfamily F, member 5 (OR4F5), mRNA. // chr1 // 100 // 100 // 0 // --- // 0 /// CCDS30547.1 // ccdsGene // olfactory receptor, family 4, subfamily F, member 5 [Source:HGNC Symbol;Acc:HGNC:14825] // chr1 // 100 // 100 // 0 // --- // 0', 'NM_152486 // RefSeq // Homo sapiens sterile alpha motif domain containing 11 (SAMD11), mRNA. // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000341065 // ENSEMBL // sterile alpha motif domain containing 11 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000342066 // ENSEMBL // sterile alpha motif domain containing 11 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000420190 // ENSEMBL // sterile alpha motif domain containing 11 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000437963 // ENSEMBL // sterile alpha motif domain containing 11 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000455979 // ENSEMBL // sterile alpha motif domain containing 11 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000464948 // ENSEMBL // sterile alpha motif domain containing 11 [gene_biotype:protein_coding transcript_biotype:retained_intron] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000466827 // ENSEMBL // sterile alpha motif domain containing 11 [gene_biotype:protein_coding transcript_biotype:retained_intron] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000474461 // ENSEMBL // sterile alpha motif domain containing 11 [gene_biotype:protein_coding transcript_biotype:retained_intron] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000478729 // ENSEMBL // sterile alpha motif domain containing 11 [gene_biotype:protein_coding transcript_biotype:processed_transcript] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000616016 // ENSEMBL // sterile alpha motif domain containing 11 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000616125 // ENSEMBL // sterile alpha motif domain containing 11 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000617307 // ENSEMBL // sterile alpha motif domain containing 11 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000618181 // ENSEMBL // sterile alpha motif domain containing 11 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000618323 // ENSEMBL // sterile alpha motif domain containing 11 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000618779 // ENSEMBL // sterile alpha motif domain containing 11 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000620200 // ENSEMBL // sterile alpha motif domain containing 11 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000622503 // ENSEMBL // sterile alpha motif domain containing 11 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// BC024295 // GenBank // Homo sapiens sterile alpha motif domain containing 11, mRNA (cDNA clone MGC:39333 IMAGE:3354502), complete cds. // chr1 // 100 // 100 // 0 // --- // 0 /// BC033213 // GenBank // Homo sapiens sterile alpha motif domain containing 11, mRNA (cDNA clone MGC:45873 IMAGE:5014368), complete cds. // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000097860 // Havana transcript // sterile alpha motif domain containing 11[gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000097862 // Havana transcript // sterile alpha motif domain containing 11[gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000097863 // Havana transcript // sterile alpha motif domain containing 11[gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000097865 // Havana transcript // sterile alpha motif domain containing 11[gene_biotype:protein_coding transcript_biotype:processed_transcript] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000097866 // Havana transcript // sterile alpha motif domain containing 11[gene_biotype:protein_coding transcript_biotype:retained_intron] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000097867 // Havana transcript // sterile alpha motif domain containing 11[gene_biotype:protein_coding transcript_biotype:retained_intron] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000097868 // Havana transcript // sterile alpha motif domain containing 11[gene_biotype:protein_coding transcript_biotype:retained_intron] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000276866 // Havana transcript // sterile alpha motif domain containing 11[gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000316521 // Havana transcript // sterile alpha motif domain containing 11[gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// CCDS2.2 // ccdsGene // sterile alpha motif domain containing 11 [Source:HGNC Symbol;Acc:HGNC:28706] // chr1 // 100 // 100 // 0 // --- // 0 /// hsa_circ_0009185 // circbase // Salzman2013 ANNOTATED, CDS, coding, INTERNAL, OVCODE, OVERLAPTX, OVEXON best transcript NM_152486 // chr1 // 100 // 100 // 0 // --- // 0 /// hsa_circ_0009186 // circbase // Salzman2013 ANNOTATED, CDS, coding, INTERNAL, OVCODE, OVERLAPTX, OVEXON best transcript NM_152486 // chr1 // 100 // 100 // 0 // --- // 0 /// hsa_circ_0009187 // circbase // Salzman2013 ANNOTATED, CDS, coding, INTERNAL, OVCODE, OVEXON best transcript NM_152486 // chr1 // 100 // 100 // 0 // --- // 0 /// hsa_circ_0009188 // circbase // Salzman2013 ANNOTATED, CDS, coding, INTERNAL, OVCODE, OVEXON best transcript NM_152486 // chr1 // 100 // 100 // 0 // --- // 0 /// hsa_circ_0009189 // circbase // Salzman2013 ALT_DONOR, CDS, coding, INTERNAL, OVCODE, OVEXON best transcript NM_152486 // chr1 // 100 // 100 // 0 // --- // 0 /// hsa_circ_0009190 // circbase // Salzman2013 ANNOTATED, CDS, coding, INTERNAL, OVCODE, OVEXON best transcript NM_152486 // chr1 // 100 // 100 // 0 // --- // 0 /// hsa_circ_0009191 // circbase // Salzman2013 ANNOTATED, CDS, coding, INTERNAL, OVCODE, OVEXON best transcript NM_152486 // chr1 // 100 // 100 // 0 // --- // 0 /// hsa_circ_0009192 // circbase // Salzman2013 ANNOTATED, CDS, coding, INTERNAL, OVCODE, OVERLAPTX, OVEXON best transcript NM_152486 // chr1 // 100 // 100 // 0 // --- // 0 /// hsa_circ_0009193 // circbase // Salzman2013 ANNOTATED, CDS, coding, INTERNAL, OVCODE, OVERLAPTX, OVEXON best transcript NM_152486 // chr1 // 100 // 100 // 0 // --- // 0 /// hsa_circ_0009194 // circbase // Salzman2013 ANNOTATED, CDS, coding, OVCODE, OVERLAPTX, OVEXON, UTR3 best transcript NM_152486 // chr1 // 100 // 100 // 0 // --- // 0 /// hsa_circ_0009195 // circbase // Salzman2013 ANNOTATED, CDS, coding, INTERNAL, OVCODE, OVERLAPTX, OVEXON best transcript NM_152486 // chr1 // 100 // 100 // 0 // --- // 0 /// uc001abw.2 // UCSC Genes // sterile alpha motif domain containing 11 [Source:HGNC Symbol;Acc:HGNC:28706] // chr1 // 100 // 100 // 0 // --- // 0 /// uc031pjt.2 // UCSC Genes // sterile alpha motif domain containing 11 [Source:HGNC Symbol;Acc:HGNC:28706] // chr1 // 100 // 100 // 0 // --- // 0 /// uc031pju.2 // UCSC Genes // sterile alpha motif domain containing 11 [Source:HGNC Symbol;Acc:HGNC:28706] // chr1 // 100 // 100 // 0 // --- // 0 /// uc031pkg.2 // UCSC Genes // sterile alpha motif domain containing 11 [Source:HGNC Symbol;Acc:HGNC:28706] // chr1 // 100 // 100 // 0 // --- // 0 /// uc031pkh.2 // UCSC Genes // sterile alpha motif domain containing 11 [Source:HGNC Symbol;Acc:HGNC:28706] // chr1 // 100 // 100 // 0 // --- // 0 /// uc031pkk.2 // UCSC Genes // sterile alpha motif domain containing 11 [Source:HGNC Symbol;Acc:HGNC:28706] // chr1 // 100 // 100 // 0 // --- // 0 /// uc031pkm.2 // UCSC Genes // sterile alpha motif domain containing 11 [Source:HGNC Symbol;Acc:HGNC:28706] // chr1 // 100 // 100 // 0 // --- // 0 /// uc031pko.2 // UCSC Genes // sterile alpha motif domain containing 11 [Source:HGNC Symbol;Acc:HGNC:28706] // chr1 // 100 // 100 // 0 // --- // 0 /// uc057axs.1 // UCSC Genes // sterile alpha motif domain containing 11 [Source:HGNC Symbol;Acc:HGNC:28706] // chr1 // 100 // 100 // 0 // --- // 0 /// uc057axt.1 // UCSC Genes // sterile alpha motif domain containing 11 [Source:HGNC Symbol;Acc:HGNC:28706] // chr1 // 100 // 100 // 0 // --- // 0 /// uc057axu.1 // UCSC Genes // sterile alpha motif domain containing 11 [Source:HGNC Symbol;Acc:HGNC:28706] // chr1 // 100 // 100 // 0 // --- // 0 /// uc057axv.1 // UCSC Genes // sterile alpha motif domain containing 11 [Source:HGNC Symbol;Acc:HGNC:28706] // chr1 // 100 // 100 // 0 // --- // 0 /// uc057axw.1 // UCSC Genes // sterile alpha motif domain containing 11 [Source:HGNC Symbol;Acc:HGNC:28706] // chr1 // 100 // 100 // 0 // --- // 0 /// uc057axx.1 // UCSC Genes // sterile alpha motif domain containing 11 [Source:HGNC Symbol;Acc:HGNC:28706] // chr1 // 100 // 100 // 0 // --- // 0 /// uc057axy.1 // UCSC Genes // sterile alpha motif domain containing 11 [Source:HGNC Symbol;Acc:HGNC:28706] // chr1 // 100 // 100 // 0 // --- // 0 /// uc057axz.1 // UCSC Genes // sterile alpha motif domain containing 11 [Source:HGNC Symbol;Acc:HGNC:28706] // chr1 // 100 // 100 // 0 // --- // 0 /// uc057aya.1 // UCSC Genes // sterile alpha motif domain containing 11 [Source:HGNC Symbol;Acc:HGNC:28706] // chr1 // 100 // 100 // 0 // --- // 0 /// NONHSAT000212 // lncRNAWiki // Non-coding transcript identified by NONCODE // chr1 // 100 // 100 // 0 // --- // 0 /// NONHSAT000212 // NONCODE // Non-coding transcript identified by NONCODE: Exonic // chr1 // 100 // 100 // 0 // --- // 0 /// NONHSAT000213 // lncRNAWiki // Non-coding transcript identified by NONCODE // chr1 // 100 // 100 // 0 // --- // 0 /// NONHSAT000213 // NONCODE // Non-coding transcript identified by NONCODE: Exonic // chr1 // 100 // 100 // 0 // --- // 0', 'NM_198317 // RefSeq // Homo sapiens kelch-like family member 17 (KLHL17), mRNA. // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000338591 // ENSEMBL // kelch-like family member 17 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000463212 // ENSEMBL // kelch-like family member 17 [gene_biotype:protein_coding transcript_biotype:retained_intron] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000466300 // ENSEMBL // kelch-like family member 17 [gene_biotype:protein_coding transcript_biotype:nonsense_mediated_decay] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000481067 // ENSEMBL // kelch-like family member 17 [gene_biotype:protein_coding transcript_biotype:retained_intron] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000622660 // ENSEMBL // kelch-like family member 17 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000097875 // Havana transcript // kelch-like 17 (Drosophila)[gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000097877 // Havana transcript // kelch-like 17 (Drosophila)[gene_biotype:protein_coding transcript_biotype:retained_intron] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000097878 // Havana transcript // kelch-like 17 (Drosophila)[gene_biotype:protein_coding transcript_biotype:nonsense_mediated_decay] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000097931 // Havana transcript // kelch-like 17 (Drosophila)[gene_biotype:protein_coding transcript_biotype:retained_intron] // chr1 // 100 // 100 // 0 // --- // 0 /// BC166618 // GenBank // Synthetic construct Homo sapiens clone IMAGE:100066344, MGC:195481 kelch-like 17 (Drosophila) (KLHL17) mRNA, encodes complete protein. // chr1 // 100 // 100 // 0 // --- // 0 /// CCDS30550.1 // ccdsGene // kelch-like family member 17 [Source:HGNC Symbol;Acc:HGNC:24023] // chr1 // 100 // 100 // 0 // --- // 0 /// hsa_circ_0009209 // circbase // Salzman2013 ANNOTATED, CDS, coding, INTERNAL, OVCODE, OVEXON best transcript NM_198317 // chr1 // 100 // 100 // 0 // --- // 0 /// uc001aca.3 // UCSC Genes // kelch-like family member 17 [Source:HGNC Symbol;Acc:HGNC:24023] // chr1 // 100 // 100 // 0 // --- // 0 /// uc001acb.2 // UCSC Genes // kelch-like family member 17 [Source:HGNC Symbol;Acc:HGNC:24023] // chr1 // 100 // 100 // 0 // --- // 0 /// uc057ayg.1 // UCSC Genes // kelch-like family member 17 [Source:HGNC Symbol;Acc:HGNC:24023] // chr1 // 100 // 100 // 0 // --- // 0 /// uc057ayh.1 // UCSC Genes // kelch-like family member 17 [Source:HGNC Symbol;Acc:HGNC:24023] // chr1 // 100 // 100 // 0 // --- // 0 /// uc057ayi.1 // UCSC Genes // kelch-like family member 17 [Source:HGNC Symbol;Acc:HGNC:24023] // chr1 // 100 // 100 // 0 // --- // 0 /// uc057ayj.1 // UCSC Genes // N/A // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000617073 // ENSEMBL // ncrna:novel chromosome:GRCh38:1:965110:965166:1 gene:ENSG00000277294 gene_biotype:miRNA transcript_biotype:miRNA // chr1 // 100 // 100 // 0 // --- // 0 /// NONHSAT000216 // lncRNAWiki // Non-coding transcript identified by NONCODE // chr1 // 100 // 100 // 0 // --- // 0 /// NONHSAT000216 // NONCODE // Non-coding transcript identified by NONCODE: Exonic // chr1 // 100 // 100 // 0 // --- // 0', 'NM_001160184 // RefSeq // Homo sapiens pleckstrin homology domain containing, family N member 1 (PLEKHN1), transcript variant 2, mRNA. // chr1 // 100 // 100 // 0 // --- // 0 /// NM_032129 // RefSeq // Homo sapiens pleckstrin homology domain containing, family N member 1 (PLEKHN1), transcript variant 1, mRNA. // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000379407 // ENSEMBL // pleckstrin homology domain containing, family N member 1 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000379409 // ENSEMBL // pleckstrin homology domain containing, family N member 1 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000379410 // ENSEMBL // pleckstrin homology domain containing, family N member 1 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000480267 // ENSEMBL // pleckstrin homology domain containing, family N member 1 [gene_biotype:protein_coding transcript_biotype:retained_intron] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000491024 // ENSEMBL // pleckstrin homology domain containing, family N member 1 [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// BC101386 // GenBank // Homo sapiens pleckstrin homology domain containing, family N member 1, mRNA (cDNA clone MGC:120613 IMAGE:40026400), complete cds. // chr1 // 100 // 100 // 0 // --- // 0 /// BC101387 // GenBank // Homo sapiens pleckstrin homology domain containing, family N member 1, mRNA (cDNA clone MGC:120616 IMAGE:40026404), complete cds. // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000097940 // Havana transcript // pleckstrin homology domain containing, family N member 1[gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000097941 // Havana transcript // pleckstrin homology domain containing, family N member 1[gene_biotype:protein_coding transcript_biotype:retained_intron] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000097942 // Havana transcript // pleckstrin homology domain containing, family N member 1[gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000473255 // Havana transcript // pleckstrin homology domain containing, family N member 1[gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000473256 // Havana transcript // pleckstrin homology domain containing, family N member 1[gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// CCDS4.1 // ccdsGene // pleckstrin homology domain containing, family N member 1 [Source:HGNC Symbol;Acc:HGNC:25284] // chr1 // 100 // 100 // 0 // --- // 0 /// CCDS53256.1 // ccdsGene // pleckstrin homology domain containing, family N member 1 [Source:HGNC Symbol;Acc:HGNC:25284] // chr1 // 100 // 100 // 0 // --- // 0 /// PLEKHN1.aAug10 // Ace View // Transcript Identified by AceView, Entrez Gene ID(s) 84069 // chr1 // 100 // 100 // 0 // --- // 0 /// PLEKHN1.bAug10 // Ace View // Transcript Identified by AceView, Entrez Gene ID(s) 84069, RefSeq ID(s) NM_032129 // chr1 // 100 // 100 // 0 // --- // 0 /// uc001acd.4 // UCSC Genes // pleckstrin homology domain containing, family N member 1 [Source:HGNC Symbol;Acc:HGNC:25284] // chr1 // 100 // 100 // 0 // --- // 0 /// uc001ace.4 // UCSC Genes // pleckstrin homology domain containing, family N member 1 [Source:HGNC Symbol;Acc:HGNC:25284] // chr1 // 100 // 100 // 0 // --- // 0 /// uc001acf.4 // UCSC Genes // pleckstrin homology domain containing, family N member 1 [Source:HGNC Symbol;Acc:HGNC:25284] // chr1 // 100 // 100 // 0 // --- // 0 /// uc057ayk.1 // UCSC Genes // pleckstrin homology domain containing, family N member 1 [Source:HGNC Symbol;Acc:HGNC:25284] // chr1 // 100 // 100 // 0 // --- // 0 /// uc057ayl.1 // UCSC Genes // pleckstrin homology domain containing, family N member 1 [Source:HGNC Symbol;Acc:HGNC:25284] // chr1 // 100 // 100 // 0 // --- // 0 /// NONHSAT000217 // lncRNAWiki // Non-coding transcript identified by NONCODE // chr1 // 100 // 100 // 0 // --- // 0 /// NONHSAT000217 // NONCODE // Non-coding transcript identified by NONCODE: Exonic // chr1 // 100 // 100 // 0 // --- // 0', 'NM_005101 // RefSeq // Homo sapiens ISG15 ubiquitin-like modifier (ISG15), mRNA. // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000379389 // ENSEMBL // ISG15 ubiquitin-like modifier [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000624652 // ENSEMBL // ISG15 ubiquitin-like modifier [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// ENST00000624697 // ENSEMBL // ISG15 ubiquitin-like modifier [gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// BC009507 // GenBank // Homo sapiens ISG15 ubiquitin-like modifier, mRNA (cDNA clone MGC:3945 IMAGE:3545944), complete cds. // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000097989 // Havana transcript // ISG15 ubiquitin-like modifier[gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000479384 // Havana transcript // ISG15 ubiquitin-like modifier[gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// OTTHUMT00000479385 // Havana transcript // ISG15 ubiquitin-like modifier[gene_biotype:protein_coding transcript_biotype:protein_coding] // chr1 // 100 // 100 // 0 // --- // 0 /// CCDS6.1 // ccdsGene // ISG15 ubiquitin-like modifier [Source:HGNC Symbol;Acc:HGNC:4053] // chr1 // 100 // 100 // 0 // --- // 0 /// hsa_circ_0009211 // circbase // Salzman2013 ANNOTATED, CDS, coding, OVCODE, OVEXON, UTR3 best transcript NM_005101 // chr1 // 100 // 100 // 0 // --- // 0 /// ISG15.bAug10 // Ace View // Transcript Identified by AceView, Entrez Gene ID(s) 9636 // chr1 // 100 // 100 // 0 // --- // 0 /// ISG15.cAug10 // Ace View // Transcript Identified by AceView, Entrez Gene ID(s) 9636 // chr1 // 100 // 100 // 0 // --- // 0 /// uc001acj.5 // UCSC Genes // ISG15 ubiquitin-like modifier [Source:HGNC Symbol;Acc:HGNC:4053] // chr1 // 100 // 100 // 0 // --- // 0 /// uc057ayq.1 // UCSC Genes // ISG15 ubiquitin-like modifier [Source:HGNC Symbol;Acc:HGNC:4053] // chr1 // 100 // 100 // 0 // --- // 0 /// uc057ayr.1 // UCSC Genes // ISG15 ubiquitin-like modifier [Source:HGNC Symbol;Acc:HGNC:4053] // chr1 // 100 // 100 // 0 // --- // 0']}\n" ] } ], "source": [ "# 1. Use the 'get_gene_annotation' function from the library to get gene annotation data from the SOFT file.\n", "gene_annotation = get_gene_annotation(soft_file)\n", "\n", "# 2. Use the 'preview_df' function from the library to preview the data and print out the results.\n", "print(\"Gene annotation preview:\")\n", "print(preview_df(gene_annotation))\n" ] }, { "cell_type": "markdown", "id": "79d76b02", "metadata": {}, "source": [ "### Step 6: Gene Identifier Mapping" ] }, { "cell_type": "code", "execution_count": 7, "id": "531d069f", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T03:58:09.058882Z", "iopub.status.busy": "2025-03-25T03:58:09.058756Z", "iopub.status.idle": "2025-03-25T03:58:15.035937Z", "shell.execute_reply": "2025-03-25T03:58:15.035492Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Gene data index format: Index(['23064070', '23064071', '23064072', '23064073', '23064074'], dtype='object', name='ID')\n", "\n", "Gene annotation columns: ['ID', 'probeset_id', 'seqname', 'strand', 'start', 'stop', 'total_probes', 'category', 'SPOT_ID', 'SPOT_ID.1']\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Gene mapping sample (first 5 rows):\n", " ID Gene\n", "0 TC0100006437.hg.1 [OR4F5, ENSEMBL, UCSC, CCDS30547, HGNC]\n", "1 TC0100006476.hg.1 [SAMD11, ENSEMBL, BC024295, MGC, IMAGE, BC0332...\n", "2 TC0100006479.hg.1 [KLHL17, ENSEMBL, BC166618, IMAGE, MGC, CCDS30...\n", "3 TC0100006480.hg.1 [PLEKHN1, ENSEMBL, BC101386, MGC, IMAGE, BC101...\n", "4 TC0100006483.hg.1 [ISG15, ENSEMBL, BC009507, MGC, IMAGE, CCDS6, ...\n", "\n", "First few column names in gene_data:\n", "['GSM4155114', 'GSM4155115', 'GSM4155116', 'GSM4155117', 'GSM4155118']\n", "\n", "Gene data after mapping (preview):\n", "(0, 351)\n", "Index([], dtype='object', name='Gene')\n", "\n", "Final gene data after normalization (preview):\n", "(0, 351)\n", "Index([], dtype='object', name='Gene')\n", "\n", "Gene data saved to ../../output/preprocess/Sjögrens_Syndrome/gene_data/GSE140161.csv\n" ] } ], "source": [ "# After examining the gene expression data and gene annotation data:\n", "# In gene expression data, we have IDs like '23064070', '23064071', etc.\n", "# In gene annotation data, we have IDs like 'TC0100006437.hg.1', which don't match.\n", "# The gene expression data's IDs are likely in a different format.\n", "\n", "# We need to identify if there's a mapping between gene expression IDs and annotation IDs\n", "\n", "# Let's examine the gene_data structure more closely\n", "print(\"Gene data index format:\", gene_data.index[:5])\n", "\n", "# And print some more details from gene_annotation to find the right columns\n", "print(\"\\nGene annotation columns:\", gene_annotation.columns.tolist())\n", "\n", "# Looking for a suitable gene ID column and gene symbol information\n", "# From looking at the SPOT_ID.1 column in the annotation preview, we can see it contains\n", "# gene info like \"NM_001005484 // RefSeq // Homo sapiens olfactory receptor...\"\n", "# Let's extract gene symbols from this text using the extract_human_gene_symbols function\n", "\n", "# Create gene mapping dataframe\n", "# The 'ID' column is the identifier column\n", "# The 'SPOT_ID.1' column contains information about genes including their symbols\n", "gene_mapping = pd.DataFrame({\n", " 'ID': gene_annotation['ID'],\n", " 'Gene': gene_annotation['SPOT_ID.1'].apply(extract_human_gene_symbols)\n", "})\n", "\n", "# Filter out rows where no gene symbols were extracted\n", "gene_mapping = gene_mapping[gene_mapping['Gene'].apply(lambda x: len(x) > 0)]\n", "print(\"\\nGene mapping sample (first 5 rows):\")\n", "print(gene_mapping.head())\n", "\n", "# We need to handle the mismatch between gene_data IDs and gene_mapping IDs\n", "# Let's check if the gene expression matrix actually has ID column values that match probe IDs\n", "print(\"\\nFirst few column names in gene_data:\")\n", "print(list(gene_data.columns)[:5])\n", "\n", "# Since we have a mismatch in identifier formats, we need to check if there's another column in gene_annotation\n", "# that matches the gene_data indices, or we need alternative mapping approach\n", "\n", "# Try to find common patterns or relationships between the two ID systems\n", "# Let's try using the apply_gene_mapping function with our current data\n", "try:\n", " # Apply the gene mapping to convert probe-level data to gene expression data\n", " gene_data = apply_gene_mapping(gene_data, gene_mapping)\n", " print(\"\\nGene data after mapping (preview):\")\n", " print(gene_data.shape)\n", " print(gene_data.index[:10]) # Show first 10 gene symbols\n", "except Exception as e:\n", " print(f\"\\nError in gene mapping: {e}\")\n", " print(\"Attempting alternative approach...\")\n", " \n", " # Since there might be a mismatch in ID formats, we'll attempt a different approach\n", " # The issue could be that the soft file's annotation doesn't match the matrix file's probe IDs\n", " # Let's extract the first few rows of gene data to see the IDs\n", " print(\"\\nGene data rows:\")\n", " print(gene_data.head(3))\n", " \n", " # Let's check if we can extract probe-gene mappings from the SOFT file differently\n", " with gzip.open(soft_file, 'rt') as f:\n", " for i, line in enumerate(f):\n", " if i < 20: # Look at the first 20 lines to understand structure\n", " print(line.strip())\n", " else:\n", " break\n", " \n", " # Based on file examination, we'll try a different approach to get the mapping\n", " # We'll try to use probeset_id instead, which might be more likely to match\n", " gene_mapping = get_gene_mapping(gene_annotation, 'probeset_id', 'SPOT_ID.1')\n", " \n", " # Now apply the mapping\n", " gene_data = apply_gene_mapping(gene_data, gene_mapping)\n", " print(\"\\nGene data after mapping with alternative approach (preview):\")\n", " print(gene_data.shape)\n", " print(gene_data.index[:10]) # Show first 10 gene symbols\n", " \n", "# Normalize gene symbols to ensure consistent naming\n", "gene_data = normalize_gene_symbols_in_index(gene_data)\n", "print(\"\\nFinal gene data after normalization (preview):\")\n", "print(gene_data.shape)\n", "print(gene_data.index[:10])\n", "\n", "# Save the gene data to a file for future steps\n", "os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)\n", "gene_data.to_csv(out_gene_data_file)\n", "print(f\"\\nGene data saved to {out_gene_data_file}\")" ] } ], "metadata": { "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.10.16" } }, "nbformat": 4, "nbformat_minor": 5 }