{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "e0a867b3", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T03:55:58.480557Z", "iopub.status.busy": "2025-03-25T03:55:58.480457Z", "iopub.status.idle": "2025-03-25T03:55:58.647160Z", "shell.execute_reply": "2025-03-25T03:55:58.646803Z" } }, "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 = \"Schizophrenia\"\n", "cohort = \"GSE145554\"\n", "\n", "# Input paths\n", "in_trait_dir = \"../../input/GEO/Schizophrenia\"\n", "in_cohort_dir = \"../../input/GEO/Schizophrenia/GSE145554\"\n", "\n", "# Output paths\n", "out_data_file = \"../../output/preprocess/Schizophrenia/GSE145554.csv\"\n", "out_gene_data_file = \"../../output/preprocess/Schizophrenia/gene_data/GSE145554.csv\"\n", "out_clinical_data_file = \"../../output/preprocess/Schizophrenia/clinical_data/GSE145554.csv\"\n", "json_path = \"../../output/preprocess/Schizophrenia/cohort_info.json\"\n" ] }, { "cell_type": "markdown", "id": "9416ae57", "metadata": {}, "source": [ "### Step 1: Initial Data Loading" ] }, { "cell_type": "code", "execution_count": 2, "id": "dd71019b", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T03:55:58.648582Z", "iopub.status.busy": "2025-03-25T03:55:58.648431Z", "iopub.status.idle": "2025-03-25T03:55:58.762312Z", "shell.execute_reply": "2025-03-25T03:55:58.762012Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Background Information:\n", "!Series_title\t\"Transcriptional profile of pyramidal neurons in chronic schizophrenia reveals lamina-specific dysfunction of neuronal immunity\"\n", "!Series_summary\t\"While the pathophysiology of schizophrenia has been extensively investigated using homogenized postmortem brain samples, few studies have examined changes in brain samples with techniques that may attribute perturbations to specific cell types. To fill this gap, we performed microarray assays on mRNA isolated from anterior cingulate cortex (ACC) superficial and deep pyramidal neurons from 12 schizophrenia and 12 control subjects using laser capture microdissection. Among all the annotated genes, we identified 134 significantly increased and 130 decreased genes in superficial pyramidal neurons, while 93 significantly increased and 101 decreased genes were found in deep pyramidal neurons, in schizophrenia compared to control subjects. In these differentially expressed genes, we detected lamina-specific changes of 55 and 31 genes in superficial and deep neurons in schizophrenia, respectively. Gene set enrichment analysis (GSEA) was applied to the entire pre-ranked differential expression gene lists to gain a complete pathway analysis throughout all annotated genes. Our analysis revealed over-represented groups of gene sets in schizophrenia, particularly in immunity and synapse related pathways in pyramidal neurons, suggesting the disruption of these pathways plays an important role in schizophrenia. We also detected other pathways previously demonstrated in schizophrenia pathophysiology, including cytokine and chemotaxis, post-synaptic signaling, and glutamatergic synapses. In addition, we observed several novel pathways, including ubiquitin-independent protein catabolic process. We also used a bioinformatics approach to compare our differential expression gene profiles with 51 antipsychotic treatment datasets, demonstrating that our results were not influenced by antipsychotic treatment. Taken together, we found pyramidal neuron-specific changes in neuronal immunity, synaptic dysfunction, and olfactory dysregulation in schizophrenia, providing new insights for the cell-subtype specific pathophysiology of chronic schizophrenia.\"\n", "!Series_overall_design\t\"we performed microarray assays on mRNA isolated from anterior cingulate cortex (ACC) superficial and deep pyramidal neurons from 12 schizophrenia and 12 control subjects using laser capture microdissection\"\n", "Sample Characteristics Dictionary:\n", "{0: ['disease state: schizophrenia', 'disease state: control'], 1: ['Sex: Male', 'Sex: Female'], 2: ['pmi: 372', 'pmi: 250', 'pmi: 1225', 'pmi: 255', 'pmi: 203', 'pmi: 1110', 'pmi: 504', 'pmi: 600', 'pmi: 230', 'pmi: 1140', 'pmi: 940', 'pmi: 417', 'pmi: 454', 'pmi: 1092', 'pmi: 410', 'pmi: 583', 'pmi: 534', 'pmi: 737', 'pmi: 465', 'pmi: 720', 'pmi: 415', 'pmi: 800', 'pmi: 1220'], 3: ['age: 63', 'age: 90', 'age: 83', 'age: 69', 'age: 73', 'age: 84', 'age: 66', 'age: 78', 'age: 65', 'age: 89', 'age: 74', 'age: 86', 'age: 79', 'age: 77', 'age: 68', 'age: 59', 'age: 58', 'age: 72', 'age: 80', 'age: 57'], 4: ['ph: 5.9', 'ph: 6', 'ph: 7.1', 'ph: 6.3', 'ph: 6.21', 'ph: 6.69', 'ph: 6.19', 'ph: 6.82', 'ph: 6.72', 'ph: 6.68', 'ph: 6.58', 'ph: 5.8', 'ph: 6.6', 'ph: 6.01', 'ph: 6.27', 'ph: 6.63', 'ph: 6.17', 'ph: 5.97', 'ph: 6.9', 'ph: 6.1'], 5: ['meds: ON', 'meds: OFF', 'meds: Unknown'], 6: ['tissue: pyramidal neurons'], 7: ['tissue source: Neurons captured by LCM isolated from superficial (lamina II-III) layers', 'tissue source: Neurons captured by LCM isolated from deep (lamina V-VI) layers']}\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": "07a0cf6f", "metadata": {}, "source": [ "### Step 2: Dataset Analysis and Clinical Feature Extraction" ] }, { "cell_type": "code", "execution_count": 3, "id": "63a6d36d", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T03:55:58.763466Z", "iopub.status.busy": "2025-03-25T03:55:58.763359Z", "iopub.status.idle": "2025-03-25T03:55:58.774672Z", "shell.execute_reply": "2025-03-25T03:55:58.774382Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Preview of clinical data:\n", "{0: [1.0, 63.0, 1.0], 1: [0.0, 90.0, 0.0], 2: [nan, 83.0, nan], 3: [nan, 69.0, nan], 4: [nan, 73.0, nan], 5: [nan, 84.0, nan], 6: [nan, 66.0, nan], 7: [nan, 78.0, nan], 8: [nan, 65.0, nan], 9: [nan, 89.0, nan], 10: [nan, 74.0, nan], 11: [nan, 86.0, nan], 12: [nan, 79.0, nan], 13: [nan, 77.0, nan], 14: [nan, 68.0, nan], 15: [nan, 59.0, nan], 16: [nan, 58.0, nan], 17: [nan, 72.0, nan], 18: [nan, 80.0, nan], 19: [nan, 57.0, nan], 20: [nan, nan, nan], 21: [nan, nan, nan], 22: [nan, nan, nan]}\n", "Clinical data saved to ../../output/preprocess/Schizophrenia/clinical_data/GSE145554.csv\n" ] } ], "source": [ "# 1. Check if gene expression data is available\n", "is_gene_available = True # Based on the background info, this dataset contains gene expression data from microarray assays\n", "\n", "# 2.1 Identify keys for trait, age, and gender in the sample characteristics dictionary\n", "trait_row = 0 # \"disease state\" contains schizophrenia vs control\n", "age_row = 3 # \"age\" information is available\n", "gender_row = 1 # \"Sex\" information is available\n", "\n", "# 2.2 Data type conversion functions for each variable\n", "\n", "def convert_trait(value):\n", " \"\"\"Convert trait values to binary 0/1 format.\"\"\"\n", " if value is None:\n", " return None\n", " # Extract value after the colon\n", " if \":\" in value:\n", " value = value.split(\":\", 1)[1].strip().lower()\n", " else:\n", " value = value.strip().lower()\n", " \n", " if \"schizophrenia\" in value:\n", " return 1\n", " elif \"control\" in value:\n", " return 0\n", " else:\n", " return None\n", "\n", "def convert_age(value):\n", " \"\"\"Convert age values to numeric format.\"\"\"\n", " if value is None:\n", " return None\n", " # Extract value after the colon\n", " if \":\" in value:\n", " value = value.split(\":\", 1)[1].strip()\n", " else:\n", " value = value.strip()\n", " \n", " try:\n", " return float(value)\n", " except:\n", " return None\n", "\n", "def convert_gender(value):\n", " \"\"\"Convert gender values to binary 0/1 format (female=0, male=1).\"\"\"\n", " if value is None:\n", " return None\n", " # Extract value after the colon\n", " if \":\" in value:\n", " value = value.split(\":\", 1)[1].strip().lower()\n", " else:\n", " value = value.strip().lower()\n", " \n", " if \"female\" in value:\n", " return 0\n", " elif \"male\" in value:\n", " return 1\n", " else:\n", " return None\n", "\n", "# 3. Save metadata - initial filtering\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 (if trait data is available)\n", "if trait_row is not None:\n", " # Create the sample characteristics DataFrame from the dictionary provided in the previous step\n", " sample_characteristics_dict = {\n", " 0: ['disease state: schizophrenia', 'disease state: control'], \n", " 1: ['Sex: Male', 'Sex: Female'], \n", " 2: ['pmi: 372', 'pmi: 250', 'pmi: 1225', 'pmi: 255', 'pmi: 203', 'pmi: 1110', 'pmi: 504', 'pmi: 600', 'pmi: 230', 'pmi: 1140', 'pmi: 940', 'pmi: 417', 'pmi: 454', 'pmi: 1092', 'pmi: 410', 'pmi: 583', 'pmi: 534', 'pmi: 737', 'pmi: 465', 'pmi: 720', 'pmi: 415', 'pmi: 800', 'pmi: 1220'], \n", " 3: ['age: 63', 'age: 90', 'age: 83', 'age: 69', 'age: 73', 'age: 84', 'age: 66', 'age: 78', 'age: 65', 'age: 89', 'age: 74', 'age: 86', 'age: 79', 'age: 77', 'age: 68', 'age: 59', 'age: 58', 'age: 72', 'age: 80', 'age: 57'], \n", " 4: ['ph: 5.9', 'ph: 6', 'ph: 7.1', 'ph: 6.3', 'ph: 6.21', 'ph: 6.69', 'ph: 6.19', 'ph: 6.82', 'ph: 6.72', 'ph: 6.68', 'ph: 6.58', 'ph: 5.8', 'ph: 6.6', 'ph: 6.01', 'ph: 6.27', 'ph: 6.63', 'ph: 6.17', 'ph: 5.97', 'ph: 6.9', 'ph: 6.1'], \n", " 5: ['meds: ON', 'meds: OFF', 'meds: Unknown'], \n", " 6: ['tissue: pyramidal neurons'], \n", " 7: ['tissue source: Neurons captured by LCM isolated from superficial (lamina II-III) layers', 'tissue source: Neurons captured by LCM isolated from deep (lamina V-VI) layers']\n", " }\n", " \n", " # Convert to DataFrame format expected by geo_select_clinical_features\n", " clinical_data = pd.DataFrame.from_dict(sample_characteristics_dict, orient='index')\n", " \n", " # Extract clinical features\n", " 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 data\n", " preview = preview_df(clinical_df)\n", " print(\"Preview of clinical data:\")\n", " print(preview)\n", " \n", " # Create the directory if it doesn't exist\n", " os.makedirs(os.path.dirname(out_clinical_data_file), exist_ok=True)\n", " \n", " # Save the clinical data\n", " clinical_df.to_csv(out_clinical_data_file, index=False)\n", " print(f\"Clinical data saved to {out_clinical_data_file}\")\n" ] }, { "cell_type": "markdown", "id": "8fedd1b1", "metadata": {}, "source": [ "### Step 3: Gene Data Extraction" ] }, { "cell_type": "code", "execution_count": 4, "id": "b01d0699", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T03:55:58.775695Z", "iopub.status.busy": "2025-03-25T03:55:58.775591Z", "iopub.status.idle": "2025-03-25T03:55:58.932323Z", "shell.execute_reply": "2025-03-25T03:55:58.931932Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Matrix file found: ../../input/GEO/Schizophrenia/GSE145554/GSE145554_series_matrix.txt.gz\n", "Gene data shape: (32321, 43)\n", "First 20 gene/probe identifiers:\n", "Index(['7892501', '7892502', '7892503', '7892504', '7892505', '7892506',\n", " '7892507', '7892508', '7892509', '7892510', '7892511', '7892512',\n", " '7892513', '7892514', '7892515', '7892516', '7892517', '7892518',\n", " '7892519', '7892520'],\n", " dtype='object', name='ID')\n" ] } ], "source": [ "# 1. Get the SOFT and matrix file paths again \n", "soft_file, matrix_file = geo_get_relevant_filepaths(in_cohort_dir)\n", "print(f\"Matrix file found: {matrix_file}\")\n", "\n", "# 2. Use the get_genetic_data function from the library to get the gene_data\n", "try:\n", " gene_data = get_genetic_data(matrix_file)\n", " print(f\"Gene data shape: {gene_data.shape}\")\n", " \n", " # 3. Print the first 20 row IDs (gene or probe identifiers)\n", " print(\"First 20 gene/probe identifiers:\")\n", " print(gene_data.index[:20])\n", "except Exception as e:\n", " print(f\"Error extracting gene data: {e}\")\n" ] }, { "cell_type": "markdown", "id": "284970c7", "metadata": {}, "source": [ "### Step 4: Gene Identifier Review" ] }, { "cell_type": "code", "execution_count": 5, "id": "32e520e0", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T03:55:58.933553Z", "iopub.status.busy": "2025-03-25T03:55:58.933434Z", "iopub.status.idle": "2025-03-25T03:55:58.935415Z", "shell.execute_reply": "2025-03-25T03:55:58.935134Z" } }, "outputs": [], "source": [ "# Review the gene identifiers\n", "# These appear to be probe IDs (numeric identifiers) rather than human gene symbols\n", "# Human gene symbols typically have alphabetic characters (like BRCA1, TP53, etc.)\n", "# These numeric identifiers (7892501, 7892502, etc.) are likely probe IDs from a microarray platform\n", "# and need to be mapped to gene symbols\n", "\n", "requires_gene_mapping = True\n" ] }, { "cell_type": "markdown", "id": "147ff88e", "metadata": {}, "source": [ "### Step 5: Gene Annotation" ] }, { "cell_type": "code", "execution_count": 6, "id": "11ef12dc", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T03:55:58.936531Z", "iopub.status.busy": "2025-03-25T03:55:58.936428Z", "iopub.status.idle": "2025-03-25T03:56:06.094601Z", "shell.execute_reply": "2025-03-25T03:56:06.094277Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "Gene annotation preview:\n", "Columns in gene annotation: ['ID', 'GB_LIST', 'SPOT_ID', 'seqname', 'RANGE_GB', 'RANGE_STRAND', 'RANGE_START', 'RANGE_STOP', 'total_probes', 'gene_assignment', 'mrna_assignment', 'category']\n", "{'ID': ['7896736', '7896738', '7896740', '7896742', '7896744'], 'GB_LIST': [nan, nan, 'NM_001004195,NM_001005240,NM_001005484,BC136848,BC136867,BC136907,BC136908', 'NR_024437,XM_006711854,XM_006726377,XR_430662,AK298283,AL137655,BC032332,BC118988,BC122537,BC131690,NM_207366,AK301928,BC071667', 'NM_001005221,NM_001005224,NM_001005277,NM_001005504,BC137547,BC137568'], 'SPOT_ID': ['chr1:53049-54936', 'chr1:63015-63887', 'chr1:69091-70008', 'chr1:334129-334296', 'chr1:367659-368597'], 'seqname': ['chr1', 'chr1', 'chr1', 'chr1', 'chr1'], 'RANGE_GB': ['NC_000001.10', 'NC_000001.10', 'NC_000001.10', 'NC_000001.10', 'NC_000001.10'], 'RANGE_STRAND': ['+', '+', '+', '+', '+'], 'RANGE_START': ['53049', '63015', '69091', '334129', '367659'], 'RANGE_STOP': ['54936', '63887', '70008', '334296', '368597'], 'total_probes': [7.0, 31.0, 24.0, 6.0, 36.0], 'gene_assignment': ['---', 'ENST00000328113 // OR4G2P // olfactory receptor, family 4, subfamily G, member 2 pseudogene // --- // --- /// ENST00000492842 // OR4G11P // olfactory receptor, family 4, subfamily G, member 11 pseudogene // --- // --- /// ENST00000588632 // OR4G1P // olfactory receptor, family 4, subfamily G, member 1 pseudogene // --- // ---', 'NM_001004195 // OR4F4 // olfactory receptor, family 4, subfamily F, member 4 // 15q26.3 // 26682 /// NM_001005240 // OR4F17 // olfactory receptor, family 4, subfamily F, member 17 // 19p13.3 // 81099 /// NM_001005484 // OR4F5 // olfactory receptor, family 4, subfamily F, member 5 // 1p36.33 // 79501 /// ENST00000318050 // OR4F17 // olfactory receptor, family 4, subfamily F, member 17 // 19p13.3 // 81099 /// ENST00000326183 // OR4F4 // olfactory receptor, family 4, subfamily F, member 4 // 15q26.3 // 26682 /// ENST00000335137 // OR4F5 // olfactory receptor, family 4, subfamily F, member 5 // 1p36.33 // 79501 /// ENST00000585993 // OR4F17 // olfactory receptor, family 4, subfamily F, member 17 // 19p13.3 // 81099 /// BC136848 // OR4F17 // olfactory receptor, family 4, subfamily F, member 17 // 19p13.3 // 81099 /// BC136867 // OR4F17 // olfactory receptor, family 4, subfamily F, member 17 // 19p13.3 // 81099 /// BC136907 // OR4F4 // olfactory receptor, family 4, subfamily F, member 4 // 15q26.3 // 26682 /// BC136908 // OR4F4 // olfactory receptor, family 4, subfamily F, member 4 // 15q26.3 // 26682', 'NR_024437 // LOC728323 // uncharacterized LOC728323 // 2q37.3 // 728323 /// XM_006711854 // LOC101060626 // F-box only protein 25-like // --- // 101060626 /// XM_006726377 // LOC101060626 // F-box only protein 25-like // --- // 101060626 /// XR_430662 // LOC101927097 // uncharacterized LOC101927097 // --- // 101927097 /// ENST00000279067 // LINC00266-1 // long intergenic non-protein coding RNA 266-1 // 20q13.33 // 140849 /// ENST00000431812 // LOC101928706 // uncharacterized LOC101928706 // --- // 101928706 /// ENST00000431812 // LOC101929823 // uncharacterized LOC101929823 // --- // 101929823 /// ENST00000433444 // LOC728323 // uncharacterized LOC728323 // 2q37.3 // 728323 /// ENST00000436899 // LINC00266-3 // long intergenic non-protein coding RNA 266-3 // --- // --- /// ENST00000445252 // LINC00266-1 // long intergenic non-protein coding RNA 266-1 // 20q13.33 // 140849 /// ENST00000455207 // LOC101928706 // uncharacterized LOC101928706 // --- // 101928706 /// ENST00000455207 // LOC101929823 // uncharacterized LOC101929823 // --- // 101929823 /// ENST00000455464 // LOC101928706 // uncharacterized LOC101928706 // --- // 101928706 /// ENST00000455464 // LOC101929823 // uncharacterized LOC101929823 // --- // 101929823 /// ENST00000456398 // LOC728323 // uncharacterized LOC728323 // 2q37.3 // 728323 /// ENST00000601814 // LOC101928706 // uncharacterized LOC101928706 // --- // 101928706 /// ENST00000601814 // LOC101929823 // uncharacterized LOC101929823 // --- // 101929823 /// AK298283 // LOC728323 // uncharacterized LOC728323 // 2q37.3 // 728323 /// AL137655 // LOC100134822 // uncharacterized LOC100134822 // --- // 100134822 /// BC032332 // PCMTD2 // protein-L-isoaspartate (D-aspartate) O-methyltransferase domain containing 2 // 20q13.33 // 55251 /// BC118988 // LINC00266-1 // long intergenic non-protein coding RNA 266-1 // 20q13.33 // 140849 /// BC122537 // LINC00266-1 // long intergenic non-protein coding RNA 266-1 // 20q13.33 // 140849 /// BC131690 // LOC728323 // uncharacterized LOC728323 // 2q37.3 // 728323 /// NM_207366 // SEPT14 // septin 14 // 7p11.2 // 346288 /// ENST00000388975 // SEPT14 // septin 14 // 7p11.2 // 346288 /// ENST00000427373 // LINC00266-4P // long intergenic non-protein coding RNA 266-4, pseudogene // --- // --- /// ENST00000431796 // LOC728323 // uncharacterized LOC728323 // 2q37.3 // 728323 /// ENST00000509776 // LINC00266-2P // long intergenic non-protein coding RNA 266-2, pseudogene // --- // --- /// ENST00000570230 // LOC101929008 // uncharacterized LOC101929008 // --- // 101929008 /// ENST00000570230 // LOC101929038 // uncharacterized LOC101929038 // --- // 101929038 /// ENST00000570230 // LOC101930130 // uncharacterized LOC101930130 // --- // 101930130 /// ENST00000570230 // LOC101930567 // uncharacterized LOC101930567 // --- // 101930567 /// AK301928 // SEPT14 // septin 14 // 7p11.2 // 346288', 'NM_001005221 // OR4F29 // olfactory receptor, family 4, subfamily F, member 29 // 1p36.33 // 729759 /// NM_001005224 // OR4F3 // olfactory receptor, family 4, subfamily F, member 3 // 5q35.3 // 26683 /// NM_001005277 // OR4F16 // olfactory receptor, family 4, subfamily F, member 16 // 1p36.33 // 81399 /// NM_001005504 // OR4F21 // olfactory receptor, family 4, subfamily F, member 21 // 8p23.3 // 441308 /// ENST00000320901 // OR4F21 // olfactory receptor, family 4, subfamily F, member 21 // 8p23.3 // 441308 /// ENST00000332831 // OR4F3 // olfactory receptor, family 4, subfamily F, member 3 // 5q35.3 // 26683 /// ENST00000332831 // OR4F16 // olfactory receptor, family 4, subfamily F, member 16 // 1p36.33 // 81399 /// ENST00000332831 // OR4F29 // olfactory receptor, family 4, subfamily F, member 29 // 1p36.33 // 729759 /// ENST00000402444 // OR4F7P // olfactory receptor, family 4, subfamily F, member 7 pseudogene // --- // --- /// ENST00000405102 // OR4F1P // olfactory receptor, family 4, subfamily F, member 1 pseudogene // --- // --- /// ENST00000424047 // OR4F2P // olfactory receptor, family 4, subfamily F, member 2 pseudogene // --- // --- /// ENST00000426406 // OR4F3 // olfactory receptor, family 4, subfamily F, member 3 // 5q35.3 // 26683 /// ENST00000426406 // OR4F16 // olfactory receptor, family 4, subfamily F, member 16 // 1p36.33 // 81399 /// ENST00000426406 // OR4F29 // olfactory receptor, family 4, subfamily F, member 29 // 1p36.33 // 729759 /// ENST00000456475 // OR4F3 // olfactory receptor, family 4, subfamily F, member 3 // 5q35.3 // 26683 /// ENST00000456475 // OR4F16 // olfactory receptor, family 4, subfamily F, member 16 // 1p36.33 // 81399 /// ENST00000456475 // OR4F29 // olfactory receptor, family 4, subfamily F, member 29 // 1p36.33 // 729759 /// ENST00000559128 // OR4F28P // olfactory receptor, family 4, subfamily F, member 28 pseudogene // --- // --- /// BC137547 // OR4F3 // olfactory receptor, family 4, subfamily F, member 3 // 5q35.3 // 26683 /// BC137547 // OR4F16 // olfactory receptor, family 4, subfamily F, member 16 // 1p36.33 // 81399 /// BC137547 // OR4F29 // olfactory receptor, family 4, subfamily F, member 29 // 1p36.33 // 729759 /// BC137568 // OR4F3 // olfactory receptor, family 4, subfamily F, member 3 // 5q35.3 // 26683 /// BC137568 // OR4F16 // olfactory receptor, family 4, subfamily F, member 16 // 1p36.33 // 81399 /// BC137568 // OR4F29 // olfactory receptor, family 4, subfamily F, member 29 // 1p36.33 // 729759 /// ENST00000589943 // OR4F8P // olfactory receptor, family 4, subfamily F, member 8 pseudogene // --- // ---'], 'mrna_assignment': ['NONHSAT060105 // NONCODE // Non-coding transcript identified by NONCODE // chr1 // 100 // 100 // 7 // 7 // 0', 'ENST00000328113 // ENSEMBL // havana:known chromosome:GRCh38:15:101926805:101927707:-1 gene:ENSG00000183909 gene_biotype:unprocessed_pseudogene transcript_biotype:unprocessed_pseudogene // chr1 // 100 // 100 // 31 // 31 // 0 /// ENST00000492842 // ENSEMBL // havana:known chromosome:GRCh38:1:62948:63887:1 gene:ENSG00000240361 gene_biotype:unprocessed_pseudogene transcript_biotype:unprocessed_pseudogene // chr1 // 100 // 100 // 31 // 31 // 0 /// ENST00000588632 // ENSEMBL // havana:known chromosome:GRCh38:19:104535:105471:1 gene:ENSG00000267310 gene_biotype:unprocessed_pseudogene transcript_biotype:unprocessed_pseudogene // chr1 // 100 // 100 // 31 // 31 // 0 /// NONHSAT000016 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 100 // 100 // 31 // 31 // 0 /// NONHSAT051704 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 100 // 100 // 31 // 31 // 0 /// NONHSAT060106 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 100 // 100 // 31 // 31 // 0', 'NM_001004195 // RefSeq // Homo sapiens olfactory receptor, family 4, subfamily F, member 4 (OR4F4), mRNA. // chr1 // 100 // 100 // 24 // 24 // 0 /// NM_001005240 // RefSeq // Homo sapiens olfactory receptor, family 4, subfamily F, member 17 (OR4F17), mRNA. // chr1 // 100 // 100 // 24 // 24 // 0 /// NM_001005484 // RefSeq // Homo sapiens olfactory receptor, family 4, subfamily F, member 5 (OR4F5), mRNA. // chr1 // 100 // 100 // 24 // 24 // 0 /// ENST00000318050 // ENSEMBL // ensembl:known chromosome:GRCh38:19:110643:111696:1 gene:ENSG00000176695 gene_biotype:protein_coding transcript_biotype:protein_coding // chr1 // 100 // 100 // 24 // 24 // 0 /// ENST00000326183 // ENSEMBL // ensembl_havana_transcript:known chromosome:GRCh38:15:101922042:101923095:-1 gene:ENSG00000177693 gene_biotype:protein_coding transcript_biotype:protein_coding // chr1 // 100 // 100 // 24 // 24 // 0 /// ENST00000335137 // ENSEMBL // ensembl_havana_transcript:known chromosome:GRCh38:1:69091:70008:1 gene:ENSG00000186092 gene_biotype:protein_coding transcript_biotype:protein_coding // chr1 // 100 // 100 // 24 // 24 // 0 /// ENST00000585993 // ENSEMBL // havana:known chromosome:GRCh38:19:107461:111696:1 gene:ENSG00000176695 gene_biotype:protein_coding transcript_biotype:protein_coding // chr1 // 100 // 100 // 24 // 24 // 0 /// BC136848 // GenBank // Homo sapiens olfactory receptor, family 4, subfamily F, member 17, mRNA (cDNA clone MGC:168462 IMAGE:9020839), complete cds. // chr1 // 100 // 100 // 24 // 24 // 0 /// BC136867 // GenBank // Homo sapiens olfactory receptor, family 4, subfamily F, member 17, mRNA (cDNA clone MGC:168481 IMAGE:9020858), complete cds. // chr1 // 100 // 100 // 24 // 24 // 0 /// BC136907 // GenBank // Homo sapiens olfactory receptor, family 4, subfamily F, member 4, mRNA (cDNA clone MGC:168521 IMAGE:9020898), complete cds. // chr1 // 100 // 100 // 24 // 24 // 0 /// BC136908 // GenBank // Homo sapiens olfactory receptor, family 4, subfamily F, member 4, mRNA (cDNA clone MGC:168522 IMAGE:9020899), complete cds. // chr1 // 100 // 100 // 24 // 24 // 0 /// ENST00000618231 // ENSEMBL // havana:known chromosome:GRCh38:19:110613:111417:1 gene:ENSG00000176695 gene_biotype:protein_coding transcript_biotype:retained_intron // chr1 // 100 // 88 // 21 // 21 // 0', 'NR_024437 // RefSeq // Homo sapiens uncharacterized LOC728323 (LOC728323), long non-coding RNA. // chr1 // 100 // 100 // 6 // 6 // 0 /// XM_006711854 // RefSeq // PREDICTED: Homo sapiens F-box only protein 25-like (LOC101060626), partial mRNA. // chr1 // 100 // 100 // 6 // 6 // 0 /// XM_006726377 // RefSeq // PREDICTED: Homo sapiens F-box only protein 25-like (LOC101060626), partial mRNA. // chr1 // 100 // 100 // 6 // 6 // 0 /// XR_430662 // RefSeq // PREDICTED: Homo sapiens uncharacterized LOC101927097 (LOC101927097), misc_RNA. // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000279067 // ENSEMBL // ensembl_havana_transcript:known chromosome:GRCh38:20:64290385:64303559:1 gene:ENSG00000149656 gene_biotype:processed_transcript transcript_biotype:processed_transcript // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000431812 // ENSEMBL // havana:known chromosome:GRCh38:1:485066:489553:-1 gene:ENSG00000237094 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 83 // 100 // 5 // 6 // 0 /// ENST00000433444 // ENSEMBL // havana:putative chromosome:GRCh38:2:242122293:242138888:1 gene:ENSG00000220804 gene_biotype:transcribed_unprocessed_pseudogene transcript_biotype:processed_transcript // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000436899 // ENSEMBL // havana:known chromosome:GRCh38:6:131910:144885:-1 gene:ENSG00000170590 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000445252 // ENSEMBL // havana:known chromosome:GRCh38:20:64294897:64311371:1 gene:ENSG00000149656 gene_biotype:processed_transcript transcript_biotype:processed_transcript // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000455207 // ENSEMBL // havana:known chromosome:GRCh38:1:373182:485208:-1 gene:ENSG00000237094 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000455464 // ENSEMBL // havana:known chromosome:GRCh38:1:476531:497259:-1 gene:ENSG00000237094 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000456398 // ENSEMBL // havana:known chromosome:GRCh38:2:242088633:242140638:1 gene:ENSG00000220804 gene_biotype:transcribed_unprocessed_pseudogene transcript_biotype:processed_transcript // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000601814 // ENSEMBL // havana:known chromosome:GRCh38:1:484832:495476:-1 gene:ENSG00000237094 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 100 // 100 // 6 // 6 // 0 /// AK298283 // GenBank // Homo sapiens cDNA FLJ60027 complete cds, moderately similar to F-box only protein 25. // chr1 // 100 // 100 // 6 // 6 // 0 /// AL137655 // GenBank // Homo sapiens mRNA; cDNA DKFZp434B2016 (from clone DKFZp434B2016). // chr1 // 100 // 100 // 6 // 6 // 0 /// BC032332 // GenBank // Homo sapiens protein-L-isoaspartate (D-aspartate) O-methyltransferase domain containing 2, mRNA (cDNA clone MGC:40288 IMAGE:5169056), complete cds. // chr1 // 100 // 100 // 6 // 6 // 0 /// BC118988 // GenBank // Homo sapiens chromosome 20 open reading frame 69, mRNA (cDNA clone MGC:141807 IMAGE:40035995), complete cds. // chr1 // 100 // 100 // 6 // 6 // 0 /// BC122537 // GenBank // Homo sapiens chromosome 20 open reading frame 69, mRNA (cDNA clone MGC:141808 IMAGE:40035996), complete cds. // chr1 // 100 // 100 // 6 // 6 // 0 /// BC131690 // GenBank // Homo sapiens similar to bA476I15.3 (novel protein similar to septin), mRNA (cDNA clone IMAGE:40119684), partial cds. // chr1 // 100 // 100 // 6 // 6 // 0 /// NM_207366 // RefSeq // Homo sapiens septin 14 (SEPT14), mRNA. // chr1 // 50 // 100 // 3 // 6 // 0 /// ENST00000388975 // ENSEMBL // ensembl_havana_transcript:known chromosome:GRCh38:7:55793544:55862789:-1 gene:ENSG00000154997 gene_biotype:protein_coding transcript_biotype:protein_coding // chr1 // 50 // 100 // 3 // 6 // 0 /// ENST00000427373 // ENSEMBL // havana:known chromosome:GRCh38:Y:25378300:25394719:-1 gene:ENSG00000228786 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 67 // 100 // 4 // 6 // 0 /// ENST00000431796 // ENSEMBL // havana:known chromosome:GRCh38:2:242088693:242122405:1 gene:ENSG00000220804 gene_biotype:transcribed_unprocessed_pseudogene transcript_biotype:processed_transcript // chr1 // 60 // 83 // 3 // 5 // 0 /// ENST00000509776 // ENSEMBL // havana:known chromosome:GRCh38:Y:24278681:24291346:1 gene:ENSG00000248792 gene_biotype:unprocessed_pseudogene transcript_biotype:unprocessed_pseudogene // chr1 // 67 // 100 // 4 // 6 // 0 /// ENST00000570230 // ENSEMBL // havana:known chromosome:GRCh38:16:90157932:90178344:1 gene:ENSG00000260528 gene_biotype:processed_transcript transcript_biotype:processed_transcript // chr1 // 67 // 100 // 4 // 6 // 0 /// AK301928 // GenBank // Homo sapiens cDNA FLJ59065 complete cds, moderately similar to Septin-10. // chr1 // 50 // 100 // 3 // 6 // 0 /// ENST00000413839 // ENSEMBL // havana:known chromosome:GRCh38:7:45816557:45821064:1 gene:ENSG00000226838 gene_biotype:unprocessed_pseudogene transcript_biotype:unprocessed_pseudogene // chr1 // 83 // 100 // 5 // 6 // 0 /// ENST00000414688 // ENSEMBL // havana:known chromosome:GRCh38:1:711342:720200:-1 gene:ENSG00000230021 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000419394 // ENSEMBL // havana:known chromosome:GRCh38:1:703685:720194:-1 gene:ENSG00000230021 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000420830 // ENSEMBL // havana:known chromosome:GRCh38:1:243031272:243047869:-1 gene:ENSG00000231512 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 83 // 100 // 5 // 6 // 0 /// ENST00000428915 // ENSEMBL // havana:known chromosome:GRCh38:10:38453181:38466176:1 gene:ENSG00000203496 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000439401 // ENSEMBL // havana:known chromosome:GRCh38:3:198228194:198228376:1 gene:ENSG00000226008 gene_biotype:unprocessed_pseudogene transcript_biotype:unprocessed_pseudogene // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000440200 // ENSEMBL // havana:known chromosome:GRCh38:1:601436:720200:-1 gene:ENSG00000230021 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000441245 // ENSEMBL // havana:known chromosome:GRCh38:1:701936:720150:-1 gene:ENSG00000230021 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 100 // 67 // 4 // 4 // 0 /// ENST00000445840 // ENSEMBL // havana:known chromosome:GRCh38:1:485032:485211:-1 gene:ENSG00000224813 gene_biotype:transcribed_unprocessed_pseudogene transcript_biotype:transcribed_unprocessed_pseudogene // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000447954 // ENSEMBL // havana:known chromosome:GRCh38:1:720058:724550:-1 gene:ENSG00000230021 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 83 // 100 // 5 // 6 // 0 /// ENST00000450226 // ENSEMBL // havana:known chromosome:GRCh38:1:243038914:243047875:-1 gene:ENSG00000231512 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 83 // 100 // 5 // 6 // 0 /// ENST00000453405 // ENSEMBL // havana:known chromosome:GRCh38:2:242122287:242122469:1 gene:ENSG00000244528 gene_biotype:processed_pseudogene transcript_biotype:processed_pseudogene // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000477740 // ENSEMBL // havana:known chromosome:GRCh38:1:92230:129217:-1 gene:ENSG00000238009 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 83 // 100 // 5 // 6 // 0 /// ENST00000508026 // ENSEMBL // havana:known chromosome:GRCh38:8:200385:200562:-1 gene:ENSG00000255464 gene_biotype:processed_pseudogene transcript_biotype:processed_pseudogene // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000509192 // ENSEMBL // havana:known chromosome:GRCh38:5:181329241:181342213:1 gene:ENSG00000250765 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000513445 // ENSEMBL // havana:known chromosome:GRCh38:4:118640673:118640858:1 gene:ENSG00000251155 gene_biotype:processed_pseudogene transcript_biotype:processed_pseudogene // chr1 // 83 // 100 // 5 // 6 // 0 /// ENST00000523795 // ENSEMBL // havana:known chromosome:GRCh38:8:192091:200563:-1 gene:ENSG00000250210 gene_biotype:protein_coding transcript_biotype:protein_coding // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000529266 // ENSEMBL // havana:known chromosome:GRCh38:11:121279:125784:-1 gene:ENSG00000254468 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000587432 // ENSEMBL // havana:known chromosome:GRCh38:19:191212:195696:-1 gene:ENSG00000267237 gene_biotype:transcribed_unprocessed_pseudogene transcript_biotype:processed_transcript // chr1 // 83 // 100 // 5 // 6 // 0 /// ENST00000610542 // ENSEMBL // ensembl:known chromosome:GRCh38:1:120725:133723:-1 gene:ENSG00000238009 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 83 // 100 // 5 // 6 // 0 /// ENST00000612088 // ENSEMBL // ensembl:known chromosome:GRCh38:10:38453181:38466176:1 gene:ENSG00000203496 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000612214 // ENSEMBL // havana:known chromosome:GRCh38:19:186371:191429:-1 gene:ENSG00000267237 gene_biotype:transcribed_unprocessed_pseudogene transcript_biotype:processed_transcript // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000613471 // ENSEMBL // ensembl:known chromosome:GRCh38:1:476738:489710:-1 gene:ENSG00000237094 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000615295 // ENSEMBL // ensembl:known chromosome:GRCh38:5:181329241:181342213:1 gene:ENSG00000250765 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000616585 // ENSEMBL // ensembl:known chromosome:GRCh38:1:711715:724707:-1 gene:ENSG00000230021 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000618096 // ENSEMBL // havana:known chromosome:GRCh38:19:191178:191354:-1 gene:ENSG00000267237 gene_biotype:transcribed_unprocessed_pseudogene transcript_biotype:transcribed_unprocessed_pseudogene // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000618222 // ENSEMBL // ensembl:known chromosome:GRCh38:6:131910:144885:-1 gene:ENSG00000170590 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000622435 // ENSEMBL // havana:known chromosome:GRCh38:2:242088684:242159382:1 gene:ENSG00000220804 gene_biotype:transcribed_unprocessed_pseudogene transcript_biotype:processed_transcript // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000622626 // ENSEMBL // ensembl:known chromosome:GRCh38:11:112967:125927:-1 gene:ENSG00000254468 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 100 // 100 // 6 // 6 // 0 /// GENSCAN00000007486 // ENSEMBL // cdna:genscan chromosome:GRCh38:2:242089132:242175655:1 transcript_biotype:protein_coding // chr1 // 100 // 100 // 6 // 6 // 0 /// GENSCAN00000023775 // ENSEMBL // cdna:genscan chromosome:GRCh38:7:45812479:45856081:1 transcript_biotype:protein_coding // chr1 // 100 // 100 // 6 // 6 // 0 /// GENSCAN00000045845 // ENSEMBL // cdna:genscan chromosome:GRCh38:8:166086:213433:-1 transcript_biotype:protein_coding // chr1 // 100 // 100 // 6 // 6 // 0 /// BC071667 // GenBank HTC // Homo sapiens cDNA clone IMAGE:4384656, **** WARNING: chimeric clone ****. // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT000053 // NONCODE // Non-coding transcript identified by NONCODE: Sense No Exonic // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT000055 // NONCODE // Non-coding transcript identified by NONCODE: Sense No Exonic // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT000063 // NONCODE // Non-coding transcript identified by NONCODE: Sense No Exonic // chr1 // 83 // 100 // 5 // 6 // 0 /// NONHSAT000064 // NONCODE // Non-coding transcript identified by NONCODE // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT000065 // NONCODE // Non-coding transcript identified by NONCODE: Sense No Exonic // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT000086 // NONCODE // Non-coding transcript identified by NONCODE: Sense No Exonic // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT000097 // NONCODE // Non-coding transcript identified by NONCODE: Sense No Exonic // chr1 // 100 // 67 // 4 // 4 // 0 /// NONHSAT000098 // NONCODE // Non-coding transcript identified by NONCODE: Sense No Exonic // chr1 // 83 // 100 // 5 // 6 // 0 /// NONHSAT010578 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 83 // 100 // 5 // 6 // 0 /// NONHSAT012829 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT017180 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT060112 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT078034 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT078035 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT078039 // NONCODE // Non-coding transcript identified by NONCODE // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT078040 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT078041 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT081035 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT081036 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT094494 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT094497 // NONCODE // Non-coding transcript identified by NONCODE // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT098010 // NONCODE // Non-coding transcript identified by NONCODE // chr1 // 83 // 100 // 5 // 6 // 0 /// NONHSAT105956 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT105968 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 100 // 100 // 6 // 6 // 0 /// NONHSAT120472 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 83 // 100 // 5 // 6 // 0 /// NONHSAT124571 // NONCODE // Non-coding transcript identified by NONCODE // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00001800-XLOC_l2_001331 // Broad TUCP // linc-TP53BP2-4 chr1:-:224133091-224222680 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00001926-XLOC_l2_000004 // Broad TUCP // linc-OR4F16-1 chr1:+:329783-334271 // chr1 // 83 // 100 // 5 // 6 // 0 /// TCONS_l2_00001927-XLOC_l2_000004 // Broad TUCP // linc-OR4F16-1 chr1:+:334139-342806 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00002370-XLOC_l2_000720 // Broad TUCP // linc-ZNF692-5 chr1:-:92229-129217 // chr1 // 83 // 100 // 5 // 6 // 0 /// TCONS_l2_00002386-XLOC_l2_000726 // Broad TUCP // linc-OR4F29-1 chr1:-:637315-655530 // chr1 // 100 // 67 // 4 // 4 // 0 /// TCONS_l2_00002387-XLOC_l2_000726 // Broad TUCP // linc-OR4F29-1 chr1:-:639064-655574 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00002388-XLOC_l2_000726 // Broad TUCP // linc-OR4F29-1 chr1:-:646721-655580 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00002389-XLOC_l2_000726 // Broad TUCP // linc-OR4F29-1 chr1:-:655437-659930 // chr1 // 83 // 100 // 5 // 6 // 0 /// TCONS_l2_00002812-XLOC_l2_001398 // Broad TUCP // linc-PLD5-4 chr1:-:243194573-243211171 // chr1 // 83 // 100 // 5 // 6 // 0 /// TCONS_l2_00003949-XLOC_l2_001561 // Broad TUCP // linc-BMS1-9 chr10:+:38742108-38755311 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00003950-XLOC_l2_001561 // Broad TUCP // linc-BMS1-9 chr10:+:38742265-38764837 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00014349-XLOC_l2_007835 // Broad TUCP // linc-ORC6-14 chr2:+:243030831-243101574 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00014350-XLOC_l2_007835 // Broad TUCP // linc-ORC6-14 chr2:+:243030855-243102147 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00014351-XLOC_l2_007835 // Broad TUCP // linc-ORC6-14 chr2:+:243030868-243101569 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00014352-XLOC_l2_007835 // Broad TUCP // linc-ORC6-14 chr2:+:243030886-243064759 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00014354-XLOC_l2_007835 // Broad TUCP // linc-ORC6-14 chr2:+:243030931-243067562 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00014355-XLOC_l2_007835 // Broad TUCP // linc-ORC6-14 chr2:+:243030941-243102157 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00014357-XLOC_l2_007835 // Broad TUCP // linc-ORC6-14 chr2:+:243037045-243101538 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00014358-XLOC_l2_007835 // Broad TUCP // linc-ORC6-14 chr2:+:243058329-243064628 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00015637-XLOC_l2_007835 // Broad TUCP // linc-ORC6-14 chr2:+:243030783-243082789 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00015638-XLOC_l2_007835 // Broad TUCP // linc-ORC6-14 chr2:+:243030843-243065243 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00015639-XLOC_l2_007835 // Broad TUCP // linc-ORC6-14 chr2:+:243030843-243102469 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00015640-XLOC_l2_007835 // Broad TUCP // linc-ORC6-14 chr2:+:243030843-243102469 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00015641-XLOC_l2_007835 // Broad TUCP // linc-ORC6-14 chr2:+:243030843-243102469 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00015643-XLOC_l2_007835 // Broad TUCP // linc-ORC6-14 chr2:+:243064443-243081039 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00016828-XLOC_l2_008724 // Broad TUCP // linc-HNF1B-4 chr20:+:62921737-62934707 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00020055-XLOC_l2_010084 // Broad TUCP // linc-MCMBP-2 chr3:+:197937115-197955676 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00025304-XLOC_l2_012836 // Broad TUCP // linc-PDCD2-1 chr6:-:131909-144885 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00025849-XLOC_l2_013383 // Broad TUCP // linc-IGFBP1-1 chr7:+:45831387-45863181 // chr1 // 100 // 100 // 6 // 6 // 0 /// TCONS_l2_00025850-XLOC_l2_013383 // Broad TUCP // linc-IGFBP1-1 chr7:+:45836951-45863174 // chr1 // 100 // 100 // 6 // 6 // 0 /// ENST00000437691 // ENSEMBL // havana:known chromosome:GRCh38:1:243047737:243052252:-1 gene:ENSG00000231512 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 67 // 100 // 4 // 6 // 0 /// ENST00000447236 // ENSEMBL // havana:known chromosome:GRCh38:7:56360362:56360541:-1 gene:ENSG00000231299 gene_biotype:unprocessed_pseudogene transcript_biotype:unprocessed_pseudogene // chr1 // 50 // 100 // 3 // 6 // 0 /// ENST00000453576 // ENSEMBL // havana:known chromosome:GRCh38:1:129081:133566:-1 gene:ENSG00000238009 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 67 // 100 // 4 // 6 // 0 /// ENST00000611754 // ENSEMBL // ensembl:known chromosome:GRCh38:Y:25378671:25391610:-1 gene:ENSG00000228786 gene_biotype:lincRNA transcript_biotype:lincRNA // chr1 // 67 // 100 // 4 // 6 // 0 /// ENST00000617978 // ENSEMBL // havana:known chromosome:GRCh38:1:227980051:227980227:1 gene:ENSG00000274886 gene_biotype:unprocessed_pseudogene transcript_biotype:unprocessed_pseudogene // chr1 // 67 // 100 // 4 // 6 // 0 /// ENST00000621799 // ENSEMBL // ensembl:known chromosome:GRCh38:16:90173217:90186204:1 gene:ENSG00000260528 gene_biotype:processed_transcript transcript_biotype:processed_transcript // chr1 // 67 // 100 // 4 // 6 // 0 /// NONHSAT000022 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 67 // 100 // 4 // 6 // 0 /// NONHSAT010579 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 67 // 100 // 4 // 6 // 0 /// NONHSAT010580 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 67 // 100 // 4 // 6 // 0 /// NONHSAT120743 // NONCODE // Non-coding transcript identified by NONCODE // chr1 // 50 // 100 // 3 // 6 // 0 /// NONHSAT139746 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 67 // 100 // 4 // 6 // 0 /// NONHSAT144650 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 67 // 100 // 4 // 6 // 0 /// NONHSAT144655 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 67 // 100 // 4 // 6 // 0 /// TCONS_l2_00002372-XLOC_l2_000720 // Broad TUCP // linc-ZNF692-5 chr1:-:129080-133566 // chr1 // 67 // 100 // 4 // 6 // 0 /// TCONS_l2_00002813-XLOC_l2_001398 // Broad TUCP // linc-PLD5-4 chr1:-:243202215-243211826 // chr1 // 67 // 100 // 4 // 6 // 0 /// TCONS_l2_00002814-XLOC_l2_001398 // Broad TUCP // linc-PLD5-4 chr1:-:243211038-243215554 // chr1 // 67 // 100 // 4 // 6 // 0 /// TCONS_l2_00010440-XLOC_l2_005352 // Broad TUCP // linc-RBM11-5 chr16:+:90244124-90289080 // chr1 // 67 // 100 // 4 // 6 // 0 /// TCONS_l2_00031062-XLOC_l2_015962 // Broad TUCP // linc-BPY2B-4 chrY:-:27524446-27540866 // chr1 // 67 // 100 // 4 // 6 // 0', 'NM_001005221 // RefSeq // Homo sapiens olfactory receptor, family 4, subfamily F, member 29 (OR4F29), mRNA. // chr1 // 100 // 100 // 36 // 36 // 0 /// NM_001005224 // RefSeq // Homo sapiens olfactory receptor, family 4, subfamily F, member 3 (OR4F3), mRNA. // chr1 // 100 // 100 // 36 // 36 // 0 /// NM_001005277 // RefSeq // Homo sapiens olfactory receptor, family 4, subfamily F, member 16 (OR4F16), mRNA. // chr1 // 100 // 100 // 36 // 36 // 0 /// NM_001005504 // RefSeq // Homo sapiens olfactory receptor, family 4, subfamily F, member 21 (OR4F21), mRNA. // chr1 // 89 // 100 // 32 // 36 // 0 /// ENST00000320901 // ENSEMBL // ensembl_havana_transcript:known chromosome:GRCh38:8:166049:167043:-1 gene:ENSG00000176269 gene_biotype:protein_coding transcript_biotype:protein_coding // chr1 // 89 // 100 // 32 // 36 // 0 /// ENST00000332831 // ENSEMBL // ensembl_havana_transcript:known chromosome:GRCh38:1:685716:686654:-1 gene:ENSG00000273547 gene_biotype:protein_coding transcript_biotype:protein_coding gene:ENSG00000185097 // chr1 // 100 // 100 // 36 // 36 // 0 /// ENST00000402444 // ENSEMBL // havana:known chromosome:GRCh38:6:170639606:170640536:1 gene:ENSG00000217874 gene_biotype:unprocessed_pseudogene transcript_biotype:unprocessed_pseudogene // chr1 // 78 // 100 // 28 // 36 // 0 /// ENST00000405102 // ENSEMBL // havana:known chromosome:GRCh38:6:105919:106856:-1 gene:ENSG00000220212 gene_biotype:unprocessed_pseudogene transcript_biotype:unprocessed_pseudogene // chr1 // 81 // 100 // 29 // 36 // 0 /// ENST00000424047 // ENSEMBL // havana:known chromosome:GRCh38:11:86649:87586:-1 gene:ENSG00000224777 gene_biotype:unprocessed_pseudogene transcript_biotype:unprocessed_pseudogene // chr1 // 78 // 100 // 28 // 36 // 0 /// ENST00000426406 // ENSEMBL // ensembl_havana_transcript:known chromosome:GRCh38:1:450740:451678:-1 gene:ENSG00000278566 gene_biotype:protein_coding transcript_biotype:protein_coding gene:ENSG00000235249 // chr1 // 100 // 100 // 36 // 36 // 0 /// ENST00000456475 // ENSEMBL // ensembl_havana_transcript:known chromosome:GRCh38:5:181367268:181368262:1 gene:ENSG00000230178 gene_biotype:protein_coding transcript_biotype:protein_coding // chr1 // 100 // 100 // 36 // 36 // 0 /// ENST00000559128 // ENSEMBL // havana:known chromosome:GRCh38:15:101875964:101876901:1 gene:ENSG00000257109 gene_biotype:unprocessed_pseudogene transcript_biotype:unprocessed_pseudogene // chr1 // 83 // 100 // 30 // 36 // 0 /// BC137547 // GenBank // Homo sapiens olfactory receptor, family 4, subfamily F, member 3, mRNA (cDNA clone MGC:169170 IMAGE:9021547), complete cds. // chr1 // 100 // 100 // 36 // 36 // 0 /// BC137568 // GenBank // Homo sapiens olfactory receptor, family 4, subfamily F, member 3, mRNA (cDNA clone MGC:169191 IMAGE:9021568), complete cds. // chr1 // 100 // 100 // 36 // 36 // 0 /// ENST00000589943 // ENSEMBL // havana:known chromosome:GRCh38:19:156279:157215:-1 gene:ENSG00000266971 gene_biotype:unprocessed_pseudogene transcript_biotype:unprocessed_pseudogene // chr1 // 72 // 100 // 26 // 36 // 0 /// GENSCAN00000011446 // ENSEMBL // cdna:genscan chromosome:GRCh38:5:181367527:181368225:1 transcript_biotype:protein_coding // chr1 // 100 // 64 // 23 // 23 // 0 /// GENSCAN00000017675 // ENSEMBL // cdna:genscan chromosome:GRCh38:1:685716:686414:-1 transcript_biotype:protein_coding // chr1 // 100 // 64 // 23 // 23 // 0 /// GENSCAN00000017679 // ENSEMBL // cdna:genscan chromosome:GRCh38:1:450740:451438:-1 transcript_biotype:protein_coding // chr1 // 100 // 64 // 23 // 23 // 0 /// GENSCAN00000045845 // ENSEMBL // cdna:genscan chromosome:GRCh38:8:166086:213433:-1 transcript_biotype:protein_coding // chr1 // 87 // 83 // 26 // 30 // 0 /// NONHSAT051700 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 83 // 100 // 30 // 36 // 0 /// NONHSAT051701 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 83 // 100 // 30 // 36 // 0 /// NONHSAT105966 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 81 // 100 // 29 // 36 // 0 /// NONHSAT060109 // NONCODE // Non-coding transcript identified by NONCODE: Linc // chr1 // 72 // 100 // 26 // 36 // 0'], 'category': ['main', 'main', 'main', 'main', 'main']}\n", "\n", "Analyzing SPOT_ID.1 column for gene symbols:\n", "\n", "Gene data ID prefix: 7892501\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Column 'ID' contains values matching gene data ID pattern\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Checking for columns containing transcript or gene related terms:\n", "Column 'seqname' may contain gene-related information\n", "Sample values: ['chr1', 'chr1', 'chr1']\n", "Column 'gene_assignment' may contain gene-related information\n", "Sample values: ['---', 'ENST00000328113 // OR4G2P // olfactory receptor, family 4, subfamily G, member 2 pseudogene // --- // --- /// ENST00000492842 // OR4G11P // olfactory receptor, family 4, subfamily G, member 11 pseudogene // --- // --- /// ENST00000588632 // OR4G1P // olfactory receptor, family 4, subfamily G, member 1 pseudogene // --- // ---', 'NM_001004195 // OR4F4 // olfactory receptor, family 4, subfamily F, member 4 // 15q26.3 // 26682 /// NM_001005240 // OR4F17 // olfactory receptor, family 4, subfamily F, member 17 // 19p13.3 // 81099 /// NM_001005484 // OR4F5 // olfactory receptor, family 4, subfamily F, member 5 // 1p36.33 // 79501 /// ENST00000318050 // OR4F17 // olfactory receptor, family 4, subfamily F, member 17 // 19p13.3 // 81099 /// ENST00000326183 // OR4F4 // olfactory receptor, family 4, subfamily F, member 4 // 15q26.3 // 26682 /// ENST00000335137 // OR4F5 // olfactory receptor, family 4, subfamily F, member 5 // 1p36.33 // 79501 /// ENST00000585993 // OR4F17 // olfactory receptor, family 4, subfamily F, member 17 // 19p13.3 // 81099 /// BC136848 // OR4F17 // olfactory receptor, family 4, subfamily F, member 17 // 19p13.3 // 81099 /// BC136867 // OR4F17 // olfactory receptor, family 4, subfamily F, member 17 // 19p13.3 // 81099 /// BC136907 // OR4F4 // olfactory receptor, family 4, subfamily F, member 4 // 15q26.3 // 26682 /// BC136908 // OR4F4 // olfactory receptor, family 4, subfamily F, member 4 // 15q26.3 // 26682']\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. Analyze the gene annotation dataframe to identify which columns contain the gene identifiers and gene symbols\n", "print(\"\\nGene annotation preview:\")\n", "print(f\"Columns in gene annotation: {gene_annotation.columns.tolist()}\")\n", "print(preview_df(gene_annotation, n=5))\n", "\n", "# Check for gene information in the SPOT_ID.1 column which appears to contain gene names\n", "print(\"\\nAnalyzing SPOT_ID.1 column for gene symbols:\")\n", "if 'SPOT_ID.1' in gene_annotation.columns:\n", " # Extract a few sample values\n", " sample_values = gene_annotation['SPOT_ID.1'].head(3).tolist()\n", " for i, value in enumerate(sample_values):\n", " print(f\"Sample {i+1} excerpt: {value[:200]}...\") # Print first 200 chars\n", " # Test the extract_human_gene_symbols function on these values\n", " symbols = extract_human_gene_symbols(value)\n", " print(f\" Extracted gene symbols: {symbols}\")\n", "\n", "# Try to find the probe IDs in the gene annotation\n", "gene_data_id_prefix = gene_data.index[0].split('_')[0] # Get prefix of first gene ID\n", "print(f\"\\nGene data ID prefix: {gene_data_id_prefix}\")\n", "\n", "# Look for columns that might match the gene data IDs\n", "for col in gene_annotation.columns:\n", " if gene_annotation[col].astype(str).str.contains(gene_data_id_prefix).any():\n", " print(f\"Column '{col}' contains values matching gene data ID pattern\")\n", "\n", "# Check if there's any column that might contain transcript or gene IDs\n", "print(\"\\nChecking for columns containing transcript or gene related terms:\")\n", "for col in gene_annotation.columns:\n", " if any(term in col.upper() for term in ['GENE', 'TRANSCRIPT', 'SYMBOL', 'NAME', 'DESCRIPTION']):\n", " print(f\"Column '{col}' may contain gene-related information\")\n", " # Show sample values\n", " print(f\"Sample values: {gene_annotation[col].head(3).tolist()}\")\n" ] }, { "cell_type": "markdown", "id": "4f554a16", "metadata": {}, "source": [ "### Step 6: Gene Identifier Mapping" ] }, { "cell_type": "code", "execution_count": 7, "id": "cb612eff", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T03:56:06.095746Z", "iopub.status.busy": "2025-03-25T03:56:06.095640Z", "iopub.status.idle": "2025-03-25T03:56:11.045497Z", "shell.execute_reply": "2025-03-25T03:56:11.044861Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Mapping dataframe shape: (33297, 2)\n", "Sample of mapping dataframe:\n", " ID Gene\n", "0 7896736 ---\n", "1 7896738 ENST00000328113 // OR4G2P // olfactory recepto...\n", "2 7896740 NM_001004195 // OR4F4 // olfactory receptor, f...\n", "3 7896742 NR_024437 // LOC728323 // uncharacterized LOC7...\n", "4 7896744 NM_001005221 // OR4F29 // olfactory receptor, ...\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Gene expression data shape after mapping: (117447, 43)\n", "First 5 genes and sample counts:\n", " GSM4321410 GSM4321411 GSM4321412 GSM4321413 GSM4321414 GSM4321415 \\\n", "Gene \n", "A- 26.855859 27.203828 26.176372 26.485634 27.129572 26.785776 \n", "A-3- 0.676297 0.827000 0.786592 0.700897 0.691317 0.688663 \n", "A-52 0.763744 0.822074 0.841448 0.893042 0.798220 0.812496 \n", "A-E 1.058217 1.061592 1.057221 1.097058 1.119544 0.977072 \n", "A-I 1.528381 1.560647 1.581738 1.504029 1.412246 1.480298 \n", "\n", " GSM4321416 GSM4321417 GSM4321418 GSM4321419 ... GSM4321443 \\\n", "Gene ... \n", "A- 26.380192 26.041538 26.106642 27.330138 ... 27.254018 \n", "A-3- 0.700579 0.661088 0.768229 0.693318 ... 0.724141 \n", "A-52 0.848997 0.801966 0.829038 0.783488 ... 0.840226 \n", "A-E 1.155154 1.094185 1.104402 1.093266 ... 1.117682 \n", "A-I 1.475403 1.570329 1.580891 1.411538 ... 1.478690 \n", "\n", " GSM4321444 GSM4321445 GSM4321446 GSM4321447 GSM4321448 GSM4321449 \\\n", "Gene \n", "A- 26.446451 26.214304 27.068068 27.145919 27.242462 27.081340 \n", "A-3- 0.807092 0.746520 0.774799 0.658112 0.679716 0.605859 \n", "A-52 0.882675 0.806497 0.872652 0.850269 0.766694 0.837301 \n", "A-E 1.164948 1.088518 1.137077 1.101817 1.092101 1.087067 \n", "A-I 1.503403 1.402302 1.414364 1.331857 1.469729 1.561176 \n", "\n", " GSM4321450 GSM4321451 GSM4321452 \n", "Gene \n", "A- 27.734275 27.086626 27.191560 \n", "A-3- 0.737203 0.652010 0.691733 \n", "A-52 0.841960 0.829552 0.772303 \n", "A-E 1.083828 1.084875 1.054550 \n", "A-I 1.416012 1.500237 1.524035 \n", "\n", "[5 rows x 43 columns]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Gene data saved to ../../output/preprocess/Schizophrenia/gene_data/GSE145554.csv\n" ] } ], "source": [ "# 1. Identify the relevant columns from gene_annotation\n", "# The 'ID' column in gene_annotation matches the index of gene_data\n", "# The 'gene_assignment' column contains gene symbols information\n", "\n", "# 2. Create a mapping dataframe from ID to gene symbols\n", "mapping_df = get_gene_mapping(gene_annotation, prob_col='ID', gene_col='gene_assignment')\n", "print(f\"Mapping dataframe shape: {mapping_df.shape}\")\n", "print(\"Sample of mapping dataframe:\")\n", "print(mapping_df.head())\n", "\n", "# 3. Apply the gene mapping to convert probes to gene expressions\n", "gene_data = apply_gene_mapping(gene_data, mapping_df)\n", "print(f\"Gene expression data shape after mapping: {gene_data.shape}\")\n", "print(\"First 5 genes and sample counts:\")\n", "print(gene_data.head())\n", "\n", "# Save the processed gene data\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\"Gene data saved to {out_gene_data_file}\")\n" ] }, { "cell_type": "markdown", "id": "50ed722b", "metadata": {}, "source": [ "### Step 7: Data Normalization and Linking" ] }, { "cell_type": "code", "execution_count": 8, "id": "febada67", "metadata": { "execution": { "iopub.execute_input": "2025-03-25T03:56:11.047413Z", "iopub.status.busy": "2025-03-25T03:56:11.047282Z", "iopub.status.idle": "2025-03-25T03:56:11.987641Z", "shell.execute_reply": "2025-03-25T03:56:11.987112Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Gene data shape after normalization: (24221, 43)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Normalized gene expression data saved to ../../output/preprocess/Schizophrenia/gene_data/GSE145554.csv\n", "Loaded clinical data shape: (3, 23)\n", "Clinical data preview:\n", " 0 1 2 3 4 5 6 7 8 9 ... 13 \\\n", "0 1.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN ... NaN \n", "1 63.0 90.0 83.0 69.0 73.0 84.0 66.0 78.0 65.0 89.0 ... 77.0 \n", "2 1.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN ... NaN \n", "\n", " 14 15 16 17 18 19 20 21 22 \n", "0 NaN NaN NaN NaN NaN NaN NaN NaN NaN \n", "1 68.0 59.0 58.0 72.0 80.0 57.0 NaN NaN NaN \n", "2 NaN NaN NaN NaN NaN NaN NaN NaN NaN \n", "\n", "[3 rows x 23 columns]\n", "Clinical data with proper index:\n", " 0 1 2 3 4 5 6 7 8 9 \\\n", "Schizophrenia 1.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN \n", "Age 63.0 90.0 83.0 69.0 73.0 84.0 66.0 78.0 65.0 89.0 \n", "Gender 1.0 0.0 NaN NaN NaN NaN NaN NaN NaN NaN \n", "\n", " ... 13 14 15 16 17 18 19 20 21 22 \n", "Schizophrenia ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN \n", "Age ... 77.0 68.0 59.0 58.0 72.0 80.0 57.0 NaN NaN NaN \n", "Gender ... NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN \n", "\n", "[3 rows x 23 columns]\n", "Transposed clinical data shape: (23, 3)\n", "Sample clinical values after transposition:\n", " Schizophrenia Age Gender\n", "0 1.0 63.0 1.0\n", "1 0.0 90.0 0.0\n", "2 NaN 83.0 NaN\n", "3 NaN 69.0 NaN\n", "4 NaN 73.0 NaN\n", "Valid clinical data counts - Schizophrenia: 2, Age: 20, Gender: 2\n", "WARNING: Very few samples (2) have valid trait data. Dataset may not be usable.\n", "Gene data sample format: Index(['GSM4321410', 'GSM4321411', 'GSM4321412'], dtype='object')\n", "Clinical data indices: Index(['0', '1', '2'], dtype='object')\n", "Common samples between clinical and genetic data: 23\n", "Error during data linking or processing: \"None of [Index(['GSM4321418', 'GSM4321431', 'GSM4321420', 'GSM4321421', 'GSM4321427',\\n 'GSM4321416', 'GSM4321432', 'GSM4321412', 'GSM4321410', 'GSM4321414',\\n 'GSM4321415', 'GSM4321424', 'GSM4321411', 'GSM4321419', 'GSM4321413',\\n 'GSM4321430', 'GSM4321425', 'GSM4321422', 'GSM4321426', 'GSM4321429',\\n 'GSM4321428', 'GSM4321423', 'GSM4321417'],\\n dtype='object')] are in the [index]\"\n", "Abnormality detected in the cohort: GSE145554. Preprocessing failed.\n" ] } ], "source": [ "# 1. Normalize gene symbols in the gene expression data\n", "try:\n", " normalized_gene_data = normalize_gene_symbols_in_index(gene_data)\n", " print(f\"Gene data shape after normalization: {normalized_gene_data.shape}\")\n", " \n", " # Save the normalized gene data to file\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 during gene normalization: {e}\")\n", " # Continue with original gene data if normalization fails\n", " normalized_gene_data = gene_data\n", " print(\"Using original gene data without normalization\")\n", "\n", "# 2. Link the clinical and genetic data\n", "# First, fix the clinical data format and properly transpose it\n", "clinical_df = pd.read_csv(out_clinical_data_file)\n", "print(f\"Loaded clinical data shape: {clinical_df.shape}\")\n", "print(\"Clinical data preview:\")\n", "print(clinical_df.head())\n", "\n", "# Set proper index for clinical data (each row represents a feature)\n", "clinical_df.index = [\"Schizophrenia\", \"Age\", \"Gender\"]\n", "print(f\"Clinical data with proper index:\")\n", "print(clinical_df.head())\n", "\n", "# Transpose to get samples as rows and features as columns\n", "clinical_df_t = clinical_df.T\n", "print(f\"Transposed clinical data shape: {clinical_df_t.shape}\")\n", "print(\"Sample clinical values after transposition:\")\n", "print(clinical_df_t.head())\n", "\n", "# Count valid clinical data to diagnose issues\n", "valid_trait_count = clinical_df_t['Schizophrenia'].notna().sum()\n", "valid_age_count = clinical_df_t['Age'].notna().sum()\n", "valid_gender_count = clinical_df_t['Gender'].notna().sum()\n", "\n", "print(f\"Valid clinical data counts - Schizophrenia: {valid_trait_count}, Age: {valid_age_count}, Gender: {valid_gender_count}\")\n", "\n", "# Check if we have sufficient clinical data to proceed\n", "if valid_trait_count < 5:\n", " print(f\"WARNING: Very few samples ({valid_trait_count}) have valid trait data. Dataset may not be usable.\")\n", "\n", "# Link the clinical and genetic data\n", "try:\n", " # Ensure column names are consistent between datasets\n", " # Convert sample IDs to the format used in gene data (GSM numbers)\n", " gene_samples = normalized_gene_data.columns\n", " clinical_samples = clinical_df_t.index\n", " \n", " print(f\"Gene data sample format: {gene_samples[:3]}\")\n", " print(f\"Clinical data indices: {clinical_samples[:3]}\")\n", " \n", " # Match sample formats between datasets if needed\n", " # For this dataset, just use the samples common to both datasets\n", " common_samples = list(set(gene_samples).intersection(set([f\"GSM{idx+4321410}\" for idx in range(len(clinical_samples))])))\n", " \n", " if not common_samples:\n", " print(\"No direct sample name matches. Attempting to align by position...\")\n", " # Match by position if names don't match directly\n", " if len(gene_samples) >= len(clinical_samples):\n", " # Rename clinical data indices to match gene data column names\n", " clinical_df_t.index = gene_samples[:len(clinical_samples)]\n", " common_samples = list(clinical_df_t.index)\n", " else:\n", " print(\"Cannot align samples - unequal lengths\")\n", " common_samples = []\n", " \n", " print(f\"Common samples between clinical and genetic data: {len(common_samples)}\")\n", " \n", " if len(common_samples) >= 5:\n", " # Link the data\n", " linked_data = pd.DataFrame(index=common_samples)\n", " \n", " # Add clinical features\n", " for feature in clinical_df_t.columns:\n", " if feature in clinical_df_t.columns:\n", " linked_data[feature] = clinical_df_t.loc[common_samples, feature].values\n", " \n", " # Add gene features\n", " for gene in normalized_gene_data.index:\n", " linked_data[gene] = normalized_gene_data.loc[gene, common_samples].values\n", " \n", " # Reset index to get sample IDs as a column\n", " linked_data = linked_data.reset_index().rename(columns={'index': 'Sample_ID'})\n", " \n", " print(f\"Linked data shape: {linked_data.shape}\")\n", " print(\"Linked data preview (first 5 rows, 5 columns):\")\n", " print(linked_data.iloc[:5, :5])\n", " \n", " # 3. Handle missing values\n", " print(\"Handling missing values...\")\n", " linked_data = handle_missing_values(linked_data, trait)\n", " print(f\"Data shape after handling missing values: {linked_data.shape}\")\n", " \n", " if linked_data.shape[0] > 0:\n", " # 4. Check for bias in features\n", " is_biased, linked_data = judge_and_remove_biased_features(linked_data, trait)\n", " print(f\"Data shape after removing biased features: {linked_data.shape}\")\n", " \n", " # 5. Validate and save cohort information\n", " is_usable = validate_and_save_cohort_info(\n", " is_final=True,\n", " cohort=cohort,\n", " info_path=json_path,\n", " is_gene_available=True,\n", " is_trait_available=True,\n", " is_biased=is_biased,\n", " df=linked_data,\n", " note=\"Gene expression from pyramidal neurons in anterior cingulate cortex of schizophrenia patients.\"\n", " )\n", " \n", " # 6. Save the linked data if usable\n", " if is_usable:\n", " os.makedirs(os.path.dirname(out_data_file), exist_ok=True)\n", " linked_data.to_csv(out_data_file, index=False)\n", " print(f\"Linked data saved to {out_data_file}\")\n", " else:\n", " print(\"Dataset is not usable for analysis. No linked data file saved.\")\n", " else:\n", " print(\"No valid samples remaining after handling missing values. Dataset is not usable.\")\n", " validate_and_save_cohort_info(\n", " is_final=True,\n", " cohort=cohort,\n", " info_path=json_path,\n", " is_gene_available=True,\n", " is_trait_available=False,\n", " is_biased=True,\n", " df=pd.DataFrame(),\n", " note=\"Insufficient clinical-genetic correspondence. No usable samples after filtering.\"\n", " )\n", " else:\n", " print(\"Insufficient common samples between clinical and genetic data.\")\n", " validate_and_save_cohort_info(\n", " is_final=True,\n", " cohort=cohort,\n", " info_path=json_path,\n", " is_gene_available=True,\n", " is_trait_available=True,\n", " is_biased=True,\n", " df=pd.DataFrame(),\n", " note=\"Insufficient overlap between clinical and genetic data samples.\"\n", " )\n", "except Exception as e:\n", " print(f\"Error during data linking or processing: {e}\")\n", " validate_and_save_cohort_info(\n", " is_final=True,\n", " cohort=cohort,\n", " info_path=json_path,\n", " is_gene_available=True,\n", " is_trait_available=True,\n", " is_biased=True,\n", " df=pd.DataFrame(),\n", " note=f\"Error during processing: {str(e)}\"\n", " )" ] } ], "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 }