{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "010c788d", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T07:17:04.426919Z", "iopub.status.busy": "2025-03-25T07:17:04.426742Z", "iopub.status.idle": "2025-03-25T07:17:04.590080Z", "shell.execute_reply": "2025-03-25T07:17:04.589736Z" } }, "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 = \"Kidney_Clear_Cell_Carcinoma\"\n", "cohort = \"GSE102807\"\n", "\n", "# Input paths\n", "in_trait_dir = \"../../input/GEO/Kidney_Clear_Cell_Carcinoma\"\n", "in_cohort_dir = \"../../input/GEO/Kidney_Clear_Cell_Carcinoma/GSE102807\"\n", "\n", "# Output paths\n", "out_data_file = \"../../output/preprocess/Kidney_Clear_Cell_Carcinoma/GSE102807.csv\"\n", "out_gene_data_file = \"../../output/preprocess/Kidney_Clear_Cell_Carcinoma/gene_data/GSE102807.csv\"\n", "out_clinical_data_file = \"../../output/preprocess/Kidney_Clear_Cell_Carcinoma/clinical_data/GSE102807.csv\"\n", "json_path = \"../../output/preprocess/Kidney_Clear_Cell_Carcinoma/cohort_info.json\"\n" ] }, { "cell_type": "markdown", "id": "c3171811", "metadata": {}, "source": [ "### Step 1: Initial Data Loading" ] }, { "cell_type": "code", "execution_count": 2, "id": "9a2aa30b", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T07:17:04.591300Z", "iopub.status.busy": "2025-03-25T07:17:04.591160Z", "iopub.status.idle": "2025-03-25T07:17:04.641266Z", "shell.execute_reply": "2025-03-25T07:17:04.640968Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Background Information:\n", "!Series_title\t\"ARID2 promotes clear cell renal cell carcinoma in the absence of functional PBRM1\"\n", "!Series_summary\t\"This SuperSeries is composed of the SubSeries listed below.\"\n", "!Series_overall_design\t\"Refer to individual Series\"\n", "Sample Characteristics Dictionary:\n", "{0: ['cell type: MEF'], 1: ['adenovirus: GFP', 'adenovirus: Cre'], 2: ['genotype/variation: control', 'genotype/variation: loss of Pbrm1 expression']}\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": "06759e96", "metadata": {}, "source": [ "### Step 2: Dataset Analysis and Clinical Feature Extraction" ] }, { "cell_type": "code", "execution_count": 3, "id": "f5861bbd", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T07:17:04.642181Z", "iopub.status.busy": "2025-03-25T07:17:04.642077Z", "iopub.status.idle": "2025-03-25T07:17:04.648593Z", "shell.execute_reply": "2025-03-25T07:17:04.648324Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "A new JSON file was created at: ../../output/preprocess/Kidney_Clear_Cell_Carcinoma/cohort_info.json\n" ] }, { "data": { "text/plain": [ "False" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# 1. Gene Expression Data Availability\n", "# Based on the background information, this appears to be a MEF (mouse embryonic fibroblast) cell line study\n", "# with adenovirus treatment and genotype variations. This suggests it might be a gene expression dataset,\n", "# but there's no clear indication of human gene expression data as required.\n", "is_gene_available = False # No clear indication of human gene expression data\n", "\n", "# 2. Variable Availability and Data Type Conversion\n", "# Looking at the sample characteristics, we don't see clear trait (Kidney Clear Cell Carcinoma), age, or gender information\n", "# The data appears to be from a cell line experiment rather than human samples\n", "\n", "# 2.1 Data Availability\n", "trait_row = None # No trait information found\n", "age_row = None # No age information found\n", "gender_row = None # No gender information found\n", "\n", "# 2.2 Data Type Conversion Functions\n", "# Define these functions even though we don't have the data, to maintain code structure\n", "def convert_trait(value):\n", " if value is None:\n", " return None\n", " if ':' in value:\n", " value = value.split(':', 1)[1].strip()\n", " # For kidney clear cell carcinoma, binary classification (0 for normal, 1 for cancer)\n", " if value.lower() in ['normal', 'control', 'healthy']:\n", " return 0\n", " elif 'carcinoma' in value.lower() or 'cancer' in value.lower() or 'tumor' in value.lower():\n", " return 1\n", " return None\n", "\n", "def convert_age(value):\n", " if value is None:\n", " return None\n", " if ':' in value:\n", " value = value.split(':', 1)[1].strip()\n", " try:\n", " # Convert to float to handle both integers and decimal ages\n", " return float(value)\n", " except:\n", " return None\n", "\n", "def convert_gender(value):\n", " if value is None:\n", " return None\n", " if ':' in value:\n", " value = value.split(':', 1)[1].strip()\n", " # Convert to binary (0 for female, 1 for male)\n", " if value.lower() in ['female', 'f']:\n", " return 0\n", " elif value.lower() in ['male', 'm']:\n", " return 1\n", " return None\n", "\n", "# 3. Save Metadata\n", "# Initial filtering check: both gene and trait data should be available\n", "is_trait_available = trait_row is not None\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", "# Since trait_row is None, we skip clinical feature extraction\n" ] }, { "cell_type": "markdown", "id": "68714ad2", "metadata": {}, "source": [ "### Step 3: Gene Data Extraction" ] }, { "cell_type": "code", "execution_count": 4, "id": "806f3df8", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T07:17:04.649496Z", "iopub.status.busy": "2025-03-25T07:17:04.649396Z", "iopub.status.idle": "2025-03-25T07:17:04.680165Z", "shell.execute_reply": "2025-03-25T07:17:04.679879Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Examining matrix file structure...\n", "Line 0: !Series_title\t\"ARID2 promotes clear cell renal cell carcinoma in the absence of functional PBRM1\"\n", "Line 1: !Series_geo_accession\t\"GSE102807\"\n", "Line 2: !Series_status\t\"Public on Aug 14 2018\"\n", "Line 3: !Series_submission_date\t\"Aug 18 2017\"\n", "Line 4: !Series_last_update_date\t\"Mar 08 2022\"\n", "Line 5: !Series_summary\t\"This SuperSeries is composed of the SubSeries listed below.\"\n", "Line 6: !Series_overall_design\t\"Refer to individual Series\"\n", "Line 7: !Series_type\t\"Expression profiling by array\"\n", "Line 8: !Series_type\t\"Genome binding/occupancy profiling by high throughput sequencing\"\n", "Line 9: !Series_type\t\"Expression profiling by high throughput sequencing\"\n", "Found table marker at line 73\n", "First few lines after marker:\n", "\"ID_REF\"\t\"GSM2742483\"\t\"GSM2742484\"\t\"GSM2742485\"\t\"GSM2742486\"\t\"GSM2742487\"\t\"GSM2742488\"\n", "17210855\t10.07882196\t9.892336836\t10.0362495\t10.41165178\t10.26672026\t10.29559358\n", "17210869\t10.25753481\t10.20831352\t10.25449864\t10.15972146\t10.34576857\t10.26063389\n", "17210887\t9.078214747\t9.19452191\t9.286071328\t9.190763556\t9.093589675\t9.32145365\n", "17210904\t4.467212363\t4.660369058\t3.922016103\t4.234968587\t4.198707966\t4.105846964\n", "Total lines examined: 74\n", "\n", "Attempting to extract gene data from matrix file...\n", "Successfully extracted gene data with 27037 rows\n", "First 20 gene IDs:\n", "Index(['17210855', '17210869', '17210887', '17210904', '17210912', '17210947',\n", " '17210953', '17210984', '17211000', '17211004', '17211023', '17211033',\n", " '17211043', '17211066', '17211090', '17211131', '17211174', '17211194',\n", " '17211198', '17211223'],\n", " dtype='object', name='ID')\n", "\n", "Gene expression data available: True\n" ] } ], "source": [ "# 1. Get the file paths for the SOFT file and matrix file\n", "soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)\n", "\n", "# Add diagnostic code to check file content and structure\n", "print(\"Examining matrix file structure...\")\n", "with gzip.open(matrix_file, 'rt') as file:\n", " table_marker_found = False\n", " lines_read = 0\n", " for i, line in enumerate(file):\n", " lines_read += 1\n", " if '!series_matrix_table_begin' in line:\n", " table_marker_found = True\n", " print(f\"Found table marker at line {i}\")\n", " # Read a few lines after the marker to check data structure\n", " next_lines = [next(file, \"\").strip() for _ in range(5)]\n", " print(\"First few lines after marker:\")\n", " for next_line in next_lines:\n", " print(next_line)\n", " break\n", " if i < 10: # Print first few lines to see file structure\n", " print(f\"Line {i}: {line.strip()}\")\n", " if i > 100: # Don't read the entire file\n", " break\n", " \n", " if not table_marker_found:\n", " print(\"Table marker '!series_matrix_table_begin' not found in first 100 lines\")\n", " print(f\"Total lines examined: {lines_read}\")\n", "\n", "# 2. Try extracting gene expression data from the matrix file again with better diagnostics\n", "try:\n", " print(\"\\nAttempting to extract gene data from matrix file...\")\n", " gene_data = get_genetic_data(matrix_file)\n", " if gene_data.empty:\n", " print(\"Extracted gene expression data is empty\")\n", " is_gene_available = False\n", " else:\n", " print(f\"Successfully extracted gene data with {len(gene_data.index)} rows\")\n", " print(\"First 20 gene IDs:\")\n", " print(gene_data.index[:20])\n", " is_gene_available = True\n", "except Exception as e:\n", " print(f\"Error extracting gene data: {str(e)}\")\n", " print(\"This dataset appears to have an empty or malformed gene expression matrix\")\n", " is_gene_available = False\n", "\n", "print(f\"\\nGene expression data available: {is_gene_available}\")\n", "\n", "# If data extraction failed, try an alternative approach using pandas directly\n", "if not is_gene_available:\n", " print(\"\\nTrying alternative approach to read gene expression data...\")\n", " try:\n", " with gzip.open(matrix_file, 'rt') as file:\n", " # Skip lines until we find the marker\n", " for line in file:\n", " if '!series_matrix_table_begin' in line:\n", " break\n", " \n", " # Try to read the data directly with pandas\n", " gene_data = pd.read_csv(file, sep='\\t', index_col=0)\n", " \n", " if not gene_data.empty:\n", " print(f\"Successfully extracted gene data with alternative method: {gene_data.shape}\")\n", " print(\"First 20 gene IDs:\")\n", " print(gene_data.index[:20])\n", " is_gene_available = True\n", " else:\n", " print(\"Alternative extraction method also produced empty data\")\n", " except Exception as e:\n", " print(f\"Alternative extraction failed: {str(e)}\")\n" ] }, { "cell_type": "markdown", "id": "9c72c553", "metadata": {}, "source": [ "### Step 4: Gene Identifier Review" ] }, { "cell_type": "code", "execution_count": 5, "id": "e5872f4e", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T07:17:04.681340Z", "iopub.status.busy": "2025-03-25T07:17:04.681242Z", "iopub.status.idle": "2025-03-25T07:17:04.682924Z", "shell.execute_reply": "2025-03-25T07:17:04.682670Z" } }, "outputs": [], "source": [ "# Examining the gene identifiers from the gene data\n", "# The identifiers appear to be numeric IDs (17210855, 17210869, etc.)\n", "# These are not standard human gene symbols (like BRCA1, TP53, etc.)\n", "# They appear to be probe IDs from a microarray platform\n", "# These would need to be mapped to human gene symbols for interpretation\n", "\n", "requires_gene_mapping = True\n" ] }, { "cell_type": "markdown", "id": "289ca805", "metadata": {}, "source": [ "### Step 5: Gene Annotation" ] }, { "cell_type": "code", "execution_count": 6, "id": "cefd59a0", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T07:17:04.684011Z", "iopub.status.busy": "2025-03-25T07:17:04.683911Z", "iopub.status.idle": "2025-03-25T07:17:07.466994Z", "shell.execute_reply": "2025-03-25T07:17:07.466634Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Extracting gene annotation data from SOFT file...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Successfully extracted gene annotation data with 204029 rows\n", "\n", "Gene annotation preview (first few rows):\n", "{'ID': ['17210850', '17210852', '17210855', '17210869', '17210883'], 'probeset_id': ['17210850', '17210852', '17210855', '17210869', '17210883'], 'SPOT_ID': ['chr1(+):3102016-3102125', 'chr1(+):3466587-3513553', 'chr1(+):4807823-4846739', 'chr1(+):4857694-4897909', 'chr1(+):4970857-4976820'], 'seqname': ['chr1', 'chr1', 'chr1', 'chr1', 'chr1'], 'strand': ['+', '+', '+', '+', '+'], 'start': [3102016.0, 3466587.0, 4807823.0, 4857694.0, 4970857.0], 'stop': [3102125.0, 3513553.0, 4846739.0, 4897909.0, 4976820.0], 'total_probes': [8.0, 23.0, 20.0, 21.0, 23.0], 'gene_assignment': ['---', '---', 'NM_008866 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000027036 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// BC013536 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// BC052848 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// U89352 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// CT010201 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000134384 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000150971 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000134384 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000155020 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000141278 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// AK050549 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// AK167231 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000115529 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000137887 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// AK034851 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000131119 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000119612 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777', 'NM_001159751 // Tcea1 // transcription elongation factor A (SII) 1 // 1 A1|1 // 21399 /// ENSMUST00000165720 // Tcea1 // transcription elongation factor A (SII) 1 // 1 A1|1 // 21399 /// NM_011541 // Tcea1 // transcription elongation factor A (SII) 1 // 1 A1|1 // 21399 /// NM_001159750 // Tcea1 // transcription elongation factor A (SII) 1 // 1 A1|1 // 21399 /// ENSMUST00000081551 // Tcea1 // transcription elongation factor A (SII) 1 // 1 A1|1 // 21399 /// M18210 // Tcea1 // transcription elongation factor A (SII) 1 // 1 A1|1 // 21399', '---'], 'mrna_assignment': ['ENSMUST00000082908 // ENSEMBL // ncrna:snRNA chromosome:NCBIM37:1:3092097:3092206:1 gene:ENSMUSG00000064842 gene_biotype:snRNA transcript_biotype:snRNA // chr1 // 100 // 100 // 8 // 8 // 0', 'ENSMUST00000161581 // ENSEMBL // cdna:putative chromosome:NCBIM37:1:3456668:3503634:1 gene:ENSMUSG00000089699 gene_biotype:antisense transcript_biotype:antisense // chr1 // 100 // 100 // 23 // 23 // 0', 'NM_008866 // RefSeq // Mus musculus lysophospholipase 1 (Lypla1), mRNA. // chr1 // 100 // 85 // 17 // 17 // 0 /// ENSMUST00000027036 // ENSEMBL // cdna:known chromosome:NCBIM37:1:4797904:4836820:1 gene:ENSMUSG00000025903 gene_biotype:protein_coding transcript_biotype:protein_coding // chr1 // 100 // 85 // 17 // 17 // 0 /// BC013536 // GenBank // Mus musculus lysophospholipase 1, mRNA (cDNA clone MGC:19218 IMAGE:4240573), complete cds. // chr1 // 100 // 85 // 17 // 17 // 0 /// BC052848 // GenBank // Mus musculus lysophospholipase 1, mRNA (cDNA clone MGC:60679 IMAGE:30055025), complete cds. // chr1 // 94 // 85 // 16 // 17 // 0 /// U89352 // GenBank // Mus musculus lysophospholipase I mRNA, complete cds. // chr1 // 100 // 75 // 15 // 15 // 0 /// CT010201 // GenBank // Mus musculus full open reading frame cDNA clone RZPDo836F0950D for gene Lypla1, Lysophospholipase 1; complete cds, incl. stopcodon. // chr1 // 100 // 70 // 14 // 14 // 0 /// ENSMUST00000134384 // ENSEMBL // cdna:known chromosome:NCBIM37:1:4797869:4838491:1 gene:ENSMUSG00000025903 gene_biotype:protein_coding transcript_biotype:nonsense_mediated_decay // chr1 // 100 // 100 // 36 // 36 // 0 /// ENSMUST00000150971 // ENSEMBL // cdna:known chromosome:NCBIM37:1:4797999:4831367:1 gene:ENSMUSG00000025903 gene_biotype:protein_coding transcript_biotype:retained_intron // chr1 // 100 // 70 // 14 // 14 // 0 /// ENSMUST00000134384 // ENSEMBL // cdna:known chromosome:NCBIM37:1:4797869:4838491:1 gene:ENSMUSG00000025903 gene_biotype:protein_coding transcript_biotype:nonsense_mediated_decay // chr1 // 100 // 60 // 12 // 12 // 0 /// ENSMUST00000155020 // ENSEMBL // cdna:known chromosome:NCBIM37:1:4797973:4876851:1 gene:ENSMUSG00000025903 gene_biotype:protein_coding transcript_biotype:nonsense_mediated_decay // chr1 // 100 // 60 // 12 // 12 // 0 /// ENSMUST00000141278 // ENSEMBL // cdna:known chromosome:NCBIM37:1:4826986:4832908:1 gene:ENSMUSG00000025903 gene_biotype:protein_coding transcript_biotype:retained_intron // chr1 // 100 // 25 // 5 // 5 // 0 /// AK050549 // GenBank HTC // Mus musculus adult pancreas islet cells cDNA, RIKEN full-length enriched library, clone:C820014D19 product:lysophospholipase 1, full insert sequence. // chr1 // 100 // 70 // 14 // 14 // 0 /// AK167231 // GenBank HTC // Mus musculus blastocyst blastocyst cDNA, RIKEN full-length enriched library, clone:I1C0043L13 product:lysophospholipase 1, full insert sequence. // chr1 // 100 // 70 // 14 // 14 // 0 /// ENSMUST00000115529 // ENSEMBL // cdna:novel chromosome:NCBIM37:1:4797992:4835433:1 gene:ENSMUSG00000025903 gene_biotype:protein_coding transcript_biotype:protein_coding // chr1 // 100 // 65 // 13 // 13 // 0 /// ENSMUST00000137887 // ENSEMBL // cdna:novel chromosome:NCBIM37:1:4797979:4831050:1 gene:ENSMUSG00000025903 gene_biotype:protein_coding transcript_biotype:protein_coding // chr1 // 100 // 55 // 11 // 11 // 0 /// AK034851 // GenBank HTC // Mus musculus 12 days embryo embryonic body between diaphragm region and neck cDNA, RIKEN full-length enriched library, clone:9430047N20 product:lysophospholipase 1, full insert sequence. // chr1 // 100 // 25 // 5 // 5 // 0 /// ENSMUST00000131119 // ENSEMBL // cdna:putative chromosome:NCBIM37:1:4798318:4831174:1 gene:ENSMUSG00000025903 gene_biotype:protein_coding transcript_biotype:protein_coding // chr1 // 100 // 75 // 15 // 15 // 0 /// ENSMUST00000119612 // ENSEMBL // cdna:putative chromosome:NCBIM37:1:4797977:4835255:1 gene:ENSMUSG00000025903 gene_biotype:protein_coding transcript_biotype:processed_transcript // chr1 // 100 // 50 // 10 // 10 // 0 /// GENSCAN00000010943 // ENSEMBL // cdna:genscan chromosome:NCBIM37:1:4803477:4844373:1 transcript_biotype:protein_coding // chr1 // 100 // 25 // 5 // 5 // 0', 'NM_001159751 // RefSeq // Mus musculus transcription elongation factor A (SII) 1 (Tcea1), transcript variant 1, mRNA. // chr1 // 100 // 81 // 17 // 17 // 0 /// ENSMUST00000165720 // ENSEMBL // cdna:known chromosome:NCBIM37:1:4848409:4887987:1 gene:ENSMUSG00000033813 gene_biotype:protein_coding transcript_biotype:protein_coding // chr1 // 100 // 81 // 17 // 17 // 0 /// NM_011541 // RefSeq // Mus musculus transcription elongation factor A (SII) 1 (Tcea1), transcript variant 2, mRNA. // chr1 // 100 // 76 // 16 // 16 // 0 /// NM_001159750 // RefSeq // Mus musculus transcription elongation factor A (SII) 1 (Tcea1), transcript variant 3, mRNA. // chr1 // 100 // 76 // 16 // 16 // 0 /// ENSMUST00000081551 // ENSEMBL // cdna:known chromosome:NCBIM37:1:4847775:4887987:1 gene:ENSMUSG00000033813 gene_biotype:protein_coding transcript_biotype:protein_coding // chr1 // 100 // 76 // 16 // 16 // 0 /// M18210 // GenBank // Mouse transcription factor S-II, clone PSII-3. // chr1 // 100 // 67 // 14 // 14 // 0', 'ENSMUST00000144339 // ENSEMBL // cdna:known chromosome:NCBIM37:1:4960938:4966901:1 gene:ENSMUSG00000085623 gene_biotype:antisense transcript_biotype:antisense // chr1 // 100 // 100 // 23 // 23 // 0'], 'swissprot': ['---', '---', 'NM_008866 // P97823 /// BC013536 // P97823 /// BC052848 // P97823 /// U89352 // P97823 /// CT010201 // Q4FK51 /// CT010201 // P97823 /// AK050549 // P97823 /// AK167231 // P97823', 'NM_011541 // Q3UPE0 /// NM_011541 // Q3UWX7 /// NM_011541 // P10711 /// NM_001159750 // Q3UPE0 /// NM_001159750 // Q3UWX7 /// NM_001159750 // P10711 /// M18210 // P10711', '---'], 'unigene': ['---', '---', 'NM_008866 // Mm.299955 // bladder| blood| bone| bone marrow| brain| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| mammary gland| molar| ovary| pancreas| pituitary gland| salivary gland| skin| spleen| testis| thymus|oocyte| zygote| cleavage| morula| blastocyst| egg cylinder| gastrula| organogenesis| fetus| neonate| juvenile| adult /// ENSMUST00000027036 // Mm.299955 // bladder| blood| bone| bone marrow| brain| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| mammary gland| molar| ovary| pancreas| pituitary gland| salivary gland| skin| spleen| testis| thymus|oocyte| zygote| cleavage| morula| blastocyst| egg cylinder| gastrula| organogenesis| fetus| neonate| juvenile| adult /// BC013536 // Mm.299955 // bladder| blood| bone| bone marrow| brain| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| mammary gland| molar| ovary| pancreas| pituitary gland| salivary gland| skin| spleen| testis| thymus|oocyte| zygote| cleavage| morula| blastocyst| egg cylinder| gastrula| organogenesis| fetus| neonate| juvenile| adult /// BC052848 // Mm.299955 // bladder| blood| bone| bone marrow| brain| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| mammary gland| molar| ovary| pancreas| pituitary gland| salivary gland| skin| spleen| testis| thymus|oocyte| zygote| cleavage| morula| blastocyst| egg cylinder| gastrula| organogenesis| fetus| neonate| juvenile| adult /// U89352 // Mm.299955 // bladder| blood| bone| bone marrow| brain| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| mammary gland| molar| ovary| pancreas| pituitary gland| salivary gland| skin| spleen| testis| thymus|oocyte| zygote| cleavage| morula| blastocyst| egg cylinder| gastrula| organogenesis| fetus| neonate| juvenile| adult /// CT010201 // Mm.299955 // bladder| blood| bone| bone marrow| brain| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| mammary gland| molar| ovary| pancreas| pituitary gland| salivary gland| skin| spleen| testis| thymus|oocyte| zygote| cleavage| morula| blastocyst| egg cylinder| gastrula| organogenesis| fetus| neonate| juvenile| adult /// ENSMUST00000134384 // Mm.299955 // bladder| blood| bone| bone marrow| brain| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| mammary gland| molar| ovary| pancreas| pituitary gland| salivary gland| skin| spleen| testis| thymus|oocyte| zygote| cleavage| morula| blastocyst| egg cylinder| gastrula| organogenesis| fetus| neonate| juvenile| adult /// ENSMUST00000150971 // Mm.299955 // bladder| blood| bone| bone marrow| brain| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| mammary gland| molar| ovary| pancreas| pituitary gland| salivary gland| skin| spleen| testis| thymus|oocyte| zygote| cleavage| morula| blastocyst| egg cylinder| gastrula| organogenesis| fetus| neonate| juvenile| adult /// ENSMUST00000134384 // Mm.299955 // bladder| blood| bone| bone marrow| brain| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| mammary gland| molar| ovary| pancreas| pituitary gland| salivary gland| skin| spleen| testis| thymus|oocyte| zygote| cleavage| morula| blastocyst| egg cylinder| gastrula| organogenesis| fetus| neonate| juvenile| adult /// ENSMUST00000155020 // Mm.299955 // bladder| blood| bone| bone marrow| brain| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| mammary gland| molar| ovary| pancreas| pituitary gland| salivary gland| skin| spleen| testis| thymus|oocyte| zygote| cleavage| morula| blastocyst| egg cylinder| gastrula| organogenesis| fetus| neonate| juvenile| adult /// ENSMUST00000141278 // Mm.299955 // bladder| blood| bone| bone marrow| brain| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| mammary gland| molar| ovary| pancreas| pituitary gland| salivary gland| skin| spleen| testis| thymus|oocyte| zygote| cleavage| morula| blastocyst| egg cylinder| gastrula| organogenesis| fetus| neonate| juvenile| adult /// AK050549 // Mm.299955 // bladder| blood| bone| bone marrow| brain| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| mammary gland| molar| ovary| pancreas| pituitary gland| salivary gland| skin| spleen| testis| thymus|oocyte| zygote| cleavage| morula| blastocyst| egg cylinder| gastrula| organogenesis| fetus| neonate| juvenile| adult /// AK167231 // Mm.299955 // bladder| blood| bone| bone marrow| brain| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| mammary gland| molar| ovary| pancreas| pituitary gland| salivary gland| skin| spleen| testis| thymus|oocyte| zygote| cleavage| morula| blastocyst| egg cylinder| gastrula| organogenesis| fetus| neonate| juvenile| adult /// ENSMUST00000115529 // Mm.299955 // bladder| blood| bone| bone marrow| brain| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| mammary gland| molar| ovary| pancreas| pituitary gland| salivary gland| skin| spleen| testis| thymus|oocyte| zygote| cleavage| morula| blastocyst| egg cylinder| gastrula| organogenesis| fetus| neonate| juvenile| adult /// ENSMUST00000137887 // Mm.299955 // bladder| blood| bone| bone marrow| brain| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| mammary gland| molar| ovary| pancreas| pituitary gland| salivary gland| skin| spleen| testis| thymus|oocyte| zygote| cleavage| morula| blastocyst| egg cylinder| gastrula| organogenesis| fetus| neonate| juvenile| adult /// AK034851 // Mm.299955 // bladder| blood| bone| bone marrow| brain| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| mammary gland| molar| ovary| pancreas| pituitary gland| salivary gland| skin| spleen| testis| thymus|oocyte| zygote| cleavage| morula| blastocyst| egg cylinder| gastrula| organogenesis| fetus| neonate| juvenile| adult /// ENSMUST00000131119 // Mm.299955 // bladder| blood| bone| bone marrow| brain| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| mammary gland| molar| ovary| pancreas| pituitary gland| salivary gland| skin| spleen| testis| thymus|oocyte| zygote| cleavage| morula| blastocyst| egg cylinder| gastrula| organogenesis| fetus| neonate| juvenile| adult /// ENSMUST00000119612 // Mm.299955 // bladder| blood| bone| bone marrow| brain| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| mammary gland| molar| ovary| pancreas| pituitary gland| salivary gland| skin| spleen| testis| thymus|oocyte| zygote| cleavage| morula| blastocyst| egg cylinder| gastrula| organogenesis| fetus| neonate| juvenile| adult', 'NM_001159751 // Mm.207263 // blood| bone| bone marrow| brain| connective tissue| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| lymph node| mammary gland| muscle| nasopharynx| ovary| pancreas| salivary gland| skin| spleen| sympathetic ganglion| testis| thymus| thyroid| tongue| uterus|oocyte| unfertilized ovum| zygote| cleavage| morula| blastocyst| gastrula| organogenesis| fetus| neonate| juvenile| adult /// ENSMUST00000165720 // Mm.207263 // blood| bone| bone marrow| brain| connective tissue| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| lymph node| mammary gland| muscle| nasopharynx| ovary| pancreas| salivary gland| skin| spleen| sympathetic ganglion| testis| thymus| thyroid| tongue| uterus|oocyte| unfertilized ovum| zygote| cleavage| morula| blastocyst| gastrula| organogenesis| fetus| neonate| juvenile| adult /// NM_011541 // Mm.207263 // blood| bone| bone marrow| brain| connective tissue| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| lymph node| mammary gland| muscle| nasopharynx| ovary| pancreas| salivary gland| skin| spleen| sympathetic ganglion| testis| thymus| thyroid| tongue| uterus|oocyte| unfertilized ovum| zygote| cleavage| morula| blastocyst| gastrula| organogenesis| fetus| neonate| juvenile| adult /// NM_001159750 // Mm.207263 // blood| bone| bone marrow| brain| connective tissue| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| lymph node| mammary gland| muscle| nasopharynx| ovary| pancreas| salivary gland| skin| spleen| sympathetic ganglion| testis| thymus| thyroid| tongue| uterus|oocyte| unfertilized ovum| zygote| cleavage| morula| blastocyst| gastrula| organogenesis| fetus| neonate| juvenile| adult /// ENSMUST00000081551 // Mm.207263 // blood| bone| bone marrow| brain| connective tissue| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| lymph node| mammary gland| muscle| nasopharynx| ovary| pancreas| salivary gland| skin| spleen| sympathetic ganglion| testis| thymus| thyroid| tongue| uterus|oocyte| unfertilized ovum| zygote| cleavage| morula| blastocyst| gastrula| organogenesis| fetus| neonate| juvenile| adult /// M18210 // Mm.207263 // blood| bone| bone marrow| brain| connective tissue| dorsal root ganglion| embryonic tissue| extraembryonic tissue| eye| fertilized ovum| heart| inner ear| intestine| kidney| liver| lung| lymph node| mammary gland| muscle| nasopharynx| ovary| pancreas| salivary gland| skin| spleen| sympathetic ganglion| testis| thymus| thyroid| tongue| uterus|oocyte| unfertilized ovum| zygote| cleavage| morula| blastocyst| gastrula| organogenesis| fetus| neonate| juvenile| adult', '---'], 'GO_biological_process': ['---', '---', 'NM_008866 // GO:0006629 // lipid metabolic process // inferred from electronic annotation /// NM_008866 // GO:0006631 // fatty acid metabolic process // inferred from electronic annotation /// ENSMUST00000027036 // GO:0006629 // lipid metabolic process // inferred from electronic annotation /// ENSMUST00000027036 // GO:0006631 // fatty acid metabolic process // inferred from electronic annotation /// BC013536 // GO:0006629 // lipid metabolic process // inferred from electronic annotation /// BC013536 // GO:0006631 // fatty acid metabolic process // inferred from electronic annotation /// BC052848 // GO:0006629 // lipid metabolic process // inferred from electronic annotation /// BC052848 // GO:0006631 // fatty acid metabolic process // inferred from electronic annotation /// U89352 // GO:0006629 // lipid metabolic process // inferred from electronic annotation /// U89352 // GO:0006631 // fatty acid metabolic process // inferred from electronic annotation /// CT010201 // GO:0006629 // lipid metabolic process // inferred from electronic annotation /// CT010201 // GO:0006631 // fatty acid metabolic process // inferred from electronic annotation /// ENSMUST00000134384 // GO:0006629 // lipid metabolic process // inferred from electronic annotation /// ENSMUST00000134384 // GO:0006631 // fatty acid metabolic process // inferred from electronic annotation /// ENSMUST00000150971 // GO:0006629 // lipid metabolic process // inferred from electronic annotation /// ENSMUST00000150971 // GO:0006631 // fatty acid metabolic process // inferred from electronic annotation /// ENSMUST00000134384 // GO:0006629 // lipid metabolic process // inferred from electronic annotation /// ENSMUST00000134384 // GO:0006631 // fatty acid metabolic process // inferred from electronic annotation /// ENSMUST00000155020 // GO:0006629 // lipid metabolic process // inferred from electronic annotation /// ENSMUST00000155020 // GO:0006631 // fatty acid metabolic process // inferred from electronic annotation /// ENSMUST00000141278 // GO:0006629 // lipid metabolic process // inferred from electronic annotation /// ENSMUST00000141278 // GO:0006631 // fatty acid metabolic process // inferred from electronic annotation /// AK050549 // GO:0006629 // lipid metabolic process // inferred from electronic annotation /// AK050549 // GO:0006631 // fatty acid metabolic process // inferred from electronic annotation /// AK167231 // GO:0006629 // lipid metabolic process // inferred from electronic annotation /// AK167231 // GO:0006631 // fatty acid metabolic process // inferred from electronic annotation /// ENSMUST00000115529 // GO:0006629 // lipid metabolic process // inferred from electronic annotation /// ENSMUST00000115529 // GO:0006631 // fatty acid metabolic process // inferred from electronic annotation /// ENSMUST00000137887 // GO:0006629 // lipid metabolic process // inferred from electronic annotation /// ENSMUST00000137887 // GO:0006631 // fatty acid metabolic process // inferred from electronic annotation /// AK034851 // GO:0006629 // lipid metabolic process // inferred from electronic annotation /// AK034851 // GO:0006631 // fatty acid metabolic process // inferred from electronic annotation /// ENSMUST00000131119 // GO:0006629 // lipid metabolic process // inferred from electronic annotation /// ENSMUST00000131119 // GO:0006631 // fatty acid metabolic process // inferred from electronic annotation /// ENSMUST00000119612 // GO:0006629 // lipid metabolic process // inferred from electronic annotation /// ENSMUST00000119612 // GO:0006631 // fatty acid metabolic process // inferred from electronic annotation', 'NM_001159751 // GO:0006351 // transcription, DNA-dependent // inferred from electronic annotation /// NM_001159751 // GO:0006355 // regulation of transcription, DNA-dependent // inferred from electronic annotation /// NM_001159751 // GO:0006357 // regulation of transcription from RNA polymerase II promoter // inferred from electronic annotation /// NM_001159751 // GO:0030218 // erythrocyte differentiation // inferred from mutant phenotype /// NM_001159751 // GO:0032784 // regulation of transcription elongation, DNA-dependent // inferred from electronic annotation /// NM_001159751 // GO:0045893 // positive regulation of transcription, DNA-dependent // inferred from direct assay /// NM_001159751 // GO:0045944 // positive regulation of transcription from RNA polymerase II promoter // inferred from direct assay /// ENSMUST00000165720 // GO:0006351 // transcription, DNA-dependent // inferred from electronic annotation /// ENSMUST00000165720 // GO:0006355 // regulation of transcription, DNA-dependent // inferred from electronic annotation /// ENSMUST00000165720 // GO:0006357 // regulation of transcription from RNA polymerase II promoter // inferred from electronic annotation /// ENSMUST00000165720 // GO:0030218 // erythrocyte differentiation // inferred from mutant phenotype /// ENSMUST00000165720 // GO:0032784 // regulation of transcription elongation, DNA-dependent // inferred from electronic annotation /// ENSMUST00000165720 // GO:0045893 // positive regulation of transcription, DNA-dependent // inferred from direct assay /// ENSMUST00000165720 // GO:0045944 // positive regulation of transcription from RNA polymerase II promoter // inferred from direct assay /// NM_011541 // GO:0006351 // transcription, DNA-dependent // inferred from electronic annotation /// NM_011541 // GO:0006355 // regulation of transcription, DNA-dependent // inferred from electronic annotation /// NM_011541 // GO:0006357 // regulation of transcription from RNA polymerase II promoter // inferred from electronic annotation /// NM_011541 // GO:0030218 // erythrocyte differentiation // inferred from mutant phenotype /// NM_011541 // GO:0032784 // regulation of transcription elongation, DNA-dependent // inferred from electronic annotation /// NM_011541 // GO:0045893 // positive regulation of transcription, DNA-dependent // inferred from direct assay /// NM_011541 // GO:0045944 // positive regulation of transcription from RNA polymerase II promoter // inferred from direct assay /// NM_001159750 // GO:0006351 // transcription, DNA-dependent // inferred from electronic annotation /// NM_001159750 // GO:0006355 // regulation of transcription, DNA-dependent // inferred from electronic annotation /// NM_001159750 // GO:0006357 // regulation of transcription from RNA polymerase II promoter // inferred from electronic annotation /// NM_001159750 // GO:0030218 // erythrocyte differentiation // inferred from mutant phenotype /// NM_001159750 // GO:0032784 // regulation of transcription elongation, DNA-dependent // inferred from electronic annotation /// NM_001159750 // GO:0045893 // positive regulation of transcription, DNA-dependent // inferred from direct assay /// NM_001159750 // GO:0045944 // positive regulation of transcription from RNA polymerase II promoter // inferred from direct assay /// ENSMUST00000081551 // GO:0006351 // transcription, DNA-dependent // inferred from electronic annotation /// ENSMUST00000081551 // GO:0006355 // regulation of transcription, DNA-dependent // inferred from electronic annotation /// ENSMUST00000081551 // GO:0006357 // regulation of transcription from RNA polymerase II promoter // inferred from electronic annotation /// ENSMUST00000081551 // GO:0030218 // erythrocyte differentiation // inferred from mutant phenotype /// ENSMUST00000081551 // GO:0032784 // regulation of transcription elongation, DNA-dependent // inferred from electronic annotation /// ENSMUST00000081551 // GO:0045893 // positive regulation of transcription, DNA-dependent // inferred from direct assay /// ENSMUST00000081551 // GO:0045944 // positive regulation of transcription from RNA polymerase II promoter // inferred from direct assay /// M18210 // GO:0006351 // transcription, DNA-dependent // inferred from electronic annotation /// M18210 // GO:0006355 // regulation of transcription, DNA-dependent // inferred from electronic annotation /// M18210 // GO:0006357 // regulation of transcription from RNA polymerase II promoter // inferred from electronic annotation /// M18210 // GO:0030218 // erythrocyte differentiation // inferred from mutant phenotype /// M18210 // GO:0032784 // regulation of transcription elongation, DNA-dependent // inferred from electronic annotation /// M18210 // GO:0045893 // positive regulation of transcription, DNA-dependent // inferred from direct assay /// M18210 // GO:0045944 // positive regulation of transcription from RNA polymerase II promoter // inferred from direct assay', '---'], 'GO_cellular_component': ['---', '---', 'NM_008866 // GO:0005737 // cytoplasm // inferred from electronic annotation /// NM_008866 // GO:0005739 // mitochondrion // inferred from direct assay /// ENSMUST00000027036 // GO:0005737 // cytoplasm // inferred from electronic annotation /// ENSMUST00000027036 // GO:0005739 // mitochondrion // inferred from direct assay /// BC013536 // GO:0005737 // cytoplasm // inferred from electronic annotation /// BC013536 // GO:0005739 // mitochondrion // inferred from direct assay /// BC052848 // GO:0005737 // cytoplasm // inferred from electronic annotation /// BC052848 // GO:0005739 // mitochondrion // inferred from direct assay /// U89352 // GO:0005737 // cytoplasm // inferred from electronic annotation /// U89352 // GO:0005739 // mitochondrion // inferred from direct assay /// CT010201 // GO:0005737 // cytoplasm // inferred from electronic annotation /// CT010201 // GO:0005739 // mitochondrion // inferred from direct assay /// ENSMUST00000134384 // GO:0005737 // cytoplasm // inferred from electronic annotation /// ENSMUST00000134384 // GO:0005739 // mitochondrion // inferred from direct assay /// ENSMUST00000150971 // GO:0005737 // cytoplasm // inferred from electronic annotation /// ENSMUST00000150971 // GO:0005739 // mitochondrion // inferred from direct assay /// ENSMUST00000134384 // GO:0005737 // cytoplasm // inferred from electronic annotation /// ENSMUST00000134384 // GO:0005739 // mitochondrion // inferred from direct assay /// ENSMUST00000155020 // GO:0005737 // cytoplasm // inferred from electronic annotation /// ENSMUST00000155020 // GO:0005739 // mitochondrion // inferred from direct assay /// ENSMUST00000141278 // GO:0005737 // cytoplasm // inferred from electronic annotation /// ENSMUST00000141278 // GO:0005739 // mitochondrion // inferred from direct assay /// AK050549 // GO:0005737 // cytoplasm // inferred from electronic annotation /// AK050549 // GO:0005739 // mitochondrion // inferred from direct assay /// AK167231 // GO:0005737 // cytoplasm // inferred from electronic annotation /// AK167231 // GO:0005739 // mitochondrion // inferred from direct assay /// ENSMUST00000115529 // GO:0005737 // cytoplasm // inferred from electronic annotation /// ENSMUST00000115529 // GO:0005739 // mitochondrion // inferred from direct assay /// ENSMUST00000137887 // GO:0005737 // cytoplasm // inferred from electronic annotation /// ENSMUST00000137887 // GO:0005739 // mitochondrion // inferred from direct assay /// AK034851 // GO:0005737 // cytoplasm // inferred from electronic annotation /// AK034851 // GO:0005739 // mitochondrion // inferred from direct assay /// ENSMUST00000131119 // GO:0005737 // cytoplasm // inferred from electronic annotation /// ENSMUST00000131119 // GO:0005739 // mitochondrion // inferred from direct assay /// ENSMUST00000119612 // GO:0005737 // cytoplasm // inferred from electronic annotation /// ENSMUST00000119612 // GO:0005739 // mitochondrion // inferred from direct assay', 'NM_001159751 // GO:0005634 // nucleus // not recorded /// NM_001159751 // GO:0005654 // nucleoplasm // inferred from direct assay /// NM_001159751 // GO:0005730 // nucleolus // not recorded /// ENSMUST00000165720 // GO:0005634 // nucleus // not recorded /// ENSMUST00000165720 // GO:0005654 // nucleoplasm // inferred from direct assay /// ENSMUST00000165720 // GO:0005730 // nucleolus // not recorded /// NM_011541 // GO:0005634 // nucleus // not recorded /// NM_011541 // GO:0005654 // nucleoplasm // inferred from direct assay /// NM_011541 // GO:0005730 // nucleolus // not recorded /// NM_001159750 // GO:0005634 // nucleus // not recorded /// NM_001159750 // GO:0005654 // nucleoplasm // inferred from direct assay /// NM_001159750 // GO:0005730 // nucleolus // not recorded /// ENSMUST00000081551 // GO:0005634 // nucleus // not recorded /// ENSMUST00000081551 // GO:0005654 // nucleoplasm // inferred from direct assay /// ENSMUST00000081551 // GO:0005730 // nucleolus // not recorded /// M18210 // GO:0005634 // nucleus // not recorded /// M18210 // GO:0005654 // nucleoplasm // inferred from direct assay /// M18210 // GO:0005730 // nucleolus // not recorded', '---'], 'GO_molecular_function': ['---', '---', 'NM_008866 // GO:0004622 // lysophospholipase activity // not recorded /// NM_008866 // GO:0008474 // palmitoyl-(protein) hydrolase activity // not recorded /// NM_008866 // GO:0016787 // hydrolase activity // inferred from electronic annotation /// ENSMUST00000027036 // GO:0004622 // lysophospholipase activity // not recorded /// ENSMUST00000027036 // GO:0008474 // palmitoyl-(protein) hydrolase activity // not recorded /// ENSMUST00000027036 // GO:0016787 // hydrolase activity // inferred from electronic annotation /// BC013536 // GO:0004622 // lysophospholipase activity // not recorded /// BC013536 // GO:0008474 // palmitoyl-(protein) hydrolase activity // not recorded /// BC013536 // GO:0016787 // hydrolase activity // inferred from electronic annotation /// BC052848 // GO:0004622 // lysophospholipase activity // not recorded /// BC052848 // GO:0008474 // palmitoyl-(protein) hydrolase activity // not recorded /// BC052848 // GO:0016787 // hydrolase activity // inferred from electronic annotation /// U89352 // GO:0004622 // lysophospholipase activity // not recorded /// U89352 // GO:0008474 // palmitoyl-(protein) hydrolase activity // not recorded /// U89352 // GO:0016787 // hydrolase activity // inferred from electronic annotation /// CT010201 // GO:0004622 // lysophospholipase activity // not recorded /// CT010201 // GO:0008474 // palmitoyl-(protein) hydrolase activity // not recorded /// CT010201 // GO:0016787 // hydrolase activity // inferred from electronic annotation /// ENSMUST00000134384 // GO:0004622 // lysophospholipase activity // not recorded /// ENSMUST00000134384 // GO:0008474 // palmitoyl-(protein) hydrolase activity // not recorded /// ENSMUST00000134384 // GO:0016787 // hydrolase activity // inferred from electronic annotation /// ENSMUST00000150971 // GO:0004622 // lysophospholipase activity // not recorded /// ENSMUST00000150971 // GO:0008474 // palmitoyl-(protein) hydrolase activity // not recorded /// ENSMUST00000150971 // GO:0016787 // hydrolase activity // inferred from electronic annotation /// ENSMUST00000134384 // GO:0004622 // lysophospholipase activity // not recorded /// ENSMUST00000134384 // GO:0008474 // palmitoyl-(protein) hydrolase activity // not recorded /// ENSMUST00000134384 // GO:0016787 // hydrolase activity // inferred from electronic annotation /// ENSMUST00000155020 // GO:0004622 // lysophospholipase activity // not recorded /// ENSMUST00000155020 // GO:0008474 // palmitoyl-(protein) hydrolase activity // not recorded /// ENSMUST00000155020 // GO:0016787 // hydrolase activity // inferred from electronic annotation /// ENSMUST00000141278 // GO:0004622 // lysophospholipase activity // not recorded /// ENSMUST00000141278 // GO:0008474 // palmitoyl-(protein) hydrolase activity // not recorded /// ENSMUST00000141278 // GO:0016787 // hydrolase activity // inferred from electronic annotation /// AK050549 // GO:0004622 // lysophospholipase activity // not recorded /// AK050549 // GO:0008474 // palmitoyl-(protein) hydrolase activity // not recorded /// AK050549 // GO:0016787 // hydrolase activity // inferred from electronic annotation /// AK167231 // GO:0004622 // lysophospholipase activity // not recorded /// AK167231 // GO:0008474 // palmitoyl-(protein) hydrolase activity // not recorded /// AK167231 // GO:0016787 // hydrolase activity // inferred from electronic annotation /// ENSMUST00000115529 // GO:0004622 // lysophospholipase activity // not recorded /// ENSMUST00000115529 // GO:0008474 // palmitoyl-(protein) hydrolase activity // not recorded /// ENSMUST00000115529 // GO:0016787 // hydrolase activity // inferred from electronic annotation /// ENSMUST00000137887 // GO:0004622 // lysophospholipase activity // not recorded /// ENSMUST00000137887 // GO:0008474 // palmitoyl-(protein) hydrolase activity // not recorded /// ENSMUST00000137887 // GO:0016787 // hydrolase activity // inferred from electronic annotation /// AK034851 // GO:0004622 // lysophospholipase activity // not recorded /// AK034851 // GO:0008474 // palmitoyl-(protein) hydrolase activity // not recorded /// AK034851 // GO:0016787 // hydrolase activity // inferred from electronic annotation /// ENSMUST00000131119 // GO:0004622 // lysophospholipase activity // not recorded /// ENSMUST00000131119 // GO:0008474 // palmitoyl-(protein) hydrolase activity // not recorded /// ENSMUST00000131119 // GO:0016787 // hydrolase activity // inferred from electronic annotation /// ENSMUST00000119612 // GO:0004622 // lysophospholipase activity // not recorded /// ENSMUST00000119612 // GO:0008474 // palmitoyl-(protein) hydrolase activity // not recorded /// ENSMUST00000119612 // GO:0016787 // hydrolase activity // inferred from electronic annotation', 'NM_001159751 // GO:0003676 // nucleic acid binding // inferred from electronic annotation /// NM_001159751 // GO:0003677 // DNA binding // inferred from electronic annotation /// NM_001159751 // GO:0005515 // protein binding // inferred from physical interaction /// NM_001159751 // GO:0008270 // zinc ion binding // inferred from electronic annotation /// NM_001159751 // GO:0046872 // metal ion binding // inferred from electronic annotation /// ENSMUST00000165720 // GO:0003676 // nucleic acid binding // inferred from electronic annotation /// ENSMUST00000165720 // GO:0003677 // DNA binding // inferred from electronic annotation /// ENSMUST00000165720 // GO:0005515 // protein binding // inferred from physical interaction /// ENSMUST00000165720 // GO:0008270 // zinc ion binding // inferred from electronic annotation /// ENSMUST00000165720 // GO:0046872 // metal ion binding // inferred from electronic annotation /// NM_011541 // GO:0003676 // nucleic acid binding // inferred from electronic annotation /// NM_011541 // GO:0003677 // DNA binding // inferred from electronic annotation /// NM_011541 // GO:0005515 // protein binding // inferred from physical interaction /// NM_011541 // GO:0008270 // zinc ion binding // inferred from electronic annotation /// NM_011541 // GO:0046872 // metal ion binding // inferred from electronic annotation /// NM_001159750 // GO:0003676 // nucleic acid binding // inferred from electronic annotation /// NM_001159750 // GO:0003677 // DNA binding // inferred from electronic annotation /// NM_001159750 // GO:0005515 // protein binding // inferred from physical interaction /// NM_001159750 // GO:0008270 // zinc ion binding // inferred from electronic annotation /// NM_001159750 // GO:0046872 // metal ion binding // inferred from electronic annotation /// ENSMUST00000081551 // GO:0003676 // nucleic acid binding // inferred from electronic annotation /// ENSMUST00000081551 // GO:0003677 // DNA binding // inferred from electronic annotation /// ENSMUST00000081551 // GO:0005515 // protein binding // inferred from physical interaction /// ENSMUST00000081551 // GO:0008270 // zinc ion binding // inferred from electronic annotation /// ENSMUST00000081551 // GO:0046872 // metal ion binding // inferred from electronic annotation /// M18210 // GO:0003676 // nucleic acid binding // inferred from electronic annotation /// M18210 // GO:0003677 // DNA binding // inferred from electronic annotation /// M18210 // GO:0005515 // protein binding // inferred from physical interaction /// M18210 // GO:0008270 // zinc ion binding // inferred from electronic annotation /// M18210 // GO:0046872 // metal ion binding // inferred from electronic annotation', '---'], 'pathway': ['---', '---', '---', '---', '---'], 'protein_domains': ['---', '---', 'ENSMUST00000027036 // Pfam // IPR003140 // Phospholipase/carboxylesterase/thioesterase /// ENSMUST00000027036 // Pfam // IPR013094 // Alpha/beta hydrolase fold-3 /// ENSMUST00000115529 // Pfam // IPR003140 // Phospholipase/carboxylesterase/thioesterase /// ENSMUST00000137887 // Pfam // IPR003140 // Phospholipase/carboxylesterase/thioesterase /// ENSMUST00000137887 // Pfam // IPR013094 // Alpha/beta hydrolase fold-3 /// ENSMUST00000131119 // Pfam // IPR003140 // Phospholipase/carboxylesterase/thioesterase /// ENSMUST00000131119 // Pfam // IPR013094 // Alpha/beta hydrolase fold-3', 'ENSMUST00000165720 // Pfam // IPR001222 // Zinc finger, TFIIS-type /// ENSMUST00000165720 // Pfam // IPR003618 // Transcription elongation factor S-II, central domain /// ENSMUST00000165720 // Pfam // IPR017923 // Transcription factor IIS, N-terminal /// ENSMUST00000081551 // Pfam // IPR001222 // Zinc finger, TFIIS-type /// ENSMUST00000081551 // Pfam // IPR003618 // Transcription elongation factor S-II, central domain /// ENSMUST00000081551 // Pfam // IPR017923 // Transcription factor IIS, N-terminal', '---'], 'crosshyb_type': ['3', '1', '1', '1', '1'], 'category': ['main', 'main', 'main', 'main', 'main']}\n", "\n", "Column names in gene annotation data:\n", "['ID', 'probeset_id', 'SPOT_ID', 'seqname', 'strand', 'start', 'stop', 'total_probes', 'gene_assignment', 'mrna_assignment', 'swissprot', 'unigene', 'GO_biological_process', 'GO_cellular_component', 'GO_molecular_function', 'pathway', 'protein_domains', 'crosshyb_type', 'category']\n", "\n", "The dataset contains genomic regions (SPOT_ID) that could be used for location-based gene mapping.\n", "Example SPOT_ID format: chr1(+):3102016-3102125\n" ] } ], "source": [ "# 1. Extract gene annotation data from the SOFT file\n", "print(\"Extracting gene annotation data from SOFT file...\")\n", "try:\n", " # Use the library function to extract gene annotation\n", " gene_annotation = get_gene_annotation(soft_file)\n", " print(f\"Successfully extracted gene annotation data with {len(gene_annotation.index)} rows\")\n", " \n", " # Preview the annotation DataFrame\n", " print(\"\\nGene annotation preview (first few rows):\")\n", " print(preview_df(gene_annotation))\n", " \n", " # Show column names to help identify which columns we need for mapping\n", " print(\"\\nColumn names in gene annotation data:\")\n", " print(gene_annotation.columns.tolist())\n", " \n", " # Check for relevant mapping columns\n", " if 'GB_ACC' in gene_annotation.columns:\n", " print(\"\\nThe dataset contains GenBank accessions (GB_ACC) that could be used for gene mapping.\")\n", " # Count non-null values in GB_ACC column\n", " non_null_count = gene_annotation['GB_ACC'].count()\n", " print(f\"Number of rows with GenBank accessions: {non_null_count} out of {len(gene_annotation)}\")\n", " \n", " if 'SPOT_ID' in gene_annotation.columns:\n", " print(\"\\nThe dataset contains genomic regions (SPOT_ID) that could be used for location-based gene mapping.\")\n", " print(\"Example SPOT_ID format:\", gene_annotation['SPOT_ID'].iloc[0])\n", " \n", "except Exception as e:\n", " print(f\"Error processing gene annotation data: {e}\")\n", " is_gene_available = False\n" ] }, { "cell_type": "markdown", "id": "0adef343", "metadata": {}, "source": [ "### Step 6: Gene Identifier Mapping" ] }, { "cell_type": "code", "execution_count": 7, "id": "09997772", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T07:17:07.468560Z", "iopub.status.busy": "2025-03-25T07:17:07.468392Z", "iopub.status.idle": "2025-03-25T07:17:07.717737Z", "shell.execute_reply": "2025-03-25T07:17:07.717379Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Examining gene_assignment format in the first few rows:\n", "['---', '---', 'NM_008866 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000027036 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// BC013536 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// BC052848 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// U89352 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// CT010201 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000134384 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000150971 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000134384 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000155020 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000141278 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// AK050549 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// AK167231 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000115529 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000137887 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// AK034851 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000131119 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777 /// ENSMUST00000119612 // Lypla1 // lysophospholipase 1 // 1 A1|1 // 18777']\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Gene mapping preview (first few rows):\n", " ID Gene\n", "2 17210855 [Lypla1]\n", "3 17210869 [Tcea1]\n", "5 17210887 [Atp6v1h]\n", "6 17210904 [Oprk1]\n", "7 17210912 [Rb1cc1]\n", "Number of probes with gene mappings: 27017\n", "Number of common IDs between gene_mapping and gene_data: 27017\n", "\n", "Mapped gene expression data preview (first few rows):\n", "Empty DataFrame\n", "Columns: [GSM2742483, GSM2742484, GSM2742485, GSM2742486, GSM2742487, GSM2742488]\n", "Index: []\n", "\n", "Gene expression data dimensions: (0, 6)\n", "Gene expression data saved to ../../output/preprocess/Kidney_Clear_Cell_Carcinoma/gene_data/GSE102807.csv\n", "Note: Although we mapped the gene expression, this is mouse data not human data.\n", "For human trait associations, we'll mark gene expression as unavailable.\n" ] } ], "source": [ "# 1. Determine which columns to use for mapping\n", "# From examining the gene_data and gene_annotation dataframes:\n", "# - 'ID' in gene_annotation contains the same identifiers as the index in gene_data\n", "# - 'gene_assignment' contains gene symbol information, but needs parsing\n", "\n", "# Check the first few gene_assignment values to understand the format\n", "print(\"Examining gene_assignment format in the first few rows:\")\n", "print(gene_annotation['gene_assignment'].head(3).tolist())\n", "\n", "# Create a modified mapping function that works with this specific gene annotation format\n", "def get_mouse_gene_mapping(annotation_df):\n", " \"\"\"\n", " Extract probe ID to gene symbol mapping from mouse gene annotation data.\n", " The gene_assignment column has a complex format with multiple gene entries separated by /// \n", " and each entry having gene identifier information and gene symbol.\n", " \"\"\"\n", " mapping_data = annotation_df[['ID', 'gene_assignment']].copy()\n", " mapping_data = mapping_data.rename(columns={'gene_assignment': 'Gene'})\n", " \n", " # Extract mouse gene symbols from the gene_assignment text\n", " def extract_mouse_gene_symbols(text):\n", " if text == '---' or pd.isna(text):\n", " return []\n", " \n", " # Extract gene symbols following the pattern RefSeq_ID // GeneSymbol // Description\n", " genes = []\n", " # Look for patterns like \"// Lypla1 //\" where Lypla1 is the gene symbol\n", " segments = text.split('///')\n", " for segment in segments:\n", " # Find the pattern \"// GeneSymbol //\"\n", " match = re.search(r'//\\s+([A-Za-z0-9-]+)\\s+//', segment)\n", " if match:\n", " genes.append(match.group(1))\n", " \n", " # Remove duplicates while preserving order\n", " return list(dict.fromkeys(genes))\n", " \n", " mapping_data['Gene'] = mapping_data['Gene'].apply(extract_mouse_gene_symbols)\n", " \n", " # Filter rows with no gene symbols\n", " mapping_data = mapping_data[mapping_data['Gene'].apply(len) > 0]\n", " \n", " return mapping_data\n", "\n", "# 2. Get gene mapping dataframe\n", "gene_mapping = get_mouse_gene_mapping(gene_annotation)\n", "\n", "# Print the mapping dataframe to verify\n", "print(\"\\nGene mapping preview (first few rows):\")\n", "print(gene_mapping.head())\n", "print(f\"Number of probes with gene mappings: {len(gene_mapping)}\")\n", "\n", "# Check if the IDs in gene_mapping exist in gene_data\n", "common_ids = set(gene_mapping['ID']).intersection(set(gene_data.index))\n", "print(f\"Number of common IDs between gene_mapping and gene_data: {len(common_ids)}\")\n", "\n", "# 3. Apply gene mapping to convert probe values to gene expression data\n", "# Since we're working with mouse data but our project is about human disease,\n", "# we'll map the mouse genes but mark the data as not applicable for human studies\n", "try:\n", " # Convert gene_data index to string type to match mapping\n", " gene_data.index = gene_data.index.astype(str)\n", " \n", " # Apply gene mapping\n", " gene_data_mapped = apply_gene_mapping(gene_data, gene_mapping)\n", " \n", " # Print results\n", " print(\"\\nMapped gene expression data preview (first few rows):\")\n", " print(gene_data_mapped.head())\n", " print(f\"\\nGene expression data dimensions: {gene_data_mapped.shape}\")\n", " \n", " # Save the gene expression data\n", " os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)\n", " gene_data_mapped.to_csv(out_gene_data_file)\n", " print(f\"Gene expression data saved to {out_gene_data_file}\")\n", " \n", " # This is mouse data not human data, so we should mark it as not available\n", " is_gene_available = False\n", " print(\"Note: Although we mapped the gene expression, this is mouse data not human data.\")\n", " print(\"For human trait associations, we'll mark gene expression as unavailable.\")\n", " \n", "except Exception as e:\n", " print(f\"Error applying gene mapping: {e}\")\n", " is_gene_available = False\n" ] }, { "cell_type": "markdown", "id": "743766c5", "metadata": {}, "source": [ "### Step 7: Data Normalization and Linking" ] }, { "cell_type": "code", "execution_count": 8, "id": "4d0d1ac9", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T07:17:07.719254Z", "iopub.status.busy": "2025-03-25T07:17:07.719142Z", "iopub.status.idle": "2025-03-25T07:17:07.810831Z", "shell.execute_reply": "2025-03-25T07:17:07.810476Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Normalizing gene symbols...\n", "After normalization: 0 unique gene symbols\n", "Normalized gene expression data saved to ../../output/preprocess/Kidney_Clear_Cell_Carcinoma/gene_data/GSE102807.csv\n", "\n", "Checking trait availability from previous analysis...\n", "Error loading clinical data: [Errno 2] No such file or directory: '../../output/preprocess/Kidney_Clear_Cell_Carcinoma/clinical_data/GSE102807.csv'\n", "\n", "Linking clinical and genetic data...\n", "Cannot link data: clinical or genetic data is missing.\n", "Reason: Trait column 'Kidney_Clear_Cell_Carcinoma' is not available in clinical data.\n", "Reason: Gene expression data is empty.\n", "\n", "Performing final validation...\n", "Abnormality detected in the cohort: GSE102807. Preprocessing failed.\n", "Dataset not usable for Kidney_Clear_Cell_Carcinoma association studies. Data not saved.\n" ] } ], "source": [ "# 1. Normalize gene symbols in the gene expression data\n", "print(\"\\nNormalizing gene symbols...\")\n", "try:\n", " # Check if gene_data is empty before normalization\n", " if gene_data.empty:\n", " print(\"Gene data is empty. Skipping normalization.\")\n", " normalized_gene_data = gene_data\n", " else:\n", " normalized_gene_data = normalize_gene_symbols_in_index(gene_data)\n", " print(f\"After normalization: {len(normalized_gene_data.index)} unique gene symbols\")\n", " \n", " # Save the normalized gene data (even if empty, to maintain consistent workflow)\n", " os.makedirs(os.path.dirname(out_gene_data_file), exist_ok=True)\n", " normalized_gene_data.to_csv(out_gene_data_file)\n", " print(f\"Normalized gene expression data saved to {out_gene_data_file}\")\n", "except Exception as e:\n", " print(f\"Error normalizing gene symbols: {e}\")\n", " normalized_gene_data = gene_data # Use original data if normalization fails\n", "\n", "# Use is_trait_available from previous steps, don't recheck trait_row\n", "print(\"\\nChecking trait availability from previous analysis...\")\n", "# Load the clinical data from the previously saved file\n", "try:\n", " clinical_df = pd.read_csv(out_clinical_data_file)\n", " print(f\"Loaded clinical data with shape: {clinical_df.shape}\")\n", " # Rename the column '1' to the trait name if it exists\n", " if '1' in clinical_df.columns:\n", " clinical_df = clinical_df.rename(columns={'1': trait})\n", " print(f\"Renamed column '1' to '{trait}'\")\n", " is_trait_available = trait in clinical_df.columns\n", "except Exception as e:\n", " print(f\"Error loading clinical data: {e}\")\n", " clinical_df = pd.DataFrame()\n", " is_trait_available = False\n", "\n", "# 2. Link clinical and genetic data if available\n", "print(\"\\nLinking clinical and genetic data...\")\n", "try:\n", " if is_trait_available and not normalized_gene_data.empty:\n", " # Print sample IDs from both datasets for debugging\n", " print(\"Clinical columns:\", list(clinical_df.columns))\n", " print(\"First few genetic sample columns:\", list(normalized_gene_data.columns)[:5])\n", " \n", " # Transpose clinical data so samples are rows\n", " if clinical_df.shape[0] == 1: # If it's currently 1 row with samples as columns\n", " clinical_df = clinical_df.T\n", " clinical_df.columns = [trait]\n", " print(f\"Transposed clinical data to shape: {clinical_df.shape}\")\n", " \n", " # Now link clinical and genetic data\n", " linked_data = pd.concat([clinical_df, normalized_gene_data.T], axis=1)\n", " print(f\"Linked data shape: {linked_data.shape}\")\n", " \n", " # Check if we have at least one sample with trait value\n", " if trait in linked_data.columns:\n", " trait_count = linked_data[trait].count()\n", " print(f\"Number of samples with trait values: {trait_count}\")\n", " \n", " if trait_count > 0:\n", " # 3. Handle missing values systematically\n", " print(\"\\nHandling missing values...\")\n", " linked_data = handle_missing_values(linked_data, trait)\n", " print(f\"After handling missing values, data shape: {linked_data.shape}\")\n", " \n", " # Check if we still have samples after missing value handling\n", " if linked_data.shape[0] > 0:\n", " # 4. Determine whether the trait and demographic features are biased\n", " print(\"\\nChecking for bias in features...\")\n", " is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)\n", " else:\n", " print(\"Error: All samples were removed during missing value handling.\")\n", " is_biased = True\n", " else:\n", " print(\"No samples have valid trait values. Dataset cannot be used.\")\n", " is_biased = True\n", " else:\n", " print(f\"Trait column '{trait}' not found in linked data.\")\n", " is_biased = True\n", " else:\n", " print(\"Cannot link data: clinical or genetic data is missing.\")\n", " if not is_trait_available:\n", " print(f\"Reason: Trait column '{trait}' is not available in clinical data.\")\n", " if normalized_gene_data.empty:\n", " print(\"Reason: Gene expression data is empty.\")\n", " linked_data = pd.DataFrame()\n", " is_biased = True\n", " \n", "except Exception as e:\n", " print(f\"Error in linking clinical and genetic data: {e}\")\n", " linked_data = pd.DataFrame()\n", " is_biased = True\n", "\n", "# 5. Final quality validation\n", "print(\"\\nPerforming final validation...\")\n", "note = \"\"\n", "if 'linked_data' in locals() and linked_data.empty:\n", " if not normalized_gene_data.empty and not clinical_df.empty:\n", " note = \"Dataset failed in linking phase. Clinical data structure could not be properly matched with gene expression data.\"\n", " elif normalized_gene_data.empty:\n", " note = \"Dataset failed in gene mapping phase. Could not properly map probe IDs to gene symbols.\"\n", " elif clinical_df.empty:\n", " note = \"Dataset failed in clinical data extraction. No valid trait information available.\"\n", "elif 'is_biased' in locals() and is_biased:\n", " note = \"Dataset passed initial processing but contains severely biased trait distribution.\"\n", "\n", "is_usable = validate_and_save_cohort_info(\n", " is_final=True,\n", " cohort=cohort,\n", " info_path=json_path,\n", " is_gene_available=not normalized_gene_data.empty, # Set based on actual gene data availability\n", " is_trait_available=is_trait_available,\n", " is_biased=is_biased if 'is_biased' in locals() else True,\n", " df=linked_data if 'linked_data' in locals() and not linked_data.empty else pd.DataFrame(),\n", " note=note\n", ")\n", "\n", "# 6. Save linked data if usable\n", "if is_usable and 'linked_data' in locals() and not linked_data.empty:\n", " # Create directory if it doesn't exist\n", " os.makedirs(os.path.dirname(out_data_file), exist_ok=True)\n", " \n", " # Save linked data\n", " linked_data.to_csv(out_data_file)\n", " print(f\"Linked data saved to {out_data_file}\")\n", "else:\n", " print(f\"Dataset not usable for {trait} association studies. Data not saved.\")" ] } ], "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 }