{ "cells": [ { "cell_type": "markdown", "id": "d8258b09-f8c5-486c-8206-8ba8f475af5d", "metadata": {}, "source": [ "# V. CELLS QUANTIFICATION AND CLASSIFICATION" ] }, { "cell_type": "raw", "id": "7ce34589-aa00-4bd7-b047-49389c6b824a", "metadata": {}, "source": [ "11/01/2024\n", "Modifications by Zoé Gerber\n", "from an original code from Marilyne Labrie" ] }, { "cell_type": "raw", "id": "3e2a9466-d945-4f72-abdf-d442f5a37015", "metadata": {}, "source": [ "V.1. PACKAGES IMPORT\n", "V.2. DIRECTORIES\n", "V.3. FILES\n", " V.3.1. METADATA\n", " V.3.2. NOT_INTENSITIES\n", " V.3.3. FULL_TO_SHORT_COLUMN_NAMES\n", " V.3.4. SHORT_TO_FULL_COLUMN_NAMES\n", " V.3.5. SAMPLES COLORS\n", " V.3.6. CHANNELS COLORS\n", " V.3.7. ROUNDS COLORS\n", " V.3.8. CELL TYPES COLORS\n", " V.3.9. CELL SUBTYPES COLORS\n", " V.3.10. IMMUNE CHECKPOINT COLORS\n", " V.3.11. DATA\n", " V.3.12. UNIQUE ROIs\n", " V.3.13. NACT/NACT\n", "V.4. COUNTS\n", " V.4.1. CELL TYPES\n", " V.4.2. CELL SUBTYPES\n", " V.4.2.1. \n", " \n", " V.4.3. NACT\n", "V.5. XY MAPS\n", "V.6. CORRELATION PLOTS\n", " V.6.1. OPTION 1\n", " V.6.2. OPTION 2\n", "V.7. PCA\n", "V.8. KMEANS\n", "V.9. T-SNE\n", "V.10. SAVE" ] }, { "cell_type": "markdown", "id": "f771a071-3f4c-4d05-954d-0c732ea5bf0e", "metadata": {}, "source": [ "## V.1. PACKAGES IMPORT" ] }, { "cell_type": "code", "execution_count": 1, "id": "3c51f7fc-8851-48d5-b953-7a7e6a62baa7", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/var/folders/5g/xq32h5h56rj2qzygbnhjg65h0000gn/T/ipykernel_22409/1860222382.py:13: DeprecationWarning: Please import `pearsonr` from the `scipy.stats` namespace; the `scipy.stats.stats` namespace is deprecated and will be removed in SciPy 2.0.0.\n", " from scipy.stats.stats import pearsonr\n" ] } ], "source": [ "import os\n", "import random\n", "import re\n", "import pandas as pd\n", "import numpy as np\n", "import seaborn as sb\n", "import matplotlib.pyplot as plt\n", "import matplotlib.colors as mplc\n", "import plotly.graph_objects as go\n", "import warnings\n", "import plotly.express as px\n", "\n", "from scipy.stats.stats import pearsonr\n", "\n", "from my_modules import *" ] }, { "cell_type": "code", "execution_count": 2, "id": "4ccdde05-5c79-4b30-a0ff-d6347a96bed2", "metadata": {}, "outputs": [], "source": [ "#Silence FutureWarnings & UserWarnings\n", "warnings.filterwarnings('ignore', category= FutureWarning)\n", "warnings.filterwarnings('ignore', category= UserWarning)" ] }, { "cell_type": "markdown", "id": "f4234174-1a38-47f6-9a79-4902ef916c1d", "metadata": {}, "source": [ "## V.2. *DIRECTORIES" ] }, { "cell_type": "code", "execution_count": 5, "id": "590d74b3-bfc9-418d-97b5-f1a9d0519e6e", "metadata": {}, "outputs": [], "source": [ "# Set base directory\n", "\n", "##### MAC WORKSTATION #####\n", "#base_dir = r'/Volumes/LaboLabrie/Projets/OC_TMA_Pejovic/Temp/Zoe/CyCIF_pipeline/'\n", "###########################\n", "\n", "##### WINDOWS WORKSTATION #####\n", "#base_dir = r'C:\\Users\\LaboLabrie\\gerz2701\\Cyc-IF_pipeline\\Set_B'\n", "###############################\n", "\n", "##### LOCAL WORKSTATION #####\n", "base_dir = r'/Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431'\n", "#############################\n", "\n", "#set_name = 'Set_A'\n", "set_name = 'test'" ] }, { "cell_type": "raw", "id": "4b322058-fc47-4933-a7ac-e811187e3c91", "metadata": {}, "source": [ "The project is organized as :\n", "main dir \n", " code\n", " proj_data > all csv files\n", " proj_metadata > exposure time csv file, images dir,...\n", " proj_qc_eda > csv after the QC/EDA step\n", " proj_bs > csv after the BS step\n", " proj_zscore > csv after the ZCORES step\n", " proj_mt > csv after the MARKERS TRESHOLDS step\n", " proj_cqc > csv after the CELLS QUANTICICATION AND CLASSIFICATION step" ] }, { "cell_type": "code", "execution_count": 6, "id": "3629fde0-6ab2-41c2-b7d8-0d881b6d0311", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The /Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431 directory already exists !\n", "The /Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431/test_mt directory already exists !\n", "Creation of the /Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431/test_cqc directory...\n", "Creation of the /Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431/test_cqc/images directory...\n", "The /Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431/test_metadata directory already exists !\n", "The /Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431/test_metadata/images directory already exists !\n" ] } ], "source": [ "project_name = set_name # Project name\n", "step_suffix = 'cqc' # Curent part (here part V)\n", "previous_step_suffix_long = \"_mt\" # Previous part (here MT NOTEBOOK)\n", "\n", "# Initial input data directory\n", "input_data_dir = os.path.join(base_dir, project_name + previous_step_suffix_long) \n", "\n", "# BS output directories\n", "output_data_dir = os.path.join(base_dir, project_name + \"_\" + step_suffix)\n", "# BS images subdirectory\n", "output_images_dir = os.path.join(output_data_dir,\"images\")\n", "\n", "# Data and Metadata directories\n", "# Metadata directories\n", "metadata_dir = os.path.join(base_dir, project_name + \"_metadata\")\n", "# images subdirectory\n", "metadata_images_dir = os.path.join(metadata_dir,\"images\")\n", "\n", "# Create directories if they don't already exist\n", "for d in [base_dir, input_data_dir, output_data_dir, output_images_dir, metadata_dir, metadata_images_dir]:\n", " if not os.path.exists(d):\n", " print(\"Creation of the\" , d, \"directory...\")\n", " os.makedirs(d)\n", " else :\n", " print(\"The\", d, \"directory already exists !\")\n", "\n", "os.chdir(input_data_dir)" ] }, { "cell_type": "code", "execution_count": 7, "id": "adc46cb2-a2c8-4ee6-ab2a-f2a69c907eef", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "base_dir : /Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431\n", "input_data_dir : /Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431/test_mt\n", "output_data_dir : /Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431/test_cqc\n", "output_images_dir : /Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431/test_cqc/images\n", "metadata_dir : /Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431/test_metadata\n", "metadata_images_dir : /Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431/test_metadata/images\n" ] } ], "source": [ "# Verify paths\n", "print('base_dir :', base_dir)\n", "print('input_data_dir :', input_data_dir)\n", "print('output_data_dir :', output_data_dir)\n", "print('output_images_dir :', output_images_dir)\n", "print('metadata_dir :', metadata_dir)\n", "print('metadata_images_dir :', metadata_images_dir)" ] }, { "cell_type": "markdown", "id": "bd22fe75-ff48-464b-8461-0ec543a7ed79", "metadata": {}, "source": [ "## V.3. FILES" ] }, { "cell_type": "markdown", "id": "15862ca9-d6c2-4d7f-a90a-5b86990a4fd4", "metadata": {}, "source": [ "### V.3.1. METADATA" ] }, { "cell_type": "code", "execution_count": 8, "id": "0863ca5e-11aa-4b4b-b87f-1a4a6d0f60ef", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The /Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431/test_metadata/marker_intensity_metadata.csv file was imported for further analysis!\n", "WARNING: 'Marker metadata file' has the following unexpected item(s): \n", "['Exp']\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
RoundTargetExpChanneltarget_lowerfull_columnmarkerlocalisation
0R0AF488300c2af488AF488_Cell_Intensity_AverageAF488cell
1R0AF488300c2af488AF488_Cytoplasm_Intensity_AverageAF488cytoplasm
2R0AF488300c2af488AF488_Nucleus_Intensity_AverageAF488nucleus
3R0AF5551500c3af555AF555_Cell_Intensity_AverageAF555cell
4R0AF5551500c3af555AF555_Cytoplasm_Intensity_AverageAF555cytoplasm
\n", "
" ], "text/plain": [ " Round Target Exp Channel target_lower full_column \\\n", "0 R0 AF488 300 c2 af488 AF488_Cell_Intensity_Average \n", "1 R0 AF488 300 c2 af488 AF488_Cytoplasm_Intensity_Average \n", "2 R0 AF488 300 c2 af488 AF488_Nucleus_Intensity_Average \n", "3 R0 AF555 1500 c3 af555 AF555_Cell_Intensity_Average \n", "4 R0 AF555 1500 c3 af555 AF555_Cytoplasm_Intensity_Average \n", "\n", " marker localisation \n", "0 AF488 cell \n", "1 AF488 cytoplasm \n", "2 AF488 nucleus \n", "3 AF555 cell \n", "4 AF555 cytoplasm " ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Import all metadata we need from the BS chapter\n", "\n", "filename = \"marker_intensity_metadata.csv\"\n", "filename = os.path.join(metadata_dir, filename)\n", "\n", "# Check file exists\n", "if not os.path.exists(filename):\n", " print(\"WARNING: Could not find desired file: \"+filename)\n", "else :\n", " print(\"The\",filename,\"file was imported for further analysis!\")\n", "\n", "# Open, read in information\n", "metadata = pd.read_csv(filename)\n", "\n", "# Verify size with verify_line_no() function in my_modules.py\n", "#verify_line_no(filename, metadata.shape[0] + 1)\n", "\n", "# Verify headers\n", "exp_cols = ['Round','Target','Channel','target_lower','full_column','marker','localisation']\n", "compare_headers(exp_cols, metadata.columns.values, \"Marker metadata file\")\n", "\n", "metadata = metadata.dropna()\n", "metadata.head()" ] }, { "cell_type": "markdown", "id": "890f832b-ce09-4194-87d3-d71ca672bfbe", "metadata": {}, "source": [ "### V.3.2. NOT_INTENSITIES" ] }, { "cell_type": "code", "execution_count": 9, "id": "f05a229d-756b-409b-9134-ed698e594a69", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The /Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431/test_metadata/not_intensities.csv file was imported for further analysis!\n", "Verifying data read from file is the correct length...\n", "\n", "not_intensities =\n", " ['Cytoplasm_Size', 'Nuc_X', 'Primary_chem(1)_vs_surg(0)', 'cluster', 'immune_checkpoint', 'Sample_ID', 'Nucleus_Roundness', 'Unique_ROI_index', 'Nuc_Y', 'Nuc_X_Inv', 'Cell_ID', 'cell_subtype', 'ID', 'Nuc_Y_Inv', 'Patient', 'replicate_ID', 'cell_type', 'ROI_index', 'Cell_Size', 'Nucleus_Size']\n" ] } ], "source": [ "filename = \"not_intensities.csv\"\n", "filename = os.path.join(metadata_dir, filename)\n", "\n", "# Check file exists\n", "if not os.path.exists(filename):\n", " print(\"WARNING: Could not find desired file: \"+filename)\n", "else :\n", " print(\"The\",filename,\"file was imported for further analysis!\")\n", " \n", "# Open, read in information\n", "not_intensities = []\n", "with open(filename, 'r') as fh:\n", " not_intensities = fh.read().strip().split(\"\\n\")\n", " # take str, strip whitespace, split on new line character\n", "\n", "# Verify size\n", "print(\"Verifying data read from file is the correct length...\\n\")\n", "#verify_line_no(filename, len(not_intensities))\n", "\n", "# Print to console\n", "print(\"not_intensities =\\n\", not_intensities)" ] }, { "cell_type": "markdown", "id": "a8c13e7b-4a11-4375-93e5-a7550e986833", "metadata": {}, "source": [ "### V.3.3. FULL_TO_SHORT_COLUMN_NAMES" ] }, { "cell_type": "code", "execution_count": 10, "id": "dbaa0a13-f499-41d5-abdc-a6f7be1f0600", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The /Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431/test_metadata/full_to_short_column_names.csv file was imported for further analysis!\n", "Verifying data read from file is the correct length...\n", "\n", "full_to_short_names =\n", " {'AF488_Cell_Intensity_Average': 'AF488_Cell', 'AF488_Cytoplasm_Intensity_Average': 'AF488_Cytoplasm', 'AF488_Nucleus_Intensity_Average': 'AF488_Nucleus', 'AF555_Cell_Intensity_Average': 'AF555_Cell', 'AF555_Cytoplasm_Intensity_Average': 'AF555_Cytoplasm', 'AF555_Nucleus_Intensity_Average': 'AF555_Nucleus', 'AF647_Cell_Intensity_Average': 'AF647_Cell', 'AF647_Cytoplasm_Intensity_Average': 'AF647_Cytoplasm', 'AF647_Nucleus_Intensity_Average': 'AF647_Nucleus', 'AF750_Cell_Intensity_Average': 'AF750_Cell', 'AF750_Cytoplasm_Intensity_Average': 'AF750_Cytoplasm', 'AF750_Nucleus_Intensity_Average': 'AF750_Nucleus', 'aSMA_Cell_Intensity_Average': 'aSMA_Cell', 'aSMA_Cytoplasm_Intensity_Average': 'aSMA_Cytoplasm', 'aSMA_Nucleus_Intensity_Average': 'aSMA_Nucleus', 'AXL_Cell_Intensity_Average': 'AXL_Cell', 'AXL_Cytoplasm_Intensity_Average': 'AXL_Cytoplasm', 'AXL_Nucleus_Intensity_Average': 'AXL_Nucleus', 'B7H4_Cell_Intensity_Average': 'B7H4_Cell', 'B7H4_Cytoplasm_Intensity_Average': 'B7H4_Cytoplasm', 'B7H4_Nucleus_Intensity_Average': 'B7H4_Nucleus', 'CA9_Cell_Intensity_Average': 'CA9_Cell', 'CA9_Cytoplasm_Intensity_Average': 'CA9_Cytoplasm', 'CA9_Nucleus_Intensity_Average': 'CA9_Nucleus', 'CD4_Cell_Intensity_Average': 'CD4_Cell', 'CD4_Cytoplasm_Intensity_Average': 'CD4_Cytoplasm', 'CD4_Nucleus_Intensity_Average': 'CD4_Nucleus', 'CD8_Cell_Intensity_Average': 'CD8_Cell', 'CD8_Cytoplasm_Intensity_Average': 'CD8_Cytoplasm', 'CD8_Nucleus_Intensity_Average': 'CD8_Nucleus', 'CD11b_Cell_Intensity_Average': 'CD11b_Cell', 'CD11b_Cytoplasm_Intensity_Average': 'CD11b_Cytoplasm', 'CD11b_Nucleus_Intensity_Average': 'CD11b_Nucleus', 'CD11c_Cell_Intensity_Average': 'CD11c_Cell', 'CD11c_Cytoplasm_Intensity_Average': 'CD11c_Cytoplasm', 'CD11c_Nucleus_Intensity_Average': 'CD11c_Nucleus', 'CD20_Cell_Intensity_Average': 'CD20_Cell', 'CD20_Cytoplasm_Intensity_Average': 'CD20_Cytoplasm', 'CD20_Nucleus_Intensity_Average': 'CD20_Nucleus', 'CD31_Cell_Intensity_Average': 'CD31_Cell', 'CD31_Cytoplasm_Intensity_Average': 'CD31_Cytoplasm', 'CD31_Nucleus_Intensity_Average': 'CD31_Nucleus', 'CD44_Cell_Intensity_Average': 'CD44_Cell', 'CD44_Cytoplasm_Intensity_Average': 'CD44_Cytoplasm', 'CD44_Nucleus_Intensity_Average': 'CD44_Nucleus', 'CD45_Cell_Intensity_Average': 'CD45_Cell', 'CD45_Cytoplasm_Intensity_Average': 'CD45_Cytoplasm', 'CD45_Nucleus_Intensity_Average': 'CD45_Nucleus', 'CD68_Cell_Intensity_Average': 'CD68_Cell', 'CD68_Cytoplasm_Intensity_Average': 'CD68_Cytoplasm', 'CD68_Nucleus_Intensity_Average': 'CD68_Nucleus', 'CD163_Cell_Intensity_Average': 'CD163_Cell', 'CD163_Cytoplasm_Intensity_Average': 'CD163_Cytoplasm', 'CD163_Nucleus_Intensity_Average': 'CD163_Nucleus', 'CKs_Cell_Intensity_Average': 'CKs_Cell', 'CKs_Cytoplasm_Intensity_Average': 'CKs_Cytoplasm', 'CKs_Nucleus_Intensity_Average': 'CKs_Nucleus', 'ColVI_Cell_Intensity_Average': 'ColVI_Cell', 'ColVI_Cytoplasm_Intensity_Average': 'ColVI_Cytoplasm', 'ColVI_Nucleus_Intensity_Average': 'ColVI_Nucleus', 'Desmin_Cell_Intensity_Average': 'Desmin_Cell', 'Desmin_Cytoplasm_Intensity_Average': 'Desmin_Cytoplasm', 'Desmin_Nucleus_Intensity_Average': 'Desmin_Nucleus', 'Ecad_Cell_Intensity_Average': 'Ecad_Cell', 'Ecad_Cytoplasm_Intensity_Average': 'Ecad_Cytoplasm', 'Ecad_Nucleus_Intensity_Average': 'Ecad_Nucleus', 'Fibronectin_Cell_Intensity_Average': 'Fibronectin_Cell', 'Fibronectin_Cytoplasm_Intensity_Average': 'Fibronectin_Cytoplasm', 'Fibronectin_Nucleus_Intensity_Average': 'Fibronectin_Nucleus', 'FOXP3_Cell_Intensity_Average': 'FOXP3_Cell', 'FOXP3_Cytoplasm_Intensity_Average': 'FOXP3_Cytoplasm', 'FOXP3_Nucleus_Intensity_Average': 'FOXP3_Nucleus', 'GATA3_Cell_Intensity_Average': 'GATA3_Cell', 'GATA3_Cytoplasm_Intensity_Average': 'GATA3_Cytoplasm', 'GATA3_Nucleus_Intensity_Average': 'GATA3_Nucleus', 'HLA_Cell_Intensity_Average': 'HLA_Cell', 'HLA_Cytoplasm_Intensity_Average': 'HLA_Cytoplasm', 'HLA_Nucleus_Intensity_Average': 'HLA_Nucleus', 'Ki67_Cell_Intensity_Average': 'Ki67_Cell', 'Ki67_Cytoplasm_Intensity_Average': 'Ki67_Cytoplasm', 'Ki67_Nucleus_Intensity_Average': 'Ki67_Nucleus', 'MMP9_Cell_Intensity_Average': 'MMP9_Cell', 'MMP9_Cytoplasm_Intensity_Average': 'MMP9_Cytoplasm', 'MMP9_Nucleus_Intensity_Average': 'MMP9_Nucleus', 'PD1_Cell_Intensity_Average': 'PD1_Cell', 'PD1_Cytoplasm_Intensity_Average': 'PD1_Cytoplasm', 'PD1_Nucleus_Intensity_Average': 'PD1_Nucleus', 'PDGFR_Cell_Intensity_Average': 'PDGFR_Cell', 'PDGFR_Cytoplasm_Intensity_Average': 'PDGFR_Cytoplasm', 'PDGFR_Nucleus_Intensity_Average': 'PDGFR_Nucleus', 'PDL1_Cell_Intensity_Average': 'PDL1_Cell', 'PDL1_Cytoplasm_Intensity_Average': 'PDL1_Cytoplasm', 'PDL1_Nucleus_Intensity_Average': 'PDL1_Nucleus', 'r5c2_Cell_Intensity_Average': 'r5c2_Cell', 'r5c2_Cytoplasm_Intensity_Average': 'r5c2_Cytoplasm', 'r5c2_Nucleus_Intensity_Average': 'r5c2_Nucleus', 'r7c2_Cell_Intensity_Average': 'r7c2_Cell', 'r7c2_Cytoplasm_Intensity_Average': 'r7c2_Cytoplasm', 'r7c2_Nucleus_Intensity_Average': 'r7c2_Nucleus', 'r8c2_Cell_Intensity_Average': 'r8c2_Cell', 'r8c2_Cytoplasm_Intensity_Average': 'r8c2_Cytoplasm', 'r8c2_Nucleus_Intensity_Average': 'r8c2_Nucleus', 'Sting_Cell_Intensity_Average': 'Sting_Cell', 'Sting_Cytoplasm_Intensity_Average': 'Sting_Cytoplasm', 'Sting_Nucleus_Intensity_Average': 'Sting_Nucleus', 'Vimentin_Cell_Intensity_Average': 'Vimentin_Cell', 'Vimentin_Cytoplasm_Intensity_Average': 'Vimentin_Cytoplasm', 'Vimentin_Nucleus_Intensity_Average': 'Vimentin_Nucleus'}\n" ] } ], "source": [ "filename = \"full_to_short_column_names.csv\"\n", "filename = os.path.join(metadata_dir, filename)\n", "\n", "# Check file exists\n", "if not os.path.exists(filename):\n", " print(\"WARNING: Could not find desired file: \" + filename)\n", "else :\n", " print(\"The\",filename,\"file was imported for further analysis!\")\n", " \n", "# Open, read in information\n", "df = pd.read_csv(filename, header = 0)\n", "\n", "# Verify size\n", "print(\"Verifying data read from file is the correct length...\\n\")\n", "#verify_line_no(filename, df.shape[0] + 1)\n", "\n", "# Turn into dictionary\n", "full_to_short_names = df.set_index('full_name').T.to_dict('records')[0]\n", "\n", "# CD45 instead of CD45b\n", "if project_name == 'Slide_A' :\n", " full_to_short_names['CD45_Cytoplasm_Intensity_Average'] = full_to_short_names.pop('CD45b_Cytoplasm_Intensity_Average')\n", " full_to_short_names['CD45_Cytoplasm_Intensity_Average'] = 'CD45_Cytoplasm'\n", "\n", "# Print information\n", "print('full_to_short_names =\\n',full_to_short_names)" ] }, { "cell_type": "markdown", "id": "1a9431d5-a6a0-4fe0-bb58-97008c662a68", "metadata": {}, "source": [ "### V.3.4. SHORT_TO_FULL_COLUMN_NAMES" ] }, { "cell_type": "code", "execution_count": 11, "id": "056adc64-1408-4f48-83d8-dec9f2f0e5cc", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The /Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431/test_metadata/short_to_full_column_names.csv file was imported for further analysis!\n", "Verifying data read from file is the correct length...\n", "\n", "short_to_full_names =\n", " {'AF488_Cell': 'AF488_Cell_Intensity_Average', 'AF488_Cytoplasm': 'AF488_Cytoplasm_Intensity_Average', 'AF488_Nucleus': 'AF488_Nucleus_Intensity_Average', 'AF555_Cell': 'AF555_Cell_Intensity_Average', 'AF555_Cytoplasm': 'AF555_Cytoplasm_Intensity_Average', 'AF555_Nucleus': 'AF555_Nucleus_Intensity_Average', 'AF647_Cell': 'AF647_Cell_Intensity_Average', 'AF647_Cytoplasm': 'AF647_Cytoplasm_Intensity_Average', 'AF647_Nucleus': 'AF647_Nucleus_Intensity_Average', 'AF750_Cell': 'AF750_Cell_Intensity_Average', 'AF750_Cytoplasm': 'AF750_Cytoplasm_Intensity_Average', 'AF750_Nucleus': 'AF750_Nucleus_Intensity_Average', 'aSMA_Cell': 'aSMA_Cell_Intensity_Average', 'aSMA_Cytoplasm': 'aSMA_Cytoplasm_Intensity_Average', 'aSMA_Nucleus': 'aSMA_Nucleus_Intensity_Average', 'AXL_Cell': 'AXL_Cell_Intensity_Average', 'AXL_Cytoplasm': 'AXL_Cytoplasm_Intensity_Average', 'AXL_Nucleus': 'AXL_Nucleus_Intensity_Average', 'B7H4_Cell': 'B7H4_Cell_Intensity_Average', 'B7H4_Cytoplasm': 'B7H4_Cytoplasm_Intensity_Average', 'B7H4_Nucleus': 'B7H4_Nucleus_Intensity_Average', 'CA9_Cell': 'CA9_Cell_Intensity_Average', 'CA9_Cytoplasm': 'CA9_Cytoplasm_Intensity_Average', 'CA9_Nucleus': 'CA9_Nucleus_Intensity_Average', 'CD4_Cell': 'CD4_Cell_Intensity_Average', 'CD4_Cytoplasm': 'CD4_Cytoplasm_Intensity_Average', 'CD4_Nucleus': 'CD4_Nucleus_Intensity_Average', 'CD8_Cell': 'CD8_Cell_Intensity_Average', 'CD8_Cytoplasm': 'CD8_Cytoplasm_Intensity_Average', 'CD8_Nucleus': 'CD8_Nucleus_Intensity_Average', 'CD11b_Cell': 'CD11b_Cell_Intensity_Average', 'CD11b_Cytoplasm': 'CD11b_Cytoplasm_Intensity_Average', 'CD11b_Nucleus': 'CD11b_Nucleus_Intensity_Average', 'CD11c_Cell': 'CD11c_Cell_Intensity_Average', 'CD11c_Cytoplasm': 'CD11c_Cytoplasm_Intensity_Average', 'CD11c_Nucleus': 'CD11c_Nucleus_Intensity_Average', 'CD20_Cell': 'CD20_Cell_Intensity_Average', 'CD20_Cytoplasm': 'CD20_Cytoplasm_Intensity_Average', 'CD20_Nucleus': 'CD20_Nucleus_Intensity_Average', 'CD31_Cell': 'CD31_Cell_Intensity_Average', 'CD31_Cytoplasm': 'CD31_Cytoplasm_Intensity_Average', 'CD31_Nucleus': 'CD31_Nucleus_Intensity_Average', 'CD44_Cell': 'CD44_Cell_Intensity_Average', 'CD44_Cytoplasm': 'CD44_Cytoplasm_Intensity_Average', 'CD44_Nucleus': 'CD44_Nucleus_Intensity_Average', 'CD45_Cell': 'CD45_Cell_Intensity_Average', 'CD45_Cytoplasm': 'CD45_Cytoplasm_Intensity_Average', 'CD45_Nucleus': 'CD45_Nucleus_Intensity_Average', 'CD68_Cell': 'CD68_Cell_Intensity_Average', 'CD68_Cytoplasm': 'CD68_Cytoplasm_Intensity_Average', 'CD68_Nucleus': 'CD68_Nucleus_Intensity_Average', 'CD163_Cell': 'CD163_Cell_Intensity_Average', 'CD163_Cytoplasm': 'CD163_Cytoplasm_Intensity_Average', 'CD163_Nucleus': 'CD163_Nucleus_Intensity_Average', 'CKs_Cell': 'CKs_Cell_Intensity_Average', 'CKs_Cytoplasm': 'CKs_Cytoplasm_Intensity_Average', 'CKs_Nucleus': 'CKs_Nucleus_Intensity_Average', 'ColVI_Cell': 'ColVI_Cell_Intensity_Average', 'ColVI_Cytoplasm': 'ColVI_Cytoplasm_Intensity_Average', 'ColVI_Nucleus': 'ColVI_Nucleus_Intensity_Average', 'Desmin_Cell': 'Desmin_Cell_Intensity_Average', 'Desmin_Cytoplasm': 'Desmin_Cytoplasm_Intensity_Average', 'Desmin_Nucleus': 'Desmin_Nucleus_Intensity_Average', 'Ecad_Cell': 'Ecad_Cell_Intensity_Average', 'Ecad_Cytoplasm': 'Ecad_Cytoplasm_Intensity_Average', 'Ecad_Nucleus': 'Ecad_Nucleus_Intensity_Average', 'Fibronectin_Cell': 'Fibronectin_Cell_Intensity_Average', 'Fibronectin_Cytoplasm': 'Fibronectin_Cytoplasm_Intensity_Average', 'Fibronectin_Nucleus': 'Fibronectin_Nucleus_Intensity_Average', 'FOXP3_Cell': 'FOXP3_Cell_Intensity_Average', 'FOXP3_Cytoplasm': 'FOXP3_Cytoplasm_Intensity_Average', 'FOXP3_Nucleus': 'FOXP3_Nucleus_Intensity_Average', 'GATA3_Cell': 'GATA3_Cell_Intensity_Average', 'GATA3_Cytoplasm': 'GATA3_Cytoplasm_Intensity_Average', 'GATA3_Nucleus': 'GATA3_Nucleus_Intensity_Average', 'HLA_Cell': 'HLA_Cell_Intensity_Average', 'HLA_Cytoplasm': 'HLA_Cytoplasm_Intensity_Average', 'HLA_Nucleus': 'HLA_Nucleus_Intensity_Average', 'Ki67_Cell': 'Ki67_Cell_Intensity_Average', 'Ki67_Cytoplasm': 'Ki67_Cytoplasm_Intensity_Average', 'Ki67_Nucleus': 'Ki67_Nucleus_Intensity_Average', 'MMP9_Cell': 'MMP9_Cell_Intensity_Average', 'MMP9_Cytoplasm': 'MMP9_Cytoplasm_Intensity_Average', 'MMP9_Nucleus': 'MMP9_Nucleus_Intensity_Average', 'PD1_Cell': 'PD1_Cell_Intensity_Average', 'PD1_Cytoplasm': 'PD1_Cytoplasm_Intensity_Average', 'PD1_Nucleus': 'PD1_Nucleus_Intensity_Average', 'PDGFR_Cell': 'PDGFR_Cell_Intensity_Average', 'PDGFR_Cytoplasm': 'PDGFR_Cytoplasm_Intensity_Average', 'PDGFR_Nucleus': 'PDGFR_Nucleus_Intensity_Average', 'PDL1_Cell': 'PDL1_Cell_Intensity_Average', 'PDL1_Cytoplasm': 'PDL1_Cytoplasm_Intensity_Average', 'PDL1_Nucleus': 'PDL1_Nucleus_Intensity_Average', 'r5c2_Cell': 'r5c2_Cell_Intensity_Average', 'r5c2_Cytoplasm': 'r5c2_Cytoplasm_Intensity_Average', 'r5c2_Nucleus': 'r5c2_Nucleus_Intensity_Average', 'r7c2_Cell': 'r7c2_Cell_Intensity_Average', 'r7c2_Cytoplasm': 'r7c2_Cytoplasm_Intensity_Average', 'r7c2_Nucleus': 'r7c2_Nucleus_Intensity_Average', 'r8c2_Cell': 'r8c2_Cell_Intensity_Average', 'r8c2_Cytoplasm': 'r8c2_Cytoplasm_Intensity_Average', 'r8c2_Nucleus': 'r8c2_Nucleus_Intensity_Average', 'Sting_Cell': 'Sting_Cell_Intensity_Average', 'Sting_Cytoplasm': 'Sting_Cytoplasm_Intensity_Average', 'Sting_Nucleus': 'Sting_Nucleus_Intensity_Average', 'Vimentin_Cell': 'Vimentin_Cell_Intensity_Average', 'Vimentin_Cytoplasm': 'Vimentin_Cytoplasm_Intensity_Average', 'Vimentin_Nucleus': 'Vimentin_Nucleus_Intensity_Average'}\n" ] } ], "source": [ "filename = \"short_to_full_column_names.csv\"\n", "filename = os.path.join(metadata_dir, filename)\n", "\n", "# Check file exists\n", "if not os.path.exists(filename):\n", " print(\"WARNING: Could not find desired file: \" + filename)\n", "else :\n", " print(\"The\",filename,\"file was imported for further analysis!\")\n", " \n", "# Open, read in information\n", "df = pd.read_csv(filename, header = 0)\n", "\n", "# Verify size\n", "print(\"Verifying data read from file is the correct length...\\n\")\n", "#verify_line_no(filename, df.shape[0] + 1)\n", "\n", "# Turn into dictionary\n", "short_to_full_names = df.set_index('short_name').T.to_dict('records')[0]\n", "\n", "# CD45 instead of CD45b\n", "if project_name == 'Slide_A' :\n", " short_to_full_names['CD45_Cytoplasm'] = short_to_full_names.pop('CD45b_Cytoplasm')\n", " short_to_full_names['CD45_Cytoplasm'] = 'CD45_Cytoplasm_Intensity_Average'\n", "\n", "# Print information\n", "print('short_to_full_names =\\n',short_to_full_names)" ] }, { "cell_type": "markdown", "id": "7eda7993-e4e3-4a19-b1b0-24a5aa088a07", "metadata": {}, "source": [ "### V.3.5. SAMPLES COLORS" ] }, { "cell_type": "code", "execution_count": 12, "id": "bf3c90f9-c395-40a8-a2bd-2df946e2a05b", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "WARNING: Could not find desired file: /Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431/test_metadata/sample_color_data.csv\n" ] }, { "ename": "FileNotFoundError", "evalue": "[Errno 2] No such file or directory: '/Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431/test_metadata/sample_color_data.csv'", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)", "Cell \u001b[0;32mIn[12], line 11\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThe\u001b[39m\u001b[38;5;124m\"\u001b[39m,filename,\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfile was imported for further analysis!\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 10\u001b[0m \u001b[38;5;66;03m# Open, read in information\u001b[39;00m\n\u001b[0;32m---> 11\u001b[0m df \u001b[38;5;241m=\u001b[39m pd\u001b[38;5;241m.\u001b[39mread_csv(filename, header \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m)\n\u001b[1;32m 12\u001b[0m df \u001b[38;5;241m=\u001b[39m df\u001b[38;5;241m.\u001b[39mdrop(columns \u001b[38;5;241m=\u001b[39m [\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mhex\u001b[39m\u001b[38;5;124m'\u001b[39m])\n\u001b[1;32m 14\u001b[0m \u001b[38;5;66;03m# our tuple of float values for rgb, (r, g, b) was read in \u001b[39;00m\n\u001b[1;32m 15\u001b[0m \u001b[38;5;66;03m# as a string '(r, g, b)'. We need to extract the r-, g-, and b-\u001b[39;00m\n\u001b[1;32m 16\u001b[0m \u001b[38;5;66;03m# substrings and convert them back into floats\u001b[39;00m\n", "File \u001b[0;32m/opt/anaconda3/envs/Cyc_If/lib/python3.11/site-packages/pandas/util/_decorators.py:211\u001b[0m, in \u001b[0;36mdeprecate_kwarg.._deprecate_kwarg..wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 209\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 210\u001b[0m kwargs[new_arg_name] \u001b[38;5;241m=\u001b[39m new_arg_value\n\u001b[0;32m--> 211\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m func(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n", "File \u001b[0;32m/opt/anaconda3/envs/Cyc_If/lib/python3.11/site-packages/pandas/util/_decorators.py:331\u001b[0m, in \u001b[0;36mdeprecate_nonkeyword_arguments..decorate..wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 325\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(args) \u001b[38;5;241m>\u001b[39m num_allow_args:\n\u001b[1;32m 326\u001b[0m warnings\u001b[38;5;241m.\u001b[39mwarn(\n\u001b[1;32m 327\u001b[0m msg\u001b[38;5;241m.\u001b[39mformat(arguments\u001b[38;5;241m=\u001b[39m_format_argument_list(allow_args)),\n\u001b[1;32m 328\u001b[0m \u001b[38;5;167;01mFutureWarning\u001b[39;00m,\n\u001b[1;32m 329\u001b[0m stacklevel\u001b[38;5;241m=\u001b[39mfind_stack_level(),\n\u001b[1;32m 330\u001b[0m )\n\u001b[0;32m--> 331\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m func(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n", "File \u001b[0;32m/opt/anaconda3/envs/Cyc_If/lib/python3.11/site-packages/pandas/io/parsers/readers.py:950\u001b[0m, in \u001b[0;36mread_csv\u001b[0;34m(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, encoding_errors, dialect, error_bad_lines, warn_bad_lines, on_bad_lines, delim_whitespace, low_memory, memory_map, float_precision, storage_options)\u001b[0m\n\u001b[1;32m 935\u001b[0m kwds_defaults \u001b[38;5;241m=\u001b[39m _refine_defaults_read(\n\u001b[1;32m 936\u001b[0m dialect,\n\u001b[1;32m 937\u001b[0m delimiter,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 946\u001b[0m defaults\u001b[38;5;241m=\u001b[39m{\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdelimiter\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m,\u001b[39m\u001b[38;5;124m\"\u001b[39m},\n\u001b[1;32m 947\u001b[0m )\n\u001b[1;32m 948\u001b[0m kwds\u001b[38;5;241m.\u001b[39mupdate(kwds_defaults)\n\u001b[0;32m--> 950\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m _read(filepath_or_buffer, kwds)\n", "File \u001b[0;32m/opt/anaconda3/envs/Cyc_If/lib/python3.11/site-packages/pandas/io/parsers/readers.py:605\u001b[0m, in \u001b[0;36m_read\u001b[0;34m(filepath_or_buffer, kwds)\u001b[0m\n\u001b[1;32m 602\u001b[0m _validate_names(kwds\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnames\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m))\n\u001b[1;32m 604\u001b[0m \u001b[38;5;66;03m# Create the parser.\u001b[39;00m\n\u001b[0;32m--> 605\u001b[0m parser \u001b[38;5;241m=\u001b[39m TextFileReader(filepath_or_buffer, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwds)\n\u001b[1;32m 607\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m chunksize \u001b[38;5;129;01mor\u001b[39;00m iterator:\n\u001b[1;32m 608\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m parser\n", "File \u001b[0;32m/opt/anaconda3/envs/Cyc_If/lib/python3.11/site-packages/pandas/io/parsers/readers.py:1442\u001b[0m, in \u001b[0;36mTextFileReader.__init__\u001b[0;34m(self, f, engine, **kwds)\u001b[0m\n\u001b[1;32m 1439\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptions[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhas_index_names\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m kwds[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mhas_index_names\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[1;32m 1441\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles: IOHandles \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m-> 1442\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_engine \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_make_engine(f, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mengine)\n", "File \u001b[0;32m/opt/anaconda3/envs/Cyc_If/lib/python3.11/site-packages/pandas/io/parsers/readers.py:1735\u001b[0m, in \u001b[0;36mTextFileReader._make_engine\u001b[0;34m(self, f, engine)\u001b[0m\n\u001b[1;32m 1733\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m mode:\n\u001b[1;32m 1734\u001b[0m mode \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m-> 1735\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles \u001b[38;5;241m=\u001b[39m get_handle(\n\u001b[1;32m 1736\u001b[0m f,\n\u001b[1;32m 1737\u001b[0m mode,\n\u001b[1;32m 1738\u001b[0m encoding\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptions\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mencoding\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m),\n\u001b[1;32m 1739\u001b[0m compression\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptions\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcompression\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m),\n\u001b[1;32m 1740\u001b[0m memory_map\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptions\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmemory_map\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mFalse\u001b[39;00m),\n\u001b[1;32m 1741\u001b[0m is_text\u001b[38;5;241m=\u001b[39mis_text,\n\u001b[1;32m 1742\u001b[0m errors\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptions\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mencoding_errors\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mstrict\u001b[39m\u001b[38;5;124m\"\u001b[39m),\n\u001b[1;32m 1743\u001b[0m storage_options\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39moptions\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mstorage_options\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m),\n\u001b[1;32m 1744\u001b[0m )\n\u001b[1;32m 1745\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 1746\u001b[0m f \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mhandles\u001b[38;5;241m.\u001b[39mhandle\n", "File \u001b[0;32m/opt/anaconda3/envs/Cyc_If/lib/python3.11/site-packages/pandas/io/common.py:856\u001b[0m, in \u001b[0;36mget_handle\u001b[0;34m(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)\u001b[0m\n\u001b[1;32m 851\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(handle, \u001b[38;5;28mstr\u001b[39m):\n\u001b[1;32m 852\u001b[0m \u001b[38;5;66;03m# Check whether the filename is to be opened in binary mode.\u001b[39;00m\n\u001b[1;32m 853\u001b[0m \u001b[38;5;66;03m# Binary mode does not support 'encoding' and 'newline'.\u001b[39;00m\n\u001b[1;32m 854\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m ioargs\u001b[38;5;241m.\u001b[39mencoding \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mb\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m ioargs\u001b[38;5;241m.\u001b[39mmode:\n\u001b[1;32m 855\u001b[0m \u001b[38;5;66;03m# Encoding\u001b[39;00m\n\u001b[0;32m--> 856\u001b[0m handle \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mopen\u001b[39m(\n\u001b[1;32m 857\u001b[0m handle,\n\u001b[1;32m 858\u001b[0m ioargs\u001b[38;5;241m.\u001b[39mmode,\n\u001b[1;32m 859\u001b[0m encoding\u001b[38;5;241m=\u001b[39mioargs\u001b[38;5;241m.\u001b[39mencoding,\n\u001b[1;32m 860\u001b[0m errors\u001b[38;5;241m=\u001b[39merrors,\n\u001b[1;32m 861\u001b[0m newline\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 862\u001b[0m )\n\u001b[1;32m 863\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 864\u001b[0m \u001b[38;5;66;03m# Binary mode\u001b[39;00m\n\u001b[1;32m 865\u001b[0m handle \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mopen\u001b[39m(handle, ioargs\u001b[38;5;241m.\u001b[39mmode)\n", "\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/Users/harshithakolipaka/Downloads/wetransfer_data-zip_2024-05-17_1431/test_metadata/sample_color_data.csv'" ] } ], "source": [ "filename = \"sample_color_data.csv\"\n", "filename = os.path.join(metadata_dir, filename)\n", "\n", "# Check file exists\n", "if not os.path.exists(filename):\n", " print(\"WARNING: Could not find desired file: \" + filename)\n", "else :\n", " print(\"The\",filename,\"file was imported for further analysis!\")\n", " \n", "# Open, read in information\n", "df = pd.read_csv(filename, header = 0)\n", "df = df.drop(columns = ['hex'])\n", "\n", "# our tuple of float values for rgb, (r, g, b) was read in \n", "# as a string '(r, g, b)'. We need to extract the r-, g-, and b-\n", "# substrings and convert them back into floats\n", "df['rgb'] = df.apply(lambda row: rgb_tuple_from_str(row['rgb']), axis = 1)\n", "\n", "# Verify size\n", "print(\"Verifying data read from file is the correct length...\\n\")\n", "#verify_line_no(filename, df.shape[0] + 1)\n", "\n", "# Turn into dictionary\n", "sample_color_dict = df.set_index('Sample_ID').T.to_dict('rgb')[0]\n", "\n", "# Print information\n", "print('sample_color_dict =\\n',sample_color_dict)" ] }, { "cell_type": "markdown", "id": "27f77fc8-d11f-4598-b66b-436f45ea4be3", "metadata": {}, "source": [ "### V.3.6. CHANNELS COLORS" ] }, { "cell_type": "code", "execution_count": 12, "id": "50f9f41b-8c2a-4b1c-8787-a198c97ec606", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The C:\\Users\\zoege\\Documents\\Temp\\Cyc-IF_pipeline\\Set_B\\Set_B_metadata\\channel_color_data.csv file was imported for further analysis!\n", "Verifying data read from file is the correct length...\n", "\n", "channel_color_dict =\n", " {'c2': (0.00784313725490196, 0.24313725490196078, 1.0), 'c3': (1.0, 0.48627450980392156, 0.0), 'c4': (0.10196078431372549, 0.788235294117647, 0.2196078431372549), 'c5': (0.9098039215686274, 0.0, 0.043137254901960784)}\n" ] } ], "source": [ "filename = \"channel_color_data.csv\"\n", "filename = os.path.join(metadata_dir, filename)\n", "\n", "# Check file exists\n", "if not os.path.exists(filename):\n", " print(\"WARNING: Could not find desired file: \"+filename)\n", "else :\n", " print(\"The\",filename,\"file was imported for further analysis!\")\n", " \n", "# Open, read in information\n", "df = pd.read_csv(filename, header = 0)\n", "df = df.drop(columns = ['hex'])\n", "\n", "# our tuple of float values for rgb, (r, g, b) was read in \n", "# as a string '(r, g, b)'. We need to extract the r-, g-, and b-\n", "# substrings and convert them back into floats\n", "df['rgb'] = df.apply(lambda row: rgb_tuple_from_str(row['rgb']), axis = 1)\n", "\n", "# Verify size\n", "print(\"Verifying data read from file is the correct length...\\n\")\n", "#verify_line_no(filename, df.shape[0] + 1)\n", "\n", "# Turn into dictionary\n", "channel_color_dict = df.set_index('Channel').T.to_dict('rgb')[0]\n", "\n", "# Print information\n", "print('channel_color_dict =\\n',channel_color_dict)" ] }, { "cell_type": "markdown", "id": "89fccf1f-692e-494e-b6db-208cbccc58d2", "metadata": {}, "source": [ "### V.3.7. ROUNDS COLORS" ] }, { "cell_type": "code", "execution_count": 13, "id": "b24c3fbf-c8ca-4b62-a1c0-b1b90ed67ac7", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The C:\\Users\\zoege\\Documents\\Temp\\Cyc-IF_pipeline\\Set_B\\Set_B_metadata\\round_color_data.csv file was imported for further analysis!\n", "Verifying data read from file is the correct length...\n", "\n", "round_color_dict =\n", " {'R0': (0.28685356234627135, 0.13009829239513535, 0.23110332132624437), 'R1': (0.36541462435986094, 0.2025447048359916, 0.37693310021636883), 'R2': (0.40867533458903105, 0.2940761173840091, 0.5166711878800253), 'R3': (0.42890613750051265, 0.4082290173220481, 0.6335348887063806), 'R4': (0.4444462906865238, 0.5264664993764805, 0.7056321892616532), 'R5': (0.47707206309601013, 0.6427061780374552, 0.7418477948908153), 'R6': (0.5414454866716836, 0.7466759172596551, 0.7572905778378964), 'R7': (0.6414710091647722, 0.8321551072276492, 0.7746773027952071), 'R8': (0.7684256891219349, 0.8992667116749021, 0.8171383269422353)}\n" ] } ], "source": [ "filename = \"round_color_data.csv\"\n", "filename = os.path.join(metadata_dir, filename)\n", "\n", "# Check file exists\n", "if not os.path.exists(filename):\n", " print(\"WARNING: Could not find desired file: \"+filename)\n", "else :\n", " print(\"The\",filename,\"file was imported for further analysis!\")\n", " \n", "# Open, read in information\n", "df = pd.read_csv(filename, header = 0)\n", "df = df.drop(columns = ['hex'])\n", "\n", "# our tuple of float values for rgb, (r, g, b) was read in \n", "# as a string '(r, g, b)'. We need to extract the r-, g-, and b-\n", "# substrings and convert them back into floats\n", "df['rgb'] = df.apply(lambda row: rgb_tuple_from_str(row['rgb']), axis = 1)\n", "\n", "# Verify size\n", "print(\"Verifying data read from file is the correct length...\\n\")\n", "#verify_line_no(filename, df.shape[0] + 1)\n", "\n", "# Turn into dictionary\n", "round_color_dict = df.set_index('Round').T.to_dict('rgb')[0]\n", "\n", "# Print information\n", "print('round_color_dict =\\n',round_color_dict)" ] }, { "cell_type": "markdown", "id": "bca04ed4-76ce-47af-b922-769365c5eed9", "metadata": {}, "source": [ "### V.3.8. CELL TYPES COLORS" ] }, { "cell_type": "code", "execution_count": 14, "id": "9ddb549a-e104-42de-b8ed-a2e64cfe468a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The C:\\Users\\zoege\\Documents\\Temp\\Cyc-IF_pipeline\\Set_B\\Set_B_metadata\\celltype_color_data.csv file was imported for further analysis!\n", "Verifying data read from file is the correct length...\n", "\n", "cell_type_color_dict =\n", " {'CANCER': (0.1333, 0.5451, 0.1333), 'STROMA': (0.4, 0.4, 0.4), 'IMMUNE': (1.0, 1.0, 0.0), 'ENDOTHELIAL': (0.502, 0.0, 0.502)}\n" ] } ], "source": [ "filename = \"celltype_color_data.csv\"\n", "filename = os.path.join(metadata_dir, filename)\n", "\n", "# Check file exists\n", "if not os.path.exists(filename):\n", " print(\"WARNING: Could not find desired file: \"+filename)\n", "else :\n", " print(\"The\",filename,\"file was imported for further analysis!\")\n", " \n", "# Open, read in information\n", "df = pd.read_csv(filename, header = 0)\n", "df = df.drop(columns = ['hex'])\n", "\n", "# our tuple of float values for rgb, (r, g, b) was read in \n", "# as a string '(r, g, b)'. We need to extract the r-, g-, and b-\n", "# substrings and convert them back into floats\n", "df['rgb'] = df.apply(lambda row: rgb_tuple_from_str(row['rgb']), axis = 1)\n", "\n", "# Verify size\n", "print(\"Verifying data read from file is the correct length...\\n\")\n", "#verify_line_no(filename, df.shape[0] + 1)\n", "\n", "# Turn into dictionary\n", "cell_type_color_dict = df.set_index('cell_type').T.to_dict('rgb')[0]\n", "\n", "# Print information\n", "print('cell_type_color_dict =\\n',cell_type_color_dict)" ] }, { "cell_type": "markdown", "id": "691eef7d-175a-4d95-b0d5-6d07900e7ed3", "metadata": {}, "source": [ "### V.3.9. CELL SUBTYPES COLORS" ] }, { "cell_type": "code", "execution_count": 15, "id": "b2cc5232-8d4d-47fa-93a6-7b0520dc04e9", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The C:\\Users\\zoege\\Documents\\Temp\\Cyc-IF_pipeline\\Set_B\\Set_B_metadata\\cellsubtype_color_data.csv file was imported for further analysis!\n", "Verifying data read from file is the correct length...\n", "\n", "cell_subtype_color_dict =\n", " {'DC': (0.6509803921568628, 0.807843137254902, 0.8901960784313725), 'B': (0.12156862745098039, 0.47058823529411764, 0.7058823529411765), 'TCD4': (0.6980392156862745, 0.8745098039215686, 0.5411764705882353), 'TCD8': (0.2, 0.6274509803921569, 0.17254901960784313), 'M1': (0.984313725490196, 0.6039215686274509, 0.6), 'M2': (0.8901960784313725, 0.10196078431372549, 0.10980392156862745), 'Treg': (0.9921568627450981, 0.7490196078431373, 0.43529411764705883), 'IMMUNE_OTHER': (1.0, 0.4980392156862745, 0.0), 'CANCER': (0.792156862745098, 0.6980392156862745, 0.8392156862745098), 'αSMA_myCAF': (0.41568627450980394, 0.23921568627450981, 0.6039215686274509), 'STROMA_OTHER': (1.0, 1.0, 0.6), 'ENDOTHELIAL': (0.6941176470588235, 0.34901960784313724, 0.1568627450980392)}\n" ] } ], "source": [ "filename = \"cellsubtype_color_data.csv\"\n", "filename = os.path.join(metadata_dir, filename)\n", "\n", "# Check file exists\n", "if not os.path.exists(filename):\n", " print(\"WARNING: Could not find desired file: \"+filename)\n", "else :\n", " print(\"The\",filename,\"file was imported for further analysis!\")\n", " \n", "# Open, read in information\n", "df = pd.read_csv(filename, header = 0)\n", "df = df.drop(columns = ['hex'])\n", "\n", "# our tuple of float values for rgb, (r, g, b) was read in \n", "# as a string '(r, g, b)'. We need to extract the r-, g-, and b-\n", "# substrings and convert them back into floats\n", "df['rgb'] = df.apply(lambda row: rgb_tuple_from_str(row['rgb']), axis = 1)\n", "\n", "# Verify size\n", "print(\"Verifying data read from file is the correct length...\\n\")\n", "#verify_line_no(filename, df.shape[0] + 1)\n", "\n", "# Turn into dictionary\n", "cell_subtype_color_dict = df.set_index('cell_subtype').T.to_dict('rgb')[0]\n", "\n", "# Print information\n", "print('cell_subtype_color_dict =\\n',cell_subtype_color_dict) " ] }, { "cell_type": "markdown", "id": "40d4692c-fcf2-4663-b180-e6183bcbbe22", "metadata": {}, "source": [ "### V.4.10. IMMUNE CHECKPOINT COLORS" ] }, { "cell_type": "code", "execution_count": 16, "id": "2da347b5-fa4d-40b4-b7f6-4f5c7d462f08", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The C:\\Users\\zoege\\Documents\\Temp\\Cyc-IF_pipeline\\Set_B\\Set_B_metadata\\immunecheckpoint_color_data.csv file was imported for further analysis!\n", "Verifying data read from file is the correct length...\n", "\n", "immune_checkpoint_color_dict =\n", " {'B7H4': (0.9677975592919913, 0.44127456009157356, 0.5358103155058701), 'PDL1': (0.3126890019504329, 0.6928754610296064, 0.1923704830330379), 'PD1': (0.23299120924703914, 0.639586552066035, 0.9260706093977744), 'B7H4_PDL1': (0.6402432806212122, 0.56707501056059, 0.36409039926945397), 'B7H4_PD1': (0.6003943842695152, 0.5404305560788043, 0.7309404624518223), 'PDL1_PD1': (0.27284010559873606, 0.6662310065478207, 0.5592205462154062), 'B7H4_PDL1_PD1': (0.5044925901631545, 0.5912455243957383, 0.5514171359788941), 'None': (0.8, 0.8, 0.8)}\n" ] } ], "source": [ "filename = \"immunecheckpoint_color_data.csv\"\n", "filename = os.path.join(metadata_dir, filename)\n", "\n", "# Check file exists\n", "if not os.path.exists(filename):\n", " print(\"WARNING: Could not find desired file: \"+filename)\n", "else :\n", " print(\"The\",filename,\"file was imported for further analysis!\")\n", " \n", "# Open, read in information\n", "df = pd.read_csv(filename, header = 0)\n", "df = df.drop(columns = ['hex'])\n", "\n", "# our tuple of float values for rgb, (r, g, b) was read in \n", "# as a string '(r, g, b)'. We need to extract the r-, g-, and b-\n", "# substrings and convert them back into floats\n", "df['rgb'] = df.apply(lambda row: rgb_tuple_from_str(row['rgb']), axis = 1)\n", "\n", "# Verify size\n", "print(\"Verifying data read from file is the correct length...\\n\")\n", "#verify_line_no(filename, df.shape[0] + 1)\n", "\n", "# Turn into dictionary\n", "immune_checkpoint_color_dict = df.set_index('immune_checkpoint').T.to_dict('rgb')[0]\n", "\n", "# Print information\n", "print('immune_checkpoint_color_dict =\\n',immune_checkpoint_color_dict)" ] }, { "cell_type": "markdown", "id": "5ba6cad2-ed2d-4fa7-afa5-6122bfdef493", "metadata": {}, "source": [ "### V.3.11. DATA" ] }, { "cell_type": "code", "execution_count": 17, "id": "1ae727be-989a-4618-9c21-d741a6e862cc", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The following CSV files were detected:\n", "['DD3S1_mt.csv', 'DD3S2_mt.csv', 'DD3S3_mt.csv', 'DD4S1_mt.csv', 'DD4S2_mt.csv', 'DD4S3_mt.csv', 'DD5S1_mt.csv', 'DD5S2_mt.csv', 'DD5S3_mt.csv', 'TMA_mt.csv']\n" ] } ], "source": [ "# DATA\n", "# List files in the directory\n", "# Check if the directory exists\n", "if os.path.exists(input_data_dir):\n", " # List files in the directory\n", " ls_samples = [sample for sample in os.listdir(input_data_dir) if sample.endswith(\"_mt.csv\")]\n", " print(\"The following CSV files were detected:\")\n", " print([sample for sample in ls_samples])\n", "else:\n", " print(f\"The directory {input_data_dir} does not exist.\")" ] }, { "cell_type": "code", "execution_count": 18, "id": "18a34f42-7d39-4177-b932-8dbb918732b1", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "['PDL1_Cytoplasm_Intensity_Average' 'HLA_Cytoplasm_Intensity_Average'\n", " 'CKs_Cytoplasm_Intensity_Average' 'Ki67_Nucleus_Intensity_Average'\n", " 'CD163_Cytoplasm_Intensity_Average' 'ColVI_Cytoplasm_Intensity_Average'\n", " 'CD20_Cytoplasm_Intensity_Average' 'PD1_Cytoplasm_Intensity_Average'\n", " 'AXL_Cytoplasm_Intensity_Average' 'CD31_Cytoplasm_Intensity_Average'\n", " 'Fibronectin_Cytoplasm_Intensity_Average'\n", " 'CD45_Cytoplasm_Intensity_Average' 'Ecad_Cytoplasm_Intensity_Average'\n", " 'CD8_Cytoplasm_Intensity_Average' 'GATA3_Nucleus_Intensity_Average'\n", " 'Sting_Cytoplasm_Intensity_Average' 'aSMA_Cytoplasm_Intensity_Average'\n", " 'FOXP3_Nucleus_Intensity_Average' 'CD11c_Cytoplasm_Intensity_Average'\n", " 'CD4_Cytoplasm_Intensity_Average' 'Vimentin_Cytoplasm_Intensity_Average'\n", " 'CD44_Cytoplasm_Intensity_Average' 'CD68_Cytoplasm_Intensity_Average'\n", " 'PDGFR_Cytoplasm_Intensity_Average' 'B7H4_Cell_Intensity_Average'\n", " 'MMP9_Cytoplasm_Intensity_Average' 'Desmin_Cytoplasm_Intensity_Average'\n", " 'cell_subtype' 'cell_type' 'Nuc_Y_Inv' 'Nucleus_Roundness' 'Nuc_X'\n", " 'ROI_index' 'Nucleus_Size' 'Sample_ID' 'immune_checkpoint' 'Cell_Size']\n", "DD3S1_mt.csv file is processed !\n", "\n", "DD3S2_mt.csv file is processed !\n", "\n", "DD3S3_mt.csv file is processed !\n", "\n", "DD4S1_mt.csv file is processed !\n", "\n", "DD4S2_mt.csv file is processed !\n", "\n", "DD4S3_mt.csv file is processed !\n", "\n", "DD5S1_mt.csv file is processed !\n", "\n", "DD5S2_mt.csv file is processed !\n", "\n", "DD5S3_mt.csv file is processed !\n", "\n", "TMA_mt.csv file is processed !\n", "\n" ] } ], "source": [ "# Import all the others files\n", "dfs = {}\n", "\n", "# Set variable to hold default header values\n", "# First gather information on expected headers using first file in ls_samples\n", "# Read in the first row of the file corresponding to the first sample (index = 0) in ls_samples\n", "df = pd.read_csv(os.path.join(input_data_dir, ls_samples[0]) , index_col = 0, nrows = 1)\n", "expected_headers = df.columns.values\n", "print(expected_headers)\n", "\n", "###############################\n", "# !! This may take a while !! #\n", "###############################\n", "for sample in ls_samples:\n", " file_path = os.path.join(input_data_dir,sample)\n", " \n", " try:\n", " # Read the CSV file\n", " df = pd.read_csv(file_path, index_col=0)\n", " # Check if the DataFrame is empty, if so, don't continue trying to process df and remove it\n", " \n", " if not df.empty:\n", " # Reorder the columns to match the expected headers list\n", " df = df.reindex(columns=expected_headers)\n", " print(sample, \"file is processed !\\n\")\n", " #print(df) \n", " \n", " except pd.errors.EmptyDataError:\n", " print(f'\\nEmpty data error in {sample} file. Removing from analysis...')\n", " ls_samples.remove(sample) \n", " \n", " # Add df to dfs \n", " dfs[sample] = df\n", "\n", "#print(dfs)" ] }, { "cell_type": "code", "execution_count": 19, "id": "6b4c0b53-1c7f-43d7-8adc-f3f0750dc7c3", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " PDL1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.677863 \n", "DD3S1_Cell_1 -0.677863 \n", "DD3S1_Cell_2 -0.677863 \n", "DD3S1_Cell_3 -0.741282 \n", "DD3S1_Cell_6 -0.621521 \n", "\n", " HLA_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.417494 \n", "DD3S1_Cell_1 -0.516487 \n", "DD3S1_Cell_2 -0.141921 \n", "DD3S1_Cell_3 -0.460472 \n", "DD3S1_Cell_6 -0.247254 \n", "\n", " CKs_Cytoplasm_Intensity_Average Ki67_Nucleus_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.912537 -0.817876 \n", "DD3S1_Cell_1 -0.838037 -0.869685 \n", "DD3S1_Cell_2 -1.016023 -0.755879 \n", "DD3S1_Cell_3 -0.491711 -0.818084 \n", "DD3S1_Cell_6 -0.867127 -0.742544 \n", "\n", " CD163_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.930099 \n", "DD3S1_Cell_1 1.114924 \n", "DD3S1_Cell_2 0.834577 \n", "DD3S1_Cell_3 0.648200 \n", "DD3S1_Cell_6 0.810579 \n", "\n", " ColVI_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.232078 \n", "DD3S1_Cell_1 0.301333 \n", "DD3S1_Cell_2 0.259216 \n", "DD3S1_Cell_3 0.107027 \n", "DD3S1_Cell_6 0.272128 \n", "\n", " CD20_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.483158 \n", "DD3S1_Cell_1 -0.344770 \n", "DD3S1_Cell_2 -0.438292 \n", "DD3S1_Cell_3 -0.444889 \n", "DD3S1_Cell_6 -0.507117 \n", "\n", " PD1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 1.535604 \n", "DD3S1_Cell_1 1.668368 \n", "DD3S1_Cell_2 1.336308 \n", "DD3S1_Cell_3 1.249805 \n", "DD3S1_Cell_6 1.251434 \n", "\n", " AXL_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.807339 \n", "DD3S1_Cell_1 0.875455 \n", "DD3S1_Cell_2 0.705088 \n", "DD3S1_Cell_3 0.660707 \n", "DD3S1_Cell_6 0.947172 \n", "\n", " CD31_Cytoplasm_Intensity_Average ... cell_subtype \\\n", "ID ... \n", "DD3S1_Cell_0 1.167755 ... αSMA_myCAF \n", "DD3S1_Cell_1 1.643023 ... αSMA_myCAF \n", "DD3S1_Cell_2 1.053636 ... αSMA_myCAF \n", "DD3S1_Cell_3 1.165861 ... αSMA_myCAF \n", "DD3S1_Cell_6 2.545301 ... ENDOTHELIAL \n", "\n", " cell_type Nuc_Y_Inv Nucleus_Roundness Nuc_X \\\n", "ID \n", "DD3S1_Cell_0 STROMA 16632.205078 0.955040 1484.771729 \n", "DD3S1_Cell_1 STROMA 16627.384766 0.966643 1426.250000 \n", "DD3S1_Cell_2 STROMA 16622.238281 0.721534 1531.110474 \n", "DD3S1_Cell_3 STROMA 16623.007812 0.587196 1518.907593 \n", "DD3S1_Cell_6 ENDOTHELIAL 16619.978516 0.935716 1471.914917 \n", "\n", " ROI_index Nucleus_Size Sample_ID immune_checkpoint Cell_Size \n", "ID \n", "DD3S1_Cell_0 0 127 DD3S1.csv None 339 \n", "DD3S1_Cell_1 0 112 DD3S1.csv None 344 \n", "DD3S1_Cell_2 0 181 DD3S1.csv None 422 \n", "DD3S1_Cell_3 0 119 DD3S1.csv None 278 \n", "DD3S1_Cell_6 0 47 DD3S1.csv None 204 \n", "\n", "[5 rows x 37 columns]\n" ] } ], "source": [ "# Merge dfs into one df\n", "df = pd.concat(dfs.values(), ignore_index=False , sort = False)\n", "del dfs\n", "\n", "print(df.head())" ] }, { "cell_type": "code", "execution_count": 20, "id": "dfc864d5-5dfd-4b0d-827d-1ac4c7726099", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(704629, 37)" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.shape" ] }, { "cell_type": "code", "execution_count": 21, "id": "66c3ad6e-af2d-40c5-9a14-dad5d9c180dc", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Index(['DD3S1_Cell_0', 'DD3S1_Cell_1', 'DD3S1_Cell_2', 'DD3S1_Cell_3',\n", " 'DD3S1_Cell_6', 'DD3S1_Cell_7', 'DD3S1_Cell_8', 'DD3S1_Cell_10',\n", " 'DD3S1_Cell_11', 'DD3S1_Cell_12',\n", " ...\n", " 'TMA_Cell_115750', 'TMA_Cell_115751', 'TMA_Cell_115752',\n", " 'TMA_Cell_115753', 'TMA_Cell_115754', 'TMA_Cell_115755',\n", " 'TMA_Cell_115756', 'TMA_Cell_115757', 'TMA_Cell_115758',\n", " 'TMA_Cell_115760'],\n", " dtype='object', name='ID', length=704629)" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.index " ] }, { "cell_type": "code", "execution_count": 22, "id": "4c918ffc-d7ac-463e-a6a4-785a72cf1066", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array(['PDL1_Cytoplasm_Intensity_Average',\n", " 'HLA_Cytoplasm_Intensity_Average',\n", " 'CKs_Cytoplasm_Intensity_Average',\n", " 'Ki67_Nucleus_Intensity_Average',\n", " 'CD163_Cytoplasm_Intensity_Average',\n", " 'ColVI_Cytoplasm_Intensity_Average',\n", " 'CD20_Cytoplasm_Intensity_Average',\n", " 'PD1_Cytoplasm_Intensity_Average',\n", " 'AXL_Cytoplasm_Intensity_Average',\n", " 'CD31_Cytoplasm_Intensity_Average',\n", " 'Fibronectin_Cytoplasm_Intensity_Average',\n", " 'CD45_Cytoplasm_Intensity_Average',\n", " 'Ecad_Cytoplasm_Intensity_Average',\n", " 'CD8_Cytoplasm_Intensity_Average',\n", " 'GATA3_Nucleus_Intensity_Average',\n", " 'Sting_Cytoplasm_Intensity_Average',\n", " 'aSMA_Cytoplasm_Intensity_Average',\n", " 'FOXP3_Nucleus_Intensity_Average',\n", " 'CD11c_Cytoplasm_Intensity_Average',\n", " 'CD4_Cytoplasm_Intensity_Average',\n", " 'Vimentin_Cytoplasm_Intensity_Average',\n", " 'CD44_Cytoplasm_Intensity_Average',\n", " 'CD68_Cytoplasm_Intensity_Average',\n", " 'PDGFR_Cytoplasm_Intensity_Average', 'B7H4_Cell_Intensity_Average',\n", " 'MMP9_Cytoplasm_Intensity_Average',\n", " 'Desmin_Cytoplasm_Intensity_Average', 'cell_subtype', 'cell_type',\n", " 'Nuc_Y_Inv', 'Nucleus_Roundness', 'Nuc_X', 'ROI_index',\n", " 'Nucleus_Size', 'Sample_ID', 'immune_checkpoint', 'Cell_Size'],\n", " dtype=object)" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.columns.values" ] }, { "cell_type": "code", "execution_count": 23, "id": "e4dc2462-3461-4a46-a131-561ebe444263", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "False" ] }, "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Check for NaN entries (should not be any unless columns do not align)\n", "# False means no NaN entries \n", "# True means NaN entries \n", "df.isnull().any().any()" ] }, { "cell_type": "markdown", "id": "c0829945-2326-4919-994d-9813663ba668", "metadata": {}, "source": [ "### V.3.12. UNIQUE ROIs" ] }, { "cell_type": "code", "execution_count": 24, "id": "80525ae8-cb95-48d8-875e-5c0d2a35f102", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The C:\\Users\\zoege\\Documents\\Temp\\Cyc-IF_pipeline\\Set_B\\Set_B_metadata\\Set_B_unique_ROIs.csv file was imported for further analysis!\n" ] } ], "source": [ "# UNIQUE ROIs\n", "filename = f'{project_name}_unique_ROIs.csv'\n", "filename = os.path.join(metadata_dir, filename)\n", "\n", "# Check file exists\n", "if not os.path.exists(filename):\n", " print(\"WARNING: Could not find desired file: \" + filename)\n", "else :\n", " print(\"The\",filename,\"file was imported for further analysis!\")" ] }, { "cell_type": "code", "execution_count": 25, "id": "b6bd5d54-85de-4acf-bc75-47b4b44ff1cb", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Sample_IDROI_indexPatientUnique_ROI_index
0DD3S1.csv06161a
1DD3S1.csv16262a
2DD3S1.csv26363a
3DD3S1.csv35959a
4DD3S1.csv46060a
...............
462TMA.csv55c55c55a
463TMA.csv56c56c56a
464TMA.csv57c57c57a
465TMA.csv58c58c58a
466TMA.csv59c59c59a
\n", "

467 rows × 4 columns

\n", "
" ], "text/plain": [ " Sample_ID ROI_index Patient Unique_ROI_index\n", "0 DD3S1.csv 0 61 61a\n", "1 DD3S1.csv 1 62 62a\n", "2 DD3S1.csv 2 63 63a\n", "3 DD3S1.csv 3 59 59a\n", "4 DD3S1.csv 4 60 60a\n", ".. ... ... ... ...\n", "462 TMA.csv 55 c55 c55a\n", "463 TMA.csv 56 c56 c56a\n", "464 TMA.csv 57 c57 c57a\n", "465 TMA.csv 58 c58 c58a\n", "466 TMA.csv 59 c59 c59a\n", "\n", "[467 rows x 4 columns]" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Open, read in information\n", "Unique_ROIs = pd.read_csv(filename,delimiter=';')\n", "\n", "# Verify headers\n", "exp_cols = ['Sample_ID', 'ROI_index','Patient','Unique_ROI_index']\n", "compare_headers(exp_cols, Unique_ROIs.columns.values, \"Unique_ROIs file\")\n", "\n", "Unique_ROIs = Unique_ROIs.dropna()\n", "Unique_ROIs" ] }, { "cell_type": "code", "execution_count": 26, "id": "e5fff391-c158-4213-8fd4-7807d0158bdf", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PDL1_Cytoplasm_Intensity_AverageHLA_Cytoplasm_Intensity_AverageCKs_Cytoplasm_Intensity_AverageKi67_Nucleus_Intensity_AverageCD163_Cytoplasm_Intensity_AverageColVI_Cytoplasm_Intensity_AverageCD20_Cytoplasm_Intensity_AveragePD1_Cytoplasm_Intensity_AverageAXL_Cytoplasm_Intensity_AverageCD31_Cytoplasm_Intensity_Average...Nuc_Y_InvNucleus_RoundnessNuc_XROI_indexNucleus_SizeSample_IDimmune_checkpointCell_SizePatientUnique_ROI_index
ID
DD3S1_Cell_0-0.677863-0.417494-0.912537-0.8178760.9300990.232078-0.4831581.5356040.8073391.167755...16632.2050780.9550401484.7717290127DD3S1.csvNone3396161a
DD3S1_Cell_1-0.677863-0.516487-0.838037-0.8696851.1149240.301333-0.3447701.6683680.8754551.643023...16627.3847660.9666431426.2500000112DD3S1.csvNone3446161a
DD3S1_Cell_2-0.677863-0.141921-1.016023-0.7558790.8345770.259216-0.4382921.3363080.7050881.053636...16622.2382810.7215341531.1104740181DD3S1.csvNone4226161a
DD3S1_Cell_3-0.741282-0.460472-0.491711-0.8180840.6482000.107027-0.4448891.2498050.6607071.165861...16623.0078120.5871961518.9075930119DD3S1.csvNone2786161a
DD3S1_Cell_6-0.621521-0.247254-0.867127-0.7425440.8105790.272128-0.5071171.2514340.9471722.545301...16619.9785160.9357161471.914917047DD3S1.csvNone2046161a
..................................................................
TMA_Cell_1157550.4782750.558670-0.9628401.7322910.507434-0.9126410.3113220.8160680.5965200.090397...2663.2534180.98219615564.45800859142TMA.csvNone386c59c59a
TMA_Cell_1157560.2974180.420594-0.9716321.9669550.304365-1.1641120.866636-0.092857-0.241830-0.617835...2661.7658690.77597715629.6806645947TMA.csvNone270c59c59a
TMA_Cell_1157570.3469500.453951-0.6028931.3389560.559435-0.8013330.4470610.9881561.5678690.403878...2657.0156250.68874715518.4218755964TMA.csvNone202c59c59a
TMA_Cell_115758-0.1894150.508840-0.8860410.647980-0.227224-1.022549-0.0992560.2197550.603715-0.219145...2660.2585450.75140215539.2753915958TMA.csvNone182c59c59a
TMA_Cell_1157600.2457770.460219-1.0038400.191158-0.313127-1.1206750.004962-0.3161991.727776-0.495501...2654.2924800.67412615542.96191459106TMA.csvNone295c59c59a
\n", "

704629 rows × 39 columns

\n", "
" ], "text/plain": [ " PDL1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.677863 \n", "DD3S1_Cell_1 -0.677863 \n", "DD3S1_Cell_2 -0.677863 \n", "DD3S1_Cell_3 -0.741282 \n", "DD3S1_Cell_6 -0.621521 \n", "... ... \n", "TMA_Cell_115755 0.478275 \n", "TMA_Cell_115756 0.297418 \n", "TMA_Cell_115757 0.346950 \n", "TMA_Cell_115758 -0.189415 \n", "TMA_Cell_115760 0.245777 \n", "\n", " HLA_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.417494 \n", "DD3S1_Cell_1 -0.516487 \n", "DD3S1_Cell_2 -0.141921 \n", "DD3S1_Cell_3 -0.460472 \n", "DD3S1_Cell_6 -0.247254 \n", "... ... \n", "TMA_Cell_115755 0.558670 \n", "TMA_Cell_115756 0.420594 \n", "TMA_Cell_115757 0.453951 \n", "TMA_Cell_115758 0.508840 \n", "TMA_Cell_115760 0.460219 \n", "\n", " CKs_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.912537 \n", "DD3S1_Cell_1 -0.838037 \n", "DD3S1_Cell_2 -1.016023 \n", "DD3S1_Cell_3 -0.491711 \n", "DD3S1_Cell_6 -0.867127 \n", "... ... \n", "TMA_Cell_115755 -0.962840 \n", "TMA_Cell_115756 -0.971632 \n", "TMA_Cell_115757 -0.602893 \n", "TMA_Cell_115758 -0.886041 \n", "TMA_Cell_115760 -1.003840 \n", "\n", " Ki67_Nucleus_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.817876 \n", "DD3S1_Cell_1 -0.869685 \n", "DD3S1_Cell_2 -0.755879 \n", "DD3S1_Cell_3 -0.818084 \n", "DD3S1_Cell_6 -0.742544 \n", "... ... \n", "TMA_Cell_115755 1.732291 \n", "TMA_Cell_115756 1.966955 \n", "TMA_Cell_115757 1.338956 \n", "TMA_Cell_115758 0.647980 \n", "TMA_Cell_115760 0.191158 \n", "\n", " CD163_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.930099 \n", "DD3S1_Cell_1 1.114924 \n", "DD3S1_Cell_2 0.834577 \n", "DD3S1_Cell_3 0.648200 \n", "DD3S1_Cell_6 0.810579 \n", "... ... \n", "TMA_Cell_115755 0.507434 \n", "TMA_Cell_115756 0.304365 \n", "TMA_Cell_115757 0.559435 \n", "TMA_Cell_115758 -0.227224 \n", "TMA_Cell_115760 -0.313127 \n", "\n", " ColVI_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.232078 \n", "DD3S1_Cell_1 0.301333 \n", "DD3S1_Cell_2 0.259216 \n", "DD3S1_Cell_3 0.107027 \n", "DD3S1_Cell_6 0.272128 \n", "... ... \n", "TMA_Cell_115755 -0.912641 \n", "TMA_Cell_115756 -1.164112 \n", "TMA_Cell_115757 -0.801333 \n", "TMA_Cell_115758 -1.022549 \n", "TMA_Cell_115760 -1.120675 \n", "\n", " CD20_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.483158 \n", "DD3S1_Cell_1 -0.344770 \n", "DD3S1_Cell_2 -0.438292 \n", "DD3S1_Cell_3 -0.444889 \n", "DD3S1_Cell_6 -0.507117 \n", "... ... \n", "TMA_Cell_115755 0.311322 \n", "TMA_Cell_115756 0.866636 \n", "TMA_Cell_115757 0.447061 \n", "TMA_Cell_115758 -0.099256 \n", "TMA_Cell_115760 0.004962 \n", "\n", " PD1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 1.535604 \n", "DD3S1_Cell_1 1.668368 \n", "DD3S1_Cell_2 1.336308 \n", "DD3S1_Cell_3 1.249805 \n", "DD3S1_Cell_6 1.251434 \n", "... ... \n", "TMA_Cell_115755 0.816068 \n", "TMA_Cell_115756 -0.092857 \n", "TMA_Cell_115757 0.988156 \n", "TMA_Cell_115758 0.219755 \n", "TMA_Cell_115760 -0.316199 \n", "\n", " AXL_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.807339 \n", "DD3S1_Cell_1 0.875455 \n", "DD3S1_Cell_2 0.705088 \n", "DD3S1_Cell_3 0.660707 \n", "DD3S1_Cell_6 0.947172 \n", "... ... \n", "TMA_Cell_115755 0.596520 \n", "TMA_Cell_115756 -0.241830 \n", "TMA_Cell_115757 1.567869 \n", "TMA_Cell_115758 0.603715 \n", "TMA_Cell_115760 1.727776 \n", "\n", " CD31_Cytoplasm_Intensity_Average ... Nuc_Y_Inv \\\n", "ID ... \n", "DD3S1_Cell_0 1.167755 ... 16632.205078 \n", "DD3S1_Cell_1 1.643023 ... 16627.384766 \n", "DD3S1_Cell_2 1.053636 ... 16622.238281 \n", "DD3S1_Cell_3 1.165861 ... 16623.007812 \n", "DD3S1_Cell_6 2.545301 ... 16619.978516 \n", "... ... ... ... \n", "TMA_Cell_115755 0.090397 ... 2663.253418 \n", "TMA_Cell_115756 -0.617835 ... 2661.765869 \n", "TMA_Cell_115757 0.403878 ... 2657.015625 \n", "TMA_Cell_115758 -0.219145 ... 2660.258545 \n", "TMA_Cell_115760 -0.495501 ... 2654.292480 \n", "\n", " Nucleus_Roundness Nuc_X ROI_index Nucleus_Size \\\n", "ID \n", "DD3S1_Cell_0 0.955040 1484.771729 0 127 \n", "DD3S1_Cell_1 0.966643 1426.250000 0 112 \n", "DD3S1_Cell_2 0.721534 1531.110474 0 181 \n", "DD3S1_Cell_3 0.587196 1518.907593 0 119 \n", "DD3S1_Cell_6 0.935716 1471.914917 0 47 \n", "... ... ... ... ... \n", "TMA_Cell_115755 0.982196 15564.458008 59 142 \n", "TMA_Cell_115756 0.775977 15629.680664 59 47 \n", "TMA_Cell_115757 0.688747 15518.421875 59 64 \n", "TMA_Cell_115758 0.751402 15539.275391 59 58 \n", "TMA_Cell_115760 0.674126 15542.961914 59 106 \n", "\n", " Sample_ID immune_checkpoint Cell_Size Patient \\\n", "ID \n", "DD3S1_Cell_0 DD3S1.csv None 339 61 \n", "DD3S1_Cell_1 DD3S1.csv None 344 61 \n", "DD3S1_Cell_2 DD3S1.csv None 422 61 \n", "DD3S1_Cell_3 DD3S1.csv None 278 61 \n", "DD3S1_Cell_6 DD3S1.csv None 204 61 \n", "... ... ... ... ... \n", "TMA_Cell_115755 TMA.csv None 386 c59 \n", "TMA_Cell_115756 TMA.csv None 270 c59 \n", "TMA_Cell_115757 TMA.csv None 202 c59 \n", "TMA_Cell_115758 TMA.csv None 182 c59 \n", "TMA_Cell_115760 TMA.csv None 295 c59 \n", "\n", " Unique_ROI_index \n", "ID \n", "DD3S1_Cell_0 61a \n", "DD3S1_Cell_1 61a \n", "DD3S1_Cell_2 61a \n", "DD3S1_Cell_3 61a \n", "DD3S1_Cell_6 61a \n", "... ... \n", "TMA_Cell_115755 c59a \n", "TMA_Cell_115756 c59a \n", "TMA_Cell_115757 c59a \n", "TMA_Cell_115758 c59a \n", "TMA_Cell_115760 c59a \n", "\n", "[704629 rows x 39 columns]" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Jointure des deux dataframes sur la colonne 'Unique_ROI_index'\n", "df1 = df.merge(Unique_ROIs[['Sample_ID', 'ROI_index', 'Patient', 'Unique_ROI_index']], on=['Sample_ID', 'ROI_index'], how='left')\n", "\n", "# Set the index of df1 to be the same as the index of df\n", "df1.set_index(df.index, inplace=True)\n", "\n", "# Vérification du nouveau dataframe\n", "display(df1)" ] }, { "cell_type": "code", "execution_count": 27, "id": "de6d2be6-a650-44ce-9393-5b765cc5854e", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "No duplicates found.\n" ] } ], "source": [ "# Resetting the index temporarily for checking for duplicates\n", "# ID + Unique_ROI_index should not return any duplicate\n", "df_temp = df1.copy()\n", "df_temp.reset_index(inplace=True)\n", "df_temp.rename(columns={'index': 'old_index'}, inplace=True)\n", "\n", "# Check for duplicates\n", "duplicates = df_temp[df_temp.duplicated(['ID', 'Unique_ROI_index'], keep=False)]\n", "if not duplicates.empty:\n", " print(\"Duplicates found:\")\n", " print(duplicates)\n", "else:\n", " print(\"No duplicates found.\")" ] }, { "cell_type": "markdown", "id": "a2e1548c-1b97-4353-92b7-f002d571a751", "metadata": {}, "source": [ "### V.3.13. NACT/ACT" ] }, { "cell_type": "raw", "id": "c4cff1cb-d829-4651-9074-634be1b84fc5", "metadata": {}, "source": [ "145 patients HGSC > 33 recieved NACT (23%)" ] }, { "cell_type": "code", "execution_count": 28, "id": "16310c91-3a80-47ed-adac-8b8a55183b46", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The C:\\Users\\zoege\\Documents\\Temp\\Cyc-IF_pipeline\\Set_B\\Set_B_metadata\\TMA_Clinical_Data_187-OC.csv file was imported for further analysis!\n" ] } ], "source": [ "filename = \"TMA_Clinical_Data_187-OC.csv\"\n", "filename = os.path.join(metadata_dir, filename)\n", "\n", "# Check file exists\n", "if not os.path.exists(filename):\n", " print(\"WARNING: Could not find desired file: \" + filename)\n", "else :\n", " print(\"The\",filename,\"file was imported for further analysis!\")" ] }, { "cell_type": "code", "execution_count": 29, "id": "668392ed-10dd-405d-8761-e9f5c1c8268a", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Patient%_tumor%_necrosisAge_DiagnosisBMICA125RaceOther_CancersBRCAStatusPrimary_chem(1)_vs_surg(0)...Histo_TypeOptimal_DebulkingResidual_DiseasePlatinum_sensitiveDays_surgery_to_recurrenceAvastinDisease_StatDays_from_surgery_to_last_contact_or_deathRecurrenceVital_Status
0180572.035.0NaNCbreast00...HGSOC0.01.01.0506.01.0DOD17761.01.0
1250036.024.0NaNCbreast10...HGSOC1.00.01.0669.01.0DOD22231.01.0
2380555.045.0944.0C0NaN0...HGSOC1.00.01.0596.00.0DOD13551.01.0
3480559.026.050.0C000...HGtubal1.00.0NaNNaNNaNNaN1783NaNNaN
4550070.032.01426.0C0NaN1...CCCNaN0.01.0377.01.0DOD9771.01.0
..................................................................
18218370572.022.0597.0Cbreast01...HGSOC1.00.01.0NaNNaNDOD1036NaN1.0
18318490072.026.03788.0CbreastNaN1...HGSOC1.00.01.0282.00.0NaN4681.0NaN
18418590070.029.01330.0C0NaN0...HGSOC1.00.0NaNNaNNaNDOD1020NaN1.0
18518680084.017.0564.0CsquamouscellcarcinomaNaN0...HGSOC1.00.0NaNNaNNaNDOC18690.01.0
18618780027.022.0922.0C001...serousprimarilylowgradewfociofhighgrade1.01.01.0540.00.0DOD12791.01.0
\n", "

187 rows × 23 columns

\n", "
" ], "text/plain": [ " Patient %_tumor %_necrosis Age_Diagnosis BMI CA125 Race \\\n", "0 1 80 5 72.0 35.0 NaN C \n", "1 2 50 0 36.0 24.0 NaN C \n", "2 3 80 5 55.0 45.0 944.0 C \n", "3 4 80 5 59.0 26.0 50.0 C \n", "4 5 50 0 70.0 32.0 1426.0 C \n", ".. ... ... ... ... ... ... ... \n", "182 183 70 5 72.0 22.0 597.0 C \n", "183 184 90 0 72.0 26.0 3788.0 C \n", "184 185 90 0 70.0 29.0 1330.0 C \n", "185 186 80 0 84.0 17.0 564.0 C \n", "186 187 80 0 27.0 22.0 922.0 C \n", "\n", " Other_Cancers BRCAStatus Primary_chem(1)_vs_surg(0) ... \\\n", "0 breast 0 0 ... \n", "1 breast 1 0 ... \n", "2 0 NaN 0 ... \n", "3 0 0 0 ... \n", "4 0 NaN 1 ... \n", ".. ... ... ... ... \n", "182 breast 0 1 ... \n", "183 breast NaN 1 ... \n", "184 0 NaN 0 ... \n", "185 squamouscellcarcinoma NaN 0 ... \n", "186 0 0 1 ... \n", "\n", " Histo_Type Optimal_Debulking \\\n", "0 HGSOC 0.0 \n", "1 HGSOC 1.0 \n", "2 HGSOC 1.0 \n", "3 HGtubal 1.0 \n", "4 CCC NaN \n", ".. ... ... \n", "182 HGSOC 1.0 \n", "183 HGSOC 1.0 \n", "184 HGSOC 1.0 \n", "185 HGSOC 1.0 \n", "186 serousprimarilylowgradewfociofhighgrade 1.0 \n", "\n", " Residual_Disease Platinum_sensitive Days_surgery_to_recurrence Avastin \\\n", "0 1.0 1.0 506.0 1.0 \n", "1 0.0 1.0 669.0 1.0 \n", "2 0.0 1.0 596.0 0.0 \n", "3 0.0 NaN NaN NaN \n", "4 0.0 1.0 377.0 1.0 \n", ".. ... ... ... ... \n", "182 0.0 1.0 NaN NaN \n", "183 0.0 1.0 282.0 0.0 \n", "184 0.0 NaN NaN NaN \n", "185 0.0 NaN NaN NaN \n", "186 1.0 1.0 540.0 0.0 \n", "\n", " Disease_Stat Days_from_surgery_to_last_contact_or_death Recurrence \\\n", "0 DOD 1776 1.0 \n", "1 DOD 2223 1.0 \n", "2 DOD 1355 1.0 \n", "3 NaN 1783 NaN \n", "4 DOD 977 1.0 \n", ".. ... ... ... \n", "182 DOD 1036 NaN \n", "183 NaN 468 1.0 \n", "184 DOD 1020 NaN \n", "185 DOC 1869 0.0 \n", "186 DOD 1279 1.0 \n", "\n", " Vital_Status \n", "0 1.0 \n", "1 1.0 \n", "2 1.0 \n", "3 NaN \n", "4 1.0 \n", ".. ... \n", "182 1.0 \n", "183 NaN \n", "184 1.0 \n", "185 1.0 \n", "186 1.0 \n", "\n", "[187 rows x 23 columns]" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Open, read in information\n", "clinical_data = pd.read_csv(filename,delimiter=',')\n", "\n", "# Renaming columns using the `rename` function\n", "clinical_data = clinical_data.rename(columns={'ID': 'Patient'})\n", "clinical_data['Patient'] = clinical_data['Patient'].astype(str)\n", "df1['Patient'] = df1['Patient'].astype(str)\n", "\n", "# Display the first few rows to check the DataFrame\n", "display(clinical_data)" ] }, { "cell_type": "code", "execution_count": 30, "id": "ec19d762-81ad-4373-a67b-508775277930", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Index(['Patient', '%_tumor', '%_necrosis', 'Age_Diagnosis', 'BMI', 'CA125',\n", " 'Race', 'Other_Cancers', 'BRCAStatus', 'Primary_chem(1)_vs_surg(0)',\n", " 'Diagnosis_to_Start_Chemo', 'Diagnosis_to_surgery', 'Stage',\n", " 'Histo_Type', 'Optimal_Debulking', 'Residual_Disease',\n", " 'Platinum_sensitive', 'Days_surgery_to_recurrence', 'Avastin',\n", " 'Disease_Stat', 'Days_from_surgery_to_last_contact_or_death',\n", " 'Recurrence', 'Vital_Status'],\n", " dtype='object')\n", "(187, 23)\n" ] } ], "source": [ "print(clinical_data.columns)\n", "print(clinical_data.shape)" ] }, { "cell_type": "code", "execution_count": 31, "id": "54ec5556-4b1e-43bf-ad0e-2f587eae3f9c", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Index(['PDL1_Cytoplasm_Intensity_Average', 'HLA_Cytoplasm_Intensity_Average',\n", " 'CKs_Cytoplasm_Intensity_Average', 'Ki67_Nucleus_Intensity_Average',\n", " 'CD163_Cytoplasm_Intensity_Average',\n", " 'ColVI_Cytoplasm_Intensity_Average', 'CD20_Cytoplasm_Intensity_Average',\n", " 'PD1_Cytoplasm_Intensity_Average', 'AXL_Cytoplasm_Intensity_Average',\n", " 'CD31_Cytoplasm_Intensity_Average',\n", " 'Fibronectin_Cytoplasm_Intensity_Average',\n", " 'CD45_Cytoplasm_Intensity_Average', 'Ecad_Cytoplasm_Intensity_Average',\n", " 'CD8_Cytoplasm_Intensity_Average', 'GATA3_Nucleus_Intensity_Average',\n", " 'Sting_Cytoplasm_Intensity_Average', 'aSMA_Cytoplasm_Intensity_Average',\n", " 'FOXP3_Nucleus_Intensity_Average', 'CD11c_Cytoplasm_Intensity_Average',\n", " 'CD4_Cytoplasm_Intensity_Average',\n", " 'Vimentin_Cytoplasm_Intensity_Average',\n", " 'CD44_Cytoplasm_Intensity_Average', 'CD68_Cytoplasm_Intensity_Average',\n", " 'PDGFR_Cytoplasm_Intensity_Average', 'B7H4_Cell_Intensity_Average',\n", " 'MMP9_Cytoplasm_Intensity_Average',\n", " 'Desmin_Cytoplasm_Intensity_Average', 'cell_subtype', 'cell_type',\n", " 'Nuc_Y_Inv', 'Nucleus_Roundness', 'Nuc_X', 'ROI_index', 'Nucleus_Size',\n", " 'Sample_ID', 'immune_checkpoint', 'Cell_Size', 'Patient',\n", " 'Unique_ROI_index'],\n", " dtype='object')\n", "(704629, 39)\n" ] } ], "source": [ "print(df1.columns)\n", "print(df1.shape)" ] }, { "cell_type": "code", "execution_count": 32, "id": "41ddb21b-569c-4e65-8b8e-d3b1b1189246", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "PDL1_Cytoplasm_Intensity_Average float64\n", "HLA_Cytoplasm_Intensity_Average float64\n", "CKs_Cytoplasm_Intensity_Average float64\n", "Ki67_Nucleus_Intensity_Average float64\n", "CD163_Cytoplasm_Intensity_Average float64\n", "ColVI_Cytoplasm_Intensity_Average float64\n", "CD20_Cytoplasm_Intensity_Average float64\n", "PD1_Cytoplasm_Intensity_Average float64\n", "AXL_Cytoplasm_Intensity_Average float64\n", "CD31_Cytoplasm_Intensity_Average float64\n", "Fibronectin_Cytoplasm_Intensity_Average float64\n", "CD45_Cytoplasm_Intensity_Average float64\n", "Ecad_Cytoplasm_Intensity_Average float64\n", "CD8_Cytoplasm_Intensity_Average float64\n", "GATA3_Nucleus_Intensity_Average float64\n", "Sting_Cytoplasm_Intensity_Average float64\n", "aSMA_Cytoplasm_Intensity_Average float64\n", "FOXP3_Nucleus_Intensity_Average float64\n", "CD11c_Cytoplasm_Intensity_Average float64\n", "CD4_Cytoplasm_Intensity_Average float64\n", "Vimentin_Cytoplasm_Intensity_Average float64\n", "CD44_Cytoplasm_Intensity_Average float64\n", "CD68_Cytoplasm_Intensity_Average float64\n", "PDGFR_Cytoplasm_Intensity_Average float64\n", "B7H4_Cell_Intensity_Average float64\n", "MMP9_Cytoplasm_Intensity_Average float64\n", "Desmin_Cytoplasm_Intensity_Average float64\n", "cell_subtype object\n", "cell_type object\n", "Nuc_Y_Inv float64\n", "Nucleus_Roundness float64\n", "Nuc_X float64\n", "ROI_index int64\n", "Nucleus_Size int64\n", "Sample_ID object\n", "immune_checkpoint object\n", "Cell_Size int64\n", "Patient object\n", "Unique_ROI_index object\n", "dtype: object\n", "\n", "Patient object\n", "%_tumor int64\n", "%_necrosis int64\n", "Age_Diagnosis float64\n", "BMI float64\n", "CA125 float64\n", "Race object\n", "Other_Cancers object\n", "BRCAStatus object\n", "Primary_chem(1)_vs_surg(0) int64\n", "Diagnosis_to_Start_Chemo float64\n", "Diagnosis_to_surgery int64\n", "Stage object\n", "Histo_Type object\n", "Optimal_Debulking float64\n", "Residual_Disease float64\n", "Platinum_sensitive float64\n", "Days_surgery_to_recurrence float64\n", "Avastin float64\n", "Disease_Stat object\n", "Days_from_surgery_to_last_contact_or_death int64\n", "Recurrence float64\n", "Vital_Status float64\n", "dtype: object\n" ] } ], "source": [ "# Display data types of columns in df1 and NACT\n", "print(df1.dtypes)\n", "print('')\n", "print(clinical_data.dtypes)" ] }, { "cell_type": "code", "execution_count": 33, "id": "39ed5f55-ac13-4702-9686-dc642853e20a", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Patients uniques dans df1 mais absents dans clinical_data:\n", "{'c37', 'c50', 'c38', 'c6', 'c52', 'c55', 'c13', 'c0', 'c25', 'c51', 'c19', 'c42', 'c57', 'c41', 'c56', 'c40', 'c18', 'c21', 'c48', 'c49', 'c1', 'c26', 'c23', 'c39', 'c15', 'c45', 'c34', 'c58', 'c43', 'c32', 'c8', 'c9', 'c4', 'c35', 'c14', 'c27', 'c7', 'c20', 'c2', 'c12', 'c16', 'c46', 'c3', 'c31', 'c28', 'c53', 'c24', 'c59', 'c5', 'c22', 'c11', 'c54', 'c44', 'c17', 'c30', 'c29', 'c10', 'c47', 'c33', 'c36'}\n", "\n", "Patients uniques dans clinical_data mais absents dans df1:\n", "{'138', '2', '93', '151', '31', '145', '163', '1', '118', '76'}\n" ] } ], "source": [ "# Liste des valeurs uniques dans la colonne 'Patient' de chaque DataFrame\n", "patients_df1 = set(df1['Patient'].unique())\n", "patients_clinical_data = set(clinical_data['Patient'].unique())\n", "\n", "# Patients présents dans df1 mais absents dans clinical_data\n", "patients_unique_to_df1 = patients_df1 - patients_clinical_data\n", "\n", "# Patients présents dans NACT mais absents dans df1\n", "patients_unique_to_clinical_data = patients_clinical_data - patients_df1\n", "\n", "# Affichage des patients uniques dans chaque DataFrame\n", "print(\"Patients uniques dans df1 mais absents dans clinical_data:\")\n", "print(patients_unique_to_df1)\n", "\n", "# no segmented cores?\n", "print(\"\\nPatients uniques dans clinical_data mais absents dans df1:\")\n", "print(patients_unique_to_clinical_data)" ] }, { "cell_type": "code", "execution_count": 34, "id": "14078e4d-2be6-4564-9fd0-6f28362a07c5", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Index(['PDL1_Cytoplasm_Intensity_Average', 'HLA_Cytoplasm_Intensity_Average',\n", " 'CKs_Cytoplasm_Intensity_Average', 'Ki67_Nucleus_Intensity_Average',\n", " 'CD163_Cytoplasm_Intensity_Average',\n", " 'ColVI_Cytoplasm_Intensity_Average', 'CD20_Cytoplasm_Intensity_Average',\n", " 'PD1_Cytoplasm_Intensity_Average', 'AXL_Cytoplasm_Intensity_Average',\n", " 'CD31_Cytoplasm_Intensity_Average',\n", " 'Fibronectin_Cytoplasm_Intensity_Average',\n", " 'CD45_Cytoplasm_Intensity_Average', 'Ecad_Cytoplasm_Intensity_Average',\n", " 'CD8_Cytoplasm_Intensity_Average', 'GATA3_Nucleus_Intensity_Average',\n", " 'Sting_Cytoplasm_Intensity_Average', 'aSMA_Cytoplasm_Intensity_Average',\n", " 'FOXP3_Nucleus_Intensity_Average', 'CD11c_Cytoplasm_Intensity_Average',\n", " 'CD4_Cytoplasm_Intensity_Average',\n", " 'Vimentin_Cytoplasm_Intensity_Average',\n", " 'CD44_Cytoplasm_Intensity_Average', 'CD68_Cytoplasm_Intensity_Average',\n", " 'PDGFR_Cytoplasm_Intensity_Average', 'B7H4_Cell_Intensity_Average',\n", " 'MMP9_Cytoplasm_Intensity_Average',\n", " 'Desmin_Cytoplasm_Intensity_Average', 'cell_subtype', 'cell_type',\n", " 'Nuc_Y_Inv', 'Nucleus_Roundness', 'Nuc_X', 'ROI_index', 'Nucleus_Size',\n", " 'Sample_ID', 'immune_checkpoint', 'Cell_Size', 'Patient',\n", " 'Unique_ROI_index', 'Primary_chem(1)_vs_surg(0)'],\n", " dtype='object')\n", "(704629, 40)\n" ] }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PDL1_Cytoplasm_Intensity_AverageHLA_Cytoplasm_Intensity_AverageCKs_Cytoplasm_Intensity_AverageKi67_Nucleus_Intensity_AverageCD163_Cytoplasm_Intensity_AverageColVI_Cytoplasm_Intensity_AverageCD20_Cytoplasm_Intensity_AveragePD1_Cytoplasm_Intensity_AverageAXL_Cytoplasm_Intensity_AverageCD31_Cytoplasm_Intensity_Average...Nucleus_RoundnessNuc_XROI_indexNucleus_SizeSample_IDimmune_checkpointCell_SizePatientUnique_ROI_indexPrimary_chem(1)_vs_surg(0)
ID
DD3S1_Cell_0-0.677863-0.417494-0.912537-0.8178760.9300990.232078-0.4831581.5356040.8073391.167755...0.9550401484.7717290127DD3S1.csvNone3396161a1.0
DD3S1_Cell_1-0.677863-0.516487-0.838037-0.8696851.1149240.301333-0.3447701.6683680.8754551.643023...0.9666431426.2500000112DD3S1.csvNone3446161a1.0
DD3S1_Cell_2-0.677863-0.141921-1.016023-0.7558790.8345770.259216-0.4382921.3363080.7050881.053636...0.7215341531.1104740181DD3S1.csvNone4226161a1.0
DD3S1_Cell_3-0.741282-0.460472-0.491711-0.8180840.6482000.107027-0.4448891.2498050.6607071.165861...0.5871961518.9075930119DD3S1.csvNone2786161a1.0
DD3S1_Cell_6-0.621521-0.247254-0.867127-0.7425440.8105790.272128-0.5071171.2514340.9471722.545301...0.9357161471.914917047DD3S1.csvNone2046161a1.0
..................................................................
TMA_Cell_1157550.4782750.558670-0.9628401.7322910.507434-0.9126410.3113220.8160680.5965200.090397...0.98219615564.45800859142TMA.csvNone386c59c59aNaN
TMA_Cell_1157560.2974180.420594-0.9716321.9669550.304365-1.1641120.866636-0.092857-0.241830-0.617835...0.77597715629.6806645947TMA.csvNone270c59c59aNaN
TMA_Cell_1157570.3469500.453951-0.6028931.3389560.559435-0.8013330.4470610.9881561.5678690.403878...0.68874715518.4218755964TMA.csvNone202c59c59aNaN
TMA_Cell_115758-0.1894150.508840-0.8860410.647980-0.227224-1.022549-0.0992560.2197550.603715-0.219145...0.75140215539.2753915958TMA.csvNone182c59c59aNaN
TMA_Cell_1157600.2457770.460219-1.0038400.191158-0.313127-1.1206750.004962-0.3161991.727776-0.495501...0.67412615542.96191459106TMA.csvNone295c59c59aNaN
\n", "

704629 rows × 40 columns

\n", "
" ], "text/plain": [ " PDL1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.677863 \n", "DD3S1_Cell_1 -0.677863 \n", "DD3S1_Cell_2 -0.677863 \n", "DD3S1_Cell_3 -0.741282 \n", "DD3S1_Cell_6 -0.621521 \n", "... ... \n", "TMA_Cell_115755 0.478275 \n", "TMA_Cell_115756 0.297418 \n", "TMA_Cell_115757 0.346950 \n", "TMA_Cell_115758 -0.189415 \n", "TMA_Cell_115760 0.245777 \n", "\n", " HLA_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.417494 \n", "DD3S1_Cell_1 -0.516487 \n", "DD3S1_Cell_2 -0.141921 \n", "DD3S1_Cell_3 -0.460472 \n", "DD3S1_Cell_6 -0.247254 \n", "... ... \n", "TMA_Cell_115755 0.558670 \n", "TMA_Cell_115756 0.420594 \n", "TMA_Cell_115757 0.453951 \n", "TMA_Cell_115758 0.508840 \n", "TMA_Cell_115760 0.460219 \n", "\n", " CKs_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.912537 \n", "DD3S1_Cell_1 -0.838037 \n", "DD3S1_Cell_2 -1.016023 \n", "DD3S1_Cell_3 -0.491711 \n", "DD3S1_Cell_6 -0.867127 \n", "... ... \n", "TMA_Cell_115755 -0.962840 \n", "TMA_Cell_115756 -0.971632 \n", "TMA_Cell_115757 -0.602893 \n", "TMA_Cell_115758 -0.886041 \n", "TMA_Cell_115760 -1.003840 \n", "\n", " Ki67_Nucleus_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.817876 \n", "DD3S1_Cell_1 -0.869685 \n", "DD3S1_Cell_2 -0.755879 \n", "DD3S1_Cell_3 -0.818084 \n", "DD3S1_Cell_6 -0.742544 \n", "... ... \n", "TMA_Cell_115755 1.732291 \n", "TMA_Cell_115756 1.966955 \n", "TMA_Cell_115757 1.338956 \n", "TMA_Cell_115758 0.647980 \n", "TMA_Cell_115760 0.191158 \n", "\n", " CD163_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.930099 \n", "DD3S1_Cell_1 1.114924 \n", "DD3S1_Cell_2 0.834577 \n", "DD3S1_Cell_3 0.648200 \n", "DD3S1_Cell_6 0.810579 \n", "... ... \n", "TMA_Cell_115755 0.507434 \n", "TMA_Cell_115756 0.304365 \n", "TMA_Cell_115757 0.559435 \n", "TMA_Cell_115758 -0.227224 \n", "TMA_Cell_115760 -0.313127 \n", "\n", " ColVI_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.232078 \n", "DD3S1_Cell_1 0.301333 \n", "DD3S1_Cell_2 0.259216 \n", "DD3S1_Cell_3 0.107027 \n", "DD3S1_Cell_6 0.272128 \n", "... ... \n", "TMA_Cell_115755 -0.912641 \n", "TMA_Cell_115756 -1.164112 \n", "TMA_Cell_115757 -0.801333 \n", "TMA_Cell_115758 -1.022549 \n", "TMA_Cell_115760 -1.120675 \n", "\n", " CD20_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.483158 \n", "DD3S1_Cell_1 -0.344770 \n", "DD3S1_Cell_2 -0.438292 \n", "DD3S1_Cell_3 -0.444889 \n", "DD3S1_Cell_6 -0.507117 \n", "... ... \n", "TMA_Cell_115755 0.311322 \n", "TMA_Cell_115756 0.866636 \n", "TMA_Cell_115757 0.447061 \n", "TMA_Cell_115758 -0.099256 \n", "TMA_Cell_115760 0.004962 \n", "\n", " PD1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 1.535604 \n", "DD3S1_Cell_1 1.668368 \n", "DD3S1_Cell_2 1.336308 \n", "DD3S1_Cell_3 1.249805 \n", "DD3S1_Cell_6 1.251434 \n", "... ... \n", "TMA_Cell_115755 0.816068 \n", "TMA_Cell_115756 -0.092857 \n", "TMA_Cell_115757 0.988156 \n", "TMA_Cell_115758 0.219755 \n", "TMA_Cell_115760 -0.316199 \n", "\n", " AXL_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.807339 \n", "DD3S1_Cell_1 0.875455 \n", "DD3S1_Cell_2 0.705088 \n", "DD3S1_Cell_3 0.660707 \n", "DD3S1_Cell_6 0.947172 \n", "... ... \n", "TMA_Cell_115755 0.596520 \n", "TMA_Cell_115756 -0.241830 \n", "TMA_Cell_115757 1.567869 \n", "TMA_Cell_115758 0.603715 \n", "TMA_Cell_115760 1.727776 \n", "\n", " CD31_Cytoplasm_Intensity_Average ... Nucleus_Roundness \\\n", "ID ... \n", "DD3S1_Cell_0 1.167755 ... 0.955040 \n", "DD3S1_Cell_1 1.643023 ... 0.966643 \n", "DD3S1_Cell_2 1.053636 ... 0.721534 \n", "DD3S1_Cell_3 1.165861 ... 0.587196 \n", "DD3S1_Cell_6 2.545301 ... 0.935716 \n", "... ... ... ... \n", "TMA_Cell_115755 0.090397 ... 0.982196 \n", "TMA_Cell_115756 -0.617835 ... 0.775977 \n", "TMA_Cell_115757 0.403878 ... 0.688747 \n", "TMA_Cell_115758 -0.219145 ... 0.751402 \n", "TMA_Cell_115760 -0.495501 ... 0.674126 \n", "\n", " Nuc_X ROI_index Nucleus_Size Sample_ID \\\n", "ID \n", "DD3S1_Cell_0 1484.771729 0 127 DD3S1.csv \n", "DD3S1_Cell_1 1426.250000 0 112 DD3S1.csv \n", "DD3S1_Cell_2 1531.110474 0 181 DD3S1.csv \n", "DD3S1_Cell_3 1518.907593 0 119 DD3S1.csv \n", "DD3S1_Cell_6 1471.914917 0 47 DD3S1.csv \n", "... ... ... ... ... \n", "TMA_Cell_115755 15564.458008 59 142 TMA.csv \n", "TMA_Cell_115756 15629.680664 59 47 TMA.csv \n", "TMA_Cell_115757 15518.421875 59 64 TMA.csv \n", "TMA_Cell_115758 15539.275391 59 58 TMA.csv \n", "TMA_Cell_115760 15542.961914 59 106 TMA.csv \n", "\n", " immune_checkpoint Cell_Size Patient Unique_ROI_index \\\n", "ID \n", "DD3S1_Cell_0 None 339 61 61a \n", "DD3S1_Cell_1 None 344 61 61a \n", "DD3S1_Cell_2 None 422 61 61a \n", "DD3S1_Cell_3 None 278 61 61a \n", "DD3S1_Cell_6 None 204 61 61a \n", "... ... ... ... ... \n", "TMA_Cell_115755 None 386 c59 c59a \n", "TMA_Cell_115756 None 270 c59 c59a \n", "TMA_Cell_115757 None 202 c59 c59a \n", "TMA_Cell_115758 None 182 c59 c59a \n", "TMA_Cell_115760 None 295 c59 c59a \n", "\n", " Primary_chem(1)_vs_surg(0) \n", "ID \n", "DD3S1_Cell_0 1.0 \n", "DD3S1_Cell_1 1.0 \n", "DD3S1_Cell_2 1.0 \n", "DD3S1_Cell_3 1.0 \n", "DD3S1_Cell_6 1.0 \n", "... ... \n", "TMA_Cell_115755 NaN \n", "TMA_Cell_115756 NaN \n", "TMA_Cell_115757 NaN \n", "TMA_Cell_115758 NaN \n", "TMA_Cell_115760 NaN \n", "\n", "[704629 rows x 40 columns]" ] }, "execution_count": 34, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# DataFrames fuson based on 'Patient' col\n", "df2 = pd.merge(df1, clinical_data[['Patient', 'Primary_chem(1)_vs_surg(0)']], on='Patient', how='left')\n", "\n", "# Set the index of df1 to be the same as the index of df\n", "df2.set_index(df.index, inplace=True)\n", "\n", "print(df2.columns)\n", "print(df2.shape)\n", "df2" ] }, { "cell_type": "code", "execution_count": 35, "id": "57d022c0-3a43-4c3c-a7e9-54d9f98e1b1a", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Patient%_tumor%_necrosisAge_DiagnosisBMICA125RaceOther_CancersBRCAStatusPrimary_chem(1)_vs_surg(0)...Histo_TypeOptimal_DebulkingResidual_DiseasePlatinum_sensitiveDays_surgery_to_recurrenceAvastinDisease_StatDays_from_surgery_to_last_contact_or_deathRecurrenceVital_Status
4550070.032.01426.0C0NaN1...CCCNaN0.01.0377.01.0DOD9771.01.0
6780563.029.010965.0C0NaN1...HGSOCNaN0.00.0516.00.0DOD8141.01.0
101190058.020.072.0C0NaN1...SignetringcellNaN0.00.0203.00.0DOD2631.01.0
141560077.035.0183.0C0NaN1...HGSOC1.00.01.0460.00.0NED25851.00.0
171890075.025.055.0C001...HGSOC1.00.01.0359.01.0DOD4391.01.0
252680069.029.01907.0C001...HGSOC1.00.01.0NaN0.0DOD10850.01.0
303170062.026.011785.0C0NaN1...HGSOC1.00.01.0NaN1.0DOD3280.01.0
313290575.041.04532.0C0NaN1...HGSOC1.00.01.01157.00.0AWD18641.00.0
394070564.0NaN8393.0CNaNNaN1...HGSOC1.00.01.0NaN0.0NaN1310.0NaN
505190055.033.01000.0CrenalcellNaN1...HGSOC1.00.01.02103.00.0NaN21241.0NaN
6061601065.023.0281.0C0NaN1...metastaticadenocarcinomaNaNNaN1.0NaN0.0NaN230.0NaN
848590061.030.0116.0hispanic0NaN1...HGSOC1.00.01.0572.00.0DOD6001.01.0
888990064.028.0855.0C001...HGSOC1.00.01.0540.01.0DOD18201.01.0
949580580.024.02799.0C0NaN1...HGSOC1.00.0NaNNaN0.0NaN960.0NaN
979870079.026.02461.0C0NaN1...HGSOC1.00.01.0343.00.0DOD9231.01.0
10310490060.029.063.0C0NaN1...HGSOC1.00.01.0335.00.0DOD3511.01.0
11011190550.032.01960.0C001...HGSOC1.00.01.0533.01.0DOD18881.01.0
11511680076.034.07453.0C0NaN1...HGSOC1.00.01.0NaN0.0NaN4780.0NaN
11811990057.017.016234.0C0NaN1...HGSOC0.01.01.0655.00.0DOD3741.01.0
12012190564.038.02207.0CmelanomaNaN1...HGSOC1.00.0NaNNaN1.0DOD2445NaN1.0
13613790054.019.02964.0Cneurofibromatosisremotebreast11...HGSOC1.00.01.0575.01.0DOD13301.01.0
13713870570.026.01210.0Asian0NaN1...HGSOC1.00.00.0268.00.0DOD4711.01.0
13914070571.021.01046.0CskincancerNaN1...HGSOC1.00.0NaNNaN0.0NaN206NaNNaN
14014170531.031.0575.0C011...HGSOC1.00.01.0613.01.0DOD16281.01.0
14514670071.021.010824.0C0NaN1...HGSOC1.00.00.0263.00.0DOD3521.01.0
14814970052.026.07363.0CpapillarythyroidNaN1...HGSOC1.00.01.0NaN0.0NED27060.00.0
15215380564.023.0968.0Cothermalignantneoplasmsitenotspecified21...HGSOC1.00.01.0361.01.0DOD23361.01.0
15615780556.036.01971.0C021...ENDOOV1.00.01.0NaN0.0DOD16670.01.0
15916090559.027.089.0Cbreast01...HGSOC0.01.01.0160.01.0DOD3281.01.0
16116280075.020.07482.0C001...serousofMullerianorigin1.00.01.0536.00.0DOD23531.01.0
16816980575.035.0245.0C0NaN1...HGSOC1.00.01.01003.00.0DOD14421.01.0
17017180560.034.0500.0C0NaN1...HGSOC1.00.01.0302.00.0DOD4561.01.0
17317450054.036.08529.0C001...HGSPC1.00.01.0387.00.0DOD6601.01.0
17617790060.032.0919.0Ccolon01...HGSOC1.00.01.0450.01.0DOD17431.01.0
17717880067.027.0107.0Cbasalcellcarcinoma01...HGSOC0.01.01.0416.00.0DOD9771.01.0
17817980083.025.0NaNC0NaN1...HGSOC1.00.01.0NaNNaNDOD1070NaN1.0
18118280081.028.0990.0C0NaN1...HGSOC1.00.00.0381.00.0DOD15521.01.0
18218370572.022.0597.0Cbreast01...HGSOC1.00.01.0NaNNaNDOD1036NaN1.0
18318490072.026.03788.0CbreastNaN1...HGSOC1.00.01.0282.00.0NaN4681.0NaN
18618780027.022.0922.0C001...serousprimarilylowgradewfociofhighgrade1.01.01.0540.00.0DOD12791.01.0
\n", "

40 rows × 23 columns

\n", "
" ], "text/plain": [ " Patient %_tumor %_necrosis Age_Diagnosis BMI CA125 Race \\\n", "4 5 50 0 70.0 32.0 1426.0 C \n", "6 7 80 5 63.0 29.0 10965.0 C \n", "10 11 90 0 58.0 20.0 72.0 C \n", "14 15 60 0 77.0 35.0 183.0 C \n", "17 18 90 0 75.0 25.0 55.0 C \n", "25 26 80 0 69.0 29.0 1907.0 C \n", "30 31 70 0 62.0 26.0 11785.0 C \n", "31 32 90 5 75.0 41.0 4532.0 C \n", "39 40 70 5 64.0 NaN 8393.0 C \n", "50 51 90 0 55.0 33.0 1000.0 C \n", "60 61 60 10 65.0 23.0 281.0 C \n", "84 85 90 0 61.0 30.0 116.0 hispanic \n", "88 89 90 0 64.0 28.0 855.0 C \n", "94 95 80 5 80.0 24.0 2799.0 C \n", "97 98 70 0 79.0 26.0 2461.0 C \n", "103 104 90 0 60.0 29.0 63.0 C \n", "110 111 90 5 50.0 32.0 1960.0 C \n", "115 116 80 0 76.0 34.0 7453.0 C \n", "118 119 90 0 57.0 17.0 16234.0 C \n", "120 121 90 5 64.0 38.0 2207.0 C \n", "136 137 90 0 54.0 19.0 2964.0 C \n", "137 138 70 5 70.0 26.0 1210.0 Asian \n", "139 140 70 5 71.0 21.0 1046.0 C \n", "140 141 70 5 31.0 31.0 575.0 C \n", "145 146 70 0 71.0 21.0 10824.0 C \n", "148 149 70 0 52.0 26.0 7363.0 C \n", "152 153 80 5 64.0 23.0 968.0 C \n", "156 157 80 5 56.0 36.0 1971.0 C \n", "159 160 90 5 59.0 27.0 89.0 C \n", "161 162 80 0 75.0 20.0 7482.0 C \n", "168 169 80 5 75.0 35.0 245.0 C \n", "170 171 80 5 60.0 34.0 500.0 C \n", "173 174 50 0 54.0 36.0 8529.0 C \n", "176 177 90 0 60.0 32.0 919.0 C \n", "177 178 80 0 67.0 27.0 107.0 C \n", "178 179 80 0 83.0 25.0 NaN C \n", "181 182 80 0 81.0 28.0 990.0 C \n", "182 183 70 5 72.0 22.0 597.0 C \n", "183 184 90 0 72.0 26.0 3788.0 C \n", "186 187 80 0 27.0 22.0 922.0 C \n", "\n", " Other_Cancers BRCAStatus \\\n", "4 0 NaN \n", "6 0 NaN \n", "10 0 NaN \n", "14 0 NaN \n", "17 0 0 \n", "25 0 0 \n", "30 0 NaN \n", "31 0 NaN \n", "39 NaN NaN \n", "50 renalcell NaN \n", "60 0 NaN \n", "84 0 NaN \n", "88 0 0 \n", "94 0 NaN \n", "97 0 NaN \n", "103 0 NaN \n", "110 0 0 \n", "115 0 NaN \n", "118 0 NaN \n", "120 melanoma NaN \n", "136 neurofibromatosisremotebreast 1 \n", "137 0 NaN \n", "139 skincancer NaN \n", "140 0 1 \n", "145 0 NaN \n", "148 papillarythyroid NaN \n", "152 othermalignantneoplasmsitenotspecified 2 \n", "156 0 2 \n", "159 breast 0 \n", "161 0 0 \n", "168 0 NaN \n", "170 0 NaN \n", "173 0 0 \n", "176 colon 0 \n", "177 basalcellcarcinoma 0 \n", "178 0 NaN \n", "181 0 NaN \n", "182 breast 0 \n", "183 breast NaN \n", "186 0 0 \n", "\n", " Primary_chem(1)_vs_surg(0) ... Histo_Type \\\n", "4 1 ... CCC \n", "6 1 ... HGSOC \n", "10 1 ... Signetringcell \n", "14 1 ... HGSOC \n", "17 1 ... HGSOC \n", "25 1 ... HGSOC \n", "30 1 ... HGSOC \n", "31 1 ... HGSOC \n", "39 1 ... HGSOC \n", "50 1 ... HGSOC \n", "60 1 ... metastaticadenocarcinoma \n", "84 1 ... HGSOC \n", "88 1 ... HGSOC \n", "94 1 ... HGSOC \n", "97 1 ... HGSOC \n", "103 1 ... HGSOC \n", "110 1 ... HGSOC \n", "115 1 ... HGSOC \n", "118 1 ... HGSOC \n", "120 1 ... HGSOC \n", "136 1 ... HGSOC \n", "137 1 ... HGSOC \n", "139 1 ... HGSOC \n", "140 1 ... HGSOC \n", "145 1 ... HGSOC \n", "148 1 ... HGSOC \n", "152 1 ... HGSOC \n", "156 1 ... ENDOOV \n", "159 1 ... HGSOC \n", "161 1 ... serousofMullerianorigin \n", "168 1 ... HGSOC \n", "170 1 ... HGSOC \n", "173 1 ... HGSPC \n", "176 1 ... HGSOC \n", "177 1 ... HGSOC \n", "178 1 ... HGSOC \n", "181 1 ... HGSOC \n", "182 1 ... HGSOC \n", "183 1 ... HGSOC \n", "186 1 ... serousprimarilylowgradewfociofhighgrade \n", "\n", " Optimal_Debulking Residual_Disease Platinum_sensitive \\\n", "4 NaN 0.0 1.0 \n", "6 NaN 0.0 0.0 \n", "10 NaN 0.0 0.0 \n", "14 1.0 0.0 1.0 \n", "17 1.0 0.0 1.0 \n", "25 1.0 0.0 1.0 \n", "30 1.0 0.0 1.0 \n", "31 1.0 0.0 1.0 \n", "39 1.0 0.0 1.0 \n", "50 1.0 0.0 1.0 \n", "60 NaN NaN 1.0 \n", "84 1.0 0.0 1.0 \n", "88 1.0 0.0 1.0 \n", "94 1.0 0.0 NaN \n", "97 1.0 0.0 1.0 \n", "103 1.0 0.0 1.0 \n", "110 1.0 0.0 1.0 \n", "115 1.0 0.0 1.0 \n", "118 0.0 1.0 1.0 \n", "120 1.0 0.0 NaN \n", "136 1.0 0.0 1.0 \n", "137 1.0 0.0 0.0 \n", "139 1.0 0.0 NaN \n", "140 1.0 0.0 1.0 \n", "145 1.0 0.0 0.0 \n", "148 1.0 0.0 1.0 \n", "152 1.0 0.0 1.0 \n", "156 1.0 0.0 1.0 \n", "159 0.0 1.0 1.0 \n", "161 1.0 0.0 1.0 \n", "168 1.0 0.0 1.0 \n", "170 1.0 0.0 1.0 \n", "173 1.0 0.0 1.0 \n", "176 1.0 0.0 1.0 \n", "177 0.0 1.0 1.0 \n", "178 1.0 0.0 1.0 \n", "181 1.0 0.0 0.0 \n", "182 1.0 0.0 1.0 \n", "183 1.0 0.0 1.0 \n", "186 1.0 1.0 1.0 \n", "\n", " Days_surgery_to_recurrence Avastin Disease_Stat \\\n", "4 377.0 1.0 DOD \n", "6 516.0 0.0 DOD \n", "10 203.0 0.0 DOD \n", "14 460.0 0.0 NED \n", "17 359.0 1.0 DOD \n", "25 NaN 0.0 DOD \n", "30 NaN 1.0 DOD \n", "31 1157.0 0.0 AWD \n", "39 NaN 0.0 NaN \n", "50 2103.0 0.0 NaN \n", "60 NaN 0.0 NaN \n", "84 572.0 0.0 DOD \n", "88 540.0 1.0 DOD \n", "94 NaN 0.0 NaN \n", "97 343.0 0.0 DOD \n", "103 335.0 0.0 DOD \n", "110 533.0 1.0 DOD \n", "115 NaN 0.0 NaN \n", "118 655.0 0.0 DOD \n", "120 NaN 1.0 DOD \n", "136 575.0 1.0 DOD \n", "137 268.0 0.0 DOD \n", "139 NaN 0.0 NaN \n", "140 613.0 1.0 DOD \n", "145 263.0 0.0 DOD \n", "148 NaN 0.0 NED \n", "152 361.0 1.0 DOD \n", "156 NaN 0.0 DOD \n", "159 160.0 1.0 DOD \n", "161 536.0 0.0 DOD \n", "168 1003.0 0.0 DOD \n", "170 302.0 0.0 DOD \n", "173 387.0 0.0 DOD \n", "176 450.0 1.0 DOD \n", "177 416.0 0.0 DOD \n", "178 NaN NaN DOD \n", "181 381.0 0.0 DOD \n", "182 NaN NaN DOD \n", "183 282.0 0.0 NaN \n", "186 540.0 0.0 DOD \n", "\n", " Days_from_surgery_to_last_contact_or_death Recurrence Vital_Status \n", "4 977 1.0 1.0 \n", "6 814 1.0 1.0 \n", "10 263 1.0 1.0 \n", "14 2585 1.0 0.0 \n", "17 439 1.0 1.0 \n", "25 1085 0.0 1.0 \n", "30 328 0.0 1.0 \n", "31 1864 1.0 0.0 \n", "39 131 0.0 NaN \n", "50 2124 1.0 NaN \n", "60 23 0.0 NaN \n", "84 600 1.0 1.0 \n", "88 1820 1.0 1.0 \n", "94 96 0.0 NaN \n", "97 923 1.0 1.0 \n", "103 351 1.0 1.0 \n", "110 1888 1.0 1.0 \n", "115 478 0.0 NaN \n", "118 374 1.0 1.0 \n", "120 2445 NaN 1.0 \n", "136 1330 1.0 1.0 \n", "137 471 1.0 1.0 \n", "139 206 NaN NaN \n", "140 1628 1.0 1.0 \n", "145 352 1.0 1.0 \n", "148 2706 0.0 0.0 \n", "152 2336 1.0 1.0 \n", "156 1667 0.0 1.0 \n", "159 328 1.0 1.0 \n", "161 2353 1.0 1.0 \n", "168 1442 1.0 1.0 \n", "170 456 1.0 1.0 \n", "173 660 1.0 1.0 \n", "176 1743 1.0 1.0 \n", "177 977 1.0 1.0 \n", "178 1070 NaN 1.0 \n", "181 1552 1.0 1.0 \n", "182 1036 NaN 1.0 \n", "183 468 1.0 NaN \n", "186 1279 1.0 1.0 \n", "\n", "[40 rows x 23 columns]" ] }, "execution_count": 35, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#NACT rows\n", "clinical_data[clinical_data['Primary_chem(1)_vs_surg(0)'] == 1]" ] }, { "cell_type": "code", "execution_count": 36, "id": "86cbf508-e723-4993-99d0-d41347a97246", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PDL1_Cytoplasm_Intensity_AverageHLA_Cytoplasm_Intensity_AverageCKs_Cytoplasm_Intensity_AverageKi67_Nucleus_Intensity_AverageCD163_Cytoplasm_Intensity_AverageColVI_Cytoplasm_Intensity_AverageCD20_Cytoplasm_Intensity_AveragePD1_Cytoplasm_Intensity_AverageAXL_Cytoplasm_Intensity_AverageCD31_Cytoplasm_Intensity_Average...Nucleus_RoundnessNuc_XROI_indexNucleus_SizeSample_IDimmune_checkpointCell_SizePatientUnique_ROI_indexPrimary_chem(1)_vs_surg(0)
ID
DD3S1_Cell_0-0.677863-0.417494-0.912537-0.8178760.9300990.232078-0.4831581.5356040.8073391.167755...0.9550401484.7717290127DD3S1.csvNone3396161a1.0
DD3S1_Cell_1-0.677863-0.516487-0.838037-0.8696851.1149240.301333-0.3447701.6683680.8754551.643023...0.9666431426.2500000112DD3S1.csvNone3446161a1.0
DD3S1_Cell_2-0.677863-0.141921-1.016023-0.7558790.8345770.259216-0.4382921.3363080.7050881.053636...0.7215341531.1104740181DD3S1.csvNone4226161a1.0
DD3S1_Cell_3-0.741282-0.460472-0.491711-0.8180840.6482000.107027-0.4448891.2498050.6607071.165861...0.5871961518.9075930119DD3S1.csvNone2786161a1.0
DD3S1_Cell_6-0.621521-0.247254-0.867127-0.7425440.8105790.272128-0.5071171.2514340.9471722.545301...0.9357161471.914917047DD3S1.csvNone2046161a1.0
..................................................................
TMA_Cell_1157550.4782750.558670-0.9628401.7322910.507434-0.9126410.3113220.8160680.5965200.090397...0.98219615564.45800859142TMA.csvNone386c59c59aCONTROL
TMA_Cell_1157560.2974180.420594-0.9716321.9669550.304365-1.1641120.866636-0.092857-0.241830-0.617835...0.77597715629.6806645947TMA.csvNone270c59c59aCONTROL
TMA_Cell_1157570.3469500.453951-0.6028931.3389560.559435-0.8013330.4470610.9881561.5678690.403878...0.68874715518.4218755964TMA.csvNone202c59c59aCONTROL
TMA_Cell_115758-0.1894150.508840-0.8860410.647980-0.227224-1.022549-0.0992560.2197550.603715-0.219145...0.75140215539.2753915958TMA.csvNone182c59c59aCONTROL
TMA_Cell_1157600.2457770.460219-1.0038400.191158-0.313127-1.1206750.004962-0.3161991.727776-0.495501...0.67412615542.96191459106TMA.csvNone295c59c59aCONTROL
\n", "

704629 rows × 40 columns

\n", "
" ], "text/plain": [ " PDL1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.677863 \n", "DD3S1_Cell_1 -0.677863 \n", "DD3S1_Cell_2 -0.677863 \n", "DD3S1_Cell_3 -0.741282 \n", "DD3S1_Cell_6 -0.621521 \n", "... ... \n", "TMA_Cell_115755 0.478275 \n", "TMA_Cell_115756 0.297418 \n", "TMA_Cell_115757 0.346950 \n", "TMA_Cell_115758 -0.189415 \n", "TMA_Cell_115760 0.245777 \n", "\n", " HLA_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.417494 \n", "DD3S1_Cell_1 -0.516487 \n", "DD3S1_Cell_2 -0.141921 \n", "DD3S1_Cell_3 -0.460472 \n", "DD3S1_Cell_6 -0.247254 \n", "... ... \n", "TMA_Cell_115755 0.558670 \n", "TMA_Cell_115756 0.420594 \n", "TMA_Cell_115757 0.453951 \n", "TMA_Cell_115758 0.508840 \n", "TMA_Cell_115760 0.460219 \n", "\n", " CKs_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.912537 \n", "DD3S1_Cell_1 -0.838037 \n", "DD3S1_Cell_2 -1.016023 \n", "DD3S1_Cell_3 -0.491711 \n", "DD3S1_Cell_6 -0.867127 \n", "... ... \n", "TMA_Cell_115755 -0.962840 \n", "TMA_Cell_115756 -0.971632 \n", "TMA_Cell_115757 -0.602893 \n", "TMA_Cell_115758 -0.886041 \n", "TMA_Cell_115760 -1.003840 \n", "\n", " Ki67_Nucleus_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.817876 \n", "DD3S1_Cell_1 -0.869685 \n", "DD3S1_Cell_2 -0.755879 \n", "DD3S1_Cell_3 -0.818084 \n", "DD3S1_Cell_6 -0.742544 \n", "... ... \n", "TMA_Cell_115755 1.732291 \n", "TMA_Cell_115756 1.966955 \n", "TMA_Cell_115757 1.338956 \n", "TMA_Cell_115758 0.647980 \n", "TMA_Cell_115760 0.191158 \n", "\n", " CD163_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.930099 \n", "DD3S1_Cell_1 1.114924 \n", "DD3S1_Cell_2 0.834577 \n", "DD3S1_Cell_3 0.648200 \n", "DD3S1_Cell_6 0.810579 \n", "... ... \n", "TMA_Cell_115755 0.507434 \n", "TMA_Cell_115756 0.304365 \n", "TMA_Cell_115757 0.559435 \n", "TMA_Cell_115758 -0.227224 \n", "TMA_Cell_115760 -0.313127 \n", "\n", " ColVI_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.232078 \n", "DD3S1_Cell_1 0.301333 \n", "DD3S1_Cell_2 0.259216 \n", "DD3S1_Cell_3 0.107027 \n", "DD3S1_Cell_6 0.272128 \n", "... ... \n", "TMA_Cell_115755 -0.912641 \n", "TMA_Cell_115756 -1.164112 \n", "TMA_Cell_115757 -0.801333 \n", "TMA_Cell_115758 -1.022549 \n", "TMA_Cell_115760 -1.120675 \n", "\n", " CD20_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.483158 \n", "DD3S1_Cell_1 -0.344770 \n", "DD3S1_Cell_2 -0.438292 \n", "DD3S1_Cell_3 -0.444889 \n", "DD3S1_Cell_6 -0.507117 \n", "... ... \n", "TMA_Cell_115755 0.311322 \n", "TMA_Cell_115756 0.866636 \n", "TMA_Cell_115757 0.447061 \n", "TMA_Cell_115758 -0.099256 \n", "TMA_Cell_115760 0.004962 \n", "\n", " PD1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 1.535604 \n", "DD3S1_Cell_1 1.668368 \n", "DD3S1_Cell_2 1.336308 \n", "DD3S1_Cell_3 1.249805 \n", "DD3S1_Cell_6 1.251434 \n", "... ... \n", "TMA_Cell_115755 0.816068 \n", "TMA_Cell_115756 -0.092857 \n", "TMA_Cell_115757 0.988156 \n", "TMA_Cell_115758 0.219755 \n", "TMA_Cell_115760 -0.316199 \n", "\n", " AXL_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.807339 \n", "DD3S1_Cell_1 0.875455 \n", "DD3S1_Cell_2 0.705088 \n", "DD3S1_Cell_3 0.660707 \n", "DD3S1_Cell_6 0.947172 \n", "... ... \n", "TMA_Cell_115755 0.596520 \n", "TMA_Cell_115756 -0.241830 \n", "TMA_Cell_115757 1.567869 \n", "TMA_Cell_115758 0.603715 \n", "TMA_Cell_115760 1.727776 \n", "\n", " CD31_Cytoplasm_Intensity_Average ... Nucleus_Roundness \\\n", "ID ... \n", "DD3S1_Cell_0 1.167755 ... 0.955040 \n", "DD3S1_Cell_1 1.643023 ... 0.966643 \n", "DD3S1_Cell_2 1.053636 ... 0.721534 \n", "DD3S1_Cell_3 1.165861 ... 0.587196 \n", "DD3S1_Cell_6 2.545301 ... 0.935716 \n", "... ... ... ... \n", "TMA_Cell_115755 0.090397 ... 0.982196 \n", "TMA_Cell_115756 -0.617835 ... 0.775977 \n", "TMA_Cell_115757 0.403878 ... 0.688747 \n", "TMA_Cell_115758 -0.219145 ... 0.751402 \n", "TMA_Cell_115760 -0.495501 ... 0.674126 \n", "\n", " Nuc_X ROI_index Nucleus_Size Sample_ID \\\n", "ID \n", "DD3S1_Cell_0 1484.771729 0 127 DD3S1.csv \n", "DD3S1_Cell_1 1426.250000 0 112 DD3S1.csv \n", "DD3S1_Cell_2 1531.110474 0 181 DD3S1.csv \n", "DD3S1_Cell_3 1518.907593 0 119 DD3S1.csv \n", "DD3S1_Cell_6 1471.914917 0 47 DD3S1.csv \n", "... ... ... ... ... \n", "TMA_Cell_115755 15564.458008 59 142 TMA.csv \n", "TMA_Cell_115756 15629.680664 59 47 TMA.csv \n", "TMA_Cell_115757 15518.421875 59 64 TMA.csv \n", "TMA_Cell_115758 15539.275391 59 58 TMA.csv \n", "TMA_Cell_115760 15542.961914 59 106 TMA.csv \n", "\n", " immune_checkpoint Cell_Size Patient Unique_ROI_index \\\n", "ID \n", "DD3S1_Cell_0 None 339 61 61a \n", "DD3S1_Cell_1 None 344 61 61a \n", "DD3S1_Cell_2 None 422 61 61a \n", "DD3S1_Cell_3 None 278 61 61a \n", "DD3S1_Cell_6 None 204 61 61a \n", "... ... ... ... ... \n", "TMA_Cell_115755 None 386 c59 c59a \n", "TMA_Cell_115756 None 270 c59 c59a \n", "TMA_Cell_115757 None 202 c59 c59a \n", "TMA_Cell_115758 None 182 c59 c59a \n", "TMA_Cell_115760 None 295 c59 c59a \n", "\n", " Primary_chem(1)_vs_surg(0) \n", "ID \n", "DD3S1_Cell_0 1.0 \n", "DD3S1_Cell_1 1.0 \n", "DD3S1_Cell_2 1.0 \n", "DD3S1_Cell_3 1.0 \n", "DD3S1_Cell_6 1.0 \n", "... ... \n", "TMA_Cell_115755 CONTROL \n", "TMA_Cell_115756 CONTROL \n", "TMA_Cell_115757 CONTROL \n", "TMA_Cell_115758 CONTROL \n", "TMA_Cell_115760 CONTROL \n", "\n", "[704629 rows x 40 columns]" ] }, "execution_count": 36, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Go through 'Primary_chem(1)_vs_surg(0)' col to replace NaN values by 'CONTROL' if 'c' in 'Patient' col\n", "df2.loc[(df2['Primary_chem(1)_vs_surg(0)'].isnull()) & (df2['Patient'].astype(str).str.contains('c|^c')), 'Primary_chem(1)_vs_surg(0)'] = 'CONTROL'\n", "\n", "df2" ] }, { "cell_type": "code", "execution_count": 37, "id": "a3987559-aa7d-4638-bafb-096adcbd7e36", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PDL1_Cytoplasm_Intensity_AverageHLA_Cytoplasm_Intensity_AverageCKs_Cytoplasm_Intensity_AverageKi67_Nucleus_Intensity_AverageCD163_Cytoplasm_Intensity_AverageColVI_Cytoplasm_Intensity_AverageCD20_Cytoplasm_Intensity_AveragePD1_Cytoplasm_Intensity_AverageAXL_Cytoplasm_Intensity_AverageCD31_Cytoplasm_Intensity_Average...Nucleus_RoundnessNuc_XROI_indexNucleus_SizeSample_IDimmune_checkpointCell_SizePatientUnique_ROI_indexPrimary_chem(1)_vs_surg(0)
ID
\n", "

0 rows × 40 columns

\n", "
" ], "text/plain": [ "Empty DataFrame\n", "Columns: [PDL1_Cytoplasm_Intensity_Average, HLA_Cytoplasm_Intensity_Average, CKs_Cytoplasm_Intensity_Average, Ki67_Nucleus_Intensity_Average, CD163_Cytoplasm_Intensity_Average, ColVI_Cytoplasm_Intensity_Average, CD20_Cytoplasm_Intensity_Average, PD1_Cytoplasm_Intensity_Average, AXL_Cytoplasm_Intensity_Average, CD31_Cytoplasm_Intensity_Average, Fibronectin_Cytoplasm_Intensity_Average, CD45_Cytoplasm_Intensity_Average, Ecad_Cytoplasm_Intensity_Average, CD8_Cytoplasm_Intensity_Average, GATA3_Nucleus_Intensity_Average, Sting_Cytoplasm_Intensity_Average, aSMA_Cytoplasm_Intensity_Average, FOXP3_Nucleus_Intensity_Average, CD11c_Cytoplasm_Intensity_Average, CD4_Cytoplasm_Intensity_Average, Vimentin_Cytoplasm_Intensity_Average, CD44_Cytoplasm_Intensity_Average, CD68_Cytoplasm_Intensity_Average, PDGFR_Cytoplasm_Intensity_Average, B7H4_Cell_Intensity_Average, MMP9_Cytoplasm_Intensity_Average, Desmin_Cytoplasm_Intensity_Average, cell_subtype, cell_type, Nuc_Y_Inv, Nucleus_Roundness, Nuc_X, ROI_index, Nucleus_Size, Sample_ID, immune_checkpoint, Cell_Size, Patient, Unique_ROI_index, Primary_chem(1)_vs_surg(0)]\n", "Index: []\n", "\n", "[0 rows x 40 columns]" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# supposed empty\n", "df2[df2['Primary_chem(1)_vs_surg(0)'].isna()]" ] }, { "cell_type": "code", "execution_count": 38, "id": "5d8089d6-1ca5-4890-abae-20947e1b4941", "metadata": { "tags": [] }, "outputs": [], "source": [ "# Création de trois DataFrames en fonction des valeurs dans 'Primary_chem(1)_vs_surg(0)'\n", "df_NACT = df2[df2['Primary_chem(1)_vs_surg(0)'] == 1]\n", "df_ACT = df2[df2['Primary_chem(1)_vs_surg(0)'] == 0]\n", "df_control = df2[df2['Primary_chem(1)_vs_surg(0)'] == 'CONTROL']\n", "\n", "filename_NACT = os.path.join(output_data_dir, 'df_NACT.csv')\n", "filename_ACT = os.path.join(output_data_dir, 'df_ACT.csv')\n", "filename_control = os.path.join(output_data_dir, 'df_control.csv')\n", "\n", "# Enregistrement des DataFrames dans des fichiers CSV dans le répertoire output_data_dir\n", "df_NACT.to_csv(filename_NACT, index=False)\n", "df_ACT.to_csv(filename_ACT, index=False)\n", "df_control.to_csv(filename_control, index=False)" ] }, { "cell_type": "code", "execution_count": 39, "id": "d4038385-3463-487b-8e80-c561adf6249a", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PDL1_Cytoplasm_Intensity_AverageHLA_Cytoplasm_Intensity_AverageCKs_Cytoplasm_Intensity_AverageKi67_Nucleus_Intensity_AverageCD163_Cytoplasm_Intensity_AverageColVI_Cytoplasm_Intensity_AverageCD20_Cytoplasm_Intensity_AveragePD1_Cytoplasm_Intensity_AverageAXL_Cytoplasm_Intensity_AverageCD31_Cytoplasm_Intensity_Average...Nucleus_RoundnessNuc_XROI_indexNucleus_SizeSample_IDimmune_checkpointCell_SizePatientUnique_ROI_indexPrimary_chem(1)_vs_surg(0)
ID
DD3S1_Cell_0-0.677863-0.417494-0.912537-0.8178760.9300990.232078-0.4831581.5356040.8073391.167755...0.9550401484.7717290127DD3S1.csvNone3396161a1.0
DD3S1_Cell_1-0.677863-0.516487-0.838037-0.8696851.1149240.301333-0.3447701.6683680.8754551.643023...0.9666431426.2500000112DD3S1.csvNone3446161a1.0
DD3S1_Cell_2-0.677863-0.141921-1.016023-0.7558790.8345770.259216-0.4382921.3363080.7050881.053636...0.7215341531.1104740181DD3S1.csvNone4226161a1.0
DD3S1_Cell_3-0.741282-0.460472-0.491711-0.8180840.6482000.107027-0.4448891.2498050.6607071.165861...0.5871961518.9075930119DD3S1.csvNone2786161a1.0
DD3S1_Cell_6-0.621521-0.247254-0.867127-0.7425440.8105790.272128-0.5071171.2514340.9471722.545301...0.9357161471.914917047DD3S1.csvNone2046161a1.0
..................................................................
DD5S3_Cell_62826-0.4460250.4802121.195440-0.081463-0.634343-0.8838151.0509280.1647090.1039860.171579...0.60976413449.42675834103DD5S3.csvNone237187187c1.0
DD5S3_Cell_62828-0.4144400.4166681.542926-0.203248-0.076555-0.7837590.4233460.6383050.3469700.453372...0.73684413469.3535163465DD5S3.csvNone231187187c1.0
DD5S3_Cell_62829-0.7205690.072144-0.311962-0.4814421.236053-0.4688130.2523532.1290421.1118091.340371...0.69131513390.4472663485DD5S3.csvNone224187187c1.0
DD5S3_Cell_62830-0.4425000.368654-1.491754-0.3162700.029502-0.7365220.3908830.8618940.4616850.586409...0.89270713430.1787113456DD5S3.csvNone139187187c1.0
DD5S3_Cell_628310.0408921.166606-1.6767530.249586-1.486438-1.0728782.024627-0.730182-0.355148-0.360887...0.67638813445.4794923448DD5S3.csvNone183187187c1.0
\n", "

113959 rows × 40 columns

\n", "
" ], "text/plain": [ " PDL1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.677863 \n", "DD3S1_Cell_1 -0.677863 \n", "DD3S1_Cell_2 -0.677863 \n", "DD3S1_Cell_3 -0.741282 \n", "DD3S1_Cell_6 -0.621521 \n", "... ... \n", "DD5S3_Cell_62826 -0.446025 \n", "DD5S3_Cell_62828 -0.414440 \n", "DD5S3_Cell_62829 -0.720569 \n", "DD5S3_Cell_62830 -0.442500 \n", "DD5S3_Cell_62831 0.040892 \n", "\n", " HLA_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.417494 \n", "DD3S1_Cell_1 -0.516487 \n", "DD3S1_Cell_2 -0.141921 \n", "DD3S1_Cell_3 -0.460472 \n", "DD3S1_Cell_6 -0.247254 \n", "... ... \n", "DD5S3_Cell_62826 0.480212 \n", "DD5S3_Cell_62828 0.416668 \n", "DD5S3_Cell_62829 0.072144 \n", "DD5S3_Cell_62830 0.368654 \n", "DD5S3_Cell_62831 1.166606 \n", "\n", " CKs_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.912537 \n", "DD3S1_Cell_1 -0.838037 \n", "DD3S1_Cell_2 -1.016023 \n", "DD3S1_Cell_3 -0.491711 \n", "DD3S1_Cell_6 -0.867127 \n", "... ... \n", "DD5S3_Cell_62826 1.195440 \n", "DD5S3_Cell_62828 1.542926 \n", "DD5S3_Cell_62829 -0.311962 \n", "DD5S3_Cell_62830 -1.491754 \n", "DD5S3_Cell_62831 -1.676753 \n", "\n", " Ki67_Nucleus_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.817876 \n", "DD3S1_Cell_1 -0.869685 \n", "DD3S1_Cell_2 -0.755879 \n", "DD3S1_Cell_3 -0.818084 \n", "DD3S1_Cell_6 -0.742544 \n", "... ... \n", "DD5S3_Cell_62826 -0.081463 \n", "DD5S3_Cell_62828 -0.203248 \n", "DD5S3_Cell_62829 -0.481442 \n", "DD5S3_Cell_62830 -0.316270 \n", "DD5S3_Cell_62831 0.249586 \n", "\n", " CD163_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.930099 \n", "DD3S1_Cell_1 1.114924 \n", "DD3S1_Cell_2 0.834577 \n", "DD3S1_Cell_3 0.648200 \n", "DD3S1_Cell_6 0.810579 \n", "... ... \n", "DD5S3_Cell_62826 -0.634343 \n", "DD5S3_Cell_62828 -0.076555 \n", "DD5S3_Cell_62829 1.236053 \n", "DD5S3_Cell_62830 0.029502 \n", "DD5S3_Cell_62831 -1.486438 \n", "\n", " ColVI_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.232078 \n", "DD3S1_Cell_1 0.301333 \n", "DD3S1_Cell_2 0.259216 \n", "DD3S1_Cell_3 0.107027 \n", "DD3S1_Cell_6 0.272128 \n", "... ... \n", "DD5S3_Cell_62826 -0.883815 \n", "DD5S3_Cell_62828 -0.783759 \n", "DD5S3_Cell_62829 -0.468813 \n", "DD5S3_Cell_62830 -0.736522 \n", "DD5S3_Cell_62831 -1.072878 \n", "\n", " CD20_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.483158 \n", "DD3S1_Cell_1 -0.344770 \n", "DD3S1_Cell_2 -0.438292 \n", "DD3S1_Cell_3 -0.444889 \n", "DD3S1_Cell_6 -0.507117 \n", "... ... \n", "DD5S3_Cell_62826 1.050928 \n", "DD5S3_Cell_62828 0.423346 \n", "DD5S3_Cell_62829 0.252353 \n", "DD5S3_Cell_62830 0.390883 \n", "DD5S3_Cell_62831 2.024627 \n", "\n", " PD1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 1.535604 \n", "DD3S1_Cell_1 1.668368 \n", "DD3S1_Cell_2 1.336308 \n", "DD3S1_Cell_3 1.249805 \n", "DD3S1_Cell_6 1.251434 \n", "... ... \n", "DD5S3_Cell_62826 0.164709 \n", "DD5S3_Cell_62828 0.638305 \n", "DD5S3_Cell_62829 2.129042 \n", "DD5S3_Cell_62830 0.861894 \n", "DD5S3_Cell_62831 -0.730182 \n", "\n", " AXL_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.807339 \n", "DD3S1_Cell_1 0.875455 \n", "DD3S1_Cell_2 0.705088 \n", "DD3S1_Cell_3 0.660707 \n", "DD3S1_Cell_6 0.947172 \n", "... ... \n", "DD5S3_Cell_62826 0.103986 \n", "DD5S3_Cell_62828 0.346970 \n", "DD5S3_Cell_62829 1.111809 \n", "DD5S3_Cell_62830 0.461685 \n", "DD5S3_Cell_62831 -0.355148 \n", "\n", " CD31_Cytoplasm_Intensity_Average ... Nucleus_Roundness \\\n", "ID ... \n", "DD3S1_Cell_0 1.167755 ... 0.955040 \n", "DD3S1_Cell_1 1.643023 ... 0.966643 \n", "DD3S1_Cell_2 1.053636 ... 0.721534 \n", "DD3S1_Cell_3 1.165861 ... 0.587196 \n", "DD3S1_Cell_6 2.545301 ... 0.935716 \n", "... ... ... ... \n", "DD5S3_Cell_62826 0.171579 ... 0.609764 \n", "DD5S3_Cell_62828 0.453372 ... 0.736844 \n", "DD5S3_Cell_62829 1.340371 ... 0.691315 \n", "DD5S3_Cell_62830 0.586409 ... 0.892707 \n", "DD5S3_Cell_62831 -0.360887 ... 0.676388 \n", "\n", " Nuc_X ROI_index Nucleus_Size Sample_ID \\\n", "ID \n", "DD3S1_Cell_0 1484.771729 0 127 DD3S1.csv \n", "DD3S1_Cell_1 1426.250000 0 112 DD3S1.csv \n", "DD3S1_Cell_2 1531.110474 0 181 DD3S1.csv \n", "DD3S1_Cell_3 1518.907593 0 119 DD3S1.csv \n", "DD3S1_Cell_6 1471.914917 0 47 DD3S1.csv \n", "... ... ... ... ... \n", "DD5S3_Cell_62826 13449.426758 34 103 DD5S3.csv \n", "DD5S3_Cell_62828 13469.353516 34 65 DD5S3.csv \n", "DD5S3_Cell_62829 13390.447266 34 85 DD5S3.csv \n", "DD5S3_Cell_62830 13430.178711 34 56 DD5S3.csv \n", "DD5S3_Cell_62831 13445.479492 34 48 DD5S3.csv \n", "\n", " immune_checkpoint Cell_Size Patient Unique_ROI_index \\\n", "ID \n", "DD3S1_Cell_0 None 339 61 61a \n", "DD3S1_Cell_1 None 344 61 61a \n", "DD3S1_Cell_2 None 422 61 61a \n", "DD3S1_Cell_3 None 278 61 61a \n", "DD3S1_Cell_6 None 204 61 61a \n", "... ... ... ... ... \n", "DD5S3_Cell_62826 None 237 187 187c \n", "DD5S3_Cell_62828 None 231 187 187c \n", "DD5S3_Cell_62829 None 224 187 187c \n", "DD5S3_Cell_62830 None 139 187 187c \n", "DD5S3_Cell_62831 None 183 187 187c \n", "\n", " Primary_chem(1)_vs_surg(0) \n", "ID \n", "DD3S1_Cell_0 1.0 \n", "DD3S1_Cell_1 1.0 \n", "DD3S1_Cell_2 1.0 \n", "DD3S1_Cell_3 1.0 \n", "DD3S1_Cell_6 1.0 \n", "... ... \n", "DD5S3_Cell_62826 1.0 \n", "DD5S3_Cell_62828 1.0 \n", "DD5S3_Cell_62829 1.0 \n", "DD5S3_Cell_62830 1.0 \n", "DD5S3_Cell_62831 1.0 \n", "\n", "[113959 rows x 40 columns]" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_NACT" ] }, { "cell_type": "code", "execution_count": 40, "id": "1af784e7-585e-4973-8012-c00627d5a685", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PDL1_Cytoplasm_Intensity_AverageHLA_Cytoplasm_Intensity_AverageCKs_Cytoplasm_Intensity_AverageKi67_Nucleus_Intensity_AverageCD163_Cytoplasm_Intensity_AverageColVI_Cytoplasm_Intensity_AverageCD20_Cytoplasm_Intensity_AveragePD1_Cytoplasm_Intensity_AverageAXL_Cytoplasm_Intensity_AverageCD31_Cytoplasm_Intensity_Average...Nucleus_RoundnessNuc_XROI_indexNucleus_SizeSample_IDimmune_checkpointCell_SizePatientUnique_ROI_indexPrimary_chem(1)_vs_surg(0)
ID
DD3S1_Cell_1910-1.137775-0.495306-1.178944-0.8329941.0677651.432729-0.2208351.9523021.0211301.235209...0.8733201143.897461178DD3S1.csvNone2656262a0.0
DD3S1_Cell_1911-1.3997890.7911060.5676680.2151550.518692-0.627981-0.0009231.3756520.7252740.945061...0.5669331396.333252193DD3S1.csvNone2106262a0.0
DD3S1_Cell_1922-1.186023-0.520883-1.104365-0.8941900.9888751.417141-0.3285881.8694490.9786221.185912...0.8863861148.870972162DD3S1.csvNone1966262a0.0
DD3S1_Cell_1928-0.3293970.3965471.7462121.3131601.139536-0.5460201.5869741.7635980.9243141.122929...0.7381591097.823486151DD3S1.csvNone1596262a0.0
DD3S1_Cell_1942-0.970875-0.1263151.0721480.1782761.103388-0.498249-0.0260611.9897141.0403251.257470...0.8901131402.0000001114DD3S1.csvNone2056262a0.0
..................................................................
DD5S3_Cell_64060-0.6778630.887158-0.5281830.5251425.217188-1.300569-0.775098-1.455787-0.908090-0.862636...0.83037913503.91503935106DD5S3.csvNone378186186a0.0
DD5S3_Cell_640610.4799940.4154560.8196580.6236112.082444-1.0538881.6712350.310590-0.309031-0.235059...0.64609813254.2109383590DD5S3.csvNone151186186a0.0
DD5S3_Cell_640620.6607360.4409651.4090100.4068282.082444-0.8493591.6223541.1286030.1876630.290273...0.56623313260.9013673561DD5S3.csvNone146186186a0.0
DD5S3_Cell_640630.2328800.5050080.7980551.7216040.625211-1.0221220.833309-0.489938-0.231888-0.208742...0.78822613292.1445313576DD5S3.csvNone326186186a0.0
DD5S3_Cell_64066-0.1664630.896852-1.9033973.4369841.873290-0.6733522.6130961.1608960.6150910.764317...0.79190713420.0654303546DD5S3.csvB7H4232186186a0.0
\n", "

495928 rows × 40 columns

\n", "
" ], "text/plain": [ " PDL1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_1910 -1.137775 \n", "DD3S1_Cell_1911 -1.399789 \n", "DD3S1_Cell_1922 -1.186023 \n", "DD3S1_Cell_1928 -0.329397 \n", "DD3S1_Cell_1942 -0.970875 \n", "... ... \n", "DD5S3_Cell_64060 -0.677863 \n", "DD5S3_Cell_64061 0.479994 \n", "DD5S3_Cell_64062 0.660736 \n", "DD5S3_Cell_64063 0.232880 \n", "DD5S3_Cell_64066 -0.166463 \n", "\n", " HLA_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_1910 -0.495306 \n", "DD3S1_Cell_1911 0.791106 \n", "DD3S1_Cell_1922 -0.520883 \n", "DD3S1_Cell_1928 0.396547 \n", "DD3S1_Cell_1942 -0.126315 \n", "... ... \n", "DD5S3_Cell_64060 0.887158 \n", "DD5S3_Cell_64061 0.415456 \n", "DD5S3_Cell_64062 0.440965 \n", "DD5S3_Cell_64063 0.505008 \n", "DD5S3_Cell_64066 0.896852 \n", "\n", " CKs_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_1910 -1.178944 \n", "DD3S1_Cell_1911 0.567668 \n", "DD3S1_Cell_1922 -1.104365 \n", "DD3S1_Cell_1928 1.746212 \n", "DD3S1_Cell_1942 1.072148 \n", "... ... \n", "DD5S3_Cell_64060 -0.528183 \n", "DD5S3_Cell_64061 0.819658 \n", "DD5S3_Cell_64062 1.409010 \n", "DD5S3_Cell_64063 0.798055 \n", "DD5S3_Cell_64066 -1.903397 \n", "\n", " Ki67_Nucleus_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_1910 -0.832994 \n", "DD3S1_Cell_1911 0.215155 \n", "DD3S1_Cell_1922 -0.894190 \n", "DD3S1_Cell_1928 1.313160 \n", "DD3S1_Cell_1942 0.178276 \n", "... ... \n", "DD5S3_Cell_64060 0.525142 \n", "DD5S3_Cell_64061 0.623611 \n", "DD5S3_Cell_64062 0.406828 \n", "DD5S3_Cell_64063 1.721604 \n", "DD5S3_Cell_64066 3.436984 \n", "\n", " CD163_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_1910 1.067765 \n", "DD3S1_Cell_1911 0.518692 \n", "DD3S1_Cell_1922 0.988875 \n", "DD3S1_Cell_1928 1.139536 \n", "DD3S1_Cell_1942 1.103388 \n", "... ... \n", "DD5S3_Cell_64060 5.217188 \n", "DD5S3_Cell_64061 2.082444 \n", "DD5S3_Cell_64062 2.082444 \n", "DD5S3_Cell_64063 0.625211 \n", "DD5S3_Cell_64066 1.873290 \n", "\n", " ColVI_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_1910 1.432729 \n", "DD3S1_Cell_1911 -0.627981 \n", "DD3S1_Cell_1922 1.417141 \n", "DD3S1_Cell_1928 -0.546020 \n", "DD3S1_Cell_1942 -0.498249 \n", "... ... \n", "DD5S3_Cell_64060 -1.300569 \n", "DD5S3_Cell_64061 -1.053888 \n", "DD5S3_Cell_64062 -0.849359 \n", "DD5S3_Cell_64063 -1.022122 \n", "DD5S3_Cell_64066 -0.673352 \n", "\n", " CD20_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_1910 -0.220835 \n", "DD3S1_Cell_1911 -0.000923 \n", "DD3S1_Cell_1922 -0.328588 \n", "DD3S1_Cell_1928 1.586974 \n", "DD3S1_Cell_1942 -0.026061 \n", "... ... \n", "DD5S3_Cell_64060 -0.775098 \n", "DD5S3_Cell_64061 1.671235 \n", "DD5S3_Cell_64062 1.622354 \n", "DD5S3_Cell_64063 0.833309 \n", "DD5S3_Cell_64066 2.613096 \n", "\n", " PD1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_1910 1.952302 \n", "DD3S1_Cell_1911 1.375652 \n", "DD3S1_Cell_1922 1.869449 \n", "DD3S1_Cell_1928 1.763598 \n", "DD3S1_Cell_1942 1.989714 \n", "... ... \n", "DD5S3_Cell_64060 -1.455787 \n", "DD5S3_Cell_64061 0.310590 \n", "DD5S3_Cell_64062 1.128603 \n", "DD5S3_Cell_64063 -0.489938 \n", "DD5S3_Cell_64066 1.160896 \n", "\n", " AXL_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_1910 1.021130 \n", "DD3S1_Cell_1911 0.725274 \n", "DD3S1_Cell_1922 0.978622 \n", "DD3S1_Cell_1928 0.924314 \n", "DD3S1_Cell_1942 1.040325 \n", "... ... \n", "DD5S3_Cell_64060 -0.908090 \n", "DD5S3_Cell_64061 -0.309031 \n", "DD5S3_Cell_64062 0.187663 \n", "DD5S3_Cell_64063 -0.231888 \n", "DD5S3_Cell_64066 0.615091 \n", "\n", " CD31_Cytoplasm_Intensity_Average ... Nucleus_Roundness \\\n", "ID ... \n", "DD3S1_Cell_1910 1.235209 ... 0.873320 \n", "DD3S1_Cell_1911 0.945061 ... 0.566933 \n", "DD3S1_Cell_1922 1.185912 ... 0.886386 \n", "DD3S1_Cell_1928 1.122929 ... 0.738159 \n", "DD3S1_Cell_1942 1.257470 ... 0.890113 \n", "... ... ... ... \n", "DD5S3_Cell_64060 -0.862636 ... 0.830379 \n", "DD5S3_Cell_64061 -0.235059 ... 0.646098 \n", "DD5S3_Cell_64062 0.290273 ... 0.566233 \n", "DD5S3_Cell_64063 -0.208742 ... 0.788226 \n", "DD5S3_Cell_64066 0.764317 ... 0.791907 \n", "\n", " Nuc_X ROI_index Nucleus_Size Sample_ID \\\n", "ID \n", "DD3S1_Cell_1910 1143.897461 1 78 DD3S1.csv \n", "DD3S1_Cell_1911 1396.333252 1 93 DD3S1.csv \n", "DD3S1_Cell_1922 1148.870972 1 62 DD3S1.csv \n", "DD3S1_Cell_1928 1097.823486 1 51 DD3S1.csv \n", "DD3S1_Cell_1942 1402.000000 1 114 DD3S1.csv \n", "... ... ... ... ... \n", "DD5S3_Cell_64060 13503.915039 35 106 DD5S3.csv \n", "DD5S3_Cell_64061 13254.210938 35 90 DD5S3.csv \n", "DD5S3_Cell_64062 13260.901367 35 61 DD5S3.csv \n", "DD5S3_Cell_64063 13292.144531 35 76 DD5S3.csv \n", "DD5S3_Cell_64066 13420.065430 35 46 DD5S3.csv \n", "\n", " immune_checkpoint Cell_Size Patient Unique_ROI_index \\\n", "ID \n", "DD3S1_Cell_1910 None 265 62 62a \n", "DD3S1_Cell_1911 None 210 62 62a \n", "DD3S1_Cell_1922 None 196 62 62a \n", "DD3S1_Cell_1928 None 159 62 62a \n", "DD3S1_Cell_1942 None 205 62 62a \n", "... ... ... ... ... \n", "DD5S3_Cell_64060 None 378 186 186a \n", "DD5S3_Cell_64061 None 151 186 186a \n", "DD5S3_Cell_64062 None 146 186 186a \n", "DD5S3_Cell_64063 None 326 186 186a \n", "DD5S3_Cell_64066 B7H4 232 186 186a \n", "\n", " Primary_chem(1)_vs_surg(0) \n", "ID \n", "DD3S1_Cell_1910 0.0 \n", "DD3S1_Cell_1911 0.0 \n", "DD3S1_Cell_1922 0.0 \n", "DD3S1_Cell_1928 0.0 \n", "DD3S1_Cell_1942 0.0 \n", "... ... \n", "DD5S3_Cell_64060 0.0 \n", "DD5S3_Cell_64061 0.0 \n", "DD5S3_Cell_64062 0.0 \n", "DD5S3_Cell_64063 0.0 \n", "DD5S3_Cell_64066 0.0 \n", "\n", "[495928 rows x 40 columns]" ] }, "execution_count": 40, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_ACT" ] }, { "cell_type": "code", "execution_count": 41, "id": "24481cf9-57bd-4879-b4ad-2e9073dc9993", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PDL1_Cytoplasm_Intensity_AverageHLA_Cytoplasm_Intensity_AverageCKs_Cytoplasm_Intensity_AverageKi67_Nucleus_Intensity_AverageCD163_Cytoplasm_Intensity_AverageColVI_Cytoplasm_Intensity_AverageCD20_Cytoplasm_Intensity_AveragePD1_Cytoplasm_Intensity_AverageAXL_Cytoplasm_Intensity_AverageCD31_Cytoplasm_Intensity_Average...Nucleus_RoundnessNuc_XROI_indexNucleus_SizeSample_IDimmune_checkpointCell_SizePatientUnique_ROI_indexPrimary_chem(1)_vs_surg(0)
ID
TMA_Cell_4-0.3670503.386458-2.000166-0.4599722.082444-0.3311270.0745760.3679980.2082852.426724...0.6394971603.6105960131TMA.csvNone307c0c0aCONTROL
TMA_Cell_300-0.7380402.894731-2.027276-0.5363342.4636640.6154130.4340080.1458700.0943200.796244...0.5576691870.953491086TMA.csvNone271c0c0aCONTROL
TMA_Cell_1231-0.1663333.870697-1.953719-0.2899152.276577-0.7604630.8560600.7485740.4035441.869273...0.9094911076.4869380115TMA.csvNone215c0c0aCONTROL
TMA_Cell_1240-0.2937662.246166-1.945873-0.6073282.082444-0.6153450.2435310.8128630.4365292.194035...0.9455921089.709717093TMA.csvNone198c0c0aCONTROL
TMA_Cell_2107-0.6778632.130819-2.035940-0.7465821.5383671.2463040.1799430.0748790.0578980.966884...0.6645891375.9396970116TMA.csvNone167c0c0aCONTROL
..................................................................
TMA_Cell_1157550.4782750.558670-0.9628401.7322910.507434-0.9126410.3113220.8160680.5965200.090397...0.98219615564.45800859142TMA.csvNone386c59c59aCONTROL
TMA_Cell_1157560.2974180.420594-0.9716321.9669550.304365-1.1641120.866636-0.092857-0.241830-0.617835...0.77597715629.6806645947TMA.csvNone270c59c59aCONTROL
TMA_Cell_1157570.3469500.453951-0.6028931.3389560.559435-0.8013330.4470610.9881561.5678690.403878...0.68874715518.4218755964TMA.csvNone202c59c59aCONTROL
TMA_Cell_115758-0.1894150.508840-0.8860410.647980-0.227224-1.022549-0.0992560.2197550.603715-0.219145...0.75140215539.2753915958TMA.csvNone182c59c59aCONTROL
TMA_Cell_1157600.2457770.460219-1.0038400.191158-0.313127-1.1206750.004962-0.3161991.727776-0.495501...0.67412615542.96191459106TMA.csvNone295c59c59aCONTROL
\n", "

94742 rows × 40 columns

\n", "
" ], "text/plain": [ " PDL1_Cytoplasm_Intensity_Average \\\n", "ID \n", "TMA_Cell_4 -0.367050 \n", "TMA_Cell_300 -0.738040 \n", "TMA_Cell_1231 -0.166333 \n", "TMA_Cell_1240 -0.293766 \n", "TMA_Cell_2107 -0.677863 \n", "... ... \n", "TMA_Cell_115755 0.478275 \n", "TMA_Cell_115756 0.297418 \n", "TMA_Cell_115757 0.346950 \n", "TMA_Cell_115758 -0.189415 \n", "TMA_Cell_115760 0.245777 \n", "\n", " HLA_Cytoplasm_Intensity_Average \\\n", "ID \n", "TMA_Cell_4 3.386458 \n", "TMA_Cell_300 2.894731 \n", "TMA_Cell_1231 3.870697 \n", "TMA_Cell_1240 2.246166 \n", "TMA_Cell_2107 2.130819 \n", "... ... \n", "TMA_Cell_115755 0.558670 \n", "TMA_Cell_115756 0.420594 \n", "TMA_Cell_115757 0.453951 \n", "TMA_Cell_115758 0.508840 \n", "TMA_Cell_115760 0.460219 \n", "\n", " CKs_Cytoplasm_Intensity_Average \\\n", "ID \n", "TMA_Cell_4 -2.000166 \n", "TMA_Cell_300 -2.027276 \n", "TMA_Cell_1231 -1.953719 \n", "TMA_Cell_1240 -1.945873 \n", "TMA_Cell_2107 -2.035940 \n", "... ... \n", "TMA_Cell_115755 -0.962840 \n", "TMA_Cell_115756 -0.971632 \n", "TMA_Cell_115757 -0.602893 \n", "TMA_Cell_115758 -0.886041 \n", "TMA_Cell_115760 -1.003840 \n", "\n", " Ki67_Nucleus_Intensity_Average \\\n", "ID \n", "TMA_Cell_4 -0.459972 \n", "TMA_Cell_300 -0.536334 \n", "TMA_Cell_1231 -0.289915 \n", "TMA_Cell_1240 -0.607328 \n", "TMA_Cell_2107 -0.746582 \n", "... ... \n", "TMA_Cell_115755 1.732291 \n", "TMA_Cell_115756 1.966955 \n", "TMA_Cell_115757 1.338956 \n", "TMA_Cell_115758 0.647980 \n", "TMA_Cell_115760 0.191158 \n", "\n", " CD163_Cytoplasm_Intensity_Average \\\n", "ID \n", "TMA_Cell_4 2.082444 \n", "TMA_Cell_300 2.463664 \n", "TMA_Cell_1231 2.276577 \n", "TMA_Cell_1240 2.082444 \n", "TMA_Cell_2107 1.538367 \n", "... ... \n", "TMA_Cell_115755 0.507434 \n", "TMA_Cell_115756 0.304365 \n", "TMA_Cell_115757 0.559435 \n", "TMA_Cell_115758 -0.227224 \n", "TMA_Cell_115760 -0.313127 \n", "\n", " ColVI_Cytoplasm_Intensity_Average \\\n", "ID \n", "TMA_Cell_4 -0.331127 \n", "TMA_Cell_300 0.615413 \n", "TMA_Cell_1231 -0.760463 \n", "TMA_Cell_1240 -0.615345 \n", "TMA_Cell_2107 1.246304 \n", "... ... \n", "TMA_Cell_115755 -0.912641 \n", "TMA_Cell_115756 -1.164112 \n", "TMA_Cell_115757 -0.801333 \n", "TMA_Cell_115758 -1.022549 \n", "TMA_Cell_115760 -1.120675 \n", "\n", " CD20_Cytoplasm_Intensity_Average \\\n", "ID \n", "TMA_Cell_4 0.074576 \n", "TMA_Cell_300 0.434008 \n", "TMA_Cell_1231 0.856060 \n", "TMA_Cell_1240 0.243531 \n", "TMA_Cell_2107 0.179943 \n", "... ... \n", "TMA_Cell_115755 0.311322 \n", "TMA_Cell_115756 0.866636 \n", "TMA_Cell_115757 0.447061 \n", "TMA_Cell_115758 -0.099256 \n", "TMA_Cell_115760 0.004962 \n", "\n", " PD1_Cytoplasm_Intensity_Average \\\n", "ID \n", "TMA_Cell_4 0.367998 \n", "TMA_Cell_300 0.145870 \n", "TMA_Cell_1231 0.748574 \n", "TMA_Cell_1240 0.812863 \n", "TMA_Cell_2107 0.074879 \n", "... ... \n", "TMA_Cell_115755 0.816068 \n", "TMA_Cell_115756 -0.092857 \n", "TMA_Cell_115757 0.988156 \n", "TMA_Cell_115758 0.219755 \n", "TMA_Cell_115760 -0.316199 \n", "\n", " AXL_Cytoplasm_Intensity_Average \\\n", "ID \n", "TMA_Cell_4 0.208285 \n", "TMA_Cell_300 0.094320 \n", "TMA_Cell_1231 0.403544 \n", "TMA_Cell_1240 0.436529 \n", "TMA_Cell_2107 0.057898 \n", "... ... \n", "TMA_Cell_115755 0.596520 \n", "TMA_Cell_115756 -0.241830 \n", "TMA_Cell_115757 1.567869 \n", "TMA_Cell_115758 0.603715 \n", "TMA_Cell_115760 1.727776 \n", "\n", " CD31_Cytoplasm_Intensity_Average ... Nucleus_Roundness \\\n", "ID ... \n", "TMA_Cell_4 2.426724 ... 0.639497 \n", "TMA_Cell_300 0.796244 ... 0.557669 \n", "TMA_Cell_1231 1.869273 ... 0.909491 \n", "TMA_Cell_1240 2.194035 ... 0.945592 \n", "TMA_Cell_2107 0.966884 ... 0.664589 \n", "... ... ... ... \n", "TMA_Cell_115755 0.090397 ... 0.982196 \n", "TMA_Cell_115756 -0.617835 ... 0.775977 \n", "TMA_Cell_115757 0.403878 ... 0.688747 \n", "TMA_Cell_115758 -0.219145 ... 0.751402 \n", "TMA_Cell_115760 -0.495501 ... 0.674126 \n", "\n", " Nuc_X ROI_index Nucleus_Size Sample_ID \\\n", "ID \n", "TMA_Cell_4 1603.610596 0 131 TMA.csv \n", "TMA_Cell_300 1870.953491 0 86 TMA.csv \n", "TMA_Cell_1231 1076.486938 0 115 TMA.csv \n", "TMA_Cell_1240 1089.709717 0 93 TMA.csv \n", "TMA_Cell_2107 1375.939697 0 116 TMA.csv \n", "... ... ... ... ... \n", "TMA_Cell_115755 15564.458008 59 142 TMA.csv \n", "TMA_Cell_115756 15629.680664 59 47 TMA.csv \n", "TMA_Cell_115757 15518.421875 59 64 TMA.csv \n", "TMA_Cell_115758 15539.275391 59 58 TMA.csv \n", "TMA_Cell_115760 15542.961914 59 106 TMA.csv \n", "\n", " immune_checkpoint Cell_Size Patient Unique_ROI_index \\\n", "ID \n", "TMA_Cell_4 None 307 c0 c0a \n", "TMA_Cell_300 None 271 c0 c0a \n", "TMA_Cell_1231 None 215 c0 c0a \n", "TMA_Cell_1240 None 198 c0 c0a \n", "TMA_Cell_2107 None 167 c0 c0a \n", "... ... ... ... ... \n", "TMA_Cell_115755 None 386 c59 c59a \n", "TMA_Cell_115756 None 270 c59 c59a \n", "TMA_Cell_115757 None 202 c59 c59a \n", "TMA_Cell_115758 None 182 c59 c59a \n", "TMA_Cell_115760 None 295 c59 c59a \n", "\n", " Primary_chem(1)_vs_surg(0) \n", "ID \n", "TMA_Cell_4 CONTROL \n", "TMA_Cell_300 CONTROL \n", "TMA_Cell_1231 CONTROL \n", "TMA_Cell_1240 CONTROL \n", "TMA_Cell_2107 CONTROL \n", "... ... \n", "TMA_Cell_115755 CONTROL \n", "TMA_Cell_115756 CONTROL \n", "TMA_Cell_115757 CONTROL \n", "TMA_Cell_115758 CONTROL \n", "TMA_Cell_115760 CONTROL \n", "\n", "[94742 rows x 40 columns]" ] }, "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_control" ] }, { "cell_type": "markdown", "id": "c43a8fb1-7366-4e96-864d-3ca0b699319e", "metadata": { "tags": [] }, "source": [ "## V.4. COUNTS" ] }, { "cell_type": "code", "execution_count": 42, "id": "2c36d567-801d-4bac-b6b7-bf8759ab6ce3", "metadata": { "tags": [] }, "outputs": [], "source": [ "df = df2.copy()" ] }, { "cell_type": "code", "execution_count": 43, "id": "89ab1bd6-d58c-4c33-9e1a-5a841d5271c9", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
countsSample_ID
DD3S1.csv68697DD3S1.csv
DD3S2.csv70850DD3S2.csv
DD3S3.csv116265DD3S3.csv
DD4S1.csv70748DD4S1.csv
DD4S2.csv51745DD4S2.csv
DD4S3.csv70818DD4S3.csv
DD5S1.csv69463DD5S1.csv
DD5S2.csv45403DD5S2.csv
DD5S3.csv45898DD5S3.csv
TMA.csv94742TMA.csv
\n", "
" ], "text/plain": [ " counts Sample_ID\n", "DD3S1.csv 68697 DD3S1.csv\n", "DD3S2.csv 70850 DD3S2.csv\n", "DD3S3.csv 116265 DD3S3.csv\n", "DD4S1.csv 70748 DD4S1.csv\n", "DD4S2.csv 51745 DD4S2.csv\n", "DD4S3.csv 70818 DD4S3.csv\n", "DD5S1.csv 69463 DD5S1.csv\n", "DD5S2.csv 45403 DD5S2.csv\n", "DD5S3.csv 45898 DD5S3.csv\n", "TMA.csv 94742 TMA.csv" ] }, "execution_count": 43, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Get counts for each Sample_ID, sorted by Sample_ID\n", "sample_counts = pd.DataFrame(df.Sample_ID.value_counts()).sort_index()\n", "sample_counts = sample_counts.rename(columns = {'Sample_ID':'counts'})\n", "sample_counts['Sample_ID'] = sample_counts.index\n", "#counts['color'] = counts.apply(lambda row: color_dict[row['Sample_ID']], axis = 1)\n", "sample_counts" ] }, { "cell_type": "markdown", "id": "963c7e14-a084-4665-8fa9-def1227ec306", "metadata": {}, "source": [ "### V.4.1. CELL TYPES" ] }, { "cell_type": "code", "execution_count": 44, "id": "38a3ca09-85f1-4fca-b769-11eb506b03fa", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " counts Sample_ID stroma cancer immune endothelial\n", "DD3S1.csv 68697 DD3S1.csv 10690 48981 7360 1666\n", "DD3S2.csv 70850 DD3S2.csv 12064 51059 5977 1750\n", "DD3S3.csv 116265 DD3S3.csv 23412 77000 13075 2778\n", "DD4S1.csv 70748 DD4S1.csv 7249 54013 7433 2053\n", "DD4S2.csv 51745 DD4S2.csv 6193 39470 4850 1232\n", "DD4S3.csv 70818 DD4S3.csv 8516 50598 10331 1373\n", "DD5S1.csv 69463 DD5S1.csv 17067 43723 5878 2795\n", "DD5S2.csv 45403 DD5S2.csv 11098 30839 2131 1335\n", "DD5S3.csv 45898 DD5S3.csv 9018 30060 5656 1164\n", "TMA.csv 94742 TMA.csv 23121 59978 9356 2287\n" ] } ], "source": [ "# Count by cell type\n", "stroma_counts = pd.DataFrame({'stroma':\n", " df.loc[\n", " df['cell_type'] == 'STROMA',:].Sample_ID.value_counts()}).sort_index()\n", "\n", "immune_counts = pd.DataFrame({'immune':\n", " df.loc[\n", " df['cell_type'] == 'IMMUNE',:].Sample_ID.value_counts()}).sort_index()\n", "\n", "cancer_counts = pd.DataFrame({'cancer':\n", " df.loc[\n", " df['cell_type'] == 'CANCER',:].Sample_ID.value_counts()}).sort_index()\n", "\n", "endothelial_counts = pd.DataFrame({'endothelial':\n", " df.loc[\n", " df['cell_type'] == 'ENDOTHELIAL',:].Sample_ID.value_counts()}).sort_index()\n", "\n", "counts = pd.concat([sample_counts, stroma_counts,cancer_counts,immune_counts,endothelial_counts], \n", " axis = 1, sort = False)\n", "\n", "counts = counts.fillna(0)\n", "print(counts)\n", "\n", "filename = os.path.join(output_data_dir , project_name + \"_cell_types_number.csv\")\n", "counts.to_csv(filename, index = False)" ] }, { "cell_type": "code", "execution_count": 45, "id": "b19b0d76-0f17-4ed2-a41d-1e14d08d60ff", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
countsSample_IDstromacancerimmuneendothelialstroma_percimmune_perccancer_percendothelial_perc
DD3S1.csv68697DD3S1.csv10690489817360166615.610.771.32.4
DD3S2.csv70850DD3S2.csv12064510595977175017.08.472.12.5
DD3S3.csv116265DD3S3.csv234127700013075277820.111.266.22.4
DD4S1.csv70748DD4S1.csv7249540137433205310.210.576.32.9
DD4S2.csv51745DD4S2.csv6193394704850123212.09.476.32.4
DD4S3.csv70818DD4S3.csv85165059810331137312.014.671.41.9
DD5S1.csv69463DD5S1.csv17067437235878279524.68.562.94.0
DD5S2.csv45403DD5S2.csv11098308392131133524.44.767.92.9
DD5S3.csv45898DD5S3.csv9018300605656116419.612.365.52.5
TMA.csv94742TMA.csv23121599789356228724.49.963.32.4
\n", "
" ], "text/plain": [ " counts Sample_ID stroma cancer immune endothelial \\\n", "DD3S1.csv 68697 DD3S1.csv 10690 48981 7360 1666 \n", "DD3S2.csv 70850 DD3S2.csv 12064 51059 5977 1750 \n", "DD3S3.csv 116265 DD3S3.csv 23412 77000 13075 2778 \n", "DD4S1.csv 70748 DD4S1.csv 7249 54013 7433 2053 \n", "DD4S2.csv 51745 DD4S2.csv 6193 39470 4850 1232 \n", "DD4S3.csv 70818 DD4S3.csv 8516 50598 10331 1373 \n", "DD5S1.csv 69463 DD5S1.csv 17067 43723 5878 2795 \n", "DD5S2.csv 45403 DD5S2.csv 11098 30839 2131 1335 \n", "DD5S3.csv 45898 DD5S3.csv 9018 30060 5656 1164 \n", "TMA.csv 94742 TMA.csv 23121 59978 9356 2287 \n", "\n", " stroma_perc immune_perc cancer_perc endothelial_perc \n", "DD3S1.csv 15.6 10.7 71.3 2.4 \n", "DD3S2.csv 17.0 8.4 72.1 2.5 \n", "DD3S3.csv 20.1 11.2 66.2 2.4 \n", "DD4S1.csv 10.2 10.5 76.3 2.9 \n", "DD4S2.csv 12.0 9.4 76.3 2.4 \n", "DD4S3.csv 12.0 14.6 71.4 1.9 \n", "DD5S1.csv 24.6 8.5 62.9 4.0 \n", "DD5S2.csv 24.4 4.7 67.9 2.9 \n", "DD5S3.csv 19.6 12.3 65.5 2.5 \n", "TMA.csv 24.4 9.9 63.3 2.4 " ] }, "execution_count": 45, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Compute %\n", "# get_perc() function in my_modules.py\n", "\n", "counts['stroma_perc'] = counts.apply(lambda row: get_perc(row, 'stroma'), axis = 1)\n", "counts['immune_perc'] = counts.apply(lambda row: get_perc(row, 'immune'), axis = 1)\n", "counts['cancer_perc'] = counts.apply(lambda row: get_perc(row, 'cancer'), axis = 1)\n", "counts['endothelial_perc'] = counts.apply(lambda row: get_perc(row, 'endothelial'), axis = 1)\n", "\n", "counts" ] }, { "cell_type": "code", "execution_count": 46, "id": "facd7887-3b7b-44f9-b65f-185963a415de", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'temp-plot.html'" ] }, "execution_count": 46, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fig = go.Figure()\n", "title = 'Cell proportions by Sample ID and tissue type'\n", "\n", "fig = go.Figure(data=[\n", " go.Bar(name='Stroma', x=counts['Sample_ID'], y=counts['stroma_perc'], \n", " text = counts['stroma_perc'], textposition='auto',\n", " marker_color = 'rgb' + str(cell_type_color_dict['STROMA'])),\n", " go.Bar(name='Immune', x=counts['Sample_ID'], y=counts['immune_perc'], \n", " text = counts['immune_perc'], textposition='auto',\n", " marker_color = 'rgb' + str(cell_type_color_dict['IMMUNE'])),\n", " go.Bar(name='Cancer',x=counts['Sample_ID'], y=counts['cancer_perc'], \n", " text = counts['cancer_perc'], textposition='auto', \n", " marker_color = 'rgb' + str(cell_type_color_dict['CANCER'])),\n", " go.Bar(name='Endothelial',x=counts['Sample_ID'], y=counts['endothelial_perc'], \n", " text = counts['endothelial_perc'], textposition='auto', \n", " marker_color = 'rgb' + str(cell_type_color_dict['ENDOTHELIAL']))\n", "])\n", " \n", "fig.update_layout( plot_bgcolor = 'white',barmode ='stack')#title = title,\n", "fig.update_xaxes( linecolor = 'black')#title = \"Sample\",\n", "fig.update_yaxes(title = \"Cell count (%)\", linecolor = 'black')\n", "plot(fig)\n", "#fig.write_image(output_images_dir + \"/\" + title.replace(\" \",\"_\") + \".png\")" ] }, { "cell_type": "markdown", "id": "ee1c2bd3-633d-4bcb-a40e-064d90ebd713", "metadata": {}, "source": [ "### V.4.2. CELL SUBTYPES" ] }, { "cell_type": "markdown", "id": "70721a22-5cc7-464e-81c3-e1766f943fe2", "metadata": {}, "source": [ "#### V.4.2.1 BY SCENES" ] }, { "cell_type": "code", "execution_count": 47, "id": "56f79b66-9d56-4678-bb21-e59a8e3c34f5", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
dcbtcd4tcd8m1m2tregimmune_othercancerαsma_mycafstroma_otherendothelialtotal_cells
DD3S1.csv810.02991284931012969944898139676723166668697.0
DD3S2.csv2940.01915235094253812615105947897275175070850.0
DD3S3.csv280138.06857355025296281874770007424159882778116265.0
DD4S1.csv27229.02667195076381223895401331064143205370748.0
DD4S2.csv13014.019381694112102198413947016644529123251745.0
DD4S3.csv115031.0235329401553283833365059836864830137370818.0
DD5S1.csv583139.028405365042828122043723697610091279569463.0
DD5S2.csv16016.0113514513163144673083938767222133545403.0
DD5S3.csv146735.02000687479110138653006048314187116445898.0
TMA.csv1322309.050279521091120960759978487518246228794742.0
\n", "
" ], "text/plain": [ " dc b tcd4 tcd8 m1 m2 treg immune_other cancer \\\n", "DD3S1.csv 81 0.0 2991 2849 310 129 6 994 48981 \n", "DD3S2.csv 294 0.0 1915 2350 94 25 38 1261 51059 \n", "DD3S3.csv 280 138.0 6857 3550 252 96 28 1874 77000 \n", "DD4S1.csv 272 29.0 2667 1950 76 38 12 2389 54013 \n", "DD4S2.csv 130 14.0 1938 1694 112 102 19 841 39470 \n", "DD4S3.csv 1150 31.0 2353 2940 155 328 38 3336 50598 \n", "DD5S1.csv 583 139.0 2840 536 504 28 28 1220 43723 \n", "DD5S2.csv 160 16.0 1135 145 131 63 14 467 30839 \n", "DD5S3.csv 1467 35.0 2000 687 479 110 13 865 30060 \n", "TMA.csv 132 2309.0 5027 952 109 11 209 607 59978 \n", "\n", " αsma_mycaf stroma_other endothelial total_cells \n", "DD3S1.csv 3967 6723 1666 68697.0 \n", "DD3S2.csv 4789 7275 1750 70850.0 \n", "DD3S3.csv 7424 15988 2778 116265.0 \n", "DD4S1.csv 3106 4143 2053 70748.0 \n", "DD4S2.csv 1664 4529 1232 51745.0 \n", "DD4S3.csv 3686 4830 1373 70818.0 \n", "DD5S1.csv 6976 10091 2795 69463.0 \n", "DD5S2.csv 3876 7222 1335 45403.0 \n", "DD5S3.csv 4831 4187 1164 45898.0 \n", "TMA.csv 4875 18246 2287 94742.0 " ] }, "execution_count": 47, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Count by cell SUBtype\n", "cell_subtypes = ['DC', 'B', 'TCD4', 'TCD8', 'M1', 'M2', 'Treg', \\\n", " 'IMMUNE_OTHER', 'CANCER', 'αSMA_myCAF', 'STROMA_OTHER', 'ENDOTHELIAL']\n", "# Initialisation d'un dictionnaire pour stocker les counts des sous-types de cellules\n", "subtype_counts = {}\n", "\n", "# Boucle sur les sous-types de cellules pour compter les échantillons correspondants\n", "for subtype in cell_subtypes:\n", " subtype_counts[subtype.lower()] = pd.DataFrame({subtype.lower():\n", " df.loc[\n", " df['cell_subtype'] == subtype, 'Sample_ID'].value_counts()\n", " }).sort_index()\n", "\n", "# Concaténation des counts des sous-types de cellules en un seul DataFrame\n", "counts_subtypes = pd.concat([pd.DataFrame(v) for v in subtype_counts.values()], axis=1, sort=False)\n", "counts_subtypes = counts_subtypes.fillna(0)\n", "\n", "# Ajouter une colonne pour le compte total de cellules par ligne\n", "counts_subtypes['total_cells'] = counts_subtypes.sum(axis=1)\n", "\n", "# Enregistrement des counts des sous-types de cellules dans un fichier CSV\n", "filename_subtypes = os.path.join(output_data_dir, project_name + \"_cell_subtypes_number_by_scenes.csv\")\n", "counts_subtypes.to_csv(filename_subtypes, index=False)\n", "counts_subtypes" ] }, { "cell_type": "code", "execution_count": 48, "id": "46678224-e49f-4ce1-baef-f6757b27c6b7", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
dcbtcd4tcd8m1m2tregimmune_othercancerαsma_mycaf...tcd8_percm1_percm2_perctreg_percimmune_other_perccancer_percαsma_mycaf_percstroma_other_percendothelial_percSample_ID
DD3S1.csv810.0299128493101296994489813967...4.1471970.4512570.1877810.0087341.44693471.3000575.7746349.7864542.425142DD3S1.csv
DD3S2.csv2940.0191523509425381261510594789...3.3168670.1326750.0352860.0536341.77981772.0663376.75935110.2681722.470007DD3S2.csv
DD3S3.csv280138.06857355025296281874770007424...3.0533690.2167460.0825700.0240831.61183566.2280146.38541313.7513442.389369DD3S3.csv
DD4S1.csv27229.0266719507638122389540133106...2.7562620.1074240.0537120.0169623.37677476.3456214.3902305.8559962.901849DD4S1.csv
DD4S2.csv13014.01938169411210219841394701664...3.2737460.2164460.1971200.0367191.62527876.2779013.2157708.7525362.380906DD4S2.csv
DD4S3.csv115031.023532940155328383336505983686...4.1514870.2188710.4631590.0536594.71066771.4479375.2048916.8203001.938773DD4S3.csv
DD5S1.csv583139.0284053650428281220437236976...0.7716340.7255660.0403090.0403091.75633162.94430110.04275714.5271584.023725DD5S1.csv
DD5S2.csv16016.011351451316314467308393876...0.3193620.2885270.1387570.0308351.02856667.9228248.53688115.9064382.940334DD5S2.csv
DD5S3.csv146735.0200068747911013865300604831...1.4967971.0436180.2396620.0283241.88461465.49305010.5255139.1224022.536058DD5S3.csv
TMA.csv1322309.0502795210911209607599784875...1.0048340.1150490.0116100.2205990.64068763.3066645.14555319.2586182.413924TMA.csv
\n", "

10 rows × 26 columns

\n", "
" ], "text/plain": [ " dc b tcd4 tcd8 m1 m2 treg immune_other cancer \\\n", "DD3S1.csv 81 0.0 2991 2849 310 129 6 994 48981 \n", "DD3S2.csv 294 0.0 1915 2350 94 25 38 1261 51059 \n", "DD3S3.csv 280 138.0 6857 3550 252 96 28 1874 77000 \n", "DD4S1.csv 272 29.0 2667 1950 76 38 12 2389 54013 \n", "DD4S2.csv 130 14.0 1938 1694 112 102 19 841 39470 \n", "DD4S3.csv 1150 31.0 2353 2940 155 328 38 3336 50598 \n", "DD5S1.csv 583 139.0 2840 536 504 28 28 1220 43723 \n", "DD5S2.csv 160 16.0 1135 145 131 63 14 467 30839 \n", "DD5S3.csv 1467 35.0 2000 687 479 110 13 865 30060 \n", "TMA.csv 132 2309.0 5027 952 109 11 209 607 59978 \n", "\n", " αsma_mycaf ... tcd8_perc m1_perc m2_perc treg_perc \\\n", "DD3S1.csv 3967 ... 4.147197 0.451257 0.187781 0.008734 \n", "DD3S2.csv 4789 ... 3.316867 0.132675 0.035286 0.053634 \n", "DD3S3.csv 7424 ... 3.053369 0.216746 0.082570 0.024083 \n", "DD4S1.csv 3106 ... 2.756262 0.107424 0.053712 0.016962 \n", "DD4S2.csv 1664 ... 3.273746 0.216446 0.197120 0.036719 \n", "DD4S3.csv 3686 ... 4.151487 0.218871 0.463159 0.053659 \n", "DD5S1.csv 6976 ... 0.771634 0.725566 0.040309 0.040309 \n", "DD5S2.csv 3876 ... 0.319362 0.288527 0.138757 0.030835 \n", "DD5S3.csv 4831 ... 1.496797 1.043618 0.239662 0.028324 \n", "TMA.csv 4875 ... 1.004834 0.115049 0.011610 0.220599 \n", "\n", " immune_other_perc cancer_perc αsma_mycaf_perc stroma_other_perc \\\n", "DD3S1.csv 1.446934 71.300057 5.774634 9.786454 \n", "DD3S2.csv 1.779817 72.066337 6.759351 10.268172 \n", "DD3S3.csv 1.611835 66.228014 6.385413 13.751344 \n", "DD4S1.csv 3.376774 76.345621 4.390230 5.855996 \n", "DD4S2.csv 1.625278 76.277901 3.215770 8.752536 \n", "DD4S3.csv 4.710667 71.447937 5.204891 6.820300 \n", "DD5S1.csv 1.756331 62.944301 10.042757 14.527158 \n", "DD5S2.csv 1.028566 67.922824 8.536881 15.906438 \n", "DD5S3.csv 1.884614 65.493050 10.525513 9.122402 \n", "TMA.csv 0.640687 63.306664 5.145553 19.258618 \n", "\n", " endothelial_perc Sample_ID \n", "DD3S1.csv 2.425142 DD3S1.csv \n", "DD3S2.csv 2.470007 DD3S2.csv \n", "DD3S3.csv 2.389369 DD3S3.csv \n", "DD4S1.csv 2.901849 DD4S1.csv \n", "DD4S2.csv 2.380906 DD4S2.csv \n", "DD4S3.csv 1.938773 DD4S3.csv \n", "DD5S1.csv 4.023725 DD5S1.csv \n", "DD5S2.csv 2.940334 DD5S2.csv \n", "DD5S3.csv 2.536058 DD5S3.csv \n", "TMA.csv 2.413924 TMA.csv \n", "\n", "[10 rows x 26 columns]" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Ajout des colonnes de pourcentages pour chaque sous-type de cellules\n", "counts_perc = counts_subtypes.copy()\n", "\n", "# Calcul des pourcentages pour chaque sous-type de cellules, en excluant la colonne 'total_cells'\n", "for col in counts_subtypes.columns:\n", " if col != 'total_cells':\n", " counts_perc[col + '_perc'] = (counts_perc[col] / counts_perc['total_cells']) * 100\n", "\n", "# Affichage des pourcentages des sous-types de cellules\n", "\n", "counts_perc['Sample_ID'] = counts_perc.index\n", "counts_perc.columns.values\n", "display(counts_perc)\n" ] }, { "cell_type": "code", "execution_count": 49, "id": "415c17ec-5449-47e6-add5-8d7eef72c3a7", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "marker": { "color": "rgb(166, 206, 227)" }, "name": "DC", "text": [ 0.11790907899908293, 0.4149611856033874, 0.24082914032597943, 0.3844631650364675, 0.2512320030920862, 1.6238809342257619, 0.8392957401782244, 0.35239962117040724, 3.1962177001176517, 0.13932574782039645 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "TMA.csv" ], "y": [ 0.11790907899908293, 0.4149611856033874, 0.24082914032597943, 0.3844631650364675, 0.2512320030920862, 1.6238809342257619, 0.8392957401782244, 0.35239962117040724, 3.1962177001176517, 0.13932574782039645 ] }, { "marker": { "color": "rgb(31, 120, 180)" }, "name": "B", "text": [ 0, 0, 0.11869436201780414, 0.040990558036976314, 0.027055754179147747, 0.043774181705216186, 0.2001065315347739, 0.035239962117040724, 0.0762560460150769, 2.437145088767389 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "TMA.csv" ], "y": [ 0, 0, 0.11869436201780414, 0.040990558036976314, 0.027055754179147747, 0.043774181705216186, 0.2001065315347739, 0.035239962117040724, 0.0762560460150769, 2.437145088767389 ] }, { "marker": { "color": "rgb(178, 223, 138)" }, "name": "TCD4", "text": [ 4.3539019171142845, 2.7028934368383912, 5.897733625768718, 3.7697178718833038, 3.7452893999420236, 3.3226015984636676, 4.088507550782431, 2.4998348126775762, 4.35748834371868, 5.305988896160098 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "TMA.csv" ], "y": [ 4.3539019171142845, 2.7028934368383912, 5.897733625768718, 3.7697178718833038, 3.7452893999420236, 3.3226015984636676, 4.088507550782431, 2.4998348126775762, 4.35748834371868, 5.305988896160098 ] }, { "marker": { "color": "rgb(51, 160, 44)" }, "name": "TCD8", "text": [ 4.147197111955398, 3.3168666196189136, 3.0533694577043824, 2.756261661107028, 3.273746255676877, 4.1514869101076, 0.7716338194434448, 0.3193621566856816, 1.4967972460673666, 1.0048341812501318 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "TMA.csv" ], "y": [ 4.147197111955398, 3.3168666196189136, 3.0533694577043824, 2.756261661107028, 3.273746255676877, 4.1514869101076, 0.7716338194434448, 0.3193621566856816, 1.4967972460673666, 1.0048341812501318 ] }, { "marker": { "color": "rgb(251, 154, 153)" }, "name": "M1", "text": [ 0.4512569690088359, 0.13267466478475654, 0.2167462262933815, 0.10742353140724827, 0.21644603343318197, 0.21887090852608093, 0.7255661287304033, 0.28852718983327097, 1.043618458320624, 0.11504929176078191 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "TMA.csv" ], "y": [ 0.4512569690088359, 0.13267466478475654, 0.2167462262933815, 0.10742353140724827, 0.21644603343318197, 0.21887090852608093, 0.7255661287304033, 0.28852718983327097, 1.043618458320624, 0.11504929176078191 ] }, { "marker": { "color": "rgb(227, 26, 28)" }, "name": "M2", "text": [ 0.1877811258133543, 0.035285815102328866, 0.08256999096890724, 0.05371176570362413, 0.19712049473379073, 0.46315908384873905, 0.04030922937391129, 0.13875735083584786, 0.23966185890452746, 0.011610478985033038 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "TMA.csv" ], "y": [ 0.1877811258133543, 0.035285815102328866, 0.08256999096890724, 0.05371176570362413, 0.19712049473379073, 0.46315908384873905, 0.04030922937391129, 0.13875735083584786, 0.23966185890452746, 0.011610478985033038 ] }, { "marker": { "color": "rgb(253, 191, 111)" }, "name": "Treg", "text": [ 0.00873400585178392, 0.05363443895553987, 0.024082914032597946, 0.016961610222197096, 0.03671852352884337, 0.05365867434832952, 0.04030922937391129, 0.030834966852410634, 0.028323674234171422, 0.2205991007156277 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "TMA.csv" ], "y": [ 0.00873400585178392, 0.05363443895553987, 0.024082914032597946, 0.016961610222197096, 0.03671852352884337, 0.05365867434832952, 0.04030922937391129, 0.030834966852410634, 0.028323674234171422, 0.2205991007156277 ] }, { "marker": { "color": "rgb(1.0, 0.4980392156862745, 0.0)" }, "name": "IMMUNE_OTHER", "text": [ 1.446933636112203, 1.7798165137614679, 1.6118350320388768, 3.3767739017357385, 1.625277804618804, 4.710666779632297, 1.7563307084347062, 1.028566394291126, 1.8846137086583294, 0.640687340355914 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "TMA.csv" ], "y": [ 1.446933636112203, 1.7798165137614679, 1.6118350320388768, 3.3767739017357385, 1.625277804618804, 4.710666779632297, 1.7563307084347062, 1.028566394291126, 1.8846137086583294, 0.640687340355914 ] }, { "marker": { "color": "rgb(202, 178, 214)" }, "name": "CANCER", "text": [ 71.30005677103803, 72.06633733239238, 66.22801358964435, 76.34562107762764, 76.27790124649725, 71.44793696517834, 62.94430128269727, 67.92282448296369, 65.49304980609176, 63.30666441493741 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "TMA.csv" ], "y": [ 71.30005677103803, 72.06633733239238, 66.22801358964435, 76.34562107762764, 76.27790124649725, 71.44793696517834, 62.94430128269727, 67.92282448296369, 65.49304980609176, 63.30666441493741 ] }, { "marker": { "color": "rgb(106, 61, 154)" }, "name": "αSMA_myCAF", "text": [ 5.774633535671136, 6.759350741002117, 6.3854126349288265, 4.390230112512015, 3.2157696395787037, 5.204891411787964, 10.042756575443041, 8.536880822853115, 10.525513094252473, 5.1455531865487325 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "TMA.csv" ], "y": [ 5.774633535671136, 6.759350741002117, 6.3854126349288265, 4.390230112512015, 3.2157696395787037, 5.204891411787964, 10.042756575443041, 8.536880822853115, 10.525513094252473, 5.1455531865487325 ] }, { "marker": { "color": "rgb(1.0, 1.0, 0.6)" }, "name": "STROMA_OTHER", "text": [ 9.786453556923883, 10.2681721947777, 13.751343912613425, 5.855995929213546, 8.752536476954296, 6.820299923748199, 14.527158343290672, 15.906437900579256, 9.122401847575059, 19.258618141901163 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "TMA.csv" ], "y": [ 9.786453556923883, 10.2681721947777, 13.751343912613425, 5.855995929213546, 8.752536476954296, 6.820299923748199, 14.527158343290672, 15.906437900579256, 9.122401847575059, 19.258618141901163 ] }, { "marker": { "color": "rgb(177, 89, 40)" }, "name": "ENDOTHELIAL", "text": [ 2.425142291512002, 2.470007057163021, 2.389369113662753, 2.9018488155142195, 2.3809063677650015, 1.9387726284278008, 4.023724860717216, 2.9403343391405854, 2.536058216044272, 2.4139241307973234 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "TMA.csv" ], "y": [ 2.425142291512002, 2.470007057163021, 2.389369113662753, 2.9018488155142195, 2.3809063677650015, 1.9387726284278008, 4.023724860717216, 2.9403343391405854, 2.536058216044272, 2.4139241307973234 ] } ], "layout": { "barmode": "stack", "plot_bgcolor": "white", "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Cell subtypes proportions by Sample ID and tissue type" }, "xaxis": { "autorange": true, "linecolor": "black", "range": [ -0.5, 9.5 ], "type": "category" }, "yaxis": { "autorange": true, "linecolor": "black", "range": [ 0, 105.26315789473685 ], "title": { "text": "Cell count (%)" }, "type": "linear" } } } }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "'temp-plot.html'" ] }, "execution_count": 49, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fig = go.Figure()\n", "title = 'Cell subtypes proportions by Sample ID and tissue type'\n", "\n", "for cell_subtype in cell_subtypes:\n", " fig.add_trace(\n", " go.Bar(\n", " name=cell_subtype,\n", " x=counts_perc['Sample_ID'],\n", " y=counts_perc[f'{cell_subtype.lower()}_perc'],\n", " text=counts_perc[f'{cell_subtype.lower()}_perc'],\n", " textposition='auto',\n", " marker_color='rgb' + str(cell_subtype_color_dict[cell_subtype])))\n", "\n", "fig.update_layout(\n", " plot_bgcolor='white',\n", " barmode='stack',\n", " title=title,\n", " xaxis=dict(linecolor='black'),\n", " yaxis=dict(title='Cell count (%)', linecolor='black')\n", ")\n", "\n", "# Enregistrer l'image\n", "output_filename = title.replace(\" \", \"_\") + \".png\"\n", "#fig.write_image(output_images_dir + \"/\" + output_filename, scale=1000)\n", "\n", "# Afficher le graphique\n", "fig.show()\n", "plot(fig)" ] }, { "cell_type": "markdown", "id": "53d9fea4-07b2-4a2f-9a61-068160198147", "metadata": {}, "source": [ "#### V.4.2.2 BY PATIENTS" ] }, { "cell_type": "code", "execution_count": 50, "id": "db7b6ff6-ac31-4dc2-91a6-fbeb10c428c8", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PDL1_Cytoplasm_Intensity_AverageHLA_Cytoplasm_Intensity_AverageCKs_Cytoplasm_Intensity_AverageKi67_Nucleus_Intensity_AverageCD163_Cytoplasm_Intensity_AverageColVI_Cytoplasm_Intensity_AverageCD20_Cytoplasm_Intensity_AveragePD1_Cytoplasm_Intensity_AverageAXL_Cytoplasm_Intensity_AverageCD31_Cytoplasm_Intensity_Average...Nucleus_RoundnessNuc_XROI_indexNucleus_SizeSample_IDimmune_checkpointCell_SizePatientUnique_ROI_indexPrimary_chem(1)_vs_surg(0)
ID
DD3S1_Cell_0-0.677863-0.417494-0.912537-0.8178760.9300990.232078-0.4831581.5356040.8073391.167755...0.9550401484.7717290127DD3S1.csvNone3396161a1.0
DD3S1_Cell_1-0.677863-0.516487-0.838037-0.8696851.1149240.301333-0.3447701.6683680.8754551.643023...0.9666431426.2500000112DD3S1.csvNone3446161a1.0
DD3S1_Cell_2-0.677863-0.141921-1.016023-0.7558790.8345770.259216-0.4382921.3363080.7050881.053636...0.7215341531.1104740181DD3S1.csvNone4226161a1.0
DD3S1_Cell_3-0.741282-0.460472-0.491711-0.8180840.6482000.107027-0.4448891.2498050.6607071.165861...0.5871961518.9075930119DD3S1.csvNone2786161a1.0
DD3S1_Cell_6-0.621521-0.247254-0.867127-0.7425440.8105790.272128-0.5071171.2514340.9471722.545301...0.9357161471.914917047DD3S1.csvNone2046161a1.0
..................................................................
TMA_Cell_1157550.4782750.558670-0.9628401.7322910.507434-0.9126410.3113220.8160680.5965200.090397...0.98219615564.45800859142TMA.csvNone386c59c59aCONTROL
TMA_Cell_1157560.2974180.420594-0.9716321.9669550.304365-1.1641120.866636-0.092857-0.241830-0.617835...0.77597715629.6806645947TMA.csvNone270c59c59aCONTROL
TMA_Cell_1157570.3469500.453951-0.6028931.3389560.559435-0.8013330.4470610.9881561.5678690.403878...0.68874715518.4218755964TMA.csvNone202c59c59aCONTROL
TMA_Cell_115758-0.1894150.508840-0.8860410.647980-0.227224-1.022549-0.0992560.2197550.603715-0.219145...0.75140215539.2753915958TMA.csvNone182c59c59aCONTROL
TMA_Cell_1157600.2457770.460219-1.0038400.191158-0.313127-1.1206750.004962-0.3161991.727776-0.495501...0.67412615542.96191459106TMA.csvNone295c59c59aCONTROL
\n", "

704629 rows × 40 columns

\n", "
" ], "text/plain": [ " PDL1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.677863 \n", "DD3S1_Cell_1 -0.677863 \n", "DD3S1_Cell_2 -0.677863 \n", "DD3S1_Cell_3 -0.741282 \n", "DD3S1_Cell_6 -0.621521 \n", "... ... \n", "TMA_Cell_115755 0.478275 \n", "TMA_Cell_115756 0.297418 \n", "TMA_Cell_115757 0.346950 \n", "TMA_Cell_115758 -0.189415 \n", "TMA_Cell_115760 0.245777 \n", "\n", " HLA_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.417494 \n", "DD3S1_Cell_1 -0.516487 \n", "DD3S1_Cell_2 -0.141921 \n", "DD3S1_Cell_3 -0.460472 \n", "DD3S1_Cell_6 -0.247254 \n", "... ... \n", "TMA_Cell_115755 0.558670 \n", "TMA_Cell_115756 0.420594 \n", "TMA_Cell_115757 0.453951 \n", "TMA_Cell_115758 0.508840 \n", "TMA_Cell_115760 0.460219 \n", "\n", " CKs_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.912537 \n", "DD3S1_Cell_1 -0.838037 \n", "DD3S1_Cell_2 -1.016023 \n", "DD3S1_Cell_3 -0.491711 \n", "DD3S1_Cell_6 -0.867127 \n", "... ... \n", "TMA_Cell_115755 -0.962840 \n", "TMA_Cell_115756 -0.971632 \n", "TMA_Cell_115757 -0.602893 \n", "TMA_Cell_115758 -0.886041 \n", "TMA_Cell_115760 -1.003840 \n", "\n", " Ki67_Nucleus_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.817876 \n", "DD3S1_Cell_1 -0.869685 \n", "DD3S1_Cell_2 -0.755879 \n", "DD3S1_Cell_3 -0.818084 \n", "DD3S1_Cell_6 -0.742544 \n", "... ... \n", "TMA_Cell_115755 1.732291 \n", "TMA_Cell_115756 1.966955 \n", "TMA_Cell_115757 1.338956 \n", "TMA_Cell_115758 0.647980 \n", "TMA_Cell_115760 0.191158 \n", "\n", " CD163_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.930099 \n", "DD3S1_Cell_1 1.114924 \n", "DD3S1_Cell_2 0.834577 \n", "DD3S1_Cell_3 0.648200 \n", "DD3S1_Cell_6 0.810579 \n", "... ... \n", "TMA_Cell_115755 0.507434 \n", "TMA_Cell_115756 0.304365 \n", "TMA_Cell_115757 0.559435 \n", "TMA_Cell_115758 -0.227224 \n", "TMA_Cell_115760 -0.313127 \n", "\n", " ColVI_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.232078 \n", "DD3S1_Cell_1 0.301333 \n", "DD3S1_Cell_2 0.259216 \n", "DD3S1_Cell_3 0.107027 \n", "DD3S1_Cell_6 0.272128 \n", "... ... \n", "TMA_Cell_115755 -0.912641 \n", "TMA_Cell_115756 -1.164112 \n", "TMA_Cell_115757 -0.801333 \n", "TMA_Cell_115758 -1.022549 \n", "TMA_Cell_115760 -1.120675 \n", "\n", " CD20_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.483158 \n", "DD3S1_Cell_1 -0.344770 \n", "DD3S1_Cell_2 -0.438292 \n", "DD3S1_Cell_3 -0.444889 \n", "DD3S1_Cell_6 -0.507117 \n", "... ... \n", "TMA_Cell_115755 0.311322 \n", "TMA_Cell_115756 0.866636 \n", "TMA_Cell_115757 0.447061 \n", "TMA_Cell_115758 -0.099256 \n", "TMA_Cell_115760 0.004962 \n", "\n", " PD1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 1.535604 \n", "DD3S1_Cell_1 1.668368 \n", "DD3S1_Cell_2 1.336308 \n", "DD3S1_Cell_3 1.249805 \n", "DD3S1_Cell_6 1.251434 \n", "... ... \n", "TMA_Cell_115755 0.816068 \n", "TMA_Cell_115756 -0.092857 \n", "TMA_Cell_115757 0.988156 \n", "TMA_Cell_115758 0.219755 \n", "TMA_Cell_115760 -0.316199 \n", "\n", " AXL_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.807339 \n", "DD3S1_Cell_1 0.875455 \n", "DD3S1_Cell_2 0.705088 \n", "DD3S1_Cell_3 0.660707 \n", "DD3S1_Cell_6 0.947172 \n", "... ... \n", "TMA_Cell_115755 0.596520 \n", "TMA_Cell_115756 -0.241830 \n", "TMA_Cell_115757 1.567869 \n", "TMA_Cell_115758 0.603715 \n", "TMA_Cell_115760 1.727776 \n", "\n", " CD31_Cytoplasm_Intensity_Average ... Nucleus_Roundness \\\n", "ID ... \n", "DD3S1_Cell_0 1.167755 ... 0.955040 \n", "DD3S1_Cell_1 1.643023 ... 0.966643 \n", "DD3S1_Cell_2 1.053636 ... 0.721534 \n", "DD3S1_Cell_3 1.165861 ... 0.587196 \n", "DD3S1_Cell_6 2.545301 ... 0.935716 \n", "... ... ... ... \n", "TMA_Cell_115755 0.090397 ... 0.982196 \n", "TMA_Cell_115756 -0.617835 ... 0.775977 \n", "TMA_Cell_115757 0.403878 ... 0.688747 \n", "TMA_Cell_115758 -0.219145 ... 0.751402 \n", "TMA_Cell_115760 -0.495501 ... 0.674126 \n", "\n", " Nuc_X ROI_index Nucleus_Size Sample_ID \\\n", "ID \n", "DD3S1_Cell_0 1484.771729 0 127 DD3S1.csv \n", "DD3S1_Cell_1 1426.250000 0 112 DD3S1.csv \n", "DD3S1_Cell_2 1531.110474 0 181 DD3S1.csv \n", "DD3S1_Cell_3 1518.907593 0 119 DD3S1.csv \n", "DD3S1_Cell_6 1471.914917 0 47 DD3S1.csv \n", "... ... ... ... ... \n", "TMA_Cell_115755 15564.458008 59 142 TMA.csv \n", "TMA_Cell_115756 15629.680664 59 47 TMA.csv \n", "TMA_Cell_115757 15518.421875 59 64 TMA.csv \n", "TMA_Cell_115758 15539.275391 59 58 TMA.csv \n", "TMA_Cell_115760 15542.961914 59 106 TMA.csv \n", "\n", " immune_checkpoint Cell_Size Patient Unique_ROI_index \\\n", "ID \n", "DD3S1_Cell_0 None 339 61 61a \n", "DD3S1_Cell_1 None 344 61 61a \n", "DD3S1_Cell_2 None 422 61 61a \n", "DD3S1_Cell_3 None 278 61 61a \n", "DD3S1_Cell_6 None 204 61 61a \n", "... ... ... ... ... \n", "TMA_Cell_115755 None 386 c59 c59a \n", "TMA_Cell_115756 None 270 c59 c59a \n", "TMA_Cell_115757 None 202 c59 c59a \n", "TMA_Cell_115758 None 182 c59 c59a \n", "TMA_Cell_115760 None 295 c59 c59a \n", "\n", " Primary_chem(1)_vs_surg(0) \n", "ID \n", "DD3S1_Cell_0 1.0 \n", "DD3S1_Cell_1 1.0 \n", "DD3S1_Cell_2 1.0 \n", "DD3S1_Cell_3 1.0 \n", "DD3S1_Cell_6 1.0 \n", "... ... \n", "TMA_Cell_115755 CONTROL \n", "TMA_Cell_115756 CONTROL \n", "TMA_Cell_115757 CONTROL \n", "TMA_Cell_115758 CONTROL \n", "TMA_Cell_115760 CONTROL \n", "\n", "[704629 rows x 40 columns]" ] }, "execution_count": 50, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df" ] }, { "cell_type": "code", "execution_count": 51, "id": "d2681077-1a50-441b-8a56-231f9b09a20a", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
dcbtcd4tcd8m1m2tregimmune_othercancerαsma_mycafstroma_otherendothelialTotal_cells
102.00.0900.024.0167.0100.05.028.03981.0388.0530.0335.06460.0
10021.00.092.046.00.03.01.030.01449.030.073.0131.01876.0
1012.00.020.015.03.01.00.024.01896.081.0173.060.02275.0
1021.02.045.024.05.01.00.038.03564.018.091.016.03805.0
10357.00.072.0555.07.00.01.078.02157.017.0131.0117.03192.0
..........................................
920.00.011.0990.03.025.01.0184.0424.0140.022.015.01815.0
960.00.076.02.02.01.00.04.01854.01.016.03.01959.0
970.00.0174.038.00.00.01.056.02193.028.0163.0102.02755.0
600.00.00.0107.09.016.01.057.01979.0107.01.032.02309.0
620.00.00.023.03.015.00.04.0151.091.020.03.0310.0
\n", "

177 rows × 13 columns

\n", "
" ], "text/plain": [ " dc b tcd4 tcd8 m1 m2 treg immune_other cancer \\\n", "10 2.0 0.0 900.0 24.0 167.0 100.0 5.0 28.0 3981.0 \n", "100 21.0 0.0 92.0 46.0 0.0 3.0 1.0 30.0 1449.0 \n", "101 2.0 0.0 20.0 15.0 3.0 1.0 0.0 24.0 1896.0 \n", "102 1.0 2.0 45.0 24.0 5.0 1.0 0.0 38.0 3564.0 \n", "103 57.0 0.0 72.0 555.0 7.0 0.0 1.0 78.0 2157.0 \n", ".. ... ... ... ... ... ... ... ... ... \n", "92 0.0 0.0 11.0 990.0 3.0 25.0 1.0 184.0 424.0 \n", "96 0.0 0.0 76.0 2.0 2.0 1.0 0.0 4.0 1854.0 \n", "97 0.0 0.0 174.0 38.0 0.0 0.0 1.0 56.0 2193.0 \n", "60 0.0 0.0 0.0 107.0 9.0 16.0 1.0 57.0 1979.0 \n", "62 0.0 0.0 0.0 23.0 3.0 15.0 0.0 4.0 151.0 \n", "\n", " αsma_mycaf stroma_other endothelial Total_cells \n", "10 388.0 530.0 335.0 6460.0 \n", "100 30.0 73.0 131.0 1876.0 \n", "101 81.0 173.0 60.0 2275.0 \n", "102 18.0 91.0 16.0 3805.0 \n", "103 17.0 131.0 117.0 3192.0 \n", ".. ... ... ... ... \n", "92 140.0 22.0 15.0 1815.0 \n", "96 1.0 16.0 3.0 1959.0 \n", "97 28.0 163.0 102.0 2755.0 \n", "60 107.0 1.0 32.0 2309.0 \n", "62 91.0 20.0 3.0 310.0 \n", "\n", "[177 rows x 13 columns]" ] }, "execution_count": 51, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Compter par numéro de patiente\n", "patient_counts = {}\n", "\n", "# Boucle sur les sous-types de cellules pour compter les échantillons correspondants par patient\n", "for subtype in cell_subtypes:\n", " patient_counts[subtype.lower()] = pd.DataFrame({subtype.lower():\n", " df.loc[\n", " df['cell_subtype'] == subtype, 'Patient'].value_counts()\n", " }).sort_index()\n", "\n", "# Concaténation des counts des sous-types de cellules en un seul DataFrame\n", "counts_patients = pd.concat([pd.DataFrame(v) for v in patient_counts.values()], axis=1, sort=False)\n", "counts_patients = counts_patients.fillna(0)\n", "\n", "# Ajout de la colonne de total de cellules comptées par patientes\n", "counts_patients['Total_cells'] = counts_patients.sum(axis=1)\n", "counts_patients = counts_patients[~counts_patients.index.str.startswith('c')]\n", "\n", "# Enregistrement des counts des sous-types de cellules par patient dans un fichier CSV\n", "filename_patients = os.path.join(output_data_dir, project_name + \"_cell_subtypes_number_by_patient.csv\")\n", "counts_patients.to_csv(filename_patients, index=False)\n", "counts_patients" ] }, { "cell_type": "code", "execution_count": 52, "id": "f95053da-c3ae-46c1-93c4-a6b052887bf3", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
dcbtcd4tcd8m1m2tregimmune_othercancerαsma_mycaf...tcd8_percm1_percm2_perctreg_percimmune_other_perccancer_percαsma_mycaf_percstroma_other_percendothelial_percPatient
102.00.0900.024.0167.0100.05.028.03981.0388.0...0.3715172.5851391.5479880.0773990.43343761.6253876.0061928.2043345.18575910
10021.00.092.046.00.03.01.030.01449.030.0...2.4520260.0000000.1599150.0533051.59914777.2388061.5991473.8912586.982942100
1012.00.020.015.03.01.00.024.01896.081.0...0.6593410.1318680.0439560.0000001.05494583.3406593.5604407.6043962.637363101
1021.02.045.024.05.01.00.038.03564.018.0...0.6307490.1314060.0262810.0000000.99868693.6662290.4730622.3915900.420499102
10357.00.072.0555.07.00.01.078.02157.017.0...17.3872180.2192980.0000000.0313282.44360967.5751880.5325814.1040103.665414103
..................................................................
920.00.011.0990.03.025.01.0184.0424.0140.0...54.5454550.1652891.3774100.05509610.13774123.3608827.7134991.2121210.82644692
960.00.076.02.02.01.00.04.01854.01.0...0.1020930.1020930.0510460.0000000.20418694.6401230.0510460.8167430.15313996
970.00.0174.038.00.00.01.056.02193.028.0...1.3793100.0000000.0000000.0362982.03266879.6007261.0163345.9165153.70235997
600.00.00.0107.09.016.01.057.01979.0107.0...4.6340410.3897790.6929410.0433092.46860185.7080994.6340410.0433091.38588160
620.00.00.023.03.015.00.04.0151.091.0...7.4193550.9677424.8387100.0000001.29032348.70967729.3548396.4516130.96774262
\n", "

177 rows × 26 columns

\n", "
" ], "text/plain": [ " dc b tcd4 tcd8 m1 m2 treg immune_other cancer \\\n", "10 2.0 0.0 900.0 24.0 167.0 100.0 5.0 28.0 3981.0 \n", "100 21.0 0.0 92.0 46.0 0.0 3.0 1.0 30.0 1449.0 \n", "101 2.0 0.0 20.0 15.0 3.0 1.0 0.0 24.0 1896.0 \n", "102 1.0 2.0 45.0 24.0 5.0 1.0 0.0 38.0 3564.0 \n", "103 57.0 0.0 72.0 555.0 7.0 0.0 1.0 78.0 2157.0 \n", ".. ... ... ... ... ... ... ... ... ... \n", "92 0.0 0.0 11.0 990.0 3.0 25.0 1.0 184.0 424.0 \n", "96 0.0 0.0 76.0 2.0 2.0 1.0 0.0 4.0 1854.0 \n", "97 0.0 0.0 174.0 38.0 0.0 0.0 1.0 56.0 2193.0 \n", "60 0.0 0.0 0.0 107.0 9.0 16.0 1.0 57.0 1979.0 \n", "62 0.0 0.0 0.0 23.0 3.0 15.0 0.0 4.0 151.0 \n", "\n", " αsma_mycaf ... tcd8_perc m1_perc m2_perc treg_perc \\\n", "10 388.0 ... 0.371517 2.585139 1.547988 0.077399 \n", "100 30.0 ... 2.452026 0.000000 0.159915 0.053305 \n", "101 81.0 ... 0.659341 0.131868 0.043956 0.000000 \n", "102 18.0 ... 0.630749 0.131406 0.026281 0.000000 \n", "103 17.0 ... 17.387218 0.219298 0.000000 0.031328 \n", ".. ... ... ... ... ... ... \n", "92 140.0 ... 54.545455 0.165289 1.377410 0.055096 \n", "96 1.0 ... 0.102093 0.102093 0.051046 0.000000 \n", "97 28.0 ... 1.379310 0.000000 0.000000 0.036298 \n", "60 107.0 ... 4.634041 0.389779 0.692941 0.043309 \n", "62 91.0 ... 7.419355 0.967742 4.838710 0.000000 \n", "\n", " immune_other_perc cancer_perc αsma_mycaf_perc stroma_other_perc \\\n", "10 0.433437 61.625387 6.006192 8.204334 \n", "100 1.599147 77.238806 1.599147 3.891258 \n", "101 1.054945 83.340659 3.560440 7.604396 \n", "102 0.998686 93.666229 0.473062 2.391590 \n", "103 2.443609 67.575188 0.532581 4.104010 \n", ".. ... ... ... ... \n", "92 10.137741 23.360882 7.713499 1.212121 \n", "96 0.204186 94.640123 0.051046 0.816743 \n", "97 2.032668 79.600726 1.016334 5.916515 \n", "60 2.468601 85.708099 4.634041 0.043309 \n", "62 1.290323 48.709677 29.354839 6.451613 \n", "\n", " endothelial_perc Patient \n", "10 5.185759 10 \n", "100 6.982942 100 \n", "101 2.637363 101 \n", "102 0.420499 102 \n", "103 3.665414 103 \n", ".. ... ... \n", "92 0.826446 92 \n", "96 0.153139 96 \n", "97 3.702359 97 \n", "60 1.385881 60 \n", "62 0.967742 62 \n", "\n", "[177 rows x 26 columns]" ] }, "execution_count": 52, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Ajout des colonnes de pourcentages pour chaque sous-type de cellules par patient\n", "counts_perc_patients = counts_patients.copy()\n", "\n", "# Calcul des pourcentages pour chaque sous-type de cellules, en excluant la colonne 'total_cells'\n", "for col in counts_perc_patients.columns:\n", " if col != 'Total_cells':\n", " counts_perc_patients[col + '_perc'] = (counts_perc_patients[col] / counts_perc_patients['Total_cells']) * 100\n", "\n", "\n", "# Affichage des pourcentages des sous-types de cellules par patient\n", "counts_perc_patients['Patient'] = counts_perc_patients.index\n", "counts_perc_patients.columns.values\n", "counts_perc_patients = counts_perc_patients[~counts_perc_patients.index.str.startswith('c')]\n", "counts_perc_patients" ] }, { "cell_type": "code", "execution_count": 53, "id": "d0c8f835-c414-4247-a701-5ed00ffcdef8", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "marker": { "color": "rgb(166, 206, 227)" }, "name": "DC", "text": [ 0.030959752321981428, 1.1194029850746268, 0.0879120879120879, 0.026281208935611037, 1.7857142857142856, 0.16251354279523295, 0.01915341888527102, 1.8001800180018002, 0.01614465611882467, 0.27932960893854747, 2.631578947368421, 0.07040600797934757, 0.03170577045022194, 0.6369426751592357, 0.19162332329592116, 1.5151515151515151, 0.022060445621001543, 0.044444444444444446, 0.25911210917256866, 0.19485580670303976, 0.1509813789632612, 0.6265664160401002, 1.3333333333333335, 1.8334606569900689, 0.48543689320388345, 0.10482180293501049, 0.4731488052992667, 0.38910505836575876, 1.3261210957948002, 11.179606797734088, 0.16381933068102036, 0.09564801530368246, 0.15408320493066258, 0.012711325791280032, 25.251256281407038, 3.75, 0.130718954248366, 1.6082294986960302, 0.38022813688212925, 0.025412960609911054, 0.250678922080635, 0.5918910920390648, 0.1352265043948614, 0.2883762200532387, 0.8665511265164645, 0.0485319097306479, 0.5867396831605711, 0.01882530120481928, 0.40417649040080833, 0.07336757153338225, 0.8547008547008548, 3.489499192245557, 0.13761467889908258, 22.03856749311295, 0.10086746015735323, 0.10156408693885843, 0.25597269624573377, 2.3359670216420474, 0.1310615989515072, 0.054945054945054944, 0.21253985122210414, 0.6975392365820577, 0.052083333333333336, 2.3801760678187156, 0.0643915003219575, 0.5820721769499418, 0.3232758620689655, 2.07667731629393, 0.09737098344693282, 0.1146131805157593, 0.5830009205277692, 0.01889287738522577, 0.029498525073746312, 1.3999164229001253, 0.026954177897574125, 0.07777259293824856, 0.03567606136282554, 0.13120899718837864, 0.33504578959124415, 0.6089604175728578, 0.836635843240863, 1.0788381742738589, 2.1150424985174934, 0.04315925766076824, 0.07789678675754626, 0.2491506228765572, 0.8224993366940834, 0.7874015748031495, 0.9978048293753742, 0.5996002664890073, 0.29505778214900413, 0.14691478942213515, 0.3534956794972506, 0.037678975131876416, 0.03664345914254306, 0.5344503827820309, 3.1978680879413726, 0.044007627988851404, 0.09629272989889263, 0.1779359430604982, 0.045187528242205156, 0.09206407659731174, 0.7308467741935484, 0.04962779156327543, 0.8764940239043826, 0.17491254372813594, 0.02337540906965872, 1.1464968152866242, 0.06357279084551812, 12.654392915404333, 0.1128668171557562, 6.478624944909652, 0.14516421702050444, 0.028477858465043433, 1.9297036526533424, 0.01858736059479554, 0.05564830272676684, 0.2434705621956618, 0.6076718571971136, 0.03254678600488201, 0.034916201117318434, 0.49532195927352773, 0.12903225806451613, 0.14248397055331277, 0.6134969325153374, 1.0619977037887485, 0.6738544474393532, 0.23715415019762848, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "11", "110", "111", "112", "113", "114", "115", "116", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "137", "139", "14", "140", "141", "143", "144", "146", "147", "148", "149", "15", "150", "152", "153", "154", "155", "157", "158", "159", "161", "162", "164", "165", "166", "168", "169", "170", "174", "175", "176", "177", "180", "181", "182", "183", "184", "186", "187", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "7", "70", "71", "73", "75", "8", "80", "81", "82", "83", "85", "87", "88", "89", "90", "91", "94", "95", "98", "99", "104", "108", "135", "18", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "160", "167", "17", "171", "172", "173", "178", "179", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 0.030959752321981428, 1.1194029850746268, 0.0879120879120879, 0.026281208935611037, 1.7857142857142856, 0.16251354279523295, 0.01915341888527102, 1.8001800180018002, 0.01614465611882467, 0.27932960893854747, 2.631578947368421, 0.07040600797934757, 0.03170577045022194, 0.6369426751592357, 0.19162332329592116, 1.5151515151515151, 0.022060445621001543, 0.044444444444444446, 0.25911210917256866, 0.19485580670303976, 0.1509813789632612, 0.6265664160401002, 1.3333333333333335, 1.8334606569900689, 0.48543689320388345, 0.10482180293501049, 0.4731488052992667, 0.38910505836575876, 1.3261210957948002, 11.179606797734088, 0.16381933068102036, 0.09564801530368246, 0.15408320493066258, 0.012711325791280032, 25.251256281407038, 3.75, 0.130718954248366, 1.6082294986960302, 0.38022813688212925, 0.025412960609911054, 0.250678922080635, 0.5918910920390648, 0.1352265043948614, 0.2883762200532387, 0.8665511265164645, 0.0485319097306479, 0.5867396831605711, 0.01882530120481928, 0.40417649040080833, 0.07336757153338225, 0.8547008547008548, 3.489499192245557, 0.13761467889908258, 22.03856749311295, 0.10086746015735323, 0.10156408693885843, 0.25597269624573377, 2.3359670216420474, 0.1310615989515072, 0.054945054945054944, 0.21253985122210414, 0.6975392365820577, 0.052083333333333336, 2.3801760678187156, 0.0643915003219575, 0.5820721769499418, 0.3232758620689655, 2.07667731629393, 0.09737098344693282, 0.1146131805157593, 0.5830009205277692, 0.01889287738522577, 0.029498525073746312, 1.3999164229001253, 0.026954177897574125, 0.07777259293824856, 0.03567606136282554, 0.13120899718837864, 0.33504578959124415, 0.6089604175728578, 0.836635843240863, 1.0788381742738589, 2.1150424985174934, 0.04315925766076824, 0.07789678675754626, 0.2491506228765572, 0.8224993366940834, 0.7874015748031495, 0.9978048293753742, 0.5996002664890073, 0.29505778214900413, 0.14691478942213515, 0.3534956794972506, 0.037678975131876416, 0.03664345914254306, 0.5344503827820309, 3.1978680879413726, 0.044007627988851404, 0.09629272989889263, 0.1779359430604982, 0.045187528242205156, 0.09206407659731174, 0.7308467741935484, 0.04962779156327543, 0.8764940239043826, 0.17491254372813594, 0.02337540906965872, 1.1464968152866242, 0.06357279084551812, 12.654392915404333, 0.1128668171557562, 6.478624944909652, 0.14516421702050444, 0.028477858465043433, 1.9297036526533424, 0.01858736059479554, 0.05564830272676684, 0.2434705621956618, 0.6076718571971136, 0.03254678600488201, 0.034916201117318434, 0.49532195927352773, 0.12903225806451613, 0.14248397055331277, 0.6134969325153374, 1.0619977037887485, 0.6738544474393532, 0.23715415019762848, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] }, { "marker": { "color": "rgb(31, 120, 180)" }, "name": "B", "text": [ 0, 0, 0, 0.052562417871222074, 0, 0, 0.15322735108216817, 0, 0, 0, 0.09746588693957114, 0, 0, 0.03352329869259135, 0, 0, 0, 0, 0.03454828122300915, 0, 0, 0.011392116655274549, 0.3660130718954248, 0.03819709702062643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.7407407407407408, 0, 0, 0, 0, 0, 0, 0, 0, 0.02426595486532395, 0, 0.03765060240963856, 0.033681374200067365, 0, 0, 0.06462035541195477, 0.022935779816513763, 0, 0.0403469840629413, 0.14218972171440178, 0, 0, 0.5242463958060288, 0, 0, 0.019376089905057157, 0, 0, 0, 0.11641443538998836, 0, 0, 0, 0, 0, 0, 2.47787610619469, 0.020894274968658588, 0, 0, 0, 0, 0.17869108778199688, 0, 0, 0, 0, 0, 0.019474196689386564, 0, 0.05306447333510214, 0, 0, 0, 0, 0, 0, 0.037678975131876416, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0398406374501992, 0, 0, 0, 0, 0, 0.02821670428893905, 0, 0, 0, 0.02297266253158741, 0.5204460966542751, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.02870264064293915, 0, 0, 0.04014452027298274, 0.06901311249137336, 3.28416365154467, 0.2795320426545191, 0.7992007992007992, 0.04482294935006724, 0.06188118811881188, 0.14691478942213515, 0.6885998469778117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "11", "110", "111", "112", "113", "114", "115", "116", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "137", "139", "14", "140", "141", "143", "144", "146", "147", "148", "149", "15", "150", "152", "153", "154", "155", "157", "158", "159", "161", "162", "164", "165", "166", "168", "169", "170", "174", "175", "176", "177", "180", "181", "182", "183", "184", "186", "187", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "7", "70", "71", "73", "75", "8", "80", "81", "82", "83", "85", "87", "88", "89", "90", "91", "94", "95", "98", "99", "104", "108", "135", "18", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "160", "167", "17", "171", "172", "173", "178", "179", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 0, 0, 0, 0.052562417871222074, 0, 0, 0.15322735108216817, 0, 0, 0, 0.09746588693957114, 0, 0, 0.03352329869259135, 0, 0, 0, 0, 0.03454828122300915, 0, 0, 0.011392116655274549, 0.3660130718954248, 0.03819709702062643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.7407407407407408, 0, 0, 0, 0, 0, 0, 0, 0, 0.02426595486532395, 0, 0.03765060240963856, 0.033681374200067365, 0, 0, 0.06462035541195477, 0.022935779816513763, 0, 0.0403469840629413, 0.14218972171440178, 0, 0, 0.5242463958060288, 0, 0, 0.019376089905057157, 0, 0, 0, 0.11641443538998836, 0, 0, 0, 0, 0, 0, 2.47787610619469, 0.020894274968658588, 0, 0, 0, 0, 0.17869108778199688, 0, 0, 0, 0, 0, 0.019474196689386564, 0, 0.05306447333510214, 0, 0, 0, 0, 0, 0, 0.037678975131876416, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0398406374501992, 0, 0, 0, 0, 0, 0.02821670428893905, 0, 0, 0, 0.02297266253158741, 0.5204460966542751, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.02870264064293915, 0, 0, 0.04014452027298274, 0.06901311249137336, 3.28416365154467, 0.2795320426545191, 0.7992007992007992, 0.04482294935006724, 0.06188118811881188, 0.14691478942213515, 0.6885998469778117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] }, { "marker": { "color": "rgb(178, 223, 138)" }, "name": "TCD4", "text": [ 13.93188854489164, 4.904051172707889, 0.8791208791208791, 1.1826544021024967, 2.2556390977443606, 0.3250270855904659, 1.991955564068186, 0.7200720072007201, 0.11301259283177267, 3.35195530726257, 0.1949317738791423, 3.9192677775170144, 1.077996195307546, 1.6426416359369762, 6.131946345469477, 2.0202020202020203, 1.3236267372600927, 1.1111111111111112, 12.160994990499223, 9.353078721745907, 2.7176648213387016, 1.1278195488721803, 14.143790849673202, 3.7815126050420167, 10.922330097087379, 6.184486373165619, 1.0172699313934233, 14.184648036788113, 3.78642470772989, 13.595468177274242, 0.5850690381465012, 1.0043041606886656, 2.6964560862865947, 2.4151519003432056, 24.183417085427138, 14.107142857142858, 0.34858387799564267, 0.7099391480730223, 5.069708491761723, 2.9987293519695046, 0.50135784416127, 7.990529742527375, 1.0818120351588911, 6.521739130434782, 1.6464471403812824, 13.758796408638679, 5.671816937218853, 0.5271084337349398, 0.5389019872010778, 0.9537784299339692, 3.9316239316239314, 3.5541195476575123, 1.743119266055046, 1.9283746556473829, 7.625579987895905, 1.360958764980703, 6.228668941979522, 6.9391961525249055, 0.655307994757536, 1.3186813186813187, 0.3188097768331562, 0.8331718659174578, 6.822916666666666, 1.3694163677861102, 0.901481004507405, 1.7462165308498252, 2.478448275862069, 2.4494142705005326, 2.044790652385589, 0.7736389684813754, 15.081313286284137, 0.49121481201587003, 0.14749262536873156, 4.9937317175094025, 4.285714285714286, 0.6999533364442371, 0.9275775954334641, 18.481724461105905, 12.698235425508154, 2.7838190517616357, 1.4971378247468077, 0.16597510373443983, 1.344139157936351, 0.02157962883038412, 0.3894839337877313, 5.458663646659117, 45.900769434863356, 60.23622047244095, 14.887248054280583, 2.9313790806129245, 1.1802311285960165, 4.521710741103494, 1.4532600157109192, 2.4868123587038435, 2.381824844265299, 1.314459049544995, 0.39973351099267157, 0.029338418659234266, 1.1073663938372653, 3.0249110320284696, 5.309534568459105, 2.1542993923770943, 1.7389112903225805, 0.5955334987593052, 0.6772908366533864, 5.022488755622189, 0.4908835904628331, 0.7825295723384895, 11.697393515575333, 3.6588207876951757, 2.3702031602708806, 3.1511679153812255, 0.32661948829613496, 10.024206179695287, 1.6540317022742934, 0.2788104089219331, 0, 2.058432934926959, 4.101785036080517, 7.518307567127747, 0.6983240223463687, 6.962025316455696, 7.677419354838709, 15.696984089289955, 0.2044989775051125, 1.9804822043628014, 21.293800539083556, 7.114624505928854, 6.784423926134083, 0.2070393374741201, 2.9223490119677153, 3.3957966663215657, 0.07492507492507493, 0.22411474675033619, 3.248762376237624, 0.2938295788442703, 0.07651109410864575, 0.45126353790613716, 0.17538731365097923, 3.5419915348629982, 1.8327067669172932, 0.6085192697768762, 0.12626262626262627, 2.686428902269569, 0.37735849056603776, 0.639749786750071, 0.35816618911174786, 0.09342883836810963, 3.3608310418576233, 5.575117370892019, 0.033681374200067365, 1.9677996422182469, 0.051150895140664954, 1.3948497854077253, 2.814191220685508, 0.47095761381475665, 0.25688930406352173, 0.43464762496119214, 1.2394366197183098, 0.26752273943285176, 9.090909090909092, 0.10162601626016261, 0.026048450117218028, 0.39913520705138866, 4.226859283039058, 0.5095541401273885, 0.18885741265344666, 0.8818342151675485, 0.14958863126402394, 2.552048354600403, 0.0992063492063492, 6.718682271348071, 0.6060606060606061, 3.8795303726391013, 6.315789473684211, 0, 0 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "11", "110", "111", "112", "113", "114", "115", "116", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "137", "139", "14", "140", "141", "143", "144", "146", "147", "148", "149", "15", "150", "152", "153", "154", "155", "157", "158", "159", "161", "162", "164", "165", "166", "168", "169", "170", "174", "175", "176", "177", "180", "181", "182", "183", "184", "186", "187", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "7", "70", "71", "73", "75", "8", "80", "81", "82", "83", "85", "87", "88", "89", "90", "91", "94", "95", "98", "99", "104", "108", "135", "18", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "160", "167", "17", "171", "172", "173", "178", "179", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 13.93188854489164, 4.904051172707889, 0.8791208791208791, 1.1826544021024967, 2.2556390977443606, 0.3250270855904659, 1.991955564068186, 0.7200720072007201, 0.11301259283177267, 3.35195530726257, 0.1949317738791423, 3.9192677775170144, 1.077996195307546, 1.6426416359369762, 6.131946345469477, 2.0202020202020203, 1.3236267372600927, 1.1111111111111112, 12.160994990499223, 9.353078721745907, 2.7176648213387016, 1.1278195488721803, 14.143790849673202, 3.7815126050420167, 10.922330097087379, 6.184486373165619, 1.0172699313934233, 14.184648036788113, 3.78642470772989, 13.595468177274242, 0.5850690381465012, 1.0043041606886656, 2.6964560862865947, 2.4151519003432056, 24.183417085427138, 14.107142857142858, 0.34858387799564267, 0.7099391480730223, 5.069708491761723, 2.9987293519695046, 0.50135784416127, 7.990529742527375, 1.0818120351588911, 6.521739130434782, 1.6464471403812824, 13.758796408638679, 5.671816937218853, 0.5271084337349398, 0.5389019872010778, 0.9537784299339692, 3.9316239316239314, 3.5541195476575123, 1.743119266055046, 1.9283746556473829, 7.625579987895905, 1.360958764980703, 6.228668941979522, 6.9391961525249055, 0.655307994757536, 1.3186813186813187, 0.3188097768331562, 0.8331718659174578, 6.822916666666666, 1.3694163677861102, 0.901481004507405, 1.7462165308498252, 2.478448275862069, 2.4494142705005326, 2.044790652385589, 0.7736389684813754, 15.081313286284137, 0.49121481201587003, 0.14749262536873156, 4.9937317175094025, 4.285714285714286, 0.6999533364442371, 0.9275775954334641, 18.481724461105905, 12.698235425508154, 2.7838190517616357, 1.4971378247468077, 0.16597510373443983, 1.344139157936351, 0.02157962883038412, 0.3894839337877313, 5.458663646659117, 45.900769434863356, 60.23622047244095, 14.887248054280583, 2.9313790806129245, 1.1802311285960165, 4.521710741103494, 1.4532600157109192, 2.4868123587038435, 2.381824844265299, 1.314459049544995, 0.39973351099267157, 0.029338418659234266, 1.1073663938372653, 3.0249110320284696, 5.309534568459105, 2.1542993923770943, 1.7389112903225805, 0.5955334987593052, 0.6772908366533864, 5.022488755622189, 0.4908835904628331, 0.7825295723384895, 11.697393515575333, 3.6588207876951757, 2.3702031602708806, 3.1511679153812255, 0.32661948829613496, 10.024206179695287, 1.6540317022742934, 0.2788104089219331, 0, 2.058432934926959, 4.101785036080517, 7.518307567127747, 0.6983240223463687, 6.962025316455696, 7.677419354838709, 15.696984089289955, 0.2044989775051125, 1.9804822043628014, 21.293800539083556, 7.114624505928854, 6.784423926134083, 0.2070393374741201, 2.9223490119677153, 3.3957966663215657, 0.07492507492507493, 0.22411474675033619, 3.248762376237624, 0.2938295788442703, 0.07651109410864575, 0.45126353790613716, 0.17538731365097923, 3.5419915348629982, 1.8327067669172932, 0.6085192697768762, 0.12626262626262627, 2.686428902269569, 0.37735849056603776, 0.639749786750071, 0.35816618911174786, 0.09342883836810963, 3.3608310418576233, 5.575117370892019, 0.033681374200067365, 1.9677996422182469, 0.051150895140664954, 1.3948497854077253, 2.814191220685508, 0.47095761381475665, 0.25688930406352173, 0.43464762496119214, 1.2394366197183098, 0.26752273943285176, 9.090909090909092, 0.10162601626016261, 0.026048450117218028, 0.39913520705138866, 4.226859283039058, 0.5095541401273885, 0.18885741265344666, 0.8818342151675485, 0.14958863126402394, 2.552048354600403, 0.0992063492063492, 6.718682271348071, 0.6060606060606061, 3.8795303726391013, 6.315789473684211, 0, 0 ] }, { "marker": { "color": "rgb(51, 160, 44)" }, "name": "TCD8", "text": [ 0.37151702786377705, 2.4520255863539444, 0.6593406593406593, 0.6307490144546649, 17.387218045112782, 6.121343445287107, 1.762114537444934, 29.072907290729074, 0.08072328059412334, 3.55147645650439, 2.923976608187134, 0.21121802393804273, 0.03170577045022194, 17.063359034528997, 0.3011223651793047, 1.0101010101010102, 0.1985440105890139, 0.26666666666666666, 0.9328035930212472, 0.03897116134060795, 0.20130850528434827, 1.948051948051948, 1.1764705882352942, 0.2291825821237586, 0.24271844660194172, 1.1530398322851152, 1.230186893778093, 0.21223912274495935, 0.24428546501483162, 0.4998333888703766, 0, 1.0521281683405068, 0.23112480739599386, 0.07626795474768018, 0.37688442211055273, 1.875, 7.363834422657953, 0.3911909591422776, 0.19011406844106463, 0.20330368487928843, 0.9609358679757677, 0.739863865048831, 0.23664638269100743, 1.4640638864241349, 0.6932409012131715, 0.5823829167677749, 0.8214355564247995, 0.1694277108433735, 5.826877736611654, 0, 0.927960927960928, 3.1825525040387723, 0.06880733944954129, 11.937557392102846, 0.0403469840629413, 0.28437944342880356, 0.6825938566552902, 0.7214015802129852, 0.1310615989515072, 0.21978021978021978, 0.10626992561105207, 0.019376089905057157, 0, 2.41278121943267, 0.19317450096587252, 0.46565774155995343, 0.16163793103448276, 0.05324813631522897, 0.9737098344693282, 0.6017191977077364, 3.958269407793802, 0.4345361798601928, 12.271386430678465, 15.670706226493941, 0.4582210242587601, 0, 0.8205494113449875, 2.7741330834114337, 7.013625195443378, 1.4354066985645932, 19.154557463672393, 71.45228215767635, 25.677011267048822, 1.294777729823047, 0.4089581304771178, 0.7927519818799547, 0.02653223666755107, 2.3622047244094486, 9.5988824585911, 0.6662225183211192, 0.34423407917383825, 0.3917727717923604, 0.864100549882168, 1.5071590052750565, 1.667277390985709, 0.10111223458038424, 1.4434821230290917, 16.62021417045621, 0.9950248756218906, 6.93950177935943, 0.11296882060551287, 1.8228687166267723, 1.033266129032258, 7.626137303556659, 0.5179282868525896, 1.5492253873063468, 0.02337540906965872, 1.4194722474977253, 1.9707565162110616, 4.474481472850152, 3.470654627539503, 12.5605993829881, 2.558519324986391, 0.25630072618539085, 4.387778543533195, 2.5650557620817844, 26.26599888703395, 0.15493581230633025, 0.41777440182301556, 0.32546786004882017, 0.13966480446927373, 0.4678040726472207, 0.25806451612903225, 2.3509855141296603, 10.429447852760736, 4.7646383467278985, 1.940700808625337, 1.8181818181818181, 1.204335608189482, 0, 0.11132758140829391, 4.089450253649446, 0.12487512487512488, 2.3756163155535632, 0.8353960396039605, 0.3428011753183154, 0, 27.707581227436823, 1.929260450160772, 0.06683002895967921, 1.3157894736842104, 0, 0.5050505050505051, 0, 0.25157232704402516, 0.5828831390389536, 0.14326647564469913, 0.21800062285892244, 0.5346776657500764, 1.643192488262911, 0, 0.17889087656529518, 0, 0.1072961373390558, 1.0944076969332532, 7.064364207221351, 0.14012143858010276, 0.3104625892579944, 2.873239436619718, 11.021936864633494, 2.272727272727273, 5.7926829268292686, 0.3125814014066163, 1.1308830866456012, 7.704654895666131, 0.12738853503184713, 0.09442870632672333, 0.5291005291005291, 1.6828721017202692, 0.1343183344526528, 0, 1.1847998844097674, 54.54545454545454, 0.10209290454313426, 1.3793103448275863, 4.634040710264184, 7.419354838709677 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "11", "110", "111", "112", "113", "114", "115", "116", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "137", "139", "14", "140", "141", "143", "144", "146", "147", "148", "149", "15", "150", "152", "153", "154", "155", "157", "158", "159", "161", "162", "164", "165", "166", "168", "169", "170", "174", "175", "176", "177", "180", "181", "182", "183", "184", "186", "187", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "7", "70", "71", "73", "75", "8", "80", "81", "82", "83", "85", "87", "88", "89", "90", "91", "94", "95", "98", "99", "104", "108", "135", "18", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "160", "167", "17", "171", "172", "173", "178", "179", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 0.37151702786377705, 2.4520255863539444, 0.6593406593406593, 0.6307490144546649, 17.387218045112782, 6.121343445287107, 1.762114537444934, 29.072907290729074, 0.08072328059412334, 3.55147645650439, 2.923976608187134, 0.21121802393804273, 0.03170577045022194, 17.063359034528997, 0.3011223651793047, 1.0101010101010102, 0.1985440105890139, 0.26666666666666666, 0.9328035930212472, 0.03897116134060795, 0.20130850528434827, 1.948051948051948, 1.1764705882352942, 0.2291825821237586, 0.24271844660194172, 1.1530398322851152, 1.230186893778093, 0.21223912274495935, 0.24428546501483162, 0.4998333888703766, 0, 1.0521281683405068, 0.23112480739599386, 0.07626795474768018, 0.37688442211055273, 1.875, 7.363834422657953, 0.3911909591422776, 0.19011406844106463, 0.20330368487928843, 0.9609358679757677, 0.739863865048831, 0.23664638269100743, 1.4640638864241349, 0.6932409012131715, 0.5823829167677749, 0.8214355564247995, 0.1694277108433735, 5.826877736611654, 0, 0.927960927960928, 3.1825525040387723, 0.06880733944954129, 11.937557392102846, 0.0403469840629413, 0.28437944342880356, 0.6825938566552902, 0.7214015802129852, 0.1310615989515072, 0.21978021978021978, 0.10626992561105207, 0.019376089905057157, 0, 2.41278121943267, 0.19317450096587252, 0.46565774155995343, 0.16163793103448276, 0.05324813631522897, 0.9737098344693282, 0.6017191977077364, 3.958269407793802, 0.4345361798601928, 12.271386430678465, 15.670706226493941, 0.4582210242587601, 0, 0.8205494113449875, 2.7741330834114337, 7.013625195443378, 1.4354066985645932, 19.154557463672393, 71.45228215767635, 25.677011267048822, 1.294777729823047, 0.4089581304771178, 0.7927519818799547, 0.02653223666755107, 2.3622047244094486, 9.5988824585911, 0.6662225183211192, 0.34423407917383825, 0.3917727717923604, 0.864100549882168, 1.5071590052750565, 1.667277390985709, 0.10111223458038424, 1.4434821230290917, 16.62021417045621, 0.9950248756218906, 6.93950177935943, 0.11296882060551287, 1.8228687166267723, 1.033266129032258, 7.626137303556659, 0.5179282868525896, 1.5492253873063468, 0.02337540906965872, 1.4194722474977253, 1.9707565162110616, 4.474481472850152, 3.470654627539503, 12.5605993829881, 2.558519324986391, 0.25630072618539085, 4.387778543533195, 2.5650557620817844, 26.26599888703395, 0.15493581230633025, 0.41777440182301556, 0.32546786004882017, 0.13966480446927373, 0.4678040726472207, 0.25806451612903225, 2.3509855141296603, 10.429447852760736, 4.7646383467278985, 1.940700808625337, 1.8181818181818181, 1.204335608189482, 0, 0.11132758140829391, 4.089450253649446, 0.12487512487512488, 2.3756163155535632, 0.8353960396039605, 0.3428011753183154, 0, 27.707581227436823, 1.929260450160772, 0.06683002895967921, 1.3157894736842104, 0, 0.5050505050505051, 0, 0.25157232704402516, 0.5828831390389536, 0.14326647564469913, 0.21800062285892244, 0.5346776657500764, 1.643192488262911, 0, 0.17889087656529518, 0, 0.1072961373390558, 1.0944076969332532, 7.064364207221351, 0.14012143858010276, 0.3104625892579944, 2.873239436619718, 11.021936864633494, 2.272727272727273, 5.7926829268292686, 0.3125814014066163, 1.1308830866456012, 7.704654895666131, 0.12738853503184713, 0.09442870632672333, 0.5291005291005291, 1.6828721017202692, 0.1343183344526528, 0, 1.1847998844097674, 54.54545454545454, 0.10209290454313426, 1.3793103448275863, 4.634040710264184, 7.419354838709677 ] }, { "marker": { "color": "rgb(251, 154, 153)" }, "name": "M1", "text": [ 2.5851393188854486, 0, 0.13186813186813187, 0.1314060446780552, 0.21929824561403508, 0.16251354279523295, 0.03830683777054204, 0.6300630063006301, 0, 0.03990422984836393, 0.9746588693957114, 0, 0.07926442612555486, 0, 0.32849712565015055, 0, 0.06618133686300463, 0, 0.0690965624460183, 0, 0.050327126321087066, 0.011392116655274549, 0.052287581699346414, 0, 0, 0, 0.02365744026496333, 0.035373187124159884, 0.034897923573547374, 3.9986671109630127, 0, 0.04782400765184123, 0.07704160246533129, 0.025422651582560064, 19.28391959798995, 0.8928571428571428, 0.261437908496732, 0, 0.06337135614702154, 0, 0.020889910173386254, 8.13850251553714, 0.23664638269100743, 0.4658385093167702, 0, 1.480223246784761, 0.019557989438685704, 0, 0.06736274840013473, 0, 0, 0.12924071082390953, 0.022935779816513763, 0, 0.0806939681258826, 0.14218972171440178, 0, 0.034352456200618345, 0, 0.054945054945054944, 0, 0.27126525867080026, 0.052083333333333336, 0.39126181936746, 0.128783000643915, 0, 0, 0.6922257720979765, 1.7526777020447908, 0.05730659025787965, 0.04602638846271863, 0, 2.0648967551622417, 0, 0, 0.04666355576294914, 0.03567606136282554, 0.056232427366447985, 0.5807460352914898, 0, 0, 2.1576763485477177, 0.0197667523225934, 0, 0.07789678675754626, 0, 0.02653223666755107, 0, 0.9978048293753742, 0, 0, 0, 0.1178318931657502, 2.93896006028636, 0.09160864785635764, 0.36111512350137226, 0, 0.044007627988851404, 0, 0, 0.022593764121102578, 0.055238445958387034, 0.12600806451612903, 0.016542597187758478, 0, 0.29985007496251875, 0.04675081813931744, 0.07279344858962694, 0, 0.3262642740619902, 0, 0.3085059497576025, 0.07258210851025222, 0, 0.13783597518952445, 0.5390334572490706, 0.1669449081803005, 0.04426737494466578, 0.7785795670338017, 0.09764035801464606, 0.034916201117318434, 0.6053935057787562, 0.25806451612903225, 0.04749465685110425, 0, 0.14351320321469577, 1.9676549865229112, 0.3952569169960474, 0.04014452027298274, 0.06901311249137336, 0, 0.01035303861683404, 0, 0, 3.125, 0, 0, 0, 0, 0.022276676319893073, 0, 0.10141987829614604, 0.06313131313131314, 0.09263547938860583, 0, 0, 0, 0.06228589224540642, 0.030553009471432937, 1.4671361502347418, 0, 6.350626118067979, 0, 0, 0, 0.15698587127158556, 0.023353573096683792, 0.03104625892579944, 0, 0, 2.272727272727273, 0.1524390243902439, 0.052096900234436055, 0.2827207716614003, 0.2140181915462814, 0, 0.09442870632672333, 0, 0.1869857890800299, 0.2686366689053056, 0, 0, 0.1652892561983471, 0.10209290454313426, 0, 0.3897791251624079, 0.967741935483871 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "11", "110", "111", "112", "113", "114", "115", "116", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "137", "139", "14", "140", "141", "143", "144", "146", "147", "148", "149", "15", "150", "152", "153", "154", "155", "157", "158", "159", "161", "162", "164", "165", "166", "168", "169", "170", "174", "175", "176", "177", "180", "181", "182", "183", "184", "186", "187", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "7", "70", "71", "73", "75", "8", "80", "81", "82", "83", "85", "87", "88", "89", "90", "91", "94", "95", "98", "99", "104", "108", "135", "18", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "160", "167", "17", "171", "172", "173", "178", "179", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 2.5851393188854486, 0, 0.13186813186813187, 0.1314060446780552, 0.21929824561403508, 0.16251354279523295, 0.03830683777054204, 0.6300630063006301, 0, 0.03990422984836393, 0.9746588693957114, 0, 0.07926442612555486, 0, 0.32849712565015055, 0, 0.06618133686300463, 0, 0.0690965624460183, 0, 0.050327126321087066, 0.011392116655274549, 0.052287581699346414, 0, 0, 0, 0.02365744026496333, 0.035373187124159884, 0.034897923573547374, 3.9986671109630127, 0, 0.04782400765184123, 0.07704160246533129, 0.025422651582560064, 19.28391959798995, 0.8928571428571428, 0.261437908496732, 0, 0.06337135614702154, 0, 0.020889910173386254, 8.13850251553714, 0.23664638269100743, 0.4658385093167702, 0, 1.480223246784761, 0.019557989438685704, 0, 0.06736274840013473, 0, 0, 0.12924071082390953, 0.022935779816513763, 0, 0.0806939681258826, 0.14218972171440178, 0, 0.034352456200618345, 0, 0.054945054945054944, 0, 0.27126525867080026, 0.052083333333333336, 0.39126181936746, 0.128783000643915, 0, 0, 0.6922257720979765, 1.7526777020447908, 0.05730659025787965, 0.04602638846271863, 0, 2.0648967551622417, 0, 0, 0.04666355576294914, 0.03567606136282554, 0.056232427366447985, 0.5807460352914898, 0, 0, 2.1576763485477177, 0.0197667523225934, 0, 0.07789678675754626, 0, 0.02653223666755107, 0, 0.9978048293753742, 0, 0, 0, 0.1178318931657502, 2.93896006028636, 0.09160864785635764, 0.36111512350137226, 0, 0.044007627988851404, 0, 0, 0.022593764121102578, 0.055238445958387034, 0.12600806451612903, 0.016542597187758478, 0, 0.29985007496251875, 0.04675081813931744, 0.07279344858962694, 0, 0.3262642740619902, 0, 0.3085059497576025, 0.07258210851025222, 0, 0.13783597518952445, 0.5390334572490706, 0.1669449081803005, 0.04426737494466578, 0.7785795670338017, 0.09764035801464606, 0.034916201117318434, 0.6053935057787562, 0.25806451612903225, 0.04749465685110425, 0, 0.14351320321469577, 1.9676549865229112, 0.3952569169960474, 0.04014452027298274, 0.06901311249137336, 0, 0.01035303861683404, 0, 0, 3.125, 0, 0, 0, 0, 0.022276676319893073, 0, 0.10141987829614604, 0.06313131313131314, 0.09263547938860583, 0, 0, 0, 0.06228589224540642, 0.030553009471432937, 1.4671361502347418, 0, 6.350626118067979, 0, 0, 0, 0.15698587127158556, 0.023353573096683792, 0.03104625892579944, 0, 0, 2.272727272727273, 0.1524390243902439, 0.052096900234436055, 0.2827207716614003, 0.2140181915462814, 0, 0.09442870632672333, 0, 0.1869857890800299, 0.2686366689053056, 0, 0, 0.1652892561983471, 0.10209290454313426, 0, 0.3897791251624079, 0.967741935483871 ] }, { "marker": { "color": "rgb(227, 26, 28)" }, "name": "M2", "text": [ 1.5479876160990713, 0.15991471215351813, 0.04395604395604395, 0.026281208935611037, 0, 0.16251354279523295, 0, 1.4401440144014401, 0, 0.11971268954509177, 0.29239766081871343, 0, 0.03170577045022194, 0, 0.08212428141253764, 0, 0, 0.044444444444444446, 0, 0.03897116134060795, 0, 0.03417634996582365, 0.0784313725490196, 0.03819709702062643, 0, 0, 0, 0.035373187124159884, 0.034897923573547374, 0.049983338887037654, 0, 0.04782400765184123, 0.30816640986132515, 0.012711325791280032, 2.386934673366834, 0.08928571428571429, 0.08714596949891067, 0, 0.12674271229404308, 0, 0.04177982034677251, 0.08878366380585972, 0.03380662609871535, 0.022182786157941437, 0, 0.3397233681145353, 0, 0.01882530120481928, 0.23576961940047153, 0, 0, 0.08077544426494346, 0, 0, 0.0403469840629413, 0, 0.3412969283276451, 0, 0.655307994757536, 0, 0, 0, 0, 2.184545158134985, 0, 0.3492433061699651, 0.05387931034482758, 0.5857294994675186, 0.4868549172346641, 0.2292263610315186, 0, 0, 0.029498525073746312, 0.06268282490597576, 0, 0.031109037175299427, 0, 0, 0.16752289479562207, 0.04349717268377556, 0.08806693086745927, 1.0788381742738589, 0, 0, 0.07789678675754626, 0, 0.10612894667020428, 0, 0.23947315905008978, 0, 0, 0.04897159647404505, 0, 0.22607385079125847, 0, 0.01444460494005489, 0, 0.029338418659234266, 0, 0, 0.11296882060551287, 0.018412815319462345, 0, 0.5128205128205128, 0, 0.12493753123438281, 0, 0.03639672429481347, 0, 0.745746912141692, 0.4514672686230248, 0.37461436756280303, 0.07258210851025222, 0, 0.1837813002526993, 0.966542750929368, 0.4451864218141347, 0.02213368747233289, 0.3038359285985568, 0.5044751830756713, 0.10474860335195531, 0.2201430930104568, 0.8387096774193548, 0.5224412253621468, 0, 1.2629161882893225, 1.8867924528301887, 0.3952569169960474, 0.08028904054596547, 0, 0, 0, 0.04995004995004995, 0.08964589870013448, 0.09282178217821782, 0, 0, 0, 0.029231218941829874, 0, 0.046992481203007516, 0.3042596348884381, 0, 0, 0, 0.04264998578333807, 0, 0.03114294612270321, 0, 0.05868544600938967, 0, 0.08944543828264759, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.35569105691056907, 0, 0.09978380176284717, 1.0165864098448367, 0.06369426751592357, 0.3777148253068933, 0, 0.037397157816005985, 0.0671591672263264, 0, 0.014448779078167894, 1.3774104683195594, 0.05104645227156713, 0, 0.6929406669553919, 4.838709677419355 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "11", "110", "111", "112", "113", "114", "115", "116", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "137", "139", "14", "140", "141", "143", "144", "146", "147", "148", "149", "15", "150", "152", "153", "154", "155", "157", "158", "159", "161", "162", "164", "165", "166", "168", "169", "170", "174", "175", "176", "177", "180", "181", "182", "183", "184", "186", "187", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "7", "70", "71", "73", "75", "8", "80", "81", "82", "83", "85", "87", "88", "89", "90", "91", "94", "95", "98", "99", "104", "108", "135", "18", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "160", "167", "17", "171", "172", "173", "178", "179", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 1.5479876160990713, 0.15991471215351813, 0.04395604395604395, 0.026281208935611037, 0, 0.16251354279523295, 0, 1.4401440144014401, 0, 0.11971268954509177, 0.29239766081871343, 0, 0.03170577045022194, 0, 0.08212428141253764, 0, 0, 0.044444444444444446, 0, 0.03897116134060795, 0, 0.03417634996582365, 0.0784313725490196, 0.03819709702062643, 0, 0, 0, 0.035373187124159884, 0.034897923573547374, 0.049983338887037654, 0, 0.04782400765184123, 0.30816640986132515, 0.012711325791280032, 2.386934673366834, 0.08928571428571429, 0.08714596949891067, 0, 0.12674271229404308, 0, 0.04177982034677251, 0.08878366380585972, 0.03380662609871535, 0.022182786157941437, 0, 0.3397233681145353, 0, 0.01882530120481928, 0.23576961940047153, 0, 0, 0.08077544426494346, 0, 0, 0.0403469840629413, 0, 0.3412969283276451, 0, 0.655307994757536, 0, 0, 0, 0, 2.184545158134985, 0, 0.3492433061699651, 0.05387931034482758, 0.5857294994675186, 0.4868549172346641, 0.2292263610315186, 0, 0, 0.029498525073746312, 0.06268282490597576, 0, 0.031109037175299427, 0, 0, 0.16752289479562207, 0.04349717268377556, 0.08806693086745927, 1.0788381742738589, 0, 0, 0.07789678675754626, 0, 0.10612894667020428, 0, 0.23947315905008978, 0, 0, 0.04897159647404505, 0, 0.22607385079125847, 0, 0.01444460494005489, 0, 0.029338418659234266, 0, 0, 0.11296882060551287, 0.018412815319462345, 0, 0.5128205128205128, 0, 0.12493753123438281, 0, 0.03639672429481347, 0, 0.745746912141692, 0.4514672686230248, 0.37461436756280303, 0.07258210851025222, 0, 0.1837813002526993, 0.966542750929368, 0.4451864218141347, 0.02213368747233289, 0.3038359285985568, 0.5044751830756713, 0.10474860335195531, 0.2201430930104568, 0.8387096774193548, 0.5224412253621468, 0, 1.2629161882893225, 1.8867924528301887, 0.3952569169960474, 0.08028904054596547, 0, 0, 0, 0.04995004995004995, 0.08964589870013448, 0.09282178217821782, 0, 0, 0, 0.029231218941829874, 0, 0.046992481203007516, 0.3042596348884381, 0, 0, 0, 0.04264998578333807, 0, 0.03114294612270321, 0, 0.05868544600938967, 0, 0.08944543828264759, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.35569105691056907, 0, 0.09978380176284717, 1.0165864098448367, 0.06369426751592357, 0.3777148253068933, 0, 0.037397157816005985, 0.0671591672263264, 0, 0.014448779078167894, 1.3774104683195594, 0.05104645227156713, 0, 0.6929406669553919, 4.838709677419355 ] }, { "marker": { "color": "rgb(253, 191, 111)" }, "name": "Treg", "text": [ 0.07739938080495357, 0.053304904051172705, 0, 0, 0.03132832080200501, 0, 0, 0, 0, 0.03990422984836393, 0.09746588693957114, 0.16428068528514433, 0, 0.1340931947703654, 0.027374760470845878, 0, 0, 0, 0.03454828122300915, 0, 0.10065425264217413, 0, 0.026143790849673207, 0, 0.08090614886731393, 0, 0.02365744026496333, 0.14149274849663954, 0, 0.049983338887037654, 0, 0.09564801530368246, 0.15408320493066258, 0, 0.18844221105527637, 0, 0.17429193899782133, 0, 0, 0.20330368487928843, 0, 0, 0, 0, 0, 0.07279786459597186, 0, 0.01882530120481928, 0, 0, 0, 0, 0.022935779816513763, 0, 0.0403469840629413, 0.020312817387771683, 0.3412969283276451, 0.034352456200618345, 0.2621231979030144, 0, 0, 0, 0, 0, 0, 0, 0.21551724137931033, 0.05324813631522897, 0, 0.05730659025787965, 0.0613685179502915, 0, 0, 0.020894274968658588, 0.026954177897574125, 0, 0, 0.09372071227741331, 0, 0.04349717268377556, 0, 0.08298755186721991, 0, 0, 0.03894839337877313, 0, 0.02653223666755107, 0.7874015748031495, 0.6385950908002395, 0.06662225183211193, 0, 0, 0, 0, 0.01832172957127153, 0, 0, 0, 0, 0.1779359430604982, 0, 0, 0, 0.033085194375516956, 0.0398406374501992, 0, 0.02337540906965872, 0, 0, 0.04660918200885575, 0.02821670428893905, 0.4627589246364037, 0, 0.056955716930086865, 0, 0.01858736059479554, 0, 0.02213368747233289, 0, 0, 0, 0.13758943313153552, 0.12903225806451613, 0.04749465685110425, 0, 0.02870264064293915, 0.05390835579514825, 0, 0.12043356081894822, 0, 0, 0.02070607723366808, 0.04995004995004995, 0, 0.03094059405940594, 0, 0, 0, 0, 0.022276676319893073, 0, 0.10141987829614604, 0, 0, 0, 0, 0, 0, 0.015276504735716468, 0, 0, 0, 0, 0.2145922746781116, 0, 0, 0, 0.03104625892579944, 0, 0, 2.272727272727273, 0, 0, 0, 0, 0, 0, 0, 0.037397157816005985, 0, 0, 0.014448779078167894, 0.055096418732782364, 0, 0.03629764065335753, 0.043308791684711995, 0 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "11", "110", "111", "112", "113", "114", "115", "116", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "137", "139", "14", "140", "141", "143", "144", "146", "147", "148", "149", "15", "150", "152", "153", "154", "155", "157", "158", "159", "161", "162", "164", "165", "166", "168", "169", "170", "174", "175", "176", "177", "180", "181", "182", "183", "184", "186", "187", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "7", "70", "71", "73", "75", "8", "80", "81", "82", "83", "85", "87", "88", "89", "90", "91", "94", "95", "98", "99", "104", "108", "135", "18", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "160", "167", "17", "171", "172", "173", "178", "179", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 0.07739938080495357, 0.053304904051172705, 0, 0, 0.03132832080200501, 0, 0, 0, 0, 0.03990422984836393, 0.09746588693957114, 0.16428068528514433, 0, 0.1340931947703654, 0.027374760470845878, 0, 0, 0, 0.03454828122300915, 0, 0.10065425264217413, 0, 0.026143790849673207, 0, 0.08090614886731393, 0, 0.02365744026496333, 0.14149274849663954, 0, 0.049983338887037654, 0, 0.09564801530368246, 0.15408320493066258, 0, 0.18844221105527637, 0, 0.17429193899782133, 0, 0, 0.20330368487928843, 0, 0, 0, 0, 0, 0.07279786459597186, 0, 0.01882530120481928, 0, 0, 0, 0, 0.022935779816513763, 0, 0.0403469840629413, 0.020312817387771683, 0.3412969283276451, 0.034352456200618345, 0.2621231979030144, 0, 0, 0, 0, 0, 0, 0, 0.21551724137931033, 0.05324813631522897, 0, 0.05730659025787965, 0.0613685179502915, 0, 0, 0.020894274968658588, 0.026954177897574125, 0, 0, 0.09372071227741331, 0, 0.04349717268377556, 0, 0.08298755186721991, 0, 0, 0.03894839337877313, 0, 0.02653223666755107, 0.7874015748031495, 0.6385950908002395, 0.06662225183211193, 0, 0, 0, 0, 0.01832172957127153, 0, 0, 0, 0, 0.1779359430604982, 0, 0, 0, 0.033085194375516956, 0.0398406374501992, 0, 0.02337540906965872, 0, 0, 0.04660918200885575, 0.02821670428893905, 0.4627589246364037, 0, 0.056955716930086865, 0, 0.01858736059479554, 0, 0.02213368747233289, 0, 0, 0, 0.13758943313153552, 0.12903225806451613, 0.04749465685110425, 0, 0.02870264064293915, 0.05390835579514825, 0, 0.12043356081894822, 0, 0, 0.02070607723366808, 0.04995004995004995, 0, 0.03094059405940594, 0, 0, 0, 0, 0.022276676319893073, 0, 0.10141987829614604, 0, 0, 0, 0, 0, 0, 0.015276504735716468, 0, 0, 0, 0, 0.2145922746781116, 0, 0, 0, 0.03104625892579944, 0, 0, 2.272727272727273, 0, 0, 0, 0, 0, 0, 0, 0.037397157816005985, 0, 0, 0.014448779078167894, 0.055096418732782364, 0, 0.03629764065335753, 0.043308791684711995, 0 ] }, { "marker": { "color": "rgb(1.0, 0.4980392156862745, 0.0)" }, "name": "IMMUNE_OTHER", "text": [ 0.43343653250773995, 1.5991471215351813, 1.054945054945055, 0.9986859395532195, 2.443609022556391, 2.654387865655471, 1.742961118559663, 7.380738073807381, 0.4197610590894414, 1.5163607342378291, 3.8011695906432745, 2.1825862473597746, 0.30120481927710846, 4.793831713040563, 0.6022447303586094, 0.5050505050505051, 0.37502757555702626, 1.2, 6.045949214026603, 1.0522213561964147, 0.9562154001006542, 1.9366598313966734, 6.431372549019608, 2.2536287242169597, 1.132686084142395, 2.515723270440252, 0.63875088715401, 0.3537318712415989, 0.9596928982725527, 0.733088970343219, 1.8956236835946643, 1.3390722142515543, 0.3852080123266564, 0.6737002669378416, 0.37688442211055273, 2.232142857142857, 4.488017429193899, 0.275282526803825, 3.2953105196451205, 0.8640406607369758, 0.6893670357217464, 7.8425569695176085, 0.6423258958755916, 2.085181898846495, 4.419410745233969, 6.867265226886678, 1.388617250146685, 1.8072289156626504, 2.9976423038059954, 0, 1.05006105006105, 2.245557350565428, 0.7110091743119267, 4.40771349862259, 0.685898729070002, 0.7312614259597806, 0.6825938566552902, 0.5839917554105118, 0.1310615989515072, 2.5274725274725274, 0.5313496280552604, 0.019376089905057157, 1.4583333333333333, 2.4779915226605804, 0.7726980038634901, 9.31315483119907, 0.43103448275862066, 0.05324813631522897, 1.7526777020447908, 1.2893982808022924, 0.981896287204664, 2.871717362554317, 1.6814159292035398, 3.238612620142081, 0.40431266846361186, 0.15554518587649713, 3.2108455226542985, 1.3870665417057169, 1.3625195443377263, 1.1309264897781643, 9.64332892998679, 5.892116182572614, 7.96600118600514, 1.7911091929218816, 0.7984420642648491, 1.0192525481313703, 0.6102414433536747, 0.7874015748031495, 4.170824186789064, 0.4663557628247834, 0.09835259404966806, 1.305909239307868, 0.3534956794972506, 2.0723436322532027, 1.2092341517039207, 2.5278058645096055, 1.6655562958027983, 4.987531172069826, 0.6900978976087305, 1.0676156583629894, 1.6041572525982828, 1.067943288528816, 4.057459677419355, 3.391232423490488, 6.135458167330677, 1.9740129935032484, 0.23375409069658717, 4.112829845313922, 0.6993006993006993, 6.688417618270799, 2.5677200902934536, 11.943587483472895, 2.7399745962620217, 0.39869001851060804, 2.3661842407535034, 7.862453531598514, 10.684474123539232, 1.1730854360336431, 5.867831371059628, 3.254678600488202, 1.291899441340782, 5.338470005503577, 0.25806451612903225, 2.7546900973640467, 6.5439672801636, 15.757749712973594, 2.183288409703504, 0.9486166007905139, 2.769971898835809, 0.4830917874396135, 1.057612023378792, 0.8593022051972253, 1.4735264735264737, 1.8825638727028238, 1.8254950495049505, 0.832517140058766, 6.809487375669472, 3.8808664259927803, 1.4907921660333234, 1.70416573847182, 0.9868421052631579, 1.1156186612576064, 1.6203703703703702, 0.7874015748031495, 1.509433962264151, 1.6917827694057437, 2.148997134670487, 0.9342883836810962, 0.4277421326000611, 3.931924882629108, 0.40417649040080833, 0.9838998211091234, 0.1534526854219949, 0.3218884120171674, 2.1286831028262174, 4.23861852433281, 0.39701074264362446, 0.37255510710959333, 0.7887323943661971, 4.5478865703584805, 0, 2.9471544715447155, 0.5209690023443605, 0.7982704141027773, 1.9796682718031033, 0.1910828025477707, 1.2275731822474032, 1.9400352733686066, 4.18848167539267, 0.5372733378106112, 1.3888888888888888, 0.5201560468140443, 10.137741046831957, 0.20418580908626852, 2.0326678765880217, 2.468601126028584, 1.2903225806451613 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "11", "110", "111", "112", "113", "114", "115", "116", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "137", "139", "14", "140", "141", "143", "144", "146", "147", "148", "149", "15", "150", "152", "153", "154", "155", "157", "158", "159", "161", "162", "164", "165", "166", "168", "169", "170", "174", "175", "176", "177", "180", "181", "182", "183", "184", "186", "187", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "7", "70", "71", "73", "75", "8", "80", "81", "82", "83", "85", "87", "88", "89", "90", "91", "94", "95", "98", "99", "104", "108", "135", "18", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "160", "167", "17", "171", "172", "173", "178", "179", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 0.43343653250773995, 1.5991471215351813, 1.054945054945055, 0.9986859395532195, 2.443609022556391, 2.654387865655471, 1.742961118559663, 7.380738073807381, 0.4197610590894414, 1.5163607342378291, 3.8011695906432745, 2.1825862473597746, 0.30120481927710846, 4.793831713040563, 0.6022447303586094, 0.5050505050505051, 0.37502757555702626, 1.2, 6.045949214026603, 1.0522213561964147, 0.9562154001006542, 1.9366598313966734, 6.431372549019608, 2.2536287242169597, 1.132686084142395, 2.515723270440252, 0.63875088715401, 0.3537318712415989, 0.9596928982725527, 0.733088970343219, 1.8956236835946643, 1.3390722142515543, 0.3852080123266564, 0.6737002669378416, 0.37688442211055273, 2.232142857142857, 4.488017429193899, 0.275282526803825, 3.2953105196451205, 0.8640406607369758, 0.6893670357217464, 7.8425569695176085, 0.6423258958755916, 2.085181898846495, 4.419410745233969, 6.867265226886678, 1.388617250146685, 1.8072289156626504, 2.9976423038059954, 0, 1.05006105006105, 2.245557350565428, 0.7110091743119267, 4.40771349862259, 0.685898729070002, 0.7312614259597806, 0.6825938566552902, 0.5839917554105118, 0.1310615989515072, 2.5274725274725274, 0.5313496280552604, 0.019376089905057157, 1.4583333333333333, 2.4779915226605804, 0.7726980038634901, 9.31315483119907, 0.43103448275862066, 0.05324813631522897, 1.7526777020447908, 1.2893982808022924, 0.981896287204664, 2.871717362554317, 1.6814159292035398, 3.238612620142081, 0.40431266846361186, 0.15554518587649713, 3.2108455226542985, 1.3870665417057169, 1.3625195443377263, 1.1309264897781643, 9.64332892998679, 5.892116182572614, 7.96600118600514, 1.7911091929218816, 0.7984420642648491, 1.0192525481313703, 0.6102414433536747, 0.7874015748031495, 4.170824186789064, 0.4663557628247834, 0.09835259404966806, 1.305909239307868, 0.3534956794972506, 2.0723436322532027, 1.2092341517039207, 2.5278058645096055, 1.6655562958027983, 4.987531172069826, 0.6900978976087305, 1.0676156583629894, 1.6041572525982828, 1.067943288528816, 4.057459677419355, 3.391232423490488, 6.135458167330677, 1.9740129935032484, 0.23375409069658717, 4.112829845313922, 0.6993006993006993, 6.688417618270799, 2.5677200902934536, 11.943587483472895, 2.7399745962620217, 0.39869001851060804, 2.3661842407535034, 7.862453531598514, 10.684474123539232, 1.1730854360336431, 5.867831371059628, 3.254678600488202, 1.291899441340782, 5.338470005503577, 0.25806451612903225, 2.7546900973640467, 6.5439672801636, 15.757749712973594, 2.183288409703504, 0.9486166007905139, 2.769971898835809, 0.4830917874396135, 1.057612023378792, 0.8593022051972253, 1.4735264735264737, 1.8825638727028238, 1.8254950495049505, 0.832517140058766, 6.809487375669472, 3.8808664259927803, 1.4907921660333234, 1.70416573847182, 0.9868421052631579, 1.1156186612576064, 1.6203703703703702, 0.7874015748031495, 1.509433962264151, 1.6917827694057437, 2.148997134670487, 0.9342883836810962, 0.4277421326000611, 3.931924882629108, 0.40417649040080833, 0.9838998211091234, 0.1534526854219949, 0.3218884120171674, 2.1286831028262174, 4.23861852433281, 0.39701074264362446, 0.37255510710959333, 0.7887323943661971, 4.5478865703584805, 0, 2.9471544715447155, 0.5209690023443605, 0.7982704141027773, 1.9796682718031033, 0.1910828025477707, 1.2275731822474032, 1.9400352733686066, 4.18848167539267, 0.5372733378106112, 1.3888888888888888, 0.5201560468140443, 10.137741046831957, 0.20418580908626852, 2.0326678765880217, 2.468601126028584, 1.2903225806451613 ] }, { "marker": { "color": "rgb(202, 178, 214)" }, "name": "CANCER", "text": [ 61.62538699690403, 77.23880597014924, 83.34065934065934, 93.66622864651774, 67.57518796992481, 31.79848320693391, 68.22447806933538, 41.4041404140414, 8.976428802066517, 65.0438946528332, 87.62183235867447, 87.23304388641165, 96.92454026632848, 55.17934964800536, 78.0454421023816, 63.13131313131313, 94.61725126847563, 95.82222222222222, 63.085161513214715, 76.34450506625097, 54.10166079516859, 88.12941444520392, 68.99346405228758, 76.54698242933537, 30.663430420711972, 56.49895178197065, 84.50437662644902, 62.7874071453838, 82.0275693596231, 38.97034321892702, 36.438099695764095, 62.26685796269727, 11.864406779661017, 90.78428880132198, 2.198492462311558, 6.3392857142857135, 82.35294117647058, 77.20950449145175, 58.04816223067174, 62.10927573062261, 88.17631084186338, 21.751997632435632, 61.629479377958084, 57.298136645962735, 17.76429809358752, 38.34020868721184, 70.38920398982984, 79.96987951807229, 82.95722465476591, 34.62949376375642, 85.61660561660561, 72.60096930533118, 53.23394495412844, 34.067952249770435, 88.5212830340932, 75.42149096079626, 76.36518771331058, 53.72724149776709, 84.40366972477065, 16.208791208791208, 98.61849096705633, 87.21178066266228, 13.489583333333332, 48.64688620802087, 92.33741146168705, 71.0128055878929, 30.010775862068968, 90.94781682641107, 89.87341772151899, 74.46991404011462, 35.624424670144215, 81.56055167201964, 72.18289085545723, 70.41370664437943, 79.51482479784366, 70.33753305335199, 35.06956831965751, 26.316776007497655, 70.66115702479338, 51.63114397564158, 62.79172170849846, 15.684647302904564, 55.44574026487447, 94.00086318515322, 93.59298928919182, 88.08607021517554, 38.657468824621915, 27.95275590551181, 59.229694671722214, 65.48967355096602, 89.08286206048685, 71.12308194580477, 89.59151610369207, 14.80783722682743, 57.80505679736167, 52.809475660840675, 68.37663779702422, 69.15065277981518, 92.52126464451933, 23.843416370106763, 73.99457749661093, 85.2329221137912, 80.49395161290323, 78.85856079404466, 81.63346613545816, 81.6591704147926, 92.56661991584852, 65.44131028207461, 49.01462174189447, 63.41179212304824, 72.65801354401806, 52.53415601586602, 88.78606423516602, 64.27452655560302, 82.97725706409372, 54.62825278810409, 60.82359488035615, 75.27667109340416, 81.14318268135207, 72.70951993490642, 86.90642458100558, 68.51953769950467, 72.3225806451613, 59.677036333412495, 79.34560327198365, 53.12858783008036, 58.11320754716981, 34.30830039525692, 64.23123243677237, 93.5127674258109, 70.52602282215419, 86.66528626151776, 85.3896103896104, 82.65351860152398, 75.74257425742574, 50.783545543584715, 55.54705432287682, 64.71119133574007, 94.9137679041216, 82.9583426152818, 87.59398496240601, 31.237322515212984, 84.4486531986532, 91.29226493747105, 94.0880503144654, 80.56582314472563, 80.30085959885386, 71.87791965119901, 63.0766880537733, 30.6924882629108, 43.078477601886156, 86.6726296958855, 82.50639386189258, 33.47639484978541, 88.43054720384846, 72.68445839874411, 53.10602522185894, 85.06674945669047, 70.53521126760563, 69.55591225254146, 25, 74.13617886178862, 90.70070330815317, 90.63695326791951, 51.2573568753344, 96.11464968152866, 64.30594900849859, 84.65608465608466, 90.42632759910246, 75.55406312961719, 82.49007936507937, 68.38607137696864, 23.360881542699723, 94.64012251148544, 79.60072595281306, 85.70809874404503, 48.70967741935484 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "11", "110", "111", "112", "113", "114", "115", "116", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "137", "139", "14", "140", "141", "143", "144", "146", "147", "148", "149", "15", "150", "152", "153", "154", "155", "157", "158", "159", "161", "162", "164", "165", "166", "168", "169", "170", "174", "175", "176", "177", "180", "181", "182", "183", "184", "186", "187", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "7", "70", "71", "73", "75", "8", "80", "81", "82", "83", "85", "87", "88", "89", "90", "91", "94", "95", "98", "99", "104", "108", "135", "18", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "160", "167", "17", "171", "172", "173", "178", "179", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 61.62538699690403, 77.23880597014924, 83.34065934065934, 93.66622864651774, 67.57518796992481, 31.79848320693391, 68.22447806933538, 41.4041404140414, 8.976428802066517, 65.0438946528332, 87.62183235867447, 87.23304388641165, 96.92454026632848, 55.17934964800536, 78.0454421023816, 63.13131313131313, 94.61725126847563, 95.82222222222222, 63.085161513214715, 76.34450506625097, 54.10166079516859, 88.12941444520392, 68.99346405228758, 76.54698242933537, 30.663430420711972, 56.49895178197065, 84.50437662644902, 62.7874071453838, 82.0275693596231, 38.97034321892702, 36.438099695764095, 62.26685796269727, 11.864406779661017, 90.78428880132198, 2.198492462311558, 6.3392857142857135, 82.35294117647058, 77.20950449145175, 58.04816223067174, 62.10927573062261, 88.17631084186338, 21.751997632435632, 61.629479377958084, 57.298136645962735, 17.76429809358752, 38.34020868721184, 70.38920398982984, 79.96987951807229, 82.95722465476591, 34.62949376375642, 85.61660561660561, 72.60096930533118, 53.23394495412844, 34.067952249770435, 88.5212830340932, 75.42149096079626, 76.36518771331058, 53.72724149776709, 84.40366972477065, 16.208791208791208, 98.61849096705633, 87.21178066266228, 13.489583333333332, 48.64688620802087, 92.33741146168705, 71.0128055878929, 30.010775862068968, 90.94781682641107, 89.87341772151899, 74.46991404011462, 35.624424670144215, 81.56055167201964, 72.18289085545723, 70.41370664437943, 79.51482479784366, 70.33753305335199, 35.06956831965751, 26.316776007497655, 70.66115702479338, 51.63114397564158, 62.79172170849846, 15.684647302904564, 55.44574026487447, 94.00086318515322, 93.59298928919182, 88.08607021517554, 38.657468824621915, 27.95275590551181, 59.229694671722214, 65.48967355096602, 89.08286206048685, 71.12308194580477, 89.59151610369207, 14.80783722682743, 57.80505679736167, 52.809475660840675, 68.37663779702422, 69.15065277981518, 92.52126464451933, 23.843416370106763, 73.99457749661093, 85.2329221137912, 80.49395161290323, 78.85856079404466, 81.63346613545816, 81.6591704147926, 92.56661991584852, 65.44131028207461, 49.01462174189447, 63.41179212304824, 72.65801354401806, 52.53415601586602, 88.78606423516602, 64.27452655560302, 82.97725706409372, 54.62825278810409, 60.82359488035615, 75.27667109340416, 81.14318268135207, 72.70951993490642, 86.90642458100558, 68.51953769950467, 72.3225806451613, 59.677036333412495, 79.34560327198365, 53.12858783008036, 58.11320754716981, 34.30830039525692, 64.23123243677237, 93.5127674258109, 70.52602282215419, 86.66528626151776, 85.3896103896104, 82.65351860152398, 75.74257425742574, 50.783545543584715, 55.54705432287682, 64.71119133574007, 94.9137679041216, 82.9583426152818, 87.59398496240601, 31.237322515212984, 84.4486531986532, 91.29226493747105, 94.0880503144654, 80.56582314472563, 80.30085959885386, 71.87791965119901, 63.0766880537733, 30.6924882629108, 43.078477601886156, 86.6726296958855, 82.50639386189258, 33.47639484978541, 88.43054720384846, 72.68445839874411, 53.10602522185894, 85.06674945669047, 70.53521126760563, 69.55591225254146, 25, 74.13617886178862, 90.70070330815317, 90.63695326791951, 51.2573568753344, 96.11464968152866, 64.30594900849859, 84.65608465608466, 90.42632759910246, 75.55406312961719, 82.49007936507937, 68.38607137696864, 23.360881542699723, 94.64012251148544, 79.60072595281306, 85.70809874404503, 48.70967741935484 ] }, { "marker": { "color": "rgb(106, 61, 154)" }, "name": "αSMA_myCAF", "text": [ 6.006191950464396, 1.5991471215351813, 3.5604395604395607, 0.47306176084099866, 0.5325814536340852, 8.992416034669557, 3.466768818234055, 9.27092709270927, 6.603164352599291, 8.419792498004789, 0.09746588693957114, 0.49284205585543295, 0.15852885225110971, 0.10056989607777406, 6.925814399124007, 2.0202020202020203, 0.3529671299360247, 0, 3.161167731905338, 1.3250194855806703, 22.496225465525917, 0.37593984962406013, 0.8627450980392156, 1.2605042016806722, 16.50485436893204, 14.884696016771489, 2.389401466761296, 12.203749557835161, 0.17448961786773687, 2.149283572142619, 18.207348467119118, 19.56001912960306, 55.007704160246526, 1.271132579128003, 4.1457286432160805, 50.44642857142857, 2.6143790849673203, 9.171254708780063, 5.640050697084917, 11.130876747141041, 2.3605598495926468, 36.99319325244155, 25.25354969574036, 2.1960958296362025, 9.272097053726169, 10.070371269109438, 15.822413455896733, 5.779367469879518, 4.445941394408893, 16.654438738077772, 0.2442002442002442, 0.5008077544426494, 13.96788990825688, 10.1010101010101, 0.1613879362517652, 12.512695510867358, 0.3412969283276451, 7.626245276537272, 1.7038007863695939, 66.0989010989011, 0, 1.9182329006006589, 40, 23.214867949135964, 0.7726980038634901, 0.23282887077997672, 0.646551724137931, 0.26624068157614483, 0.2921129503407984, 20.515759312320917, 23.672905799324948, 0.7557150954090308, 2.5958702064896757, 0.25073129962390306, 1.3207547169811322, 0.21776326022709597, 25.615412058508742, 19.66260543580131, 0.05584096493187402, 17.31187472814267, 3.742844561867019, 0.16597510373443983, 1.838307966001186, 0.7768666378938283, 1.8500486854917235, 0.4983012457531144, 0.29185460334306185, 1.574803149606299, 0.15964877270005987, 0.9993337774816788, 0.3688222276862552, 7.280444009141365, 0.8248232521602514, 69.51770911831197, 16.049835104433857, 9.648996099956667, 3.7530535198756385, 1.3495672583247762, 0.4814636494944632, 21.70818505338078, 2.914595571622232, 7.1625851592708525, 3.7298387096774195, 3.854425144747725, 2.8685258964143427, 3.4482758620689653, 0.6778868630201029, 10.191082802547772, 1.5257469802924348, 2.6800279655092054, 7.900677200902935, 3.239312472454826, 0.7439666122300853, 3.3461483696426026, 1.0797151389846085, 24.423791821561338, 0.5564830272676683, 6.219566179725542, 0.7216103304215724, 2.196908055329536, 4.504189944134078, 0.1651073197578426, 8.580645161290322, 7.1954405129422945, 0, 2.3823191733639493, 0.6738544474393532, 31.067193675889328, 11.60176635889201, 0.06901311249137336, 16.587809629835792, 0.2381198881871829, 6.8431568431568435, 0.9861048857014791, 0.8663366336633664, 0.3428011753183154, 16.985462892119358, 0, 0.08769365682548962, 0.08910670527957229, 0, 49.59432048681541, 6.228956228956229, 0.18527095877721167, 0.8805031446540881, 3.4119988626670454, 2.3638968481375358, 13.79632513235752, 21.387106630003057, 6.924882629107981, 5.4563826204109125, 0.5366726296958855, 11.253196930946292, 29.184549356223176, 1.2988574864702345, 1.4128728414442702, 36.47828117702009, 7.295870847562869, 17.464788732394364, 6.046013911182451, 2.272727272727273, 0.1524390243902439, 5.183641573326387, 4.656577415599535, 20.064205457463885, 0.7006369426751593, 24.45703493862134, 9.347442680776014, 1.2341062079281975, 7.118871725990597, 9.1765873015873, 0.9680681982372489, 7.7134986225895315, 0.05104645227156713, 1.0163339382940109, 4.634040710264184, 29.354838709677416 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "11", "110", "111", "112", "113", "114", "115", "116", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "137", "139", "14", "140", "141", "143", "144", "146", "147", "148", "149", "15", "150", "152", "153", "154", "155", "157", "158", "159", "161", "162", "164", "165", "166", "168", "169", "170", "174", "175", "176", "177", "180", "181", "182", "183", "184", "186", "187", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "7", "70", "71", "73", "75", "8", "80", "81", "82", "83", "85", "87", "88", "89", "90", "91", "94", "95", "98", "99", "104", "108", "135", "18", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "160", "167", "17", "171", "172", "173", "178", "179", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 6.006191950464396, 1.5991471215351813, 3.5604395604395607, 0.47306176084099866, 0.5325814536340852, 8.992416034669557, 3.466768818234055, 9.27092709270927, 6.603164352599291, 8.419792498004789, 0.09746588693957114, 0.49284205585543295, 0.15852885225110971, 0.10056989607777406, 6.925814399124007, 2.0202020202020203, 0.3529671299360247, 0, 3.161167731905338, 1.3250194855806703, 22.496225465525917, 0.37593984962406013, 0.8627450980392156, 1.2605042016806722, 16.50485436893204, 14.884696016771489, 2.389401466761296, 12.203749557835161, 0.17448961786773687, 2.149283572142619, 18.207348467119118, 19.56001912960306, 55.007704160246526, 1.271132579128003, 4.1457286432160805, 50.44642857142857, 2.6143790849673203, 9.171254708780063, 5.640050697084917, 11.130876747141041, 2.3605598495926468, 36.99319325244155, 25.25354969574036, 2.1960958296362025, 9.272097053726169, 10.070371269109438, 15.822413455896733, 5.779367469879518, 4.445941394408893, 16.654438738077772, 0.2442002442002442, 0.5008077544426494, 13.96788990825688, 10.1010101010101, 0.1613879362517652, 12.512695510867358, 0.3412969283276451, 7.626245276537272, 1.7038007863695939, 66.0989010989011, 0, 1.9182329006006589, 40, 23.214867949135964, 0.7726980038634901, 0.23282887077997672, 0.646551724137931, 0.26624068157614483, 0.2921129503407984, 20.515759312320917, 23.672905799324948, 0.7557150954090308, 2.5958702064896757, 0.25073129962390306, 1.3207547169811322, 0.21776326022709597, 25.615412058508742, 19.66260543580131, 0.05584096493187402, 17.31187472814267, 3.742844561867019, 0.16597510373443983, 1.838307966001186, 0.7768666378938283, 1.8500486854917235, 0.4983012457531144, 0.29185460334306185, 1.574803149606299, 0.15964877270005987, 0.9993337774816788, 0.3688222276862552, 7.280444009141365, 0.8248232521602514, 69.51770911831197, 16.049835104433857, 9.648996099956667, 3.7530535198756385, 1.3495672583247762, 0.4814636494944632, 21.70818505338078, 2.914595571622232, 7.1625851592708525, 3.7298387096774195, 3.854425144747725, 2.8685258964143427, 3.4482758620689653, 0.6778868630201029, 10.191082802547772, 1.5257469802924348, 2.6800279655092054, 7.900677200902935, 3.239312472454826, 0.7439666122300853, 3.3461483696426026, 1.0797151389846085, 24.423791821561338, 0.5564830272676683, 6.219566179725542, 0.7216103304215724, 2.196908055329536, 4.504189944134078, 0.1651073197578426, 8.580645161290322, 7.1954405129422945, 0, 2.3823191733639493, 0.6738544474393532, 31.067193675889328, 11.60176635889201, 0.06901311249137336, 16.587809629835792, 0.2381198881871829, 6.8431568431568435, 0.9861048857014791, 0.8663366336633664, 0.3428011753183154, 16.985462892119358, 0, 0.08769365682548962, 0.08910670527957229, 0, 49.59432048681541, 6.228956228956229, 0.18527095877721167, 0.8805031446540881, 3.4119988626670454, 2.3638968481375358, 13.79632513235752, 21.387106630003057, 6.924882629107981, 5.4563826204109125, 0.5366726296958855, 11.253196930946292, 29.184549356223176, 1.2988574864702345, 1.4128728414442702, 36.47828117702009, 7.295870847562869, 17.464788732394364, 6.046013911182451, 2.272727272727273, 0.1524390243902439, 5.183641573326387, 4.656577415599535, 20.064205457463885, 0.7006369426751593, 24.45703493862134, 9.347442680776014, 1.2341062079281975, 7.118871725990597, 9.1765873015873, 0.9680681982372489, 7.7134986225895315, 0.05104645227156713, 1.0163339382940109, 4.634040710264184, 29.354838709677416 ] }, { "marker": { "color": "rgb(1.0, 1.0, 0.6)" }, "name": "STROMA_OTHER", "text": [ 8.204334365325078, 3.8912579957356077, 7.604395604395604, 2.3915900131406045, 4.1040100250626566, 47.724810400866744, 18.904424439762497, 7.110711071107111, 82.3861801743623, 15.283320031923383, 0.29239766081871343, 3.9427364468434636, 0.6024096385542169, 18.739523969158565, 4.51683547768957, 28.28282828282828, 2.294286344584161, 1.1111111111111112, 4.076697184315081, 10.366328916601715, 13.38701560140916, 3.30371383002962, 4.4183006535947715, 9.511077158135981, 29.773462783171524, 15.40880503144654, 8.493021055121835, 7.7467279801910145, 8.131216192636538, 23.60879706764412, 39.316639363444885, 9.660449545671927, 24.65331278890601, 4.004067624253209, 18.40452261306533, 13.750000000000002, 0.4357298474945534, 9.330628803245435, 20.975918884664132, 22.13468869123253, 5.765615207854606, 12.577685705830127, 7.8431372549019605, 12.999112688553682, 60.65857885615251, 19.97088085416161, 3.2270682573831406, 10.466867469879517, 1.5156618390030314, 45.8547322083639, 6.349206349206349, 13.021001615508885, 22.889908256880734, 14.784205693296604, 1.9164817429897114, 6.581352833638025, 9.556313993174061, 20.405358983167297, 9.305373525557012, 12.307692307692308, 0.10626992561105207, 6.878511916295292, 14.322916666666666, 15.128790348875123, 4.443013522215067, 11.874272409778813, 56.35775862068966, 2.1299254526091587, 1.557935735150925, 1.489971346704871, 16.49278919914084, 12.091441526544493, 4.808259587020649, 2.632678646050982, 12.722371967654986, 26.52045419194276, 32.28683553335712, 25.43580131208997, 6.85727049363413, 11.43975641583297, 1.9815059445178336, 0.16597510373443983, 4.605653291164262, 0.49633146309883475, 1.6942551119766307, 3.2842582106455263, 11.223136110374105, 3.149606299212598, 5.807224106964678, 24.117255163224517, 7.892795672485862, 11.68788769180542, 6.009426551453259, 4.672192916352675, 12.678636863319898, 30.680340892676583, 20.00888296691095, 5.867683731846853, 3.1134649333975286, 16.90391459074733, 13.985539990962495, 1.067943288528816, 6.628024193548388, 3.6228287841191067, 6.414342629482071, 5.072463768115942, 4.417952314165498, 13.757961783439491, 33.75715193897012, 3.0062922395711955, 8.154627539503386, 7.073600705156456, 3.411359099981855, 18.4251744268831, 3.3769813921433496, 5.037174721189591, 0.5008347245409015, 12.107127047366092, 4.69046714774022, 10.398698128559806, 4.888268156424581, 13.401210787011559, 8.193548387096774, 8.287817620517691, 2.8629856850715747, 15.355912743972445, 8.679245283018867, 21.027667984189723, 7.226013649136894, 5.106970324361629, 3.9521291399944336, 1.9877834144321358, 2.5474525474525476, 9.816225907664725, 9.498762376237623, 44.0254652301665, 19.204284621270084, 1.7148014440433215, 0.233849751534639, 7.329026509244821, 7.471804511278196, 16.227180527383368, 6.123737373737374, 0.2779064381658175, 2.515723270440252, 11.415979528006824, 13.46704871060172, 11.398318280909374, 8.218759547815461, 41.31455399061033, 49.882115190299764, 2.5044722719141324, 4.143222506393862, 34.12017167381974, 3.2471437161755863, 12.71585557299843, 7.26296123306866, 5.867742936976095, 4.563380281690141, 1.5516318887105405, 13.636363636363635, 14.329268292682926, 1.8233915082052619, 0.6485947114585066, 9.523809523809524, 1.9745222929936306, 6.326723323890462, 0.7936507936507936, 1.5706806282722512, 12.088650100738752, 4.761904761904762, 18.971246929634447, 1.2121212121212122, 0.8167432363450741, 5.916515426497278, 0.043308791684711995, 6.451612903225806 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "11", "110", "111", "112", "113", "114", "115", "116", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "137", "139", "14", "140", "141", "143", "144", "146", "147", "148", "149", "15", "150", "152", "153", "154", "155", "157", "158", "159", "161", "162", "164", "165", "166", "168", "169", "170", "174", "175", "176", "177", "180", "181", "182", "183", "184", "186", "187", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "7", "70", "71", "73", "75", "8", "80", "81", "82", "83", "85", "87", "88", "89", "90", "91", "94", "95", "98", "99", "104", "108", "135", "18", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "160", "167", "17", "171", "172", "173", "178", "179", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 8.204334365325078, 3.8912579957356077, 7.604395604395604, 2.3915900131406045, 4.1040100250626566, 47.724810400866744, 18.904424439762497, 7.110711071107111, 82.3861801743623, 15.283320031923383, 0.29239766081871343, 3.9427364468434636, 0.6024096385542169, 18.739523969158565, 4.51683547768957, 28.28282828282828, 2.294286344584161, 1.1111111111111112, 4.076697184315081, 10.366328916601715, 13.38701560140916, 3.30371383002962, 4.4183006535947715, 9.511077158135981, 29.773462783171524, 15.40880503144654, 8.493021055121835, 7.7467279801910145, 8.131216192636538, 23.60879706764412, 39.316639363444885, 9.660449545671927, 24.65331278890601, 4.004067624253209, 18.40452261306533, 13.750000000000002, 0.4357298474945534, 9.330628803245435, 20.975918884664132, 22.13468869123253, 5.765615207854606, 12.577685705830127, 7.8431372549019605, 12.999112688553682, 60.65857885615251, 19.97088085416161, 3.2270682573831406, 10.466867469879517, 1.5156618390030314, 45.8547322083639, 6.349206349206349, 13.021001615508885, 22.889908256880734, 14.784205693296604, 1.9164817429897114, 6.581352833638025, 9.556313993174061, 20.405358983167297, 9.305373525557012, 12.307692307692308, 0.10626992561105207, 6.878511916295292, 14.322916666666666, 15.128790348875123, 4.443013522215067, 11.874272409778813, 56.35775862068966, 2.1299254526091587, 1.557935735150925, 1.489971346704871, 16.49278919914084, 12.091441526544493, 4.808259587020649, 2.632678646050982, 12.722371967654986, 26.52045419194276, 32.28683553335712, 25.43580131208997, 6.85727049363413, 11.43975641583297, 1.9815059445178336, 0.16597510373443983, 4.605653291164262, 0.49633146309883475, 1.6942551119766307, 3.2842582106455263, 11.223136110374105, 3.149606299212598, 5.807224106964678, 24.117255163224517, 7.892795672485862, 11.68788769180542, 6.009426551453259, 4.672192916352675, 12.678636863319898, 30.680340892676583, 20.00888296691095, 5.867683731846853, 3.1134649333975286, 16.90391459074733, 13.985539990962495, 1.067943288528816, 6.628024193548388, 3.6228287841191067, 6.414342629482071, 5.072463768115942, 4.417952314165498, 13.757961783439491, 33.75715193897012, 3.0062922395711955, 8.154627539503386, 7.073600705156456, 3.411359099981855, 18.4251744268831, 3.3769813921433496, 5.037174721189591, 0.5008347245409015, 12.107127047366092, 4.69046714774022, 10.398698128559806, 4.888268156424581, 13.401210787011559, 8.193548387096774, 8.287817620517691, 2.8629856850715747, 15.355912743972445, 8.679245283018867, 21.027667984189723, 7.226013649136894, 5.106970324361629, 3.9521291399944336, 1.9877834144321358, 2.5474525474525476, 9.816225907664725, 9.498762376237623, 44.0254652301665, 19.204284621270084, 1.7148014440433215, 0.233849751534639, 7.329026509244821, 7.471804511278196, 16.227180527383368, 6.123737373737374, 0.2779064381658175, 2.515723270440252, 11.415979528006824, 13.46704871060172, 11.398318280909374, 8.218759547815461, 41.31455399061033, 49.882115190299764, 2.5044722719141324, 4.143222506393862, 34.12017167381974, 3.2471437161755863, 12.71585557299843, 7.26296123306866, 5.867742936976095, 4.563380281690141, 1.5516318887105405, 13.636363636363635, 14.329268292682926, 1.8233915082052619, 0.6485947114585066, 9.523809523809524, 1.9745222929936306, 6.326723323890462, 0.7936507936507936, 1.5706806282722512, 12.088650100738752, 4.761904761904762, 18.971246929634447, 1.2121212121212122, 0.8167432363450741, 5.916515426497278, 0.043308791684711995, 6.451612903225806 ] }, { "marker": { "color": "rgb(177, 89, 40)" }, "name": "ENDOTHELIAL", "text": [ 5.185758513931889, 6.982942430703624, 2.6373626373626373, 0.4204993429697766, 3.6654135338345863, 1.895991332611051, 3.6966098448573073, 1.17011701170117, 1.4045850823377461, 2.3543495610534717, 0.9746588693957114, 1.7836188688101384, 0.7609384908053266, 1.6761649346295675, 2.8469750889679712, 1.5151515151515151, 0.7500551511140525, 0.4, 10.139920538953188, 1.2860483242400622, 5.8379466532460995, 2.4948735475051267, 2.1176470588235294, 4.507257448433919, 10.194174757281553, 3.2494758909853245, 1.20652945351313, 1.910152104704634, 3.2804048159134536, 5.1649450183272245, 3.3934004212497073, 4.8302247728359635, 4.468412942989214, 0.7245455701029617, 3.2035175879396984, 6.517857142857143, 1.0021786492374727, 1.303969863807592, 6.2103929024081115, 0.3303684879288437, 1.2325047002297889, 3.2849955608168098, 2.9073698444895197, 16.65927240461402, 4.679376083188909, 8.444552293132734, 2.0731468805006847, 1.1859939759036144, 0.9767598518019536, 1.834189288334556, 1.0256410256410255, 1.1308562197092082, 7.178899082568807, 0.7346189164370982, 0.746419205164414, 2.701604712573634, 5.2047781569965865, 7.591892820336654, 2.0969855832241153, 1.208791208791209, 0.10626992561105207, 2.1313698895562876, 23.802083333333332, 1.793283338767525, 0.38634900193174504, 4.307334109429569, 9.321120689655173, 0.6922257720979765, 1.1684518013631937, 0.40114613180515757, 3.4980055231666154, 1.7759304742112223, 1.710914454277286, 1.2954450480568325, 1.2398921832884098, 1.9132057862809144, 1.9978594363182305, 5.660731021555764, 0.08934554389099844, 13.571117877337974, 0.26420079260237783, 2.0746887966804977, 0.98833761612967, 1.5753129046180405, 0.9737098344693282, 0.6115515288788221, 2.255240116741841, 2.3622047244094486, 3.2727998403512273, 4.663557628247834, 0.7376444553725104, 3.493307215148547, 0.432050274941084, 1.6955538809344386, 8.061561011359473, 2.0078000866676295, 1.1547856984232734, 1.877658794190993, 0.9950248756218906, 26.156583629893237, 1.8978761861726163, 1.325722703001289, 1.4616935483870968, 1.4392059553349876, 0.796812749003984, 0.6746626686656672, 1.496026180458158, 3.0391264786169248, 1.2714558169103625, 2.307154509438359, 2.2573363431151243, 1.8730718378140152, 1.1431682090364725, 3.1895201480848643, 1.8837583275901677, 3.141263940520446, 0.5008347245409015, 2.6781761841522798, 1.3672616786935055, 2.9617575264442633, 1.3966480446927374, 3.6873968079251513, 1.3548387096774193, 3.2771313227261936, 0, 4.104477611940299, 2.533692722371968, 2.6877470355731226, 5.9012444801284625, 0.4830917874396135, 1.5585861397161147, 2.4536701521896678, 2.647352647352647, 1.9273868220528911, 4.672029702970297, 3.232125367286973, 0.6885998469778117, 1.5342960288808665, 1.140017538731365, 4.265983515259523, 0.7518796992481203, 0.7099391480730223, 0.8838383838383838, 4.678091709124595, 0.37735849056603776, 1.6491327836224055, 1.2177650429799427, 1.5882902522578637, 2.9483654139932782, 8.392018779342724, 1.1451667228022904, 0.7155635062611807, 1.8925831202046037, 1.1802575107296138, 0.9861695730607337, 1.2558869701726845, 2.335357309668379, 0.5898789195901893, 2.535211267605634, 7.009095773140716, 43.18181818181818, 2.0325203252032518, 1.3805678562125552, 1.3470813237984367, 4.012841091492777, 0.3184713375796179, 2.927289896128423, 1.8518518518518516, 0.48616305160807777, 1.6789791806581598, 2.083333333333333, 3.22207773443144, 0.8264462809917356, 0.1531393568147014, 3.7023593466424685, 1.3858813339107838, 0.967741935483871 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "11", "110", "111", "112", "113", "114", "115", "116", "119", "120", "121", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "137", "139", "14", "140", "141", "143", "144", "146", "147", "148", "149", "15", "150", "152", "153", "154", "155", "157", "158", "159", "161", "162", "164", "165", "166", "168", "169", "170", "174", "175", "176", "177", "180", "181", "182", "183", "184", "186", "187", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "7", "70", "71", "73", "75", "8", "80", "81", "82", "83", "85", "87", "88", "89", "90", "91", "94", "95", "98", "99", "104", "108", "135", "18", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "160", "167", "17", "171", "172", "173", "178", "179", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 5.185758513931889, 6.982942430703624, 2.6373626373626373, 0.4204993429697766, 3.6654135338345863, 1.895991332611051, 3.6966098448573073, 1.17011701170117, 1.4045850823377461, 2.3543495610534717, 0.9746588693957114, 1.7836188688101384, 0.7609384908053266, 1.6761649346295675, 2.8469750889679712, 1.5151515151515151, 0.7500551511140525, 0.4, 10.139920538953188, 1.2860483242400622, 5.8379466532460995, 2.4948735475051267, 2.1176470588235294, 4.507257448433919, 10.194174757281553, 3.2494758909853245, 1.20652945351313, 1.910152104704634, 3.2804048159134536, 5.1649450183272245, 3.3934004212497073, 4.8302247728359635, 4.468412942989214, 0.7245455701029617, 3.2035175879396984, 6.517857142857143, 1.0021786492374727, 1.303969863807592, 6.2103929024081115, 0.3303684879288437, 1.2325047002297889, 3.2849955608168098, 2.9073698444895197, 16.65927240461402, 4.679376083188909, 8.444552293132734, 2.0731468805006847, 1.1859939759036144, 0.9767598518019536, 1.834189288334556, 1.0256410256410255, 1.1308562197092082, 7.178899082568807, 0.7346189164370982, 0.746419205164414, 2.701604712573634, 5.2047781569965865, 7.591892820336654, 2.0969855832241153, 1.208791208791209, 0.10626992561105207, 2.1313698895562876, 23.802083333333332, 1.793283338767525, 0.38634900193174504, 4.307334109429569, 9.321120689655173, 0.6922257720979765, 1.1684518013631937, 0.40114613180515757, 3.4980055231666154, 1.7759304742112223, 1.710914454277286, 1.2954450480568325, 1.2398921832884098, 1.9132057862809144, 1.9978594363182305, 5.660731021555764, 0.08934554389099844, 13.571117877337974, 0.26420079260237783, 2.0746887966804977, 0.98833761612967, 1.5753129046180405, 0.9737098344693282, 0.6115515288788221, 2.255240116741841, 2.3622047244094486, 3.2727998403512273, 4.663557628247834, 0.7376444553725104, 3.493307215148547, 0.432050274941084, 1.6955538809344386, 8.061561011359473, 2.0078000866676295, 1.1547856984232734, 1.877658794190993, 0.9950248756218906, 26.156583629893237, 1.8978761861726163, 1.325722703001289, 1.4616935483870968, 1.4392059553349876, 0.796812749003984, 0.6746626686656672, 1.496026180458158, 3.0391264786169248, 1.2714558169103625, 2.307154509438359, 2.2573363431151243, 1.8730718378140152, 1.1431682090364725, 3.1895201480848643, 1.8837583275901677, 3.141263940520446, 0.5008347245409015, 2.6781761841522798, 1.3672616786935055, 2.9617575264442633, 1.3966480446927374, 3.6873968079251513, 1.3548387096774193, 3.2771313227261936, 0, 4.104477611940299, 2.533692722371968, 2.6877470355731226, 5.9012444801284625, 0.4830917874396135, 1.5585861397161147, 2.4536701521896678, 2.647352647352647, 1.9273868220528911, 4.672029702970297, 3.232125367286973, 0.6885998469778117, 1.5342960288808665, 1.140017538731365, 4.265983515259523, 0.7518796992481203, 0.7099391480730223, 0.8838383838383838, 4.678091709124595, 0.37735849056603776, 1.6491327836224055, 1.2177650429799427, 1.5882902522578637, 2.9483654139932782, 8.392018779342724, 1.1451667228022904, 0.7155635062611807, 1.8925831202046037, 1.1802575107296138, 0.9861695730607337, 1.2558869701726845, 2.335357309668379, 0.5898789195901893, 2.535211267605634, 7.009095773140716, 43.18181818181818, 2.0325203252032518, 1.3805678562125552, 1.3470813237984367, 4.012841091492777, 0.3184713375796179, 2.927289896128423, 1.8518518518518516, 0.48616305160807777, 1.6789791806581598, 2.083333333333333, 3.22207773443144, 0.8264462809917356, 0.1531393568147014, 3.7023593466424685, 1.3858813339107838, 0.967741935483871 ] } ], "layout": { "barmode": "stack", "plot_bgcolor": "white", "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Cell subtypes proportions by Patient and tissue type" }, "xaxis": { "autorange": true, "linecolor": "black", "range": [ -0.5, 176.5 ], "type": "category" }, "yaxis": { "autorange": true, "linecolor": "black", "range": [ 0, 105.26315789473688 ], "title": { "text": "Cell count (%)" }, "type": "linear" } } } }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "'temp-plot.html'" ] }, "execution_count": 53, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fig = go.Figure()\n", "title = 'Cell subtypes proportions by Patient and tissue type'\n", "\n", "for cell_subtype in cell_subtypes:\n", " fig.add_trace(\n", " go.Bar(\n", " name=cell_subtype,\n", " x=counts_perc_patients['Patient'],\n", " y=counts_perc_patients[f'{cell_subtype.lower()}_perc'],\n", " text=counts_perc_patients[f'{cell_subtype.lower()}_perc'],\n", " textposition='auto',\n", " marker_color='rgb' + str(cell_subtype_color_dict[cell_subtype])))\n", "\n", "fig.update_layout(\n", " plot_bgcolor='white',\n", " barmode='stack',\n", " title=title,\n", " xaxis=dict(linecolor='black'),\n", " yaxis=dict(title='Cell count (%)', linecolor='black'))\n", "\n", "output_filename = title.replace(\" \", \"_\") + \".png\"\n", "#fig.write_image(output_images_dir + \"/\" + output_filename, scale=1000)\n", "\n", "fig.show()\n", "plot(fig)" ] }, { "cell_type": "markdown", "id": "45841125-32c5-4996-bc6f-3440dc74bcc2", "metadata": {}, "source": [ "#### V.4.2.3 BY SCENES AND PATIENTS" ] }, { "cell_type": "raw", "id": "5eb16728-1a84-4624-b2d0-d954667d77cf", "metadata": {}, "source": [ "!!!!! DD3 !!!!!" ] }, { "cell_type": "code", "execution_count": 54, "id": "6acfff96-5194-4b24-8ac1-d7ce34f2354c", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
dcbtcd4tcd8m1m2tregimmune_othercancerαsma_mycafstroma_otherendothelialTotal_cells
102.00.0900.024.0167.0100.05.028.03981388.05303356460.0
111.00.07.05.00.00.00.026.0556409.05103876194.0
141.00.0190.06.02.01.00.053.07142100.0315577867.0
154.00.032.07.07.01.00.019.01823747.0232862958.0
1938.00.0983.0258.03.00.04.064.023221543.010752286518.0
201.00.026.023.00.00.00.0152.0431740.0640945293.0
221.084.05.0416.070.01.00.057.0244788.0163583390.0
2367.01.0239.0750.00.03.01.0155.0337012.0126624786.0
261.00.0159.017.00.00.01.015.0295049.0472463710.0
275.00.045.00.03.02.00.010.0452214.017051236429.0
281.00.026.023.01.00.00.090.0983718.0905562803.0
307.00.0986.0148.03.00.05.074.014041049.013573025335.0
3230.016.01137.0628.052.015.00.0122.063275.061488954.0
3314.00.064.033.00.01.01.026.01187398.02633122299.0
3419.00.034.0435.00.02.00.0219.0142685.04562271.0
3513.00.02.0861.026.013.01.071.01892.02251205.0
36107.00.068.01299.01.00.00.0403.0280593.0233505059.0
372.00.01.060.00.00.00.083.0435636.023734634.0
384.01.020.021.04.04.02.041.0480695.087505135.0
3911.00.0241.035.00.00.00.045.0388922.0145274415.0
431.02.01730.01.01.04.01.023.0145711.0423853769.0
412.00.0153.06.00.00.02.02.0714.086254.0
4250.00.0746.0481.050.012.032.0209.029688.02911645011.0
439.00.044.010.00.00.01.07.098315.0362701501.0
4412.00.048.014.00.00.00.04.0362315.0321304067.0
459.00.0277.024.00.03.00.080.04357446.07162146126.0
469.00.037.022.03.00.00.09.0228121.0153112546.0
51.01.066.040.078.06.00.055.03931845.0124452654.0
502.00.0130.091.05.00.01.066.03155876.06924405458.0
5237.00.091.07.025.01.00.0175.03656668.021241396923.0
53144.00.018.065.00.00.00.075.03079169.0901524503.0
543.00.02.01133.03.02.00.0340.0471492.04001286817.0
576.00.069.062.00.00.00.043.0576530.0194626231.0
581.00.017.039.00.00.01.06.0134122.095147562.0
62.00.0235.05.01.05.00.071.03275129.0619844426.0
635.00.0117.099.03.01.00.058.04629389.058725431.0
71.00.0184.031.00.00.00.011.077124.0531201573.0
82.00.0704.018.00.00.04.028.04514235.012942247023.0
180.027.0328.0395.01.00.02.083.0837123.01922379659.0
250.01.05.053.00.02.00.042.0184422.0219432231.0
290.02.0105.027.0101.03.01.059.0244828.03071513232.0
30.03.06.07.00.00.00.017.010377.0899662042.0
120.00.0318.06.02.00.02.0153.074488.06583838978.0
130.00.039.028.00.01.00.021.018640.0159162128.0
160.00.045.041.00.03.00.0119.05667240.08031167034.0
170.00.0220.035.02.00.01.028.041291400.05381936546.0
210.00.0234.091.00.00.00.0177.07353108.0270828315.0
240.00.03.045.01.00.00.027.04639.0818637.0
400.00.011.06.01.00.00.017.022741562.03111004282.0
470.00.014.010.01.00.01.012.02740235.0189193221.0
480.00.022.051.00.00.00.014.01252310.081451775.0
490.00.05.0206.00.00.00.085.01300113.0291311869.0
510.00.04.01.01.00.01.00.0111.061944.0
550.00.02.0114.03.07.00.058.014593.0282401968.0
560.00.01.012.02.00.00.020.03482199.070533839.0
590.00.024.068.017.06.00.048.05450280.039816013.0
610.00.079.0144.04.019.00.037.0958375.0178751869.0
90.00.0465.082.00.01.01.036.0473367.013132236921.0
600.00.00.0107.09.016.01.057.01979107.01322309.0
620.00.00.023.03.015.00.04.015191.0203310.0
\n", "
" ], "text/plain": [ " dc b tcd4 tcd8 m1 m2 treg immune_other cancer \\\n", "10 2.0 0.0 900.0 24.0 167.0 100.0 5.0 28.0 3981 \n", "11 1.0 0.0 7.0 5.0 0.0 0.0 0.0 26.0 556 \n", "14 1.0 0.0 190.0 6.0 2.0 1.0 0.0 53.0 7142 \n", "15 4.0 0.0 32.0 7.0 7.0 1.0 0.0 19.0 1823 \n", "19 38.0 0.0 983.0 258.0 3.0 0.0 4.0 64.0 2322 \n", "20 1.0 0.0 26.0 23.0 0.0 0.0 0.0 152.0 4317 \n", "22 1.0 84.0 5.0 416.0 70.0 1.0 0.0 57.0 2447 \n", "23 67.0 1.0 239.0 750.0 0.0 3.0 1.0 155.0 3370 \n", "26 1.0 0.0 159.0 17.0 0.0 0.0 1.0 15.0 2950 \n", "27 5.0 0.0 45.0 0.0 3.0 2.0 0.0 10.0 4522 \n", "28 1.0 0.0 26.0 23.0 1.0 0.0 0.0 90.0 983 \n", "30 7.0 0.0 986.0 148.0 3.0 0.0 5.0 74.0 1404 \n", "32 30.0 16.0 1137.0 628.0 52.0 15.0 0.0 122.0 6327 \n", "33 14.0 0.0 64.0 33.0 0.0 1.0 1.0 26.0 1187 \n", "34 19.0 0.0 34.0 435.0 0.0 2.0 0.0 219.0 1426 \n", "35 13.0 0.0 2.0 861.0 26.0 13.0 1.0 71.0 189 \n", "36 107.0 0.0 68.0 1299.0 1.0 0.0 0.0 403.0 2805 \n", "37 2.0 0.0 1.0 60.0 0.0 0.0 0.0 83.0 4356 \n", "38 4.0 1.0 20.0 21.0 4.0 4.0 2.0 41.0 4806 \n", "39 11.0 0.0 241.0 35.0 0.0 0.0 0.0 45.0 3889 \n", "4 31.0 2.0 1730.0 1.0 1.0 4.0 1.0 23.0 1457 \n", "41 2.0 0.0 153.0 6.0 0.0 0.0 2.0 2.0 71 \n", "42 50.0 0.0 746.0 481.0 50.0 12.0 32.0 209.0 2968 \n", "43 9.0 0.0 44.0 10.0 0.0 0.0 1.0 7.0 983 \n", "44 12.0 0.0 48.0 14.0 0.0 0.0 0.0 4.0 3623 \n", "45 9.0 0.0 277.0 24.0 0.0 3.0 0.0 80.0 4357 \n", "46 9.0 0.0 37.0 22.0 3.0 0.0 0.0 9.0 2281 \n", "5 1.0 1.0 66.0 40.0 78.0 6.0 0.0 55.0 393 \n", "50 2.0 0.0 130.0 91.0 5.0 0.0 1.0 66.0 3155 \n", "52 37.0 0.0 91.0 7.0 25.0 1.0 0.0 175.0 3656 \n", "53 144.0 0.0 18.0 65.0 0.0 0.0 0.0 75.0 3079 \n", "54 3.0 0.0 2.0 1133.0 3.0 2.0 0.0 340.0 4714 \n", "57 6.0 0.0 69.0 62.0 0.0 0.0 0.0 43.0 5765 \n", "58 1.0 0.0 17.0 39.0 0.0 0.0 1.0 6.0 134 \n", "6 2.0 0.0 235.0 5.0 1.0 5.0 0.0 71.0 3275 \n", "63 5.0 0.0 117.0 99.0 3.0 1.0 0.0 58.0 4629 \n", "7 1.0 0.0 184.0 31.0 0.0 0.0 0.0 11.0 771 \n", "8 2.0 0.0 704.0 18.0 0.0 0.0 4.0 28.0 4514 \n", "18 0.0 27.0 328.0 395.0 1.0 0.0 2.0 83.0 8371 \n", "25 0.0 1.0 5.0 53.0 0.0 2.0 0.0 42.0 1844 \n", "29 0.0 2.0 105.0 27.0 101.0 3.0 1.0 59.0 2448 \n", "3 0.0 3.0 6.0 7.0 0.0 0.0 0.0 17.0 1037 \n", "12 0.0 0.0 318.0 6.0 2.0 0.0 2.0 153.0 7448 \n", "13 0.0 0.0 39.0 28.0 0.0 1.0 0.0 21.0 1864 \n", "16 0.0 0.0 45.0 41.0 0.0 3.0 0.0 119.0 5667 \n", "17 0.0 0.0 220.0 35.0 2.0 0.0 1.0 28.0 4129 \n", "21 0.0 0.0 234.0 91.0 0.0 0.0 0.0 177.0 7353 \n", "24 0.0 0.0 3.0 45.0 1.0 0.0 0.0 27.0 463 \n", "40 0.0 0.0 11.0 6.0 1.0 0.0 0.0 17.0 2274 \n", "47 0.0 0.0 14.0 10.0 1.0 0.0 1.0 12.0 2740 \n", "48 0.0 0.0 22.0 51.0 0.0 0.0 0.0 14.0 1252 \n", "49 0.0 0.0 5.0 206.0 0.0 0.0 0.0 85.0 1300 \n", "51 0.0 0.0 4.0 1.0 1.0 0.0 1.0 0.0 11 \n", "55 0.0 0.0 2.0 114.0 3.0 7.0 0.0 58.0 1459 \n", "56 0.0 0.0 1.0 12.0 2.0 0.0 0.0 20.0 3482 \n", "59 0.0 0.0 24.0 68.0 17.0 6.0 0.0 48.0 5450 \n", "61 0.0 0.0 79.0 144.0 4.0 19.0 0.0 37.0 958 \n", "9 0.0 0.0 465.0 82.0 0.0 1.0 1.0 36.0 4733 \n", "60 0.0 0.0 0.0 107.0 9.0 16.0 1.0 57.0 1979 \n", "62 0.0 0.0 0.0 23.0 3.0 15.0 0.0 4.0 151 \n", "\n", " αsma_mycaf stroma_other endothelial Total_cells \n", "10 388.0 530 335 6460.0 \n", "11 409.0 5103 87 6194.0 \n", "14 100.0 315 57 7867.0 \n", "15 747.0 232 86 2958.0 \n", "19 1543.0 1075 228 6518.0 \n", "20 40.0 640 94 5293.0 \n", "22 88.0 163 58 3390.0 \n", "23 12.0 126 62 4786.0 \n", "26 49.0 472 46 3710.0 \n", "27 14.0 1705 123 6429.0 \n", "28 718.0 905 56 2803.0 \n", "30 1049.0 1357 302 5335.0 \n", "32 5.0 614 8 8954.0 \n", "33 398.0 263 312 2299.0 \n", "34 85.0 45 6 2271.0 \n", "35 2.0 2 25 1205.0 \n", "36 93.0 233 50 5059.0 \n", "37 36.0 23 73 4634.0 \n", "38 95.0 87 50 5135.0 \n", "39 22.0 145 27 4415.0 \n", "4 11.0 423 85 3769.0 \n", "41 4.0 8 6 254.0 \n", "42 8.0 291 164 5011.0 \n", "43 15.0 362 70 1501.0 \n", "44 15.0 321 30 4067.0 \n", "45 446.0 716 214 6126.0 \n", "46 21.0 153 11 2546.0 \n", "5 1845.0 124 45 2654.0 \n", "50 876.0 692 440 5458.0 \n", "52 668.0 2124 139 6923.0 \n", "53 169.0 901 52 4503.0 \n", "54 92.0 400 128 6817.0 \n", "57 30.0 194 62 6231.0 \n", "58 122.0 95 147 562.0 \n", "6 129.0 619 84 4426.0 \n", "63 389.0 58 72 5431.0 \n", "7 24.0 531 20 1573.0 \n", "8 235.0 1294 224 7023.0 \n", "18 23.0 192 237 9659.0 \n", "25 22.0 219 43 2231.0 \n", "29 28.0 307 151 3232.0 \n", "3 7.0 899 66 2042.0 \n", "12 8.0 658 383 8978.0 \n", "13 0.0 159 16 2128.0 \n", "16 240.0 803 116 7034.0 \n", "17 1400.0 538 193 6546.0 \n", "21 108.0 270 82 8315.0 \n", "24 9.0 81 8 637.0 \n", "40 1562.0 311 100 4282.0 \n", "47 235.0 189 19 3221.0 \n", "48 310.0 81 45 1775.0 \n", "49 113.0 29 131 1869.0 \n", "51 1.0 6 19 44.0 \n", "55 3.0 282 40 1968.0 \n", "56 199.0 70 53 3839.0 \n", "59 280.0 39 81 6013.0 \n", "61 375.0 178 75 1869.0 \n", "9 67.0 1313 223 6921.0 \n", "60 107.0 1 32 2309.0 \n", "62 91.0 20 3 310.0 " ] }, "execution_count": 54, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Sélectionner les valeurs de 'Sample_ID' spécifiées\n", "allowed_sample_ids = ['DD3S1.csv', 'DD3S2.csv', 'DD3S3.csv']\n", "\n", "df_filtered = df[df['Sample_ID'].isin(allowed_sample_ids)]\n", "df_filtered\n", "\n", "# Compter par numéro de patiente\n", "patient_counts = {}\n", "\n", "# Boucle sur les sous-types de cellules pour compter les échantillons correspondants par patient\n", "for subtype in cell_subtypes:\n", " patient_counts[subtype.lower()] = pd.DataFrame({subtype.lower():\n", " df_filtered.loc[\n", " df_filtered['cell_subtype'] == subtype, 'Patient'].value_counts()\n", " }).sort_index()\n", "\n", "# Concaténation des counts des sous-types de cellules en un seul DataFrame\n", "counts_patients = pd.concat([pd.DataFrame(v) for v in patient_counts.values()], axis=1, sort=False)\n", "counts_patients = counts_patients.fillna(0)\n", "\n", "# Ajout de la colonne de total de cellules comptées par patientes\n", "counts_patients['Total_cells'] = counts_patients.sum(axis=1)\n", "\n", "\n", "counts_patients" ] }, { "cell_type": "code", "execution_count": 55, "id": "7d05c34a-6c74-45dc-863d-e7eeba61a679", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
dcbtcd4tcd8m1m2tregimmune_othercancerαsma_mycaf...tcd8_percm1_percm2_perctreg_percimmune_other_perccancer_percαsma_mycaf_percstroma_other_percendothelial_percPatient
102.00.0900.024.0167.0100.05.028.03981388.0...0.3715172.5851391.5479880.0773990.43343761.6253876.0061928.2043345.18575910
111.00.07.05.00.00.00.026.0556409.0...0.0807230.0000000.0000000.0000000.4197618.9764296.60316482.3861801.40458511
141.00.0190.06.02.01.00.053.07142100.0...0.0762680.0254230.0127110.0000000.67370090.7842891.2711334.0040680.72454614
154.00.032.07.07.01.00.019.01823747.0...0.2366460.2366460.0338070.0000000.64232661.62947925.2535507.8431372.90737015
1938.00.0983.0258.03.00.04.064.023221543.0...3.9582690.0460260.0000000.0613690.98189635.62442523.67290616.4927893.49800619
201.00.026.023.00.00.00.0152.0431740.0...0.4345360.0000000.0000000.0000002.87171781.5605520.75571512.0914421.77593020
221.084.05.0416.070.01.00.057.0244788.0...12.2713862.0648970.0294990.0000001.68141672.1828912.5958704.8082601.71091422
2367.01.0239.0750.00.03.01.0155.0337012.0...15.6707060.0000000.0626830.0208943.23861370.4137070.2507312.6326791.29544523
261.00.0159.017.00.00.01.015.0295049.0...0.4582210.0000000.0000000.0269540.40431379.5148251.32075512.7223721.23989226
275.00.045.00.03.02.00.010.0452214.0...0.0000000.0466640.0311090.0000000.15554570.3375330.21776326.5204541.91320627
281.00.026.023.01.00.00.090.0983718.0...0.8205490.0356760.0000000.0000003.21084635.06956825.61541232.2868361.99785928
307.00.0986.0148.03.00.05.074.014041049.0...2.7741330.0562320.0000000.0937211.38706726.31677619.66260525.4358015.66073130
3230.016.01137.0628.052.015.00.0122.063275.0...7.0136250.5807460.1675230.0000001.36252070.6611570.0558416.8572700.08934632
3314.00.064.033.00.01.01.026.01187398.0...1.4354070.0000000.0434970.0434971.13092651.63114417.31187511.43975613.57111833
3419.00.034.0435.00.02.00.0219.0142685.0...19.1545570.0000000.0880670.0000009.64332962.7917223.7428451.9815060.26420134
3513.00.02.0861.026.013.01.071.01892.0...71.4522822.1576761.0788380.0829885.89211615.6846470.1659750.1659752.07468935
36107.00.068.01299.01.00.00.0403.0280593.0...25.6770110.0197670.0000000.0000007.96600155.4457401.8383084.6056530.98833836
372.00.01.060.00.00.00.083.0435636.0...1.2947780.0000000.0000000.0000001.79110994.0008630.7768670.4963311.57531337
384.01.020.021.04.04.02.041.0480695.0...0.4089580.0778970.0778970.0389480.79844293.5929891.8500491.6942550.97371038
3911.00.0241.035.00.00.00.045.0388922.0...0.7927520.0000000.0000000.0000001.01925388.0860700.4983013.2842580.61155239
431.02.01730.01.01.04.01.023.0145711.0...0.0265320.0265320.1061290.0265320.61024138.6574690.29185511.2231362.2552404
412.00.0153.06.00.00.02.02.0714.0...2.3622050.0000000.0000000.7874020.78740227.9527561.5748033.1496062.36220541
4250.00.0746.0481.050.012.032.0209.029688.0...9.5988820.9978050.2394730.6385954.17082459.2296950.1596495.8072243.27280042
439.00.044.010.00.00.01.07.098315.0...0.6662230.0000000.0000000.0666220.46635665.4896740.99933424.1172554.66355843
4412.00.048.014.00.00.00.04.0362315.0...0.3442340.0000000.0000000.0000000.09835389.0828620.3688227.8927960.73764444
459.00.0277.024.00.03.00.080.04357446.0...0.3917730.0000000.0489720.0000001.30590971.1230827.28044411.6878883.49330745
469.00.037.022.03.00.00.09.0228121.0...0.8641010.1178320.0000000.0000000.35349689.5915160.8248236.0094270.43205046
51.01.066.040.078.06.00.055.03931845.0...1.5071592.9389600.2260740.0000002.07234414.80783769.5177094.6721931.6955545
502.00.0130.091.05.00.01.066.03155876.0...1.6672770.0916090.0000000.0183221.20923457.80505716.04983512.6786378.06156150
5237.00.091.07.025.01.00.0175.03656668.0...0.1011120.3611150.0144450.0000002.52780652.8094769.64899630.6803412.00780052
53144.00.018.065.00.00.00.075.03079169.0...1.4434820.0000000.0000000.0000001.66555668.3766383.75305420.0088831.15478653
543.00.02.01133.03.02.00.0340.0471492.0...16.6202140.0440080.0293380.0000004.98753169.1506531.3495675.8676841.87765954
576.00.069.062.00.00.00.043.0576530.0...0.9950250.0000000.0000000.0000000.69009892.5212650.4814643.1134650.99502557
581.00.017.039.00.00.01.06.0134122.0...6.9395020.0000000.0000000.1779361.06761623.84341621.70818516.90391526.15658458
62.00.0235.05.01.05.00.071.03275129.0...0.1129690.0225940.1129690.0000001.60415773.9945772.91459613.9855401.8978766
635.00.0117.099.03.01.00.058.04629389.0...1.8228690.0552380.0184130.0000001.06794385.2329227.1625851.0679431.32572363
71.00.0184.031.00.00.00.011.077124.0...1.9707570.0000000.0000000.0000000.69930149.0146221.52574733.7571521.2714567
82.00.0704.018.00.00.04.028.04514235.0...0.2563010.0000000.0000000.0569560.39869064.2745273.34614818.4251743.1895208
180.027.0328.0395.01.00.02.083.0837123.0...4.0894500.0103530.0000000.0207060.85930286.6652860.2381201.9877832.45367018
250.01.05.053.00.02.00.042.0184422.0...2.3756160.0000000.0896460.0000001.88256482.6535190.9861059.8162261.92738725
290.02.0105.027.0101.03.01.059.0244828.0...0.8353963.1250000.0928220.0309411.82549575.7425740.8663379.4987624.67203029
30.03.06.07.00.00.00.017.010377.0...0.3428010.0000000.0000000.0000000.83251750.7835460.34280144.0254653.2321253
120.00.0318.06.02.00.02.0153.074488.0...0.0668300.0222770.0000000.0222771.70416682.9583430.0891077.3290274.26598412
130.00.039.028.00.01.00.021.018640.0...1.3157890.0000000.0469920.0000000.98684287.5939850.0000007.4718050.75188013
160.00.045.041.00.03.00.0119.05667240.0...0.5828830.0000000.0426500.0000001.69178380.5658233.41199911.4159801.64913316
170.00.0220.035.02.00.01.028.041291400.0...0.5346780.0305530.0000000.0152770.42774263.07668821.3871078.2187602.94836517
210.00.0234.091.00.00.00.0177.07353108.0...1.0944080.0000000.0000000.0000002.12868388.4305471.2988573.2471440.98617021
240.00.03.045.01.00.00.027.04639.0...7.0643640.1569860.0000000.0000004.23861972.6844581.41287312.7158561.25588724
400.00.011.06.01.00.00.017.022741562.0...0.1401210.0233540.0000000.0000000.39701153.10602536.4782817.2629612.33535740
470.00.014.010.01.00.01.012.02740235.0...0.3104630.0310460.0000000.0310460.37255585.0667497.2958715.8677430.58987947
480.00.022.051.00.00.00.014.01252310.0...2.8732390.0000000.0000000.0000000.78873270.53521117.4647894.5633802.53521148
490.00.05.0206.00.00.00.085.01300113.0...11.0219370.0000000.0000000.0000004.54788769.5559126.0460141.5516327.00909649
510.00.04.01.01.00.01.00.0111.0...2.2727272.2727270.0000002.2727270.00000025.0000002.27272713.63636443.18181851
550.00.02.0114.03.07.00.058.014593.0...5.7926830.1524390.3556910.0000002.94715474.1361790.15243914.3292682.03252055
560.00.01.012.02.00.00.020.03482199.0...0.3125810.0520970.0000000.0000000.52096990.7007035.1836421.8233921.38056856
590.00.024.068.017.06.00.048.05450280.0...1.1308830.2827210.0997840.0000000.79827090.6369534.6565770.6485951.34708159
610.00.079.0144.04.019.00.037.0958375.0...7.7046550.2140181.0165860.0000001.97966851.25735720.0642059.5238104.01284161
90.00.0465.082.00.01.01.036.0473367.0...1.1848000.0000000.0144490.0144490.52015668.3860710.96806818.9712473.2220789
600.00.00.0107.09.016.01.057.01979107.0...4.6340410.3897790.6929410.0433092.46860185.7080994.6340410.0433091.38588160
620.00.00.023.03.015.00.04.015191.0...7.4193550.9677424.8387100.0000001.29032348.70967729.3548396.4516130.96774262
\n", "

60 rows × 26 columns

\n", "
" ], "text/plain": [ " dc b tcd4 tcd8 m1 m2 treg immune_other cancer \\\n", "10 2.0 0.0 900.0 24.0 167.0 100.0 5.0 28.0 3981 \n", "11 1.0 0.0 7.0 5.0 0.0 0.0 0.0 26.0 556 \n", "14 1.0 0.0 190.0 6.0 2.0 1.0 0.0 53.0 7142 \n", "15 4.0 0.0 32.0 7.0 7.0 1.0 0.0 19.0 1823 \n", "19 38.0 0.0 983.0 258.0 3.0 0.0 4.0 64.0 2322 \n", "20 1.0 0.0 26.0 23.0 0.0 0.0 0.0 152.0 4317 \n", "22 1.0 84.0 5.0 416.0 70.0 1.0 0.0 57.0 2447 \n", "23 67.0 1.0 239.0 750.0 0.0 3.0 1.0 155.0 3370 \n", "26 1.0 0.0 159.0 17.0 0.0 0.0 1.0 15.0 2950 \n", "27 5.0 0.0 45.0 0.0 3.0 2.0 0.0 10.0 4522 \n", "28 1.0 0.0 26.0 23.0 1.0 0.0 0.0 90.0 983 \n", "30 7.0 0.0 986.0 148.0 3.0 0.0 5.0 74.0 1404 \n", "32 30.0 16.0 1137.0 628.0 52.0 15.0 0.0 122.0 6327 \n", "33 14.0 0.0 64.0 33.0 0.0 1.0 1.0 26.0 1187 \n", "34 19.0 0.0 34.0 435.0 0.0 2.0 0.0 219.0 1426 \n", "35 13.0 0.0 2.0 861.0 26.0 13.0 1.0 71.0 189 \n", "36 107.0 0.0 68.0 1299.0 1.0 0.0 0.0 403.0 2805 \n", "37 2.0 0.0 1.0 60.0 0.0 0.0 0.0 83.0 4356 \n", "38 4.0 1.0 20.0 21.0 4.0 4.0 2.0 41.0 4806 \n", "39 11.0 0.0 241.0 35.0 0.0 0.0 0.0 45.0 3889 \n", "4 31.0 2.0 1730.0 1.0 1.0 4.0 1.0 23.0 1457 \n", "41 2.0 0.0 153.0 6.0 0.0 0.0 2.0 2.0 71 \n", "42 50.0 0.0 746.0 481.0 50.0 12.0 32.0 209.0 2968 \n", "43 9.0 0.0 44.0 10.0 0.0 0.0 1.0 7.0 983 \n", "44 12.0 0.0 48.0 14.0 0.0 0.0 0.0 4.0 3623 \n", "45 9.0 0.0 277.0 24.0 0.0 3.0 0.0 80.0 4357 \n", "46 9.0 0.0 37.0 22.0 3.0 0.0 0.0 9.0 2281 \n", "5 1.0 1.0 66.0 40.0 78.0 6.0 0.0 55.0 393 \n", "50 2.0 0.0 130.0 91.0 5.0 0.0 1.0 66.0 3155 \n", "52 37.0 0.0 91.0 7.0 25.0 1.0 0.0 175.0 3656 \n", "53 144.0 0.0 18.0 65.0 0.0 0.0 0.0 75.0 3079 \n", "54 3.0 0.0 2.0 1133.0 3.0 2.0 0.0 340.0 4714 \n", "57 6.0 0.0 69.0 62.0 0.0 0.0 0.0 43.0 5765 \n", "58 1.0 0.0 17.0 39.0 0.0 0.0 1.0 6.0 134 \n", "6 2.0 0.0 235.0 5.0 1.0 5.0 0.0 71.0 3275 \n", "63 5.0 0.0 117.0 99.0 3.0 1.0 0.0 58.0 4629 \n", "7 1.0 0.0 184.0 31.0 0.0 0.0 0.0 11.0 771 \n", "8 2.0 0.0 704.0 18.0 0.0 0.0 4.0 28.0 4514 \n", "18 0.0 27.0 328.0 395.0 1.0 0.0 2.0 83.0 8371 \n", "25 0.0 1.0 5.0 53.0 0.0 2.0 0.0 42.0 1844 \n", "29 0.0 2.0 105.0 27.0 101.0 3.0 1.0 59.0 2448 \n", "3 0.0 3.0 6.0 7.0 0.0 0.0 0.0 17.0 1037 \n", "12 0.0 0.0 318.0 6.0 2.0 0.0 2.0 153.0 7448 \n", "13 0.0 0.0 39.0 28.0 0.0 1.0 0.0 21.0 1864 \n", "16 0.0 0.0 45.0 41.0 0.0 3.0 0.0 119.0 5667 \n", "17 0.0 0.0 220.0 35.0 2.0 0.0 1.0 28.0 4129 \n", "21 0.0 0.0 234.0 91.0 0.0 0.0 0.0 177.0 7353 \n", "24 0.0 0.0 3.0 45.0 1.0 0.0 0.0 27.0 463 \n", "40 0.0 0.0 11.0 6.0 1.0 0.0 0.0 17.0 2274 \n", "47 0.0 0.0 14.0 10.0 1.0 0.0 1.0 12.0 2740 \n", "48 0.0 0.0 22.0 51.0 0.0 0.0 0.0 14.0 1252 \n", "49 0.0 0.0 5.0 206.0 0.0 0.0 0.0 85.0 1300 \n", "51 0.0 0.0 4.0 1.0 1.0 0.0 1.0 0.0 11 \n", "55 0.0 0.0 2.0 114.0 3.0 7.0 0.0 58.0 1459 \n", "56 0.0 0.0 1.0 12.0 2.0 0.0 0.0 20.0 3482 \n", "59 0.0 0.0 24.0 68.0 17.0 6.0 0.0 48.0 5450 \n", "61 0.0 0.0 79.0 144.0 4.0 19.0 0.0 37.0 958 \n", "9 0.0 0.0 465.0 82.0 0.0 1.0 1.0 36.0 4733 \n", "60 0.0 0.0 0.0 107.0 9.0 16.0 1.0 57.0 1979 \n", "62 0.0 0.0 0.0 23.0 3.0 15.0 0.0 4.0 151 \n", "\n", " αsma_mycaf ... tcd8_perc m1_perc m2_perc treg_perc \\\n", "10 388.0 ... 0.371517 2.585139 1.547988 0.077399 \n", "11 409.0 ... 0.080723 0.000000 0.000000 0.000000 \n", "14 100.0 ... 0.076268 0.025423 0.012711 0.000000 \n", "15 747.0 ... 0.236646 0.236646 0.033807 0.000000 \n", "19 1543.0 ... 3.958269 0.046026 0.000000 0.061369 \n", "20 40.0 ... 0.434536 0.000000 0.000000 0.000000 \n", "22 88.0 ... 12.271386 2.064897 0.029499 0.000000 \n", "23 12.0 ... 15.670706 0.000000 0.062683 0.020894 \n", "26 49.0 ... 0.458221 0.000000 0.000000 0.026954 \n", "27 14.0 ... 0.000000 0.046664 0.031109 0.000000 \n", "28 718.0 ... 0.820549 0.035676 0.000000 0.000000 \n", "30 1049.0 ... 2.774133 0.056232 0.000000 0.093721 \n", "32 5.0 ... 7.013625 0.580746 0.167523 0.000000 \n", "33 398.0 ... 1.435407 0.000000 0.043497 0.043497 \n", "34 85.0 ... 19.154557 0.000000 0.088067 0.000000 \n", "35 2.0 ... 71.452282 2.157676 1.078838 0.082988 \n", "36 93.0 ... 25.677011 0.019767 0.000000 0.000000 \n", "37 36.0 ... 1.294778 0.000000 0.000000 0.000000 \n", "38 95.0 ... 0.408958 0.077897 0.077897 0.038948 \n", "39 22.0 ... 0.792752 0.000000 0.000000 0.000000 \n", "4 11.0 ... 0.026532 0.026532 0.106129 0.026532 \n", "41 4.0 ... 2.362205 0.000000 0.000000 0.787402 \n", "42 8.0 ... 9.598882 0.997805 0.239473 0.638595 \n", "43 15.0 ... 0.666223 0.000000 0.000000 0.066622 \n", "44 15.0 ... 0.344234 0.000000 0.000000 0.000000 \n", "45 446.0 ... 0.391773 0.000000 0.048972 0.000000 \n", "46 21.0 ... 0.864101 0.117832 0.000000 0.000000 \n", "5 1845.0 ... 1.507159 2.938960 0.226074 0.000000 \n", "50 876.0 ... 1.667277 0.091609 0.000000 0.018322 \n", "52 668.0 ... 0.101112 0.361115 0.014445 0.000000 \n", "53 169.0 ... 1.443482 0.000000 0.000000 0.000000 \n", "54 92.0 ... 16.620214 0.044008 0.029338 0.000000 \n", "57 30.0 ... 0.995025 0.000000 0.000000 0.000000 \n", "58 122.0 ... 6.939502 0.000000 0.000000 0.177936 \n", "6 129.0 ... 0.112969 0.022594 0.112969 0.000000 \n", "63 389.0 ... 1.822869 0.055238 0.018413 0.000000 \n", "7 24.0 ... 1.970757 0.000000 0.000000 0.000000 \n", "8 235.0 ... 0.256301 0.000000 0.000000 0.056956 \n", "18 23.0 ... 4.089450 0.010353 0.000000 0.020706 \n", "25 22.0 ... 2.375616 0.000000 0.089646 0.000000 \n", "29 28.0 ... 0.835396 3.125000 0.092822 0.030941 \n", "3 7.0 ... 0.342801 0.000000 0.000000 0.000000 \n", "12 8.0 ... 0.066830 0.022277 0.000000 0.022277 \n", "13 0.0 ... 1.315789 0.000000 0.046992 0.000000 \n", "16 240.0 ... 0.582883 0.000000 0.042650 0.000000 \n", "17 1400.0 ... 0.534678 0.030553 0.000000 0.015277 \n", "21 108.0 ... 1.094408 0.000000 0.000000 0.000000 \n", "24 9.0 ... 7.064364 0.156986 0.000000 0.000000 \n", "40 1562.0 ... 0.140121 0.023354 0.000000 0.000000 \n", "47 235.0 ... 0.310463 0.031046 0.000000 0.031046 \n", "48 310.0 ... 2.873239 0.000000 0.000000 0.000000 \n", "49 113.0 ... 11.021937 0.000000 0.000000 0.000000 \n", "51 1.0 ... 2.272727 2.272727 0.000000 2.272727 \n", "55 3.0 ... 5.792683 0.152439 0.355691 0.000000 \n", "56 199.0 ... 0.312581 0.052097 0.000000 0.000000 \n", "59 280.0 ... 1.130883 0.282721 0.099784 0.000000 \n", "61 375.0 ... 7.704655 0.214018 1.016586 0.000000 \n", "9 67.0 ... 1.184800 0.000000 0.014449 0.014449 \n", "60 107.0 ... 4.634041 0.389779 0.692941 0.043309 \n", "62 91.0 ... 7.419355 0.967742 4.838710 0.000000 \n", "\n", " immune_other_perc cancer_perc αsma_mycaf_perc stroma_other_perc \\\n", "10 0.433437 61.625387 6.006192 8.204334 \n", "11 0.419761 8.976429 6.603164 82.386180 \n", "14 0.673700 90.784289 1.271133 4.004068 \n", "15 0.642326 61.629479 25.253550 7.843137 \n", "19 0.981896 35.624425 23.672906 16.492789 \n", "20 2.871717 81.560552 0.755715 12.091442 \n", "22 1.681416 72.182891 2.595870 4.808260 \n", "23 3.238613 70.413707 0.250731 2.632679 \n", "26 0.404313 79.514825 1.320755 12.722372 \n", "27 0.155545 70.337533 0.217763 26.520454 \n", "28 3.210846 35.069568 25.615412 32.286836 \n", "30 1.387067 26.316776 19.662605 25.435801 \n", "32 1.362520 70.661157 0.055841 6.857270 \n", "33 1.130926 51.631144 17.311875 11.439756 \n", "34 9.643329 62.791722 3.742845 1.981506 \n", "35 5.892116 15.684647 0.165975 0.165975 \n", "36 7.966001 55.445740 1.838308 4.605653 \n", "37 1.791109 94.000863 0.776867 0.496331 \n", "38 0.798442 93.592989 1.850049 1.694255 \n", "39 1.019253 88.086070 0.498301 3.284258 \n", "4 0.610241 38.657469 0.291855 11.223136 \n", "41 0.787402 27.952756 1.574803 3.149606 \n", "42 4.170824 59.229695 0.159649 5.807224 \n", "43 0.466356 65.489674 0.999334 24.117255 \n", "44 0.098353 89.082862 0.368822 7.892796 \n", "45 1.305909 71.123082 7.280444 11.687888 \n", "46 0.353496 89.591516 0.824823 6.009427 \n", "5 2.072344 14.807837 69.517709 4.672193 \n", "50 1.209234 57.805057 16.049835 12.678637 \n", "52 2.527806 52.809476 9.648996 30.680341 \n", "53 1.665556 68.376638 3.753054 20.008883 \n", "54 4.987531 69.150653 1.349567 5.867684 \n", "57 0.690098 92.521265 0.481464 3.113465 \n", "58 1.067616 23.843416 21.708185 16.903915 \n", "6 1.604157 73.994577 2.914596 13.985540 \n", "63 1.067943 85.232922 7.162585 1.067943 \n", "7 0.699301 49.014622 1.525747 33.757152 \n", "8 0.398690 64.274527 3.346148 18.425174 \n", "18 0.859302 86.665286 0.238120 1.987783 \n", "25 1.882564 82.653519 0.986105 9.816226 \n", "29 1.825495 75.742574 0.866337 9.498762 \n", "3 0.832517 50.783546 0.342801 44.025465 \n", "12 1.704166 82.958343 0.089107 7.329027 \n", "13 0.986842 87.593985 0.000000 7.471805 \n", "16 1.691783 80.565823 3.411999 11.415980 \n", "17 0.427742 63.076688 21.387107 8.218760 \n", "21 2.128683 88.430547 1.298857 3.247144 \n", "24 4.238619 72.684458 1.412873 12.715856 \n", "40 0.397011 53.106025 36.478281 7.262961 \n", "47 0.372555 85.066749 7.295871 5.867743 \n", "48 0.788732 70.535211 17.464789 4.563380 \n", "49 4.547887 69.555912 6.046014 1.551632 \n", "51 0.000000 25.000000 2.272727 13.636364 \n", "55 2.947154 74.136179 0.152439 14.329268 \n", "56 0.520969 90.700703 5.183642 1.823392 \n", "59 0.798270 90.636953 4.656577 0.648595 \n", "61 1.979668 51.257357 20.064205 9.523810 \n", "9 0.520156 68.386071 0.968068 18.971247 \n", "60 2.468601 85.708099 4.634041 0.043309 \n", "62 1.290323 48.709677 29.354839 6.451613 \n", "\n", " endothelial_perc Patient \n", "10 5.185759 10 \n", "11 1.404585 11 \n", "14 0.724546 14 \n", "15 2.907370 15 \n", "19 3.498006 19 \n", "20 1.775930 20 \n", "22 1.710914 22 \n", "23 1.295445 23 \n", "26 1.239892 26 \n", "27 1.913206 27 \n", "28 1.997859 28 \n", "30 5.660731 30 \n", "32 0.089346 32 \n", "33 13.571118 33 \n", "34 0.264201 34 \n", "35 2.074689 35 \n", "36 0.988338 36 \n", "37 1.575313 37 \n", "38 0.973710 38 \n", "39 0.611552 39 \n", "4 2.255240 4 \n", "41 2.362205 41 \n", "42 3.272800 42 \n", "43 4.663558 43 \n", "44 0.737644 44 \n", "45 3.493307 45 \n", "46 0.432050 46 \n", "5 1.695554 5 \n", "50 8.061561 50 \n", "52 2.007800 52 \n", "53 1.154786 53 \n", "54 1.877659 54 \n", "57 0.995025 57 \n", "58 26.156584 58 \n", "6 1.897876 6 \n", "63 1.325723 63 \n", "7 1.271456 7 \n", "8 3.189520 8 \n", "18 2.453670 18 \n", "25 1.927387 25 \n", "29 4.672030 29 \n", "3 3.232125 3 \n", "12 4.265984 12 \n", "13 0.751880 13 \n", "16 1.649133 16 \n", "17 2.948365 17 \n", "21 0.986170 21 \n", "24 1.255887 24 \n", "40 2.335357 40 \n", "47 0.589879 47 \n", "48 2.535211 48 \n", "49 7.009096 49 \n", "51 43.181818 51 \n", "55 2.032520 55 \n", "56 1.380568 56 \n", "59 1.347081 59 \n", "61 4.012841 61 \n", "9 3.222078 9 \n", "60 1.385881 60 \n", "62 0.967742 62 \n", "\n", "[60 rows x 26 columns]" ] }, "execution_count": 55, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Filtrer counts_patients pour ne conserver que les lignes avec 'Sample_ID' égal à 'DD3S1.csv', 'DD3S2.csv' ou 'DD3S3.csv'\n", "counts_patients_filtered = counts_patients[counts_patients.index.isin(df_filtered['Patient'])]\n", "\n", "# Ajout des colonnes de pourcentages pour chaque sous-type de cellules par patient\n", "counts_perc_patients = counts_patients_filtered.copy()\n", "\n", "# Calcul des pourcentages pour chaque sous-type de cellules, en excluant la colonne 'total_cells'\n", "for col in counts_perc_patients.columns:\n", " if col != 'Total_cells':\n", " counts_perc_patients[col + '_perc'] = (counts_perc_patients[col] / counts_perc_patients['Total_cells']) * 100\n", "\n", "\n", "# Affichage des pourcentages des sous-types de cellules par patient\n", "counts_perc_patients['Patient'] = counts_perc_patients.index\n", "counts_perc_patients.columns.values\n", "counts_perc_patients" ] }, { "cell_type": "code", "execution_count": 56, "id": "1f30ab7d-fa1e-4914-a575-da752330c1ea", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "marker": { "color": "rgb(166, 206, 227)" }, "name": "DC", "text": [ 0.030959752321981428, 0.01614465611882467, 0.012711325791280032, 0.1352265043948614, 0.5830009205277692, 0.01889287738522577, 0.029498525073746312, 1.3999164229001253, 0.026954177897574125, 0.07777259293824856, 0.03567606136282554, 0.13120899718837864, 0.33504578959124415, 0.6089604175728578, 0.836635843240863, 1.0788381742738589, 2.1150424985174934, 0.04315925766076824, 0.07789678675754626, 0.2491506228765572, 0.8224993366940834, 0.7874015748031495, 0.9978048293753742, 0.5996002664890073, 0.29505778214900413, 0.14691478942213515, 0.3534956794972506, 0.037678975131876416, 0.03664345914254306, 0.5344503827820309, 3.1978680879413726, 0.044007627988851404, 0.09629272989889263, 0.1779359430604982, 0.045187528242205156, 0.09206407659731174, 0.06357279084551812, 0.028477858465043433, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], "textposition": "auto", "type": "bar", "x": [ "10", "11", "14", "15", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "7", "8", "18", "25", "29", "3", "12", "13", "16", "17", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "9", "60", "62" ], "y": [ 0.030959752321981428, 0.01614465611882467, 0.012711325791280032, 0.1352265043948614, 0.5830009205277692, 0.01889287738522577, 0.029498525073746312, 1.3999164229001253, 0.026954177897574125, 0.07777259293824856, 0.03567606136282554, 0.13120899718837864, 0.33504578959124415, 0.6089604175728578, 0.836635843240863, 1.0788381742738589, 2.1150424985174934, 0.04315925766076824, 0.07789678675754626, 0.2491506228765572, 0.8224993366940834, 0.7874015748031495, 0.9978048293753742, 0.5996002664890073, 0.29505778214900413, 0.14691478942213515, 0.3534956794972506, 0.037678975131876416, 0.03664345914254306, 0.5344503827820309, 3.1978680879413726, 0.044007627988851404, 0.09629272989889263, 0.1779359430604982, 0.045187528242205156, 0.09206407659731174, 0.06357279084551812, 0.028477858465043433, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] }, { "marker": { "color": "rgb(31, 120, 180)" }, "name": "B", "text": [ 0, 0, 0, 0, 0, 0, 2.47787610619469, 0.020894274968658588, 0, 0, 0, 0, 0.17869108778199688, 0, 0, 0, 0, 0, 0.019474196689386564, 0, 0.05306447333510214, 0, 0, 0, 0, 0, 0, 0.037678975131876416, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2795320426545191, 0.04482294935006724, 0.06188118811881188, 0.14691478942213515, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], "textposition": "auto", "type": "bar", "x": [ "10", "11", "14", "15", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "7", "8", "18", "25", "29", "3", "12", "13", "16", "17", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "9", "60", "62" ], "y": [ 0, 0, 0, 0, 0, 0, 2.47787610619469, 0.020894274968658588, 0, 0, 0, 0, 0.17869108778199688, 0, 0, 0, 0, 0, 0.019474196689386564, 0, 0.05306447333510214, 0, 0, 0, 0, 0, 0, 0.037678975131876416, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.2795320426545191, 0.04482294935006724, 0.06188118811881188, 0.14691478942213515, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] }, { "marker": { "color": "rgb(178, 223, 138)" }, "name": "TCD4", "text": [ 13.93188854489164, 0.11301259283177267, 2.4151519003432056, 1.0818120351588911, 15.081313286284137, 0.49121481201587003, 0.14749262536873156, 4.9937317175094025, 4.285714285714286, 0.6999533364442371, 0.9275775954334641, 18.481724461105905, 12.698235425508154, 2.7838190517616357, 1.4971378247468077, 0.16597510373443983, 1.344139157936351, 0.02157962883038412, 0.3894839337877313, 5.458663646659117, 45.900769434863356, 60.23622047244095, 14.887248054280583, 2.9313790806129245, 1.1802311285960165, 4.521710741103494, 1.4532600157109192, 2.4868123587038435, 2.381824844265299, 1.314459049544995, 0.39973351099267157, 0.029338418659234266, 1.1073663938372653, 3.0249110320284696, 5.309534568459105, 2.1542993923770943, 11.697393515575333, 10.024206179695287, 3.3957966663215657, 0.22411474675033619, 3.248762376237624, 0.2938295788442703, 3.5419915348629982, 1.8327067669172932, 0.639749786750071, 3.3608310418576233, 2.814191220685508, 0.47095761381475665, 0.25688930406352173, 0.43464762496119214, 1.2394366197183098, 0.26752273943285176, 9.090909090909092, 0.10162601626016261, 0.026048450117218028, 0.39913520705138866, 4.226859283039058, 6.718682271348071, 0, 0 ], "textposition": "auto", "type": "bar", "x": [ "10", "11", "14", "15", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "7", "8", "18", "25", "29", "3", "12", "13", "16", "17", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "9", "60", "62" ], "y": [ 13.93188854489164, 0.11301259283177267, 2.4151519003432056, 1.0818120351588911, 15.081313286284137, 0.49121481201587003, 0.14749262536873156, 4.9937317175094025, 4.285714285714286, 0.6999533364442371, 0.9275775954334641, 18.481724461105905, 12.698235425508154, 2.7838190517616357, 1.4971378247468077, 0.16597510373443983, 1.344139157936351, 0.02157962883038412, 0.3894839337877313, 5.458663646659117, 45.900769434863356, 60.23622047244095, 14.887248054280583, 2.9313790806129245, 1.1802311285960165, 4.521710741103494, 1.4532600157109192, 2.4868123587038435, 2.381824844265299, 1.314459049544995, 0.39973351099267157, 0.029338418659234266, 1.1073663938372653, 3.0249110320284696, 5.309534568459105, 2.1542993923770943, 11.697393515575333, 10.024206179695287, 3.3957966663215657, 0.22411474675033619, 3.248762376237624, 0.2938295788442703, 3.5419915348629982, 1.8327067669172932, 0.639749786750071, 3.3608310418576233, 2.814191220685508, 0.47095761381475665, 0.25688930406352173, 0.43464762496119214, 1.2394366197183098, 0.26752273943285176, 9.090909090909092, 0.10162601626016261, 0.026048450117218028, 0.39913520705138866, 4.226859283039058, 6.718682271348071, 0, 0 ] }, { "marker": { "color": "rgb(51, 160, 44)" }, "name": "TCD8", "text": [ 0.37151702786377705, 0.08072328059412334, 0.07626795474768018, 0.23664638269100743, 3.958269407793802, 0.4345361798601928, 12.271386430678465, 15.670706226493941, 0.4582210242587601, 0, 0.8205494113449875, 2.7741330834114337, 7.013625195443378, 1.4354066985645932, 19.154557463672393, 71.45228215767635, 25.677011267048822, 1.294777729823047, 0.4089581304771178, 0.7927519818799547, 0.02653223666755107, 2.3622047244094486, 9.5988824585911, 0.6662225183211192, 0.34423407917383825, 0.3917727717923604, 0.864100549882168, 1.5071590052750565, 1.667277390985709, 0.10111223458038424, 1.4434821230290917, 16.62021417045621, 0.9950248756218906, 6.93950177935943, 0.11296882060551287, 1.8228687166267723, 1.9707565162110616, 0.25630072618539085, 4.089450253649446, 2.3756163155535632, 0.8353960396039605, 0.3428011753183154, 0.06683002895967921, 1.3157894736842104, 0.5828831390389536, 0.5346776657500764, 1.0944076969332532, 7.064364207221351, 0.14012143858010276, 0.3104625892579944, 2.873239436619718, 11.021936864633494, 2.272727272727273, 5.7926829268292686, 0.3125814014066163, 1.1308830866456012, 7.704654895666131, 1.1847998844097674, 4.634040710264184, 7.419354838709677 ], "textposition": "auto", "type": "bar", "x": [ "10", "11", "14", "15", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "7", "8", "18", "25", "29", "3", "12", "13", "16", "17", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "9", "60", "62" ], "y": [ 0.37151702786377705, 0.08072328059412334, 0.07626795474768018, 0.23664638269100743, 3.958269407793802, 0.4345361798601928, 12.271386430678465, 15.670706226493941, 0.4582210242587601, 0, 0.8205494113449875, 2.7741330834114337, 7.013625195443378, 1.4354066985645932, 19.154557463672393, 71.45228215767635, 25.677011267048822, 1.294777729823047, 0.4089581304771178, 0.7927519818799547, 0.02653223666755107, 2.3622047244094486, 9.5988824585911, 0.6662225183211192, 0.34423407917383825, 0.3917727717923604, 0.864100549882168, 1.5071590052750565, 1.667277390985709, 0.10111223458038424, 1.4434821230290917, 16.62021417045621, 0.9950248756218906, 6.93950177935943, 0.11296882060551287, 1.8228687166267723, 1.9707565162110616, 0.25630072618539085, 4.089450253649446, 2.3756163155535632, 0.8353960396039605, 0.3428011753183154, 0.06683002895967921, 1.3157894736842104, 0.5828831390389536, 0.5346776657500764, 1.0944076969332532, 7.064364207221351, 0.14012143858010276, 0.3104625892579944, 2.873239436619718, 11.021936864633494, 2.272727272727273, 5.7926829268292686, 0.3125814014066163, 1.1308830866456012, 7.704654895666131, 1.1847998844097674, 4.634040710264184, 7.419354838709677 ] }, { "marker": { "color": "rgb(251, 154, 153)" }, "name": "M1", "text": [ 2.5851393188854486, 0, 0.025422651582560064, 0.23664638269100743, 0.04602638846271863, 0, 2.0648967551622417, 0, 0, 0.04666355576294914, 0.03567606136282554, 0.056232427366447985, 0.5807460352914898, 0, 0, 2.1576763485477177, 0.0197667523225934, 0, 0.07789678675754626, 0, 0.02653223666755107, 0, 0.9978048293753742, 0, 0, 0, 0.1178318931657502, 2.93896006028636, 0.09160864785635764, 0.36111512350137226, 0, 0.044007627988851404, 0, 0, 0.022593764121102578, 0.055238445958387034, 0, 0, 0.01035303861683404, 0, 3.125, 0, 0.022276676319893073, 0, 0, 0.030553009471432937, 0, 0.15698587127158556, 0.023353573096683792, 0.03104625892579944, 0, 0, 2.272727272727273, 0.1524390243902439, 0.052096900234436055, 0.2827207716614003, 0.2140181915462814, 0, 0.3897791251624079, 0.967741935483871 ], "textposition": "auto", "type": "bar", "x": [ "10", "11", "14", "15", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "7", "8", "18", "25", "29", "3", "12", "13", "16", "17", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "9", "60", "62" ], "y": [ 2.5851393188854486, 0, 0.025422651582560064, 0.23664638269100743, 0.04602638846271863, 0, 2.0648967551622417, 0, 0, 0.04666355576294914, 0.03567606136282554, 0.056232427366447985, 0.5807460352914898, 0, 0, 2.1576763485477177, 0.0197667523225934, 0, 0.07789678675754626, 0, 0.02653223666755107, 0, 0.9978048293753742, 0, 0, 0, 0.1178318931657502, 2.93896006028636, 0.09160864785635764, 0.36111512350137226, 0, 0.044007627988851404, 0, 0, 0.022593764121102578, 0.055238445958387034, 0, 0, 0.01035303861683404, 0, 3.125, 0, 0.022276676319893073, 0, 0, 0.030553009471432937, 0, 0.15698587127158556, 0.023353573096683792, 0.03104625892579944, 0, 0, 2.272727272727273, 0.1524390243902439, 0.052096900234436055, 0.2827207716614003, 0.2140181915462814, 0, 0.3897791251624079, 0.967741935483871 ] }, { "marker": { "color": "rgb(227, 26, 28)" }, "name": "M2", "text": [ 1.5479876160990713, 0, 0.012711325791280032, 0.03380662609871535, 0, 0, 0.029498525073746312, 0.06268282490597576, 0, 0.031109037175299427, 0, 0, 0.16752289479562207, 0.04349717268377556, 0.08806693086745927, 1.0788381742738589, 0, 0, 0.07789678675754626, 0, 0.10612894667020428, 0, 0.23947315905008978, 0, 0, 0.04897159647404505, 0, 0.22607385079125847, 0, 0.01444460494005489, 0, 0.029338418659234266, 0, 0, 0.11296882060551287, 0.018412815319462345, 0, 0, 0, 0.08964589870013448, 0.09282178217821782, 0, 0, 0.046992481203007516, 0.04264998578333807, 0, 0, 0, 0, 0, 0, 0, 0, 0.35569105691056907, 0, 0.09978380176284717, 1.0165864098448367, 0.014448779078167894, 0.6929406669553919, 4.838709677419355 ], "textposition": "auto", "type": "bar", "x": [ "10", "11", "14", "15", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "7", "8", "18", "25", "29", "3", "12", "13", "16", "17", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "9", "60", "62" ], "y": [ 1.5479876160990713, 0, 0.012711325791280032, 0.03380662609871535, 0, 0, 0.029498525073746312, 0.06268282490597576, 0, 0.031109037175299427, 0, 0, 0.16752289479562207, 0.04349717268377556, 0.08806693086745927, 1.0788381742738589, 0, 0, 0.07789678675754626, 0, 0.10612894667020428, 0, 0.23947315905008978, 0, 0, 0.04897159647404505, 0, 0.22607385079125847, 0, 0.01444460494005489, 0, 0.029338418659234266, 0, 0, 0.11296882060551287, 0.018412815319462345, 0, 0, 0, 0.08964589870013448, 0.09282178217821782, 0, 0, 0.046992481203007516, 0.04264998578333807, 0, 0, 0, 0, 0, 0, 0, 0, 0.35569105691056907, 0, 0.09978380176284717, 1.0165864098448367, 0.014448779078167894, 0.6929406669553919, 4.838709677419355 ] }, { "marker": { "color": "rgb(253, 191, 111)" }, "name": "Treg", "text": [ 0.07739938080495357, 0, 0, 0, 0.0613685179502915, 0, 0, 0.020894274968658588, 0.026954177897574125, 0, 0, 0.09372071227741331, 0, 0.04349717268377556, 0, 0.08298755186721991, 0, 0, 0.03894839337877313, 0, 0.02653223666755107, 0.7874015748031495, 0.6385950908002395, 0.06662225183211193, 0, 0, 0, 0, 0.01832172957127153, 0, 0, 0, 0, 0.1779359430604982, 0, 0, 0, 0.056955716930086865, 0.02070607723366808, 0, 0.03094059405940594, 0, 0.022276676319893073, 0, 0, 0.015276504735716468, 0, 0, 0, 0.03104625892579944, 0, 0, 2.272727272727273, 0, 0, 0, 0, 0.014448779078167894, 0.043308791684711995, 0 ], "textposition": "auto", "type": "bar", "x": [ "10", "11", "14", "15", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "7", "8", "18", "25", "29", "3", "12", "13", "16", "17", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "9", "60", "62" ], "y": [ 0.07739938080495357, 0, 0, 0, 0.0613685179502915, 0, 0, 0.020894274968658588, 0.026954177897574125, 0, 0, 0.09372071227741331, 0, 0.04349717268377556, 0, 0.08298755186721991, 0, 0, 0.03894839337877313, 0, 0.02653223666755107, 0.7874015748031495, 0.6385950908002395, 0.06662225183211193, 0, 0, 0, 0, 0.01832172957127153, 0, 0, 0, 0, 0.1779359430604982, 0, 0, 0, 0.056955716930086865, 0.02070607723366808, 0, 0.03094059405940594, 0, 0.022276676319893073, 0, 0, 0.015276504735716468, 0, 0, 0, 0.03104625892579944, 0, 0, 2.272727272727273, 0, 0, 0, 0, 0.014448779078167894, 0.043308791684711995, 0 ] }, { "marker": { "color": "rgb(1.0, 0.4980392156862745, 0.0)" }, "name": "IMMUNE_OTHER", "text": [ 0.43343653250773995, 0.4197610590894414, 0.6737002669378416, 0.6423258958755916, 0.981896287204664, 2.871717362554317, 1.6814159292035398, 3.238612620142081, 0.40431266846361186, 0.15554518587649713, 3.2108455226542985, 1.3870665417057169, 1.3625195443377263, 1.1309264897781643, 9.64332892998679, 5.892116182572614, 7.96600118600514, 1.7911091929218816, 0.7984420642648491, 1.0192525481313703, 0.6102414433536747, 0.7874015748031495, 4.170824186789064, 0.4663557628247834, 0.09835259404966806, 1.305909239307868, 0.3534956794972506, 2.0723436322532027, 1.2092341517039207, 2.5278058645096055, 1.6655562958027983, 4.987531172069826, 0.6900978976087305, 1.0676156583629894, 1.6041572525982828, 1.067943288528816, 0.6993006993006993, 0.39869001851060804, 0.8593022051972253, 1.8825638727028238, 1.8254950495049505, 0.832517140058766, 1.70416573847182, 0.9868421052631579, 1.6917827694057437, 0.4277421326000611, 2.1286831028262174, 4.23861852433281, 0.39701074264362446, 0.37255510710959333, 0.7887323943661971, 4.5478865703584805, 0, 2.9471544715447155, 0.5209690023443605, 0.7982704141027773, 1.9796682718031033, 0.5201560468140443, 2.468601126028584, 1.2903225806451613 ], "textposition": "auto", "type": "bar", "x": [ "10", "11", "14", "15", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "7", "8", "18", "25", "29", "3", "12", "13", "16", "17", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "9", "60", "62" ], "y": [ 0.43343653250773995, 0.4197610590894414, 0.6737002669378416, 0.6423258958755916, 0.981896287204664, 2.871717362554317, 1.6814159292035398, 3.238612620142081, 0.40431266846361186, 0.15554518587649713, 3.2108455226542985, 1.3870665417057169, 1.3625195443377263, 1.1309264897781643, 9.64332892998679, 5.892116182572614, 7.96600118600514, 1.7911091929218816, 0.7984420642648491, 1.0192525481313703, 0.6102414433536747, 0.7874015748031495, 4.170824186789064, 0.4663557628247834, 0.09835259404966806, 1.305909239307868, 0.3534956794972506, 2.0723436322532027, 1.2092341517039207, 2.5278058645096055, 1.6655562958027983, 4.987531172069826, 0.6900978976087305, 1.0676156583629894, 1.6041572525982828, 1.067943288528816, 0.6993006993006993, 0.39869001851060804, 0.8593022051972253, 1.8825638727028238, 1.8254950495049505, 0.832517140058766, 1.70416573847182, 0.9868421052631579, 1.6917827694057437, 0.4277421326000611, 2.1286831028262174, 4.23861852433281, 0.39701074264362446, 0.37255510710959333, 0.7887323943661971, 4.5478865703584805, 0, 2.9471544715447155, 0.5209690023443605, 0.7982704141027773, 1.9796682718031033, 0.5201560468140443, 2.468601126028584, 1.2903225806451613 ] }, { "marker": { "color": "rgb(202, 178, 214)" }, "name": "CANCER", "text": [ 61.62538699690403, 8.976428802066517, 90.78428880132198, 61.629479377958084, 35.624424670144215, 81.56055167201964, 72.18289085545723, 70.41370664437943, 79.51482479784366, 70.33753305335199, 35.06956831965751, 26.316776007497655, 70.66115702479338, 51.63114397564158, 62.79172170849846, 15.684647302904564, 55.44574026487447, 94.00086318515322, 93.59298928919182, 88.08607021517554, 38.657468824621915, 27.95275590551181, 59.229694671722214, 65.48967355096602, 89.08286206048685, 71.12308194580477, 89.59151610369207, 14.80783722682743, 57.80505679736167, 52.809475660840675, 68.37663779702422, 69.15065277981518, 92.52126464451933, 23.843416370106763, 73.99457749661093, 85.2329221137912, 49.01462174189447, 64.27452655560302, 86.66528626151776, 82.65351860152398, 75.74257425742574, 50.783545543584715, 82.9583426152818, 87.59398496240601, 80.56582314472563, 63.0766880537733, 88.43054720384846, 72.68445839874411, 53.10602522185894, 85.06674945669047, 70.53521126760563, 69.55591225254146, 25, 74.13617886178862, 90.70070330815317, 90.63695326791951, 51.2573568753344, 68.38607137696864, 85.70809874404503, 48.70967741935484 ], "textposition": "auto", "type": "bar", "x": [ "10", "11", "14", "15", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "7", "8", "18", "25", "29", "3", "12", "13", "16", "17", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "9", "60", "62" ], "y": [ 61.62538699690403, 8.976428802066517, 90.78428880132198, 61.629479377958084, 35.624424670144215, 81.56055167201964, 72.18289085545723, 70.41370664437943, 79.51482479784366, 70.33753305335199, 35.06956831965751, 26.316776007497655, 70.66115702479338, 51.63114397564158, 62.79172170849846, 15.684647302904564, 55.44574026487447, 94.00086318515322, 93.59298928919182, 88.08607021517554, 38.657468824621915, 27.95275590551181, 59.229694671722214, 65.48967355096602, 89.08286206048685, 71.12308194580477, 89.59151610369207, 14.80783722682743, 57.80505679736167, 52.809475660840675, 68.37663779702422, 69.15065277981518, 92.52126464451933, 23.843416370106763, 73.99457749661093, 85.2329221137912, 49.01462174189447, 64.27452655560302, 86.66528626151776, 82.65351860152398, 75.74257425742574, 50.783545543584715, 82.9583426152818, 87.59398496240601, 80.56582314472563, 63.0766880537733, 88.43054720384846, 72.68445839874411, 53.10602522185894, 85.06674945669047, 70.53521126760563, 69.55591225254146, 25, 74.13617886178862, 90.70070330815317, 90.63695326791951, 51.2573568753344, 68.38607137696864, 85.70809874404503, 48.70967741935484 ] }, { "marker": { "color": "rgb(106, 61, 154)" }, "name": "αSMA_myCAF", "text": [ 6.006191950464396, 6.603164352599291, 1.271132579128003, 25.25354969574036, 23.672905799324948, 0.7557150954090308, 2.5958702064896757, 0.25073129962390306, 1.3207547169811322, 0.21776326022709597, 25.615412058508742, 19.66260543580131, 0.05584096493187402, 17.31187472814267, 3.742844561867019, 0.16597510373443983, 1.838307966001186, 0.7768666378938283, 1.8500486854917235, 0.4983012457531144, 0.29185460334306185, 1.574803149606299, 0.15964877270005987, 0.9993337774816788, 0.3688222276862552, 7.280444009141365, 0.8248232521602514, 69.51770911831197, 16.049835104433857, 9.648996099956667, 3.7530535198756385, 1.3495672583247762, 0.4814636494944632, 21.70818505338078, 2.914595571622232, 7.1625851592708525, 1.5257469802924348, 3.3461483696426026, 0.2381198881871829, 0.9861048857014791, 0.8663366336633664, 0.3428011753183154, 0.08910670527957229, 0, 3.4119988626670454, 21.387106630003057, 1.2988574864702345, 1.4128728414442702, 36.47828117702009, 7.295870847562869, 17.464788732394364, 6.046013911182451, 2.272727272727273, 0.1524390243902439, 5.183641573326387, 4.656577415599535, 20.064205457463885, 0.9680681982372489, 4.634040710264184, 29.354838709677416 ], "textposition": "auto", "type": "bar", "x": [ "10", "11", "14", "15", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "7", "8", "18", "25", "29", "3", "12", "13", "16", "17", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "9", "60", "62" ], "y": [ 6.006191950464396, 6.603164352599291, 1.271132579128003, 25.25354969574036, 23.672905799324948, 0.7557150954090308, 2.5958702064896757, 0.25073129962390306, 1.3207547169811322, 0.21776326022709597, 25.615412058508742, 19.66260543580131, 0.05584096493187402, 17.31187472814267, 3.742844561867019, 0.16597510373443983, 1.838307966001186, 0.7768666378938283, 1.8500486854917235, 0.4983012457531144, 0.29185460334306185, 1.574803149606299, 0.15964877270005987, 0.9993337774816788, 0.3688222276862552, 7.280444009141365, 0.8248232521602514, 69.51770911831197, 16.049835104433857, 9.648996099956667, 3.7530535198756385, 1.3495672583247762, 0.4814636494944632, 21.70818505338078, 2.914595571622232, 7.1625851592708525, 1.5257469802924348, 3.3461483696426026, 0.2381198881871829, 0.9861048857014791, 0.8663366336633664, 0.3428011753183154, 0.08910670527957229, 0, 3.4119988626670454, 21.387106630003057, 1.2988574864702345, 1.4128728414442702, 36.47828117702009, 7.295870847562869, 17.464788732394364, 6.046013911182451, 2.272727272727273, 0.1524390243902439, 5.183641573326387, 4.656577415599535, 20.064205457463885, 0.9680681982372489, 4.634040710264184, 29.354838709677416 ] }, { "marker": { "color": "rgb(1.0, 1.0, 0.6)" }, "name": "STROMA_OTHER", "text": [ 8.204334365325078, 82.3861801743623, 4.004067624253209, 7.8431372549019605, 16.49278919914084, 12.091441526544493, 4.808259587020649, 2.632678646050982, 12.722371967654986, 26.52045419194276, 32.28683553335712, 25.43580131208997, 6.85727049363413, 11.43975641583297, 1.9815059445178336, 0.16597510373443983, 4.605653291164262, 0.49633146309883475, 1.6942551119766307, 3.2842582106455263, 11.223136110374105, 3.149606299212598, 5.807224106964678, 24.117255163224517, 7.892795672485862, 11.68788769180542, 6.009426551453259, 4.672192916352675, 12.678636863319898, 30.680340892676583, 20.00888296691095, 5.867683731846853, 3.1134649333975286, 16.90391459074733, 13.985539990962495, 1.067943288528816, 33.75715193897012, 18.4251744268831, 1.9877834144321358, 9.816225907664725, 9.498762376237623, 44.0254652301665, 7.329026509244821, 7.471804511278196, 11.415979528006824, 8.218759547815461, 3.2471437161755863, 12.71585557299843, 7.26296123306866, 5.867742936976095, 4.563380281690141, 1.5516318887105405, 13.636363636363635, 14.329268292682926, 1.8233915082052619, 0.6485947114585066, 9.523809523809524, 18.971246929634447, 0.043308791684711995, 6.451612903225806 ], "textposition": "auto", "type": "bar", "x": [ "10", "11", "14", "15", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "7", "8", "18", "25", "29", "3", "12", "13", "16", "17", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "9", "60", "62" ], "y": [ 8.204334365325078, 82.3861801743623, 4.004067624253209, 7.8431372549019605, 16.49278919914084, 12.091441526544493, 4.808259587020649, 2.632678646050982, 12.722371967654986, 26.52045419194276, 32.28683553335712, 25.43580131208997, 6.85727049363413, 11.43975641583297, 1.9815059445178336, 0.16597510373443983, 4.605653291164262, 0.49633146309883475, 1.6942551119766307, 3.2842582106455263, 11.223136110374105, 3.149606299212598, 5.807224106964678, 24.117255163224517, 7.892795672485862, 11.68788769180542, 6.009426551453259, 4.672192916352675, 12.678636863319898, 30.680340892676583, 20.00888296691095, 5.867683731846853, 3.1134649333975286, 16.90391459074733, 13.985539990962495, 1.067943288528816, 33.75715193897012, 18.4251744268831, 1.9877834144321358, 9.816225907664725, 9.498762376237623, 44.0254652301665, 7.329026509244821, 7.471804511278196, 11.415979528006824, 8.218759547815461, 3.2471437161755863, 12.71585557299843, 7.26296123306866, 5.867742936976095, 4.563380281690141, 1.5516318887105405, 13.636363636363635, 14.329268292682926, 1.8233915082052619, 0.6485947114585066, 9.523809523809524, 18.971246929634447, 0.043308791684711995, 6.451612903225806 ] }, { "marker": { "color": "rgb(177, 89, 40)" }, "name": "ENDOTHELIAL", "text": [ 5.185758513931889, 1.4045850823377461, 0.7245455701029617, 2.9073698444895197, 3.4980055231666154, 1.7759304742112223, 1.710914454277286, 1.2954450480568325, 1.2398921832884098, 1.9132057862809144, 1.9978594363182305, 5.660731021555764, 0.08934554389099844, 13.571117877337974, 0.26420079260237783, 2.0746887966804977, 0.98833761612967, 1.5753129046180405, 0.9737098344693282, 0.6115515288788221, 2.255240116741841, 2.3622047244094486, 3.2727998403512273, 4.663557628247834, 0.7376444553725104, 3.493307215148547, 0.432050274941084, 1.6955538809344386, 8.061561011359473, 2.0078000866676295, 1.1547856984232734, 1.877658794190993, 0.9950248756218906, 26.156583629893237, 1.8978761861726163, 1.325722703001289, 1.2714558169103625, 3.1895201480848643, 2.4536701521896678, 1.9273868220528911, 4.672029702970297, 3.232125367286973, 4.265983515259523, 0.7518796992481203, 1.6491327836224055, 2.9483654139932782, 0.9861695730607337, 1.2558869701726845, 2.335357309668379, 0.5898789195901893, 2.535211267605634, 7.009095773140716, 43.18181818181818, 2.0325203252032518, 1.3805678562125552, 1.3470813237984367, 4.012841091492777, 3.22207773443144, 1.3858813339107838, 0.967741935483871 ], "textposition": "auto", "type": "bar", "x": [ "10", "11", "14", "15", "19", "20", "22", "23", "26", "27", "28", "30", "32", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "5", "50", "52", "53", "54", "57", "58", "6", "63", "7", "8", "18", "25", "29", "3", "12", "13", "16", "17", "21", "24", "40", "47", "48", "49", "51", "55", "56", "59", "61", "9", "60", "62" ], "y": [ 5.185758513931889, 1.4045850823377461, 0.7245455701029617, 2.9073698444895197, 3.4980055231666154, 1.7759304742112223, 1.710914454277286, 1.2954450480568325, 1.2398921832884098, 1.9132057862809144, 1.9978594363182305, 5.660731021555764, 0.08934554389099844, 13.571117877337974, 0.26420079260237783, 2.0746887966804977, 0.98833761612967, 1.5753129046180405, 0.9737098344693282, 0.6115515288788221, 2.255240116741841, 2.3622047244094486, 3.2727998403512273, 4.663557628247834, 0.7376444553725104, 3.493307215148547, 0.432050274941084, 1.6955538809344386, 8.061561011359473, 2.0078000866676295, 1.1547856984232734, 1.877658794190993, 0.9950248756218906, 26.156583629893237, 1.8978761861726163, 1.325722703001289, 1.2714558169103625, 3.1895201480848643, 2.4536701521896678, 1.9273868220528911, 4.672029702970297, 3.232125367286973, 4.265983515259523, 0.7518796992481203, 1.6491327836224055, 2.9483654139932782, 0.9861695730607337, 1.2558869701726845, 2.335357309668379, 0.5898789195901893, 2.535211267605634, 7.009095773140716, 43.18181818181818, 2.0325203252032518, 1.3805678562125552, 1.3470813237984367, 4.012841091492777, 3.22207773443144, 1.3858813339107838, 0.967741935483871 ] } ], "layout": { "barmode": "stack", "plot_bgcolor": "white", "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Cell subtypes proportions by Patient and tissue type DD3" }, "xaxis": { "autorange": true, "linecolor": "black", "range": [ -0.5, 59.5 ], "type": "category" }, "yaxis": { "autorange": true, "linecolor": "black", "range": [ 0, 105.26315789473685 ], "title": { "text": "Cell count (%)" }, "type": "linear" } } } }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "'temp-plot.html'" ] }, "execution_count": 56, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fig = go.Figure()\n", "title = 'Cell subtypes proportions by Patient and tissue type DD3'\n", "\n", "for cell_subtype in cell_subtypes:\n", " fig.add_trace(\n", " go.Bar(\n", " name=cell_subtype,\n", " x=counts_perc_patients['Patient'],\n", " y=counts_perc_patients[f'{cell_subtype.lower()}_perc'],\n", " text=counts_perc_patients[f'{cell_subtype.lower()}_perc'],\n", " textposition='auto',\n", " marker_color='rgb' + str(cell_subtype_color_dict[cell_subtype])))\n", "\n", "fig.update_layout(\n", " plot_bgcolor='white',\n", " barmode='stack',\n", " title=title,\n", " xaxis=dict(linecolor='black'),\n", " yaxis=dict(title='Cell count (%)', linecolor='black'))\n", "\n", "output_filename = title.replace(\" \", \"_\") + \".png\"\n", "#fig.write_image(output_images_dir + \"/\" + output_filename, scale=1000)\n", "\n", "fig.show()\n", "plot(fig)" ] }, { "cell_type": "markdown", "id": "ff541bd3-236a-4418-90a2-99d44e6ef5a0", "metadata": {}, "source": [ "#### V.4.3.4 BY TREATMENT" ] }, { "cell_type": "code", "execution_count": 57, "id": "eaaf663e-446c-4ee8-bb50-89ed23d9359e", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PDL1_Cytoplasm_Intensity_AverageHLA_Cytoplasm_Intensity_AverageCKs_Cytoplasm_Intensity_AverageKi67_Nucleus_Intensity_AverageCD163_Cytoplasm_Intensity_AverageColVI_Cytoplasm_Intensity_AverageCD20_Cytoplasm_Intensity_AveragePD1_Cytoplasm_Intensity_AverageAXL_Cytoplasm_Intensity_AverageCD31_Cytoplasm_Intensity_Average...Nucleus_RoundnessNuc_XROI_indexNucleus_SizeSample_IDimmune_checkpointCell_SizePatientUnique_ROI_indexPrimary_chem(1)_vs_surg(0)
ID
DD3S1_Cell_0-0.677863-0.417494-0.912537-0.8178760.9300990.232078-0.4831581.5356040.8073391.167755...0.9550401484.7717290127DD3S1.csvNone3396161a1.0
DD3S1_Cell_1-0.677863-0.516487-0.838037-0.8696851.1149240.301333-0.3447701.6683680.8754551.643023...0.9666431426.2500000112DD3S1.csvNone3446161a1.0
DD3S1_Cell_2-0.677863-0.141921-1.016023-0.7558790.8345770.259216-0.4382921.3363080.7050881.053636...0.7215341531.1104740181DD3S1.csvNone4226161a1.0
DD3S1_Cell_3-0.741282-0.460472-0.491711-0.8180840.6482000.107027-0.4448891.2498050.6607071.165861...0.5871961518.9075930119DD3S1.csvNone2786161a1.0
DD3S1_Cell_6-0.621521-0.247254-0.867127-0.7425440.8105790.272128-0.5071171.2514340.9471722.545301...0.9357161471.914917047DD3S1.csvNone2046161a1.0
..................................................................
DD5S3_Cell_62826-0.4460250.4802121.195440-0.081463-0.634343-0.8838151.0509280.1647090.1039860.171579...0.60976413449.42675834103DD5S3.csvNone237187187c1.0
DD5S3_Cell_62828-0.4144400.4166681.542926-0.203248-0.076555-0.7837590.4233460.6383050.3469700.453372...0.73684413469.3535163465DD5S3.csvNone231187187c1.0
DD5S3_Cell_62829-0.7205690.072144-0.311962-0.4814421.236053-0.4688130.2523532.1290421.1118091.340371...0.69131513390.4472663485DD5S3.csvNone224187187c1.0
DD5S3_Cell_62830-0.4425000.368654-1.491754-0.3162700.029502-0.7365220.3908830.8618940.4616850.586409...0.89270713430.1787113456DD5S3.csvNone139187187c1.0
DD5S3_Cell_628310.0408921.166606-1.6767530.249586-1.486438-1.0728782.024627-0.730182-0.355148-0.360887...0.67638813445.4794923448DD5S3.csvNone183187187c1.0
\n", "

113959 rows × 40 columns

\n", "
" ], "text/plain": [ " PDL1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.677863 \n", "DD3S1_Cell_1 -0.677863 \n", "DD3S1_Cell_2 -0.677863 \n", "DD3S1_Cell_3 -0.741282 \n", "DD3S1_Cell_6 -0.621521 \n", "... ... \n", "DD5S3_Cell_62826 -0.446025 \n", "DD5S3_Cell_62828 -0.414440 \n", "DD5S3_Cell_62829 -0.720569 \n", "DD5S3_Cell_62830 -0.442500 \n", "DD5S3_Cell_62831 0.040892 \n", "\n", " HLA_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.417494 \n", "DD3S1_Cell_1 -0.516487 \n", "DD3S1_Cell_2 -0.141921 \n", "DD3S1_Cell_3 -0.460472 \n", "DD3S1_Cell_6 -0.247254 \n", "... ... \n", "DD5S3_Cell_62826 0.480212 \n", "DD5S3_Cell_62828 0.416668 \n", "DD5S3_Cell_62829 0.072144 \n", "DD5S3_Cell_62830 0.368654 \n", "DD5S3_Cell_62831 1.166606 \n", "\n", " CKs_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.912537 \n", "DD3S1_Cell_1 -0.838037 \n", "DD3S1_Cell_2 -1.016023 \n", "DD3S1_Cell_3 -0.491711 \n", "DD3S1_Cell_6 -0.867127 \n", "... ... \n", "DD5S3_Cell_62826 1.195440 \n", "DD5S3_Cell_62828 1.542926 \n", "DD5S3_Cell_62829 -0.311962 \n", "DD5S3_Cell_62830 -1.491754 \n", "DD5S3_Cell_62831 -1.676753 \n", "\n", " Ki67_Nucleus_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.817876 \n", "DD3S1_Cell_1 -0.869685 \n", "DD3S1_Cell_2 -0.755879 \n", "DD3S1_Cell_3 -0.818084 \n", "DD3S1_Cell_6 -0.742544 \n", "... ... \n", "DD5S3_Cell_62826 -0.081463 \n", "DD5S3_Cell_62828 -0.203248 \n", "DD5S3_Cell_62829 -0.481442 \n", "DD5S3_Cell_62830 -0.316270 \n", "DD5S3_Cell_62831 0.249586 \n", "\n", " CD163_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.930099 \n", "DD3S1_Cell_1 1.114924 \n", "DD3S1_Cell_2 0.834577 \n", "DD3S1_Cell_3 0.648200 \n", "DD3S1_Cell_6 0.810579 \n", "... ... \n", "DD5S3_Cell_62826 -0.634343 \n", "DD5S3_Cell_62828 -0.076555 \n", "DD5S3_Cell_62829 1.236053 \n", "DD5S3_Cell_62830 0.029502 \n", "DD5S3_Cell_62831 -1.486438 \n", "\n", " ColVI_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.232078 \n", "DD3S1_Cell_1 0.301333 \n", "DD3S1_Cell_2 0.259216 \n", "DD3S1_Cell_3 0.107027 \n", "DD3S1_Cell_6 0.272128 \n", "... ... \n", "DD5S3_Cell_62826 -0.883815 \n", "DD5S3_Cell_62828 -0.783759 \n", "DD5S3_Cell_62829 -0.468813 \n", "DD5S3_Cell_62830 -0.736522 \n", "DD5S3_Cell_62831 -1.072878 \n", "\n", " CD20_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.483158 \n", "DD3S1_Cell_1 -0.344770 \n", "DD3S1_Cell_2 -0.438292 \n", "DD3S1_Cell_3 -0.444889 \n", "DD3S1_Cell_6 -0.507117 \n", "... ... \n", "DD5S3_Cell_62826 1.050928 \n", "DD5S3_Cell_62828 0.423346 \n", "DD5S3_Cell_62829 0.252353 \n", "DD5S3_Cell_62830 0.390883 \n", "DD5S3_Cell_62831 2.024627 \n", "\n", " PD1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 1.535604 \n", "DD3S1_Cell_1 1.668368 \n", "DD3S1_Cell_2 1.336308 \n", "DD3S1_Cell_3 1.249805 \n", "DD3S1_Cell_6 1.251434 \n", "... ... \n", "DD5S3_Cell_62826 0.164709 \n", "DD5S3_Cell_62828 0.638305 \n", "DD5S3_Cell_62829 2.129042 \n", "DD5S3_Cell_62830 0.861894 \n", "DD5S3_Cell_62831 -0.730182 \n", "\n", " AXL_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.807339 \n", "DD3S1_Cell_1 0.875455 \n", "DD3S1_Cell_2 0.705088 \n", "DD3S1_Cell_3 0.660707 \n", "DD3S1_Cell_6 0.947172 \n", "... ... \n", "DD5S3_Cell_62826 0.103986 \n", "DD5S3_Cell_62828 0.346970 \n", "DD5S3_Cell_62829 1.111809 \n", "DD5S3_Cell_62830 0.461685 \n", "DD5S3_Cell_62831 -0.355148 \n", "\n", " CD31_Cytoplasm_Intensity_Average ... Nucleus_Roundness \\\n", "ID ... \n", "DD3S1_Cell_0 1.167755 ... 0.955040 \n", "DD3S1_Cell_1 1.643023 ... 0.966643 \n", "DD3S1_Cell_2 1.053636 ... 0.721534 \n", "DD3S1_Cell_3 1.165861 ... 0.587196 \n", "DD3S1_Cell_6 2.545301 ... 0.935716 \n", "... ... ... ... \n", "DD5S3_Cell_62826 0.171579 ... 0.609764 \n", "DD5S3_Cell_62828 0.453372 ... 0.736844 \n", "DD5S3_Cell_62829 1.340371 ... 0.691315 \n", "DD5S3_Cell_62830 0.586409 ... 0.892707 \n", "DD5S3_Cell_62831 -0.360887 ... 0.676388 \n", "\n", " Nuc_X ROI_index Nucleus_Size Sample_ID \\\n", "ID \n", "DD3S1_Cell_0 1484.771729 0 127 DD3S1.csv \n", "DD3S1_Cell_1 1426.250000 0 112 DD3S1.csv \n", "DD3S1_Cell_2 1531.110474 0 181 DD3S1.csv \n", "DD3S1_Cell_3 1518.907593 0 119 DD3S1.csv \n", "DD3S1_Cell_6 1471.914917 0 47 DD3S1.csv \n", "... ... ... ... ... \n", "DD5S3_Cell_62826 13449.426758 34 103 DD5S3.csv \n", "DD5S3_Cell_62828 13469.353516 34 65 DD5S3.csv \n", "DD5S3_Cell_62829 13390.447266 34 85 DD5S3.csv \n", "DD5S3_Cell_62830 13430.178711 34 56 DD5S3.csv \n", "DD5S3_Cell_62831 13445.479492 34 48 DD5S3.csv \n", "\n", " immune_checkpoint Cell_Size Patient Unique_ROI_index \\\n", "ID \n", "DD3S1_Cell_0 None 339 61 61a \n", "DD3S1_Cell_1 None 344 61 61a \n", "DD3S1_Cell_2 None 422 61 61a \n", "DD3S1_Cell_3 None 278 61 61a \n", "DD3S1_Cell_6 None 204 61 61a \n", "... ... ... ... ... \n", "DD5S3_Cell_62826 None 237 187 187c \n", "DD5S3_Cell_62828 None 231 187 187c \n", "DD5S3_Cell_62829 None 224 187 187c \n", "DD5S3_Cell_62830 None 139 187 187c \n", "DD5S3_Cell_62831 None 183 187 187c \n", "\n", " Primary_chem(1)_vs_surg(0) \n", "ID \n", "DD3S1_Cell_0 1.0 \n", "DD3S1_Cell_1 1.0 \n", "DD3S1_Cell_2 1.0 \n", "DD3S1_Cell_3 1.0 \n", "DD3S1_Cell_6 1.0 \n", "... ... \n", "DD5S3_Cell_62826 1.0 \n", "DD5S3_Cell_62828 1.0 \n", "DD5S3_Cell_62829 1.0 \n", "DD5S3_Cell_62830 1.0 \n", "DD5S3_Cell_62831 1.0 \n", "\n", "[113959 rows x 40 columns]" ] }, "execution_count": 57, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_NACT" ] }, { "cell_type": "code", "execution_count": 58, "id": "4fad07ba-a1f7-4ea7-a9d2-54b18a2082ae", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "['61' '32' '26' '15' '18' '11' '5' '51' '40' '7' '95' '121' '85' '111'\n", " '116' '98' '119' '104' '89' '140' '137' '153' '149' '146' '162' '160'\n", " '157' '171' '169' '183' '182' '179' '177' '174' '178' '187' '184' '141']\n", "['62' '63' '59' '60' '33' '35' '36' '37' '38' '30' '25' '27' '29' '20'\n", " '21' '22' '23' '24' '14' '16' '17' '19' '12' '8' '9' '10' '4' '52' '53'\n", " '54' '55' '56' '57' '50' '42' '43' '44' '45' '47' '39' '41' '49' '46'\n", " '48' '58' '28' '13' '6' '34' '3' '122' '125' '124' '94' '101' '86' '84'\n", " '83' '91' '88' '87' '75' '74' '82' '81' '80' '79' '67' '66' '65' '64'\n", " '73' '71' '69' '68' '123' '115' '114' '113' '120' '117' '126' '105' '103'\n", " '102' '110' '109' '106' '166' '112' '108' '107' '97' '96' '100' '78' '77'\n", " '70' '72' '99' '92' '90' '136' '135' '134' '133' '132' '131' '130' '129'\n", " '144' '143' '155' '154' '150' '148' '147' '164' '161' '159' '128' '127'\n", " '142' '139' '152' '158' '156' '172' '170' '168' '167' '165' '181' '180'\n", " '176' '173' '175' '185' '186']\n" ] } ], "source": [ "# Extraire les valeurs uniques de la colonne 'Patient'\n", "num_NACT_patients = df_NACT['Patient'].unique()\n", "num_ACT_patients = df_ACT['Patient'].unique()\n", "\n", "# Numéros des patientes qui ont reçu le traitement\n", "print(num_NACT_patients)\n", "print(num_ACT_patients)" ] }, { "cell_type": "markdown", "id": "55464196-3344-4586-8ab1-1284941a070a", "metadata": {}, "source": [ "##### V.4.3.4.1 NACT" ] }, { "cell_type": "code", "execution_count": 59, "id": "387289e7-0272-4a45-ab3d-ea076210cbb2", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
dcbtcd4tcd8m1m2tregimmune_othercancerαsma_mycafstroma_otherendothelialTotal_cells
111.00.075.00.00.00.026.05564095103876194.0
11127.01.0230.010.03.01.039.089913101026.0
1163.00.042.00.00.00.01.01254563198.0
1191.00.0609.03.00.00.017.0428916104344533.0
12115.02.070454.04.00.02.0350.036521832365875789.0
1372.00.02122.01.01.02.028.013024092021012091.0
140402.00.03856.0307.038.03.06.03566293511592.0
14142.00.015821.010.01.00.025.071565154731120.0
1466.00.0803.01.02.00.052.091689331981578.0
14920.00.027025.0275.03.00.0265.073512504251113379.0
154.00.0327.07.01.00.019.01823747232862958.0
1532.01.056724.061.014.03.0283.015804158233484121.0
15712.01.016173.02.07.00.089.0246313245292969.0
1626.01.0763.01.00.01.031.023216099983134360.0
16968.00.020221.01.00.01.017.015642225942212911.0
1741.00.0244.01.00.00.046.02951203224221820.0
1771.00.01310.01.00.00.028.02597682754571920.0
1825.01.0154.00.03.00.080.0610210237859.0
1836.00.0463.00.01.04.08.05571210461731856.0
18439.00.0461.013.011.01.01.01708540131878.0
1874.00.02721.02.08.02.045.0259971652143490.0
261.00.015917.00.00.01.015.0295049472463710.0
3230.016.01137628.052.015.00.0122.06327561488954.0
51.01.06640.078.06.00.055.03931845124452654.0
71.00.018431.00.00.00.011.077124531201573.0
8532.00.021622.041.016.00.0309.0427338247725266.0
8918.00.025317.022.08.05.0194.0249064871343634.0
9537.01.069166.05.044.01.0549.01851835351433484.0
9825.00.079072.073.070.02.081.0215625322943710.0
1040.01.016930.01.02.03.069.016002891801472491.0
180.027.0328395.01.00.02.083.08371231922379659.0
1600.00.052.00.00.00.030.0112133188171396.0
1710.00.09528.025.01.00.067.05231187041431704.0
1780.00.010.00.00.00.03.0161322081371955.0
1790.00.0131.00.00.02.03.031227231811932.0
400.00.0116.01.00.00.017.0227415623111004282.0
510.00.041.01.00.01.00.011161944.0
610.00.079144.04.019.00.037.0958375178751869.0
\n", "
" ], "text/plain": [ " dc b tcd4 tcd8 m1 m2 treg immune_other cancer \\\n", "11 1.0 0.0 7 5.0 0.0 0.0 0.0 26.0 556 \n", "111 27.0 1.0 2 30.0 10.0 3.0 1.0 39.0 899 \n", "116 3.0 0.0 4 2.0 0.0 0.0 0.0 1.0 125 \n", "119 1.0 0.0 60 9.0 3.0 0.0 0.0 17.0 4289 \n", "121 15.0 2.0 704 54.0 4.0 0.0 2.0 350.0 3652 \n", "137 2.0 0.0 21 22.0 1.0 1.0 2.0 28.0 1302 \n", "140 402.0 0.0 385 6.0 307.0 38.0 3.0 6.0 35 \n", "141 42.0 0.0 158 21.0 10.0 1.0 0.0 25.0 71 \n", "146 6.0 0.0 80 3.0 1.0 2.0 0.0 52.0 916 \n", "149 20.0 0.0 270 25.0 275.0 3.0 0.0 265.0 735 \n", "15 4.0 0.0 32 7.0 7.0 1.0 0.0 19.0 1823 \n", "153 2.0 1.0 567 24.0 61.0 14.0 3.0 283.0 1580 \n", "157 12.0 1.0 16 173.0 2.0 7.0 0.0 89.0 2463 \n", "162 6.0 1.0 76 3.0 1.0 0.0 1.0 31.0 2321 \n", "169 68.0 0.0 202 21.0 1.0 0.0 1.0 17.0 1564 \n", "174 1.0 0.0 24 4.0 1.0 0.0 0.0 46.0 295 \n", "177 1.0 0.0 131 0.0 1.0 0.0 0.0 28.0 259 \n", "182 5.0 1.0 15 4.0 0.0 3.0 0.0 80.0 610 \n", "183 6.0 0.0 46 3.0 0.0 1.0 4.0 8.0 557 \n", "184 39.0 0.0 46 1.0 13.0 11.0 1.0 1.0 1708 \n", "187 4.0 0.0 27 21.0 2.0 8.0 2.0 45.0 2599 \n", "26 1.0 0.0 159 17.0 0.0 0.0 1.0 15.0 2950 \n", "32 30.0 16.0 1137 628.0 52.0 15.0 0.0 122.0 6327 \n", "5 1.0 1.0 66 40.0 78.0 6.0 0.0 55.0 393 \n", "7 1.0 0.0 184 31.0 0.0 0.0 0.0 11.0 771 \n", "85 32.0 0.0 216 22.0 41.0 16.0 0.0 309.0 4273 \n", "89 18.0 0.0 253 17.0 22.0 8.0 5.0 194.0 2490 \n", "95 37.0 1.0 69 166.0 5.0 44.0 1.0 549.0 1851 \n", "98 25.0 0.0 790 72.0 73.0 70.0 2.0 81.0 2156 \n", "104 0.0 1.0 169 30.0 1.0 2.0 3.0 69.0 1600 \n", "18 0.0 27.0 328 395.0 1.0 0.0 2.0 83.0 8371 \n", "160 0.0 0.0 5 2.0 0.0 0.0 0.0 30.0 1121 \n", "171 0.0 0.0 95 28.0 25.0 1.0 0.0 67.0 523 \n", "178 0.0 0.0 1 0.0 0.0 0.0 0.0 3.0 1613 \n", "179 0.0 0.0 13 1.0 0.0 0.0 2.0 3.0 312 \n", "40 0.0 0.0 11 6.0 1.0 0.0 0.0 17.0 2274 \n", "51 0.0 0.0 4 1.0 1.0 0.0 1.0 0.0 11 \n", "61 0.0 0.0 79 144.0 4.0 19.0 0.0 37.0 958 \n", "\n", " αsma_mycaf stroma_other endothelial Total_cells \n", "11 409 5103 87 6194.0 \n", "111 1 3 10 1026.0 \n", "116 4 56 3 198.0 \n", "119 16 104 34 4533.0 \n", "121 183 236 587 5789.0 \n", "137 409 202 101 2091.0 \n", "140 66 293 51 1592.0 \n", "141 565 154 73 1120.0 \n", "146 89 331 98 1578.0 \n", "149 1250 425 111 3379.0 \n", "15 747 232 86 2958.0 \n", "153 415 823 348 4121.0 \n", "157 132 45 29 2969.0 \n", "162 609 998 313 4360.0 \n", "169 222 594 221 2911.0 \n", "174 1203 224 22 1820.0 \n", "177 768 275 457 1920.0 \n", "182 2 102 37 859.0 \n", "183 12 1046 173 1856.0 \n", "184 5 40 13 1878.0 \n", "187 716 52 14 3490.0 \n", "26 49 472 46 3710.0 \n", "32 5 614 8 8954.0 \n", "5 1845 124 45 2654.0 \n", "7 24 531 20 1573.0 \n", "85 38 247 72 5266.0 \n", "89 6 487 134 3634.0 \n", "95 83 535 143 3484.0 \n", "98 25 322 94 3710.0 \n", "104 289 180 147 2491.0 \n", "18 23 192 237 9659.0 \n", "160 33 188 17 1396.0 \n", "171 118 704 143 1704.0 \n", "178 220 81 37 1955.0 \n", "179 272 318 11 932.0 \n", "40 1562 311 100 4282.0 \n", "51 1 6 19 44.0 \n", "61 375 178 75 1869.0 " ] }, "execution_count": 59, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Compter par numéro de patiente pour les patientes NACT uniquement\n", "patient_counts = {}\n", "\n", "# Boucle sur les sous-types de cellules pour compter les échantillons correspondants par patient\n", "for subtype in cell_subtypes:\n", " patient_counts[subtype.lower()] = pd.DataFrame({subtype.lower():\n", " df.loc[\n", " (df['cell_subtype'] == subtype) & (df['Patient'].isin(num_NACT_patients)), 'Patient'].value_counts()\n", " }).sort_index()\n", "\n", "# Concaténation des counts des sous-types de cellules en un seul DataFrame\n", "counts_patients = pd.concat([pd.DataFrame(v) for v in patient_counts.values()], axis=1, sort=False)\n", "counts_patients = counts_patients.fillna(0)\n", "\n", "# Ajout de la colonne de total de cellules comptées par patientes\n", "counts_patients['Total_cells'] = counts_patients.sum(axis=1)\n", "\n", "# Enregistrement des counts des sous-types de cellules par patient dans un fichier CSV\n", "filename_patients = os.path.join(output_data_dir, project_name + \"_cell_subtypes_number_by_patient_NACT.csv\")\n", "counts_patients.to_csv(filename_patients, index=False)\n", "counts_patients\n" ] }, { "cell_type": "code", "execution_count": 60, "id": "1745b771-5dbd-4ee7-8f82-d1e308a96eb4", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
dcbtcd4tcd8m1m2tregimmune_othercancerαsma_mycaf...tcd8_percm1_percm2_perctreg_percimmune_other_perccancer_percαsma_mycaf_percstroma_other_percendothelial_percPatient
111.00.075.00.00.00.026.0556409...0.0807230.0000000.0000000.0000000.4197618.9764296.60316482.3861801.40458511
11127.01.0230.010.03.01.039.08991...2.9239770.9746590.2923980.0974663.80117087.6218320.0974660.2923980.974659111
1163.00.042.00.00.00.01.01254...1.0101010.0000000.0000000.0000000.50505163.1313132.02020228.2828281.515152116
1191.00.0609.03.00.00.017.0428916...0.1985440.0661810.0000000.0000000.37502894.6172510.3529672.2942860.750055119
12115.02.070454.04.00.02.0350.03652183...0.9328040.0690970.0000000.0345486.04594963.0851623.1611684.07669710.139921121
1372.00.02122.01.01.02.028.01302409...1.0521280.0478240.0478240.0956481.33907262.26685819.5600199.6604504.830225137
140402.00.03856.0307.038.03.06.03566...0.37688419.2839202.3869350.1884420.3768842.1984924.14572918.4045233.203518140
14142.00.015821.010.01.00.025.071565...1.8750000.8928570.0892860.0000002.2321436.33928650.44642913.7500006.517857141
1466.00.0803.01.02.00.052.091689...0.1901140.0633710.1267430.0000003.29531158.0481625.64005120.9759196.210393146
14920.00.027025.0275.03.00.0265.07351250...0.7398648.1385030.0887840.0000007.84255721.75199836.99319312.5776863.284996149
154.00.0327.07.01.00.019.01823747...0.2366460.2366460.0338070.0000000.64232661.62947925.2535507.8431372.90737015
1532.01.056724.061.014.03.0283.01580415...0.5823831.4802230.3397230.0727986.86726538.34020910.07037119.9708818.444552153
15712.01.016173.02.07.00.089.02463132...5.8268780.0673630.2357700.0000002.99764282.9572254.4459411.5156620.976760157
1626.01.0763.01.00.01.031.02321609...0.0688070.0229360.0000000.0229360.71100953.23394513.96789022.8899087.178899162
16968.00.020221.01.00.01.017.01564222...0.7214020.0343520.0000000.0343520.58399253.7272417.62624520.4053597.591893169
1741.00.0244.01.00.00.046.02951203...0.2197800.0549450.0000000.0000002.52747316.20879166.09890112.3076921.208791174
1771.00.01310.01.00.00.028.0259768...0.0000000.0520830.0000000.0000001.45833313.48958340.00000014.32291723.802083177
1825.01.0154.00.03.00.080.06102...0.4656580.0000000.3492430.0000009.31315571.0128060.23282911.8742724.307334182
1836.00.0463.00.01.04.08.055712...0.1616380.0000000.0538790.2155170.43103430.0107760.64655256.3577599.321121183
18439.00.0461.013.011.01.01.017085...0.0532480.6922260.5857290.0532480.05324890.9478170.2662412.1299250.692226184
1874.00.02721.02.08.02.045.02599716...0.6017190.0573070.2292260.0573071.28939874.46991420.5157591.4899710.401146187
261.00.015917.00.00.01.015.0295049...0.4582210.0000000.0000000.0269540.40431379.5148251.32075512.7223721.23989226
3230.016.01137628.052.015.00.0122.063275...7.0136250.5807460.1675230.0000001.36252070.6611570.0558416.8572700.08934632
51.01.06640.078.06.00.055.03931845...1.5071592.9389600.2260740.0000002.07234414.80783769.5177094.6721931.6955545
71.00.018431.00.00.00.011.077124...1.9707570.0000000.0000000.0000000.69930149.0146221.52574733.7571521.2714567
8532.00.021622.041.016.00.0309.0427338...0.4177740.7785800.3038360.0000005.86783181.1431830.7216104.6904671.36726285
8918.00.025317.022.08.05.0194.024906...0.4678040.6053940.2201430.1375895.33847068.5195380.16510713.4012113.68739789
9537.01.069166.05.044.01.0549.0185183...4.7646380.1435131.2629160.02870315.75775053.1285882.38231915.3559134.10447895
9825.00.079072.073.070.02.081.0215625...1.9407011.9676551.8867920.0539082.18328858.1132080.6738548.6792452.53369398
1040.01.016930.01.02.03.069.01600289...1.2043360.0401450.0802890.1204342.76997264.23123211.6017667.2260145.901244104
180.027.0328395.01.00.02.083.0837123...4.0894500.0103530.0000000.0207060.85930286.6652860.2381201.9877832.45367018
1600.00.052.00.00.00.030.0112133...0.1432660.0000000.0000000.0000002.14899780.3008602.36389713.4670491.217765160
1710.00.09528.025.01.00.067.0523118...1.6431921.4671360.0586850.0000003.93192530.6924886.92488341.3145548.392019171
1780.00.010.00.00.00.03.01613220...0.0000000.0000000.0000000.0000000.15345382.50639411.2531974.1432231.892583178
1790.00.0131.00.00.02.03.0312272...0.1072960.0000000.0000000.2145920.32188833.47639529.18454934.1201721.180258179
400.00.0116.01.00.00.017.022741562...0.1401210.0233540.0000000.0000000.39701153.10602536.4782817.2629612.33535740
510.00.041.01.00.01.00.0111...2.2727272.2727270.0000002.2727270.00000025.0000002.27272713.63636443.18181851
610.00.079144.04.019.00.037.0958375...7.7046550.2140181.0165860.0000001.97966851.25735720.0642059.5238104.01284161
\n", "

38 rows × 26 columns

\n", "
" ], "text/plain": [ " dc b tcd4 tcd8 m1 m2 treg immune_other cancer \\\n", "11 1.0 0.0 7 5.0 0.0 0.0 0.0 26.0 556 \n", "111 27.0 1.0 2 30.0 10.0 3.0 1.0 39.0 899 \n", "116 3.0 0.0 4 2.0 0.0 0.0 0.0 1.0 125 \n", "119 1.0 0.0 60 9.0 3.0 0.0 0.0 17.0 4289 \n", "121 15.0 2.0 704 54.0 4.0 0.0 2.0 350.0 3652 \n", "137 2.0 0.0 21 22.0 1.0 1.0 2.0 28.0 1302 \n", "140 402.0 0.0 385 6.0 307.0 38.0 3.0 6.0 35 \n", "141 42.0 0.0 158 21.0 10.0 1.0 0.0 25.0 71 \n", "146 6.0 0.0 80 3.0 1.0 2.0 0.0 52.0 916 \n", "149 20.0 0.0 270 25.0 275.0 3.0 0.0 265.0 735 \n", "15 4.0 0.0 32 7.0 7.0 1.0 0.0 19.0 1823 \n", "153 2.0 1.0 567 24.0 61.0 14.0 3.0 283.0 1580 \n", "157 12.0 1.0 16 173.0 2.0 7.0 0.0 89.0 2463 \n", "162 6.0 1.0 76 3.0 1.0 0.0 1.0 31.0 2321 \n", "169 68.0 0.0 202 21.0 1.0 0.0 1.0 17.0 1564 \n", "174 1.0 0.0 24 4.0 1.0 0.0 0.0 46.0 295 \n", "177 1.0 0.0 131 0.0 1.0 0.0 0.0 28.0 259 \n", "182 5.0 1.0 15 4.0 0.0 3.0 0.0 80.0 610 \n", "183 6.0 0.0 46 3.0 0.0 1.0 4.0 8.0 557 \n", "184 39.0 0.0 46 1.0 13.0 11.0 1.0 1.0 1708 \n", "187 4.0 0.0 27 21.0 2.0 8.0 2.0 45.0 2599 \n", "26 1.0 0.0 159 17.0 0.0 0.0 1.0 15.0 2950 \n", "32 30.0 16.0 1137 628.0 52.0 15.0 0.0 122.0 6327 \n", "5 1.0 1.0 66 40.0 78.0 6.0 0.0 55.0 393 \n", "7 1.0 0.0 184 31.0 0.0 0.0 0.0 11.0 771 \n", "85 32.0 0.0 216 22.0 41.0 16.0 0.0 309.0 4273 \n", "89 18.0 0.0 253 17.0 22.0 8.0 5.0 194.0 2490 \n", "95 37.0 1.0 69 166.0 5.0 44.0 1.0 549.0 1851 \n", "98 25.0 0.0 790 72.0 73.0 70.0 2.0 81.0 2156 \n", "104 0.0 1.0 169 30.0 1.0 2.0 3.0 69.0 1600 \n", "18 0.0 27.0 328 395.0 1.0 0.0 2.0 83.0 8371 \n", "160 0.0 0.0 5 2.0 0.0 0.0 0.0 30.0 1121 \n", "171 0.0 0.0 95 28.0 25.0 1.0 0.0 67.0 523 \n", "178 0.0 0.0 1 0.0 0.0 0.0 0.0 3.0 1613 \n", "179 0.0 0.0 13 1.0 0.0 0.0 2.0 3.0 312 \n", "40 0.0 0.0 11 6.0 1.0 0.0 0.0 17.0 2274 \n", "51 0.0 0.0 4 1.0 1.0 0.0 1.0 0.0 11 \n", "61 0.0 0.0 79 144.0 4.0 19.0 0.0 37.0 958 \n", "\n", " αsma_mycaf ... tcd8_perc m1_perc m2_perc treg_perc \\\n", "11 409 ... 0.080723 0.000000 0.000000 0.000000 \n", "111 1 ... 2.923977 0.974659 0.292398 0.097466 \n", "116 4 ... 1.010101 0.000000 0.000000 0.000000 \n", "119 16 ... 0.198544 0.066181 0.000000 0.000000 \n", "121 183 ... 0.932804 0.069097 0.000000 0.034548 \n", "137 409 ... 1.052128 0.047824 0.047824 0.095648 \n", "140 66 ... 0.376884 19.283920 2.386935 0.188442 \n", "141 565 ... 1.875000 0.892857 0.089286 0.000000 \n", "146 89 ... 0.190114 0.063371 0.126743 0.000000 \n", "149 1250 ... 0.739864 8.138503 0.088784 0.000000 \n", "15 747 ... 0.236646 0.236646 0.033807 0.000000 \n", "153 415 ... 0.582383 1.480223 0.339723 0.072798 \n", "157 132 ... 5.826878 0.067363 0.235770 0.000000 \n", "162 609 ... 0.068807 0.022936 0.000000 0.022936 \n", "169 222 ... 0.721402 0.034352 0.000000 0.034352 \n", "174 1203 ... 0.219780 0.054945 0.000000 0.000000 \n", "177 768 ... 0.000000 0.052083 0.000000 0.000000 \n", "182 2 ... 0.465658 0.000000 0.349243 0.000000 \n", "183 12 ... 0.161638 0.000000 0.053879 0.215517 \n", "184 5 ... 0.053248 0.692226 0.585729 0.053248 \n", "187 716 ... 0.601719 0.057307 0.229226 0.057307 \n", "26 49 ... 0.458221 0.000000 0.000000 0.026954 \n", "32 5 ... 7.013625 0.580746 0.167523 0.000000 \n", "5 1845 ... 1.507159 2.938960 0.226074 0.000000 \n", "7 24 ... 1.970757 0.000000 0.000000 0.000000 \n", "85 38 ... 0.417774 0.778580 0.303836 0.000000 \n", "89 6 ... 0.467804 0.605394 0.220143 0.137589 \n", "95 83 ... 4.764638 0.143513 1.262916 0.028703 \n", "98 25 ... 1.940701 1.967655 1.886792 0.053908 \n", "104 289 ... 1.204336 0.040145 0.080289 0.120434 \n", "18 23 ... 4.089450 0.010353 0.000000 0.020706 \n", "160 33 ... 0.143266 0.000000 0.000000 0.000000 \n", "171 118 ... 1.643192 1.467136 0.058685 0.000000 \n", "178 220 ... 0.000000 0.000000 0.000000 0.000000 \n", "179 272 ... 0.107296 0.000000 0.000000 0.214592 \n", "40 1562 ... 0.140121 0.023354 0.000000 0.000000 \n", "51 1 ... 2.272727 2.272727 0.000000 2.272727 \n", "61 375 ... 7.704655 0.214018 1.016586 0.000000 \n", "\n", " immune_other_perc cancer_perc αsma_mycaf_perc stroma_other_perc \\\n", "11 0.419761 8.976429 6.603164 82.386180 \n", "111 3.801170 87.621832 0.097466 0.292398 \n", "116 0.505051 63.131313 2.020202 28.282828 \n", "119 0.375028 94.617251 0.352967 2.294286 \n", "121 6.045949 63.085162 3.161168 4.076697 \n", "137 1.339072 62.266858 19.560019 9.660450 \n", "140 0.376884 2.198492 4.145729 18.404523 \n", "141 2.232143 6.339286 50.446429 13.750000 \n", "146 3.295311 58.048162 5.640051 20.975919 \n", "149 7.842557 21.751998 36.993193 12.577686 \n", "15 0.642326 61.629479 25.253550 7.843137 \n", "153 6.867265 38.340209 10.070371 19.970881 \n", "157 2.997642 82.957225 4.445941 1.515662 \n", "162 0.711009 53.233945 13.967890 22.889908 \n", "169 0.583992 53.727241 7.626245 20.405359 \n", "174 2.527473 16.208791 66.098901 12.307692 \n", "177 1.458333 13.489583 40.000000 14.322917 \n", "182 9.313155 71.012806 0.232829 11.874272 \n", "183 0.431034 30.010776 0.646552 56.357759 \n", "184 0.053248 90.947817 0.266241 2.129925 \n", "187 1.289398 74.469914 20.515759 1.489971 \n", "26 0.404313 79.514825 1.320755 12.722372 \n", "32 1.362520 70.661157 0.055841 6.857270 \n", "5 2.072344 14.807837 69.517709 4.672193 \n", "7 0.699301 49.014622 1.525747 33.757152 \n", "85 5.867831 81.143183 0.721610 4.690467 \n", "89 5.338470 68.519538 0.165107 13.401211 \n", "95 15.757750 53.128588 2.382319 15.355913 \n", "98 2.183288 58.113208 0.673854 8.679245 \n", "104 2.769972 64.231232 11.601766 7.226014 \n", "18 0.859302 86.665286 0.238120 1.987783 \n", "160 2.148997 80.300860 2.363897 13.467049 \n", "171 3.931925 30.692488 6.924883 41.314554 \n", "178 0.153453 82.506394 11.253197 4.143223 \n", "179 0.321888 33.476395 29.184549 34.120172 \n", "40 0.397011 53.106025 36.478281 7.262961 \n", "51 0.000000 25.000000 2.272727 13.636364 \n", "61 1.979668 51.257357 20.064205 9.523810 \n", "\n", " endothelial_perc Patient \n", "11 1.404585 11 \n", "111 0.974659 111 \n", "116 1.515152 116 \n", "119 0.750055 119 \n", "121 10.139921 121 \n", "137 4.830225 137 \n", "140 3.203518 140 \n", "141 6.517857 141 \n", "146 6.210393 146 \n", "149 3.284996 149 \n", "15 2.907370 15 \n", "153 8.444552 153 \n", "157 0.976760 157 \n", "162 7.178899 162 \n", "169 7.591893 169 \n", "174 1.208791 174 \n", "177 23.802083 177 \n", "182 4.307334 182 \n", "183 9.321121 183 \n", "184 0.692226 184 \n", "187 0.401146 187 \n", "26 1.239892 26 \n", "32 0.089346 32 \n", "5 1.695554 5 \n", "7 1.271456 7 \n", "85 1.367262 85 \n", "89 3.687397 89 \n", "95 4.104478 95 \n", "98 2.533693 98 \n", "104 5.901244 104 \n", "18 2.453670 18 \n", "160 1.217765 160 \n", "171 8.392019 171 \n", "178 1.892583 178 \n", "179 1.180258 179 \n", "40 2.335357 40 \n", "51 43.181818 51 \n", "61 4.012841 61 \n", "\n", "[38 rows x 26 columns]" ] }, "execution_count": 60, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Ajout des colonnes de pourcentages pour chaque sous-type de cellules par patient\n", "counts_perc_patients = counts_patients.copy()\n", "\n", "# Calcul des pourcentages pour chaque sous-type de cellules, en excluant la colonne 'total_cells'\n", "for col in counts_perc_patients.columns:\n", " if col != 'Total_cells':\n", " counts_perc_patients[col + '_perc'] = (counts_perc_patients[col] / counts_perc_patients['Total_cells']) * 100\n", "\n", "\n", "# Affichage des pourcentages des sous-types de cellules par patient\n", "counts_perc_patients['Patient'] = counts_perc_patients.index\n", "counts_perc_patients.columns.values\n", "counts_perc_patients\n", "\n" ] }, { "cell_type": "code", "execution_count": 61, "id": "76a3f907-6618-4032-8e47-8cd428531604", "metadata": {}, "outputs": [], "source": [ "counts_perc_patients_NACT = counts_perc_patients" ] }, { "cell_type": "code", "execution_count": 62, "id": "49f6c28f-c371-4817-9e70-1b2c1411f061", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "marker": { "color": "rgb(166, 206, 227)" }, "name": "DC", "text": [ 0.01614465611882467, 2.631578947368421, 1.5151515151515151, 0.022060445621001543, 0.25911210917256866, 0.09564801530368246, 25.251256281407038, 3.75, 0.38022813688212925, 0.5918910920390648, 0.1352265043948614, 0.0485319097306479, 0.40417649040080833, 0.13761467889908258, 2.3359670216420474, 0.054945054945054944, 0.052083333333333336, 0.5820721769499418, 0.3232758620689655, 2.07667731629393, 0.1146131805157593, 0.026954177897574125, 0.33504578959124415, 0.037678975131876416, 0.06357279084551812, 0.6076718571971136, 0.49532195927352773, 1.0619977037887485, 0.6738544474393532, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], "textposition": "auto", "type": "bar", "x": [ "11", "111", "116", "119", "121", "137", "140", "141", "146", "149", "15", "153", "157", "162", "169", "174", "177", "182", "183", "184", "187", "26", "32", "5", "7", "85", "89", "95", "98", "104", "18", "160", "171", "178", "179", "40", "51", "61" ], "y": [ 0.01614465611882467, 2.631578947368421, 1.5151515151515151, 0.022060445621001543, 0.25911210917256866, 0.09564801530368246, 25.251256281407038, 3.75, 0.38022813688212925, 0.5918910920390648, 0.1352265043948614, 0.0485319097306479, 0.40417649040080833, 0.13761467889908258, 2.3359670216420474, 0.054945054945054944, 0.052083333333333336, 0.5820721769499418, 0.3232758620689655, 2.07667731629393, 0.1146131805157593, 0.026954177897574125, 0.33504578959124415, 0.037678975131876416, 0.06357279084551812, 0.6076718571971136, 0.49532195927352773, 1.0619977037887485, 0.6738544474393532, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] }, { "marker": { "color": "rgb(31, 120, 180)" }, "name": "B", "text": [ 0, 0.09746588693957114, 0, 0, 0.03454828122300915, 0, 0, 0, 0, 0, 0, 0.02426595486532395, 0.033681374200067365, 0.022935779816513763, 0, 0, 0, 0.11641443538998836, 0, 0, 0, 0, 0.17869108778199688, 0.037678975131876416, 0, 0, 0, 0.02870264064293915, 0, 0.04014452027298274, 0.2795320426545191, 0, 0, 0, 0, 0, 0, 0 ], "textposition": "auto", "type": "bar", "x": [ "11", "111", "116", "119", "121", "137", "140", "141", "146", "149", "15", "153", "157", "162", "169", "174", "177", "182", "183", "184", "187", "26", "32", "5", "7", "85", "89", "95", "98", "104", "18", "160", "171", "178", "179", "40", "51", "61" ], "y": [ 0, 0.09746588693957114, 0, 0, 0.03454828122300915, 0, 0, 0, 0, 0, 0, 0.02426595486532395, 0.033681374200067365, 0.022935779816513763, 0, 0, 0, 0.11641443538998836, 0, 0, 0, 0, 0.17869108778199688, 0.037678975131876416, 0, 0, 0, 0.02870264064293915, 0, 0.04014452027298274, 0.2795320426545191, 0, 0, 0, 0, 0, 0, 0 ] }, { "marker": { "color": "rgb(178, 223, 138)" }, "name": "TCD4", "text": [ 0.11301259283177267, 0.1949317738791423, 2.0202020202020203, 1.3236267372600927, 12.160994990499223, 1.0043041606886656, 24.183417085427138, 14.107142857142858, 5.069708491761723, 7.990529742527375, 1.0818120351588911, 13.758796408638679, 0.5389019872010778, 1.743119266055046, 6.9391961525249055, 1.3186813186813187, 6.822916666666666, 1.7462165308498252, 2.478448275862069, 2.4494142705005326, 0.7736389684813754, 4.285714285714286, 12.698235425508154, 2.4868123587038435, 11.697393515575333, 4.101785036080517, 6.962025316455696, 1.9804822043628014, 21.293800539083556, 6.784423926134083, 3.3957966663215657, 0.35816618911174786, 5.575117370892019, 0.051150895140664954, 1.3948497854077253, 0.25688930406352173, 9.090909090909092, 4.226859283039058 ], "textposition": "auto", "type": "bar", "x": [ "11", "111", "116", "119", "121", "137", "140", "141", "146", "149", "15", "153", "157", "162", "169", "174", "177", "182", "183", "184", "187", "26", "32", "5", "7", "85", "89", "95", "98", "104", "18", "160", "171", "178", "179", "40", "51", "61" ], "y": [ 0.11301259283177267, 0.1949317738791423, 2.0202020202020203, 1.3236267372600927, 12.160994990499223, 1.0043041606886656, 24.183417085427138, 14.107142857142858, 5.069708491761723, 7.990529742527375, 1.0818120351588911, 13.758796408638679, 0.5389019872010778, 1.743119266055046, 6.9391961525249055, 1.3186813186813187, 6.822916666666666, 1.7462165308498252, 2.478448275862069, 2.4494142705005326, 0.7736389684813754, 4.285714285714286, 12.698235425508154, 2.4868123587038435, 11.697393515575333, 4.101785036080517, 6.962025316455696, 1.9804822043628014, 21.293800539083556, 6.784423926134083, 3.3957966663215657, 0.35816618911174786, 5.575117370892019, 0.051150895140664954, 1.3948497854077253, 0.25688930406352173, 9.090909090909092, 4.226859283039058 ] }, { "marker": { "color": "rgb(51, 160, 44)" }, "name": "TCD8", "text": [ 0.08072328059412334, 2.923976608187134, 1.0101010101010102, 0.1985440105890139, 0.9328035930212472, 1.0521281683405068, 0.37688442211055273, 1.875, 0.19011406844106463, 0.739863865048831, 0.23664638269100743, 0.5823829167677749, 5.826877736611654, 0.06880733944954129, 0.7214015802129852, 0.21978021978021978, 0, 0.46565774155995343, 0.16163793103448276, 0.05324813631522897, 0.6017191977077364, 0.4582210242587601, 7.013625195443378, 1.5071590052750565, 1.9707565162110616, 0.41777440182301556, 0.4678040726472207, 4.7646383467278985, 1.940700808625337, 1.204335608189482, 4.089450253649446, 0.14326647564469913, 1.643192488262911, 0, 0.1072961373390558, 0.14012143858010276, 2.272727272727273, 7.704654895666131 ], "textposition": "auto", "type": "bar", "x": [ "11", "111", "116", "119", "121", "137", "140", "141", "146", "149", "15", "153", "157", "162", "169", "174", "177", "182", "183", "184", "187", "26", "32", "5", "7", "85", "89", "95", "98", "104", "18", "160", "171", "178", "179", "40", "51", "61" ], "y": [ 0.08072328059412334, 2.923976608187134, 1.0101010101010102, 0.1985440105890139, 0.9328035930212472, 1.0521281683405068, 0.37688442211055273, 1.875, 0.19011406844106463, 0.739863865048831, 0.23664638269100743, 0.5823829167677749, 5.826877736611654, 0.06880733944954129, 0.7214015802129852, 0.21978021978021978, 0, 0.46565774155995343, 0.16163793103448276, 0.05324813631522897, 0.6017191977077364, 0.4582210242587601, 7.013625195443378, 1.5071590052750565, 1.9707565162110616, 0.41777440182301556, 0.4678040726472207, 4.7646383467278985, 1.940700808625337, 1.204335608189482, 4.089450253649446, 0.14326647564469913, 1.643192488262911, 0, 0.1072961373390558, 0.14012143858010276, 2.272727272727273, 7.704654895666131 ] }, { "marker": { "color": "rgb(251, 154, 153)" }, "name": "M1", "text": [ 0, 0.9746588693957114, 0, 0.06618133686300463, 0.0690965624460183, 0.04782400765184123, 19.28391959798995, 0.8928571428571428, 0.06337135614702154, 8.13850251553714, 0.23664638269100743, 1.480223246784761, 0.06736274840013473, 0.022935779816513763, 0.034352456200618345, 0.054945054945054944, 0.052083333333333336, 0, 0, 0.6922257720979765, 0.05730659025787965, 0, 0.5807460352914898, 2.93896006028636, 0, 0.7785795670338017, 0.6053935057787562, 0.14351320321469577, 1.9676549865229112, 0.04014452027298274, 0.01035303861683404, 0, 1.4671361502347418, 0, 0, 0.023353573096683792, 2.272727272727273, 0.2140181915462814 ], "textposition": "auto", "type": "bar", "x": [ "11", "111", "116", "119", "121", "137", "140", "141", "146", "149", "15", "153", "157", "162", "169", "174", "177", "182", "183", "184", "187", "26", "32", "5", "7", "85", "89", "95", "98", "104", "18", "160", "171", "178", "179", "40", "51", "61" ], "y": [ 0, 0.9746588693957114, 0, 0.06618133686300463, 0.0690965624460183, 0.04782400765184123, 19.28391959798995, 0.8928571428571428, 0.06337135614702154, 8.13850251553714, 0.23664638269100743, 1.480223246784761, 0.06736274840013473, 0.022935779816513763, 0.034352456200618345, 0.054945054945054944, 0.052083333333333336, 0, 0, 0.6922257720979765, 0.05730659025787965, 0, 0.5807460352914898, 2.93896006028636, 0, 0.7785795670338017, 0.6053935057787562, 0.14351320321469577, 1.9676549865229112, 0.04014452027298274, 0.01035303861683404, 0, 1.4671361502347418, 0, 0, 0.023353573096683792, 2.272727272727273, 0.2140181915462814 ] }, { "marker": { "color": "rgb(227, 26, 28)" }, "name": "M2", "text": [ 0, 0.29239766081871343, 0, 0, 0, 0.04782400765184123, 2.386934673366834, 0.08928571428571429, 0.12674271229404308, 0.08878366380585972, 0.03380662609871535, 0.3397233681145353, 0.23576961940047153, 0, 0, 0, 0, 0.3492433061699651, 0.05387931034482758, 0.5857294994675186, 0.2292263610315186, 0, 0.16752289479562207, 0.22607385079125847, 0, 0.3038359285985568, 0.2201430930104568, 1.2629161882893225, 1.8867924528301887, 0.08028904054596547, 0, 0, 0.05868544600938967, 0, 0, 0, 0, 1.0165864098448367 ], "textposition": "auto", "type": "bar", "x": [ "11", "111", "116", "119", "121", "137", "140", "141", "146", "149", "15", "153", "157", "162", "169", "174", "177", "182", "183", "184", "187", "26", "32", "5", "7", "85", "89", "95", "98", "104", "18", "160", "171", "178", "179", "40", "51", "61" ], "y": [ 0, 0.29239766081871343, 0, 0, 0, 0.04782400765184123, 2.386934673366834, 0.08928571428571429, 0.12674271229404308, 0.08878366380585972, 0.03380662609871535, 0.3397233681145353, 0.23576961940047153, 0, 0, 0, 0, 0.3492433061699651, 0.05387931034482758, 0.5857294994675186, 0.2292263610315186, 0, 0.16752289479562207, 0.22607385079125847, 0, 0.3038359285985568, 0.2201430930104568, 1.2629161882893225, 1.8867924528301887, 0.08028904054596547, 0, 0, 0.05868544600938967, 0, 0, 0, 0, 1.0165864098448367 ] }, { "marker": { "color": "rgb(253, 191, 111)" }, "name": "Treg", "text": [ 0, 0.09746588693957114, 0, 0, 0.03454828122300915, 0.09564801530368246, 0.18844221105527637, 0, 0, 0, 0, 0.07279786459597186, 0, 0.022935779816513763, 0.034352456200618345, 0, 0, 0, 0.21551724137931033, 0.05324813631522897, 0.05730659025787965, 0.026954177897574125, 0, 0, 0, 0, 0.13758943313153552, 0.02870264064293915, 0.05390835579514825, 0.12043356081894822, 0.02070607723366808, 0, 0, 0, 0.2145922746781116, 0, 2.272727272727273, 0 ], "textposition": "auto", "type": "bar", "x": [ "11", "111", "116", "119", "121", "137", "140", "141", "146", "149", "15", "153", "157", "162", "169", "174", "177", "182", "183", "184", "187", "26", "32", "5", "7", "85", "89", "95", "98", "104", "18", "160", "171", "178", "179", "40", "51", "61" ], "y": [ 0, 0.09746588693957114, 0, 0, 0.03454828122300915, 0.09564801530368246, 0.18844221105527637, 0, 0, 0, 0, 0.07279786459597186, 0, 0.022935779816513763, 0.034352456200618345, 0, 0, 0, 0.21551724137931033, 0.05324813631522897, 0.05730659025787965, 0.026954177897574125, 0, 0, 0, 0, 0.13758943313153552, 0.02870264064293915, 0.05390835579514825, 0.12043356081894822, 0.02070607723366808, 0, 0, 0, 0.2145922746781116, 0, 2.272727272727273, 0 ] }, { "marker": { "color": "rgb(1.0, 0.4980392156862745, 0.0)" }, "name": "IMMUNE_OTHER", "text": [ 0.4197610590894414, 3.8011695906432745, 0.5050505050505051, 0.37502757555702626, 6.045949214026603, 1.3390722142515543, 0.37688442211055273, 2.232142857142857, 3.2953105196451205, 7.8425569695176085, 0.6423258958755916, 6.867265226886678, 2.9976423038059954, 0.7110091743119267, 0.5839917554105118, 2.5274725274725274, 1.4583333333333333, 9.31315483119907, 0.43103448275862066, 0.05324813631522897, 1.2893982808022924, 0.40431266846361186, 1.3625195443377263, 2.0723436322532027, 0.6993006993006993, 5.867831371059628, 5.338470005503577, 15.757749712973594, 2.183288409703504, 2.769971898835809, 0.8593022051972253, 2.148997134670487, 3.931924882629108, 0.1534526854219949, 0.3218884120171674, 0.39701074264362446, 0, 1.9796682718031033 ], "textposition": "auto", "type": "bar", "x": [ "11", "111", "116", "119", "121", "137", "140", "141", "146", "149", "15", "153", "157", "162", "169", "174", "177", "182", "183", "184", "187", "26", "32", "5", "7", "85", "89", "95", "98", "104", "18", "160", "171", "178", "179", "40", "51", "61" ], "y": [ 0.4197610590894414, 3.8011695906432745, 0.5050505050505051, 0.37502757555702626, 6.045949214026603, 1.3390722142515543, 0.37688442211055273, 2.232142857142857, 3.2953105196451205, 7.8425569695176085, 0.6423258958755916, 6.867265226886678, 2.9976423038059954, 0.7110091743119267, 0.5839917554105118, 2.5274725274725274, 1.4583333333333333, 9.31315483119907, 0.43103448275862066, 0.05324813631522897, 1.2893982808022924, 0.40431266846361186, 1.3625195443377263, 2.0723436322532027, 0.6993006993006993, 5.867831371059628, 5.338470005503577, 15.757749712973594, 2.183288409703504, 2.769971898835809, 0.8593022051972253, 2.148997134670487, 3.931924882629108, 0.1534526854219949, 0.3218884120171674, 0.39701074264362446, 0, 1.9796682718031033 ] }, { "marker": { "color": "rgb(202, 178, 214)" }, "name": "CANCER", "text": [ 8.976428802066517, 87.62183235867447, 63.13131313131313, 94.61725126847563, 63.085161513214715, 62.26685796269727, 2.198492462311558, 6.3392857142857135, 58.04816223067174, 21.751997632435632, 61.629479377958084, 38.34020868721184, 82.95722465476591, 53.23394495412844, 53.72724149776709, 16.208791208791208, 13.489583333333332, 71.0128055878929, 30.010775862068968, 90.94781682641107, 74.46991404011462, 79.51482479784366, 70.66115702479338, 14.80783722682743, 49.01462174189447, 81.14318268135207, 68.51953769950467, 53.12858783008036, 58.11320754716981, 64.23123243677237, 86.66528626151776, 80.30085959885386, 30.6924882629108, 82.50639386189258, 33.47639484978541, 53.10602522185894, 25, 51.2573568753344 ], "textposition": "auto", "type": "bar", "x": [ "11", "111", "116", "119", "121", "137", "140", "141", "146", "149", "15", "153", "157", "162", "169", "174", "177", "182", "183", "184", "187", "26", "32", "5", "7", "85", "89", "95", "98", "104", "18", "160", "171", "178", "179", "40", "51", "61" ], "y": [ 8.976428802066517, 87.62183235867447, 63.13131313131313, 94.61725126847563, 63.085161513214715, 62.26685796269727, 2.198492462311558, 6.3392857142857135, 58.04816223067174, 21.751997632435632, 61.629479377958084, 38.34020868721184, 82.95722465476591, 53.23394495412844, 53.72724149776709, 16.208791208791208, 13.489583333333332, 71.0128055878929, 30.010775862068968, 90.94781682641107, 74.46991404011462, 79.51482479784366, 70.66115702479338, 14.80783722682743, 49.01462174189447, 81.14318268135207, 68.51953769950467, 53.12858783008036, 58.11320754716981, 64.23123243677237, 86.66528626151776, 80.30085959885386, 30.6924882629108, 82.50639386189258, 33.47639484978541, 53.10602522185894, 25, 51.2573568753344 ] }, { "marker": { "color": "rgb(106, 61, 154)" }, "name": "αSMA_myCAF", "text": [ 6.603164352599291, 0.09746588693957114, 2.0202020202020203, 0.3529671299360247, 3.161167731905338, 19.56001912960306, 4.1457286432160805, 50.44642857142857, 5.640050697084917, 36.99319325244155, 25.25354969574036, 10.070371269109438, 4.445941394408893, 13.96788990825688, 7.626245276537272, 66.0989010989011, 40, 0.23282887077997672, 0.646551724137931, 0.26624068157614483, 20.515759312320917, 1.3207547169811322, 0.05584096493187402, 69.51770911831197, 1.5257469802924348, 0.7216103304215724, 0.1651073197578426, 2.3823191733639493, 0.6738544474393532, 11.60176635889201, 0.2381198881871829, 2.3638968481375358, 6.924882629107981, 11.253196930946292, 29.184549356223176, 36.47828117702009, 2.272727272727273, 20.064205457463885 ], "textposition": "auto", "type": "bar", "x": [ "11", "111", "116", "119", "121", "137", "140", "141", "146", "149", "15", "153", "157", "162", "169", "174", "177", "182", "183", "184", "187", "26", "32", "5", "7", "85", "89", "95", "98", "104", "18", "160", "171", "178", "179", "40", "51", "61" ], "y": [ 6.603164352599291, 0.09746588693957114, 2.0202020202020203, 0.3529671299360247, 3.161167731905338, 19.56001912960306, 4.1457286432160805, 50.44642857142857, 5.640050697084917, 36.99319325244155, 25.25354969574036, 10.070371269109438, 4.445941394408893, 13.96788990825688, 7.626245276537272, 66.0989010989011, 40, 0.23282887077997672, 0.646551724137931, 0.26624068157614483, 20.515759312320917, 1.3207547169811322, 0.05584096493187402, 69.51770911831197, 1.5257469802924348, 0.7216103304215724, 0.1651073197578426, 2.3823191733639493, 0.6738544474393532, 11.60176635889201, 0.2381198881871829, 2.3638968481375358, 6.924882629107981, 11.253196930946292, 29.184549356223176, 36.47828117702009, 2.272727272727273, 20.064205457463885 ] }, { "marker": { "color": "rgb(1.0, 1.0, 0.6)" }, "name": "STROMA_OTHER", "text": [ 82.3861801743623, 0.29239766081871343, 28.28282828282828, 2.294286344584161, 4.076697184315081, 9.660449545671927, 18.40452261306533, 13.750000000000002, 20.975918884664132, 12.577685705830127, 7.8431372549019605, 19.97088085416161, 1.5156618390030314, 22.889908256880734, 20.405358983167297, 12.307692307692308, 14.322916666666666, 11.874272409778813, 56.35775862068966, 2.1299254526091587, 1.489971346704871, 12.722371967654986, 6.85727049363413, 4.672192916352675, 33.75715193897012, 4.69046714774022, 13.401210787011559, 15.355912743972445, 8.679245283018867, 7.226013649136894, 1.9877834144321358, 13.46704871060172, 41.31455399061033, 4.143222506393862, 34.12017167381974, 7.26296123306866, 13.636363636363635, 9.523809523809524 ], "textposition": "auto", "type": "bar", "x": [ "11", "111", "116", "119", "121", "137", "140", "141", "146", "149", "15", "153", "157", "162", "169", "174", "177", "182", "183", "184", "187", "26", "32", "5", "7", "85", "89", "95", "98", "104", "18", "160", "171", "178", "179", "40", "51", "61" ], "y": [ 82.3861801743623, 0.29239766081871343, 28.28282828282828, 2.294286344584161, 4.076697184315081, 9.660449545671927, 18.40452261306533, 13.750000000000002, 20.975918884664132, 12.577685705830127, 7.8431372549019605, 19.97088085416161, 1.5156618390030314, 22.889908256880734, 20.405358983167297, 12.307692307692308, 14.322916666666666, 11.874272409778813, 56.35775862068966, 2.1299254526091587, 1.489971346704871, 12.722371967654986, 6.85727049363413, 4.672192916352675, 33.75715193897012, 4.69046714774022, 13.401210787011559, 15.355912743972445, 8.679245283018867, 7.226013649136894, 1.9877834144321358, 13.46704871060172, 41.31455399061033, 4.143222506393862, 34.12017167381974, 7.26296123306866, 13.636363636363635, 9.523809523809524 ] }, { "marker": { "color": "rgb(177, 89, 40)" }, "name": "ENDOTHELIAL", "text": [ 1.4045850823377461, 0.9746588693957114, 1.5151515151515151, 0.7500551511140525, 10.139920538953188, 4.8302247728359635, 3.2035175879396984, 6.517857142857143, 6.2103929024081115, 3.2849955608168098, 2.9073698444895197, 8.444552293132734, 0.9767598518019536, 7.178899082568807, 7.591892820336654, 1.208791208791209, 23.802083333333332, 4.307334109429569, 9.321120689655173, 0.6922257720979765, 0.40114613180515757, 1.2398921832884098, 0.08934554389099844, 1.6955538809344386, 1.2714558169103625, 1.3672616786935055, 3.6873968079251513, 4.104477611940299, 2.533692722371968, 5.9012444801284625, 2.4536701521896678, 1.2177650429799427, 8.392018779342724, 1.8925831202046037, 1.1802575107296138, 2.335357309668379, 43.18181818181818, 4.012841091492777 ], "textposition": "auto", "type": "bar", "x": [ "11", "111", "116", "119", "121", "137", "140", "141", "146", "149", "15", "153", "157", "162", "169", "174", "177", "182", "183", "184", "187", "26", "32", "5", "7", "85", "89", "95", "98", "104", "18", "160", "171", "178", "179", "40", "51", "61" ], "y": [ 1.4045850823377461, 0.9746588693957114, 1.5151515151515151, 0.7500551511140525, 10.139920538953188, 4.8302247728359635, 3.2035175879396984, 6.517857142857143, 6.2103929024081115, 3.2849955608168098, 2.9073698444895197, 8.444552293132734, 0.9767598518019536, 7.178899082568807, 7.591892820336654, 1.208791208791209, 23.802083333333332, 4.307334109429569, 9.321120689655173, 0.6922257720979765, 0.40114613180515757, 1.2398921832884098, 0.08934554389099844, 1.6955538809344386, 1.2714558169103625, 1.3672616786935055, 3.6873968079251513, 4.104477611940299, 2.533692722371968, 5.9012444801284625, 2.4536701521896678, 1.2177650429799427, 8.392018779342724, 1.8925831202046037, 1.1802575107296138, 2.335357309668379, 43.18181818181818, 4.012841091492777 ] } ], "layout": { "barmode": "stack", "plot_bgcolor": "white", "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Cell subtypes proportions by Patient and tissue type - NACT group" }, "xaxis": { "autorange": true, "linecolor": "black", "range": [ -0.5, 37.5 ], "type": "category" }, "yaxis": { "autorange": true, "linecolor": "black", "range": [ 0, 105.26315789473688 ], "title": { "text": "Cell count (%)" }, "type": "linear" } } } }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "'temp-plot.html'" ] }, "execution_count": 62, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fig = go.Figure()\n", "title = 'Cell subtypes proportions by Patient and tissue type - NACT group'\n", "\n", "for cell_subtype in cell_subtypes:\n", " fig.add_trace(\n", " go.Bar(\n", " name=cell_subtype,\n", " x=counts_perc_patients['Patient'],\n", " y=counts_perc_patients[f'{cell_subtype.lower()}_perc'],\n", " text=counts_perc_patients[f'{cell_subtype.lower()}_perc'],\n", " textposition='auto',\n", " marker_color='rgb' + str(cell_subtype_color_dict[cell_subtype])))\n", "\n", "fig.update_layout(\n", " plot_bgcolor='white',\n", " barmode='stack',\n", " title=title,\n", " xaxis=dict(linecolor='black'),\n", " yaxis=dict(title='Cell count (%)', linecolor='black'))\n", "\n", "output_filename = title.replace(\" \", \"_\") + \".png\"\n", "#fig.write_image(output_images_dir + \"/\" + output_filename, scale=1000)\n", "\n", "fig.show()\n", "plot(fig)" ] }, { "cell_type": "markdown", "id": "969a6ead-d94f-4e6f-80c4-48bc8cb716d6", "metadata": {}, "source": [ "##### V.4.3.4.1 ACT" ] }, { "cell_type": "code", "execution_count": 63, "id": "e704c689-1307-43a8-98a2-4bf301f4d451", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
dcbtcd4tcd8m1m2tregimmune_othercancerαsma_mycafstroma_otherendothelialTotal_cells
102.00.0900.024.0167.0100.05.028.03981388.0530335.06460.0
10021.00.092.046.00.03.01.030.0144930.073131.01876.0
1012.00.020.015.03.01.00.024.0189681.017360.02275.0
1021.02.045.024.05.01.00.038.0356418.09116.03805.0
10357.00.072.0555.07.00.01.078.0215717.0131117.03192.0
..........................................
920.00.011.0990.03.025.01.0184.0424140.02215.01815.0
960.00.076.02.02.01.00.04.018541.0163.01959.0
970.00.0174.038.00.00.01.056.0219328.0163102.02755.0
600.00.00.0107.09.016.01.057.01979107.0132.02309.0
620.00.00.023.03.015.00.04.015191.0203.0310.0
\n", "

139 rows × 13 columns

\n", "
" ], "text/plain": [ " dc b tcd4 tcd8 m1 m2 treg immune_other cancer \\\n", "10 2.0 0.0 900.0 24.0 167.0 100.0 5.0 28.0 3981 \n", "100 21.0 0.0 92.0 46.0 0.0 3.0 1.0 30.0 1449 \n", "101 2.0 0.0 20.0 15.0 3.0 1.0 0.0 24.0 1896 \n", "102 1.0 2.0 45.0 24.0 5.0 1.0 0.0 38.0 3564 \n", "103 57.0 0.0 72.0 555.0 7.0 0.0 1.0 78.0 2157 \n", ".. ... ... ... ... ... ... ... ... ... \n", "92 0.0 0.0 11.0 990.0 3.0 25.0 1.0 184.0 424 \n", "96 0.0 0.0 76.0 2.0 2.0 1.0 0.0 4.0 1854 \n", "97 0.0 0.0 174.0 38.0 0.0 0.0 1.0 56.0 2193 \n", "60 0.0 0.0 0.0 107.0 9.0 16.0 1.0 57.0 1979 \n", "62 0.0 0.0 0.0 23.0 3.0 15.0 0.0 4.0 151 \n", "\n", " αsma_mycaf stroma_other endothelial Total_cells \n", "10 388.0 530 335.0 6460.0 \n", "100 30.0 73 131.0 1876.0 \n", "101 81.0 173 60.0 2275.0 \n", "102 18.0 91 16.0 3805.0 \n", "103 17.0 131 117.0 3192.0 \n", ".. ... ... ... ... \n", "92 140.0 22 15.0 1815.0 \n", "96 1.0 16 3.0 1959.0 \n", "97 28.0 163 102.0 2755.0 \n", "60 107.0 1 32.0 2309.0 \n", "62 91.0 20 3.0 310.0 \n", "\n", "[139 rows x 13 columns]" ] }, "execution_count": 63, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Compter par numéro de patiente pour les patientes ACT uniquement\n", "patient_counts = {}\n", "\n", "# Boucle sur les sous-types de cellules pour compter les échantillons correspondants par patient\n", "for subtype in cell_subtypes:\n", " patient_counts[subtype.lower()] = pd.DataFrame({subtype.lower():\n", " df.loc[\n", " (df['cell_subtype'] == subtype) & (df['Patient'].isin(num_ACT_patients)), 'Patient'].value_counts()\n", " }).sort_index()\n", "\n", "# Concaténation des counts des sous-types de cellules en un seul DataFrame\n", "counts_patients = pd.concat([pd.DataFrame(v) for v in patient_counts.values()], axis=1, sort=False)\n", "counts_patients = counts_patients.fillna(0)\n", "\n", "# Ajout de la colonne de total de cellules comptées par patientes\n", "counts_patients['Total_cells'] = counts_patients.sum(axis=1)\n", "\n", "# Enregistrement des counts des sous-types de cellules par patient dans un fichier CSV\n", "filename_patients = os.path.join(output_data_dir, project_name + \"_cell_subtypes_number_by_patient_ACT.csv\")\n", "counts_patients.to_csv(filename_patients, index=False)\n", "counts_patients" ] }, { "cell_type": "code", "execution_count": 64, "id": "c15c1ebe-0fa9-45a3-b753-e7370a75e10d", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
dcbtcd4tcd8m1m2tregimmune_othercancerαsma_mycaf...tcd8_percm1_percm2_perctreg_percimmune_other_perccancer_percαsma_mycaf_percstroma_other_percendothelial_percPatient
102.00.0900.024.0167.0100.05.028.03981388.0...0.3715172.5851391.5479880.0773990.43343761.6253876.0061928.2043345.18575910
10021.00.092.046.00.03.01.030.0144930.0...2.4520260.0000000.1599150.0533051.59914777.2388061.5991473.8912586.982942100
1012.00.020.015.03.01.00.024.0189681.0...0.6593410.1318680.0439560.0000001.05494583.3406593.5604407.6043962.637363101
1021.02.045.024.05.01.00.038.0356418.0...0.6307490.1314060.0262810.0000000.99868693.6662290.4730622.3915900.420499102
10357.00.072.0555.07.00.01.078.0215717.0...17.3872180.2192980.0000000.0313282.44360967.5751880.5325814.1040103.665414103
..................................................................
920.00.011.0990.03.025.01.0184.0424140.0...54.5454550.1652891.3774100.05509610.13774123.3608827.7134991.2121210.82644692
960.00.076.02.02.01.00.04.018541.0...0.1020930.1020930.0510460.0000000.20418694.6401230.0510460.8167430.15313996
970.00.0174.038.00.00.01.056.0219328.0...1.3793100.0000000.0000000.0362982.03266879.6007261.0163345.9165153.70235997
600.00.00.0107.09.016.01.057.01979107.0...4.6340410.3897790.6929410.0433092.46860185.7080994.6340410.0433091.38588160
620.00.00.023.03.015.00.04.015191.0...7.4193550.9677424.8387100.0000001.29032348.70967729.3548396.4516130.96774262
\n", "

139 rows × 26 columns

\n", "
" ], "text/plain": [ " dc b tcd4 tcd8 m1 m2 treg immune_other cancer \\\n", "10 2.0 0.0 900.0 24.0 167.0 100.0 5.0 28.0 3981 \n", "100 21.0 0.0 92.0 46.0 0.0 3.0 1.0 30.0 1449 \n", "101 2.0 0.0 20.0 15.0 3.0 1.0 0.0 24.0 1896 \n", "102 1.0 2.0 45.0 24.0 5.0 1.0 0.0 38.0 3564 \n", "103 57.0 0.0 72.0 555.0 7.0 0.0 1.0 78.0 2157 \n", ".. ... ... ... ... ... ... ... ... ... \n", "92 0.0 0.0 11.0 990.0 3.0 25.0 1.0 184.0 424 \n", "96 0.0 0.0 76.0 2.0 2.0 1.0 0.0 4.0 1854 \n", "97 0.0 0.0 174.0 38.0 0.0 0.0 1.0 56.0 2193 \n", "60 0.0 0.0 0.0 107.0 9.0 16.0 1.0 57.0 1979 \n", "62 0.0 0.0 0.0 23.0 3.0 15.0 0.0 4.0 151 \n", "\n", " αsma_mycaf ... tcd8_perc m1_perc m2_perc treg_perc \\\n", "10 388.0 ... 0.371517 2.585139 1.547988 0.077399 \n", "100 30.0 ... 2.452026 0.000000 0.159915 0.053305 \n", "101 81.0 ... 0.659341 0.131868 0.043956 0.000000 \n", "102 18.0 ... 0.630749 0.131406 0.026281 0.000000 \n", "103 17.0 ... 17.387218 0.219298 0.000000 0.031328 \n", ".. ... ... ... ... ... ... \n", "92 140.0 ... 54.545455 0.165289 1.377410 0.055096 \n", "96 1.0 ... 0.102093 0.102093 0.051046 0.000000 \n", "97 28.0 ... 1.379310 0.000000 0.000000 0.036298 \n", "60 107.0 ... 4.634041 0.389779 0.692941 0.043309 \n", "62 91.0 ... 7.419355 0.967742 4.838710 0.000000 \n", "\n", " immune_other_perc cancer_perc αsma_mycaf_perc stroma_other_perc \\\n", "10 0.433437 61.625387 6.006192 8.204334 \n", "100 1.599147 77.238806 1.599147 3.891258 \n", "101 1.054945 83.340659 3.560440 7.604396 \n", "102 0.998686 93.666229 0.473062 2.391590 \n", "103 2.443609 67.575188 0.532581 4.104010 \n", ".. ... ... ... ... \n", "92 10.137741 23.360882 7.713499 1.212121 \n", "96 0.204186 94.640123 0.051046 0.816743 \n", "97 2.032668 79.600726 1.016334 5.916515 \n", "60 2.468601 85.708099 4.634041 0.043309 \n", "62 1.290323 48.709677 29.354839 6.451613 \n", "\n", " endothelial_perc Patient \n", "10 5.185759 10 \n", "100 6.982942 100 \n", "101 2.637363 101 \n", "102 0.420499 102 \n", "103 3.665414 103 \n", ".. ... ... \n", "92 0.826446 92 \n", "96 0.153139 96 \n", "97 3.702359 97 \n", "60 1.385881 60 \n", "62 0.967742 62 \n", "\n", "[139 rows x 26 columns]" ] }, "execution_count": 64, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Ajout des colonnes de pourcentages pour chaque sous-type de cellules par patient\n", "counts_perc_patients = counts_patients.copy()\n", "\n", "# Calcul des pourcentages pour chaque sous-type de cellules, en excluant la colonne 'total_cells'\n", "for col in counts_perc_patients.columns:\n", " if col != 'Total_cells':\n", " counts_perc_patients[col + '_perc'] = (counts_perc_patients[col] / counts_perc_patients['Total_cells']) * 100\n", "\n", "\n", "# Affichage des pourcentages des sous-types de cellules par patient\n", "counts_perc_patients['Patient'] = counts_perc_patients.index\n", "counts_perc_patients.columns.values\n", "counts_perc_patients\n", "\n" ] }, { "cell_type": "code", "execution_count": 65, "id": "1ab4d7e0-5666-4692-b256-16606b279700", "metadata": {}, "outputs": [], "source": [ "counts_perc_patients_ACT = counts_perc_patients" ] }, { "cell_type": "code", "execution_count": 66, "id": "4b3e2548-257e-40dc-8c9f-78f3daf28404", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "marker": { "color": "rgb(166, 206, 227)" }, "name": "DC", "text": [ 0.030959752321981428, 1.1194029850746268, 0.0879120879120879, 0.026281208935611037, 1.7857142857142856, 0.16251354279523295, 0.01915341888527102, 1.8001800180018002, 0.27932960893854747, 0.07040600797934757, 0.03170577045022194, 0.6369426751592357, 0.19162332329592116, 0.044444444444444446, 0.19485580670303976, 0.1509813789632612, 0.6265664160401002, 1.3333333333333335, 1.8334606569900689, 0.48543689320388345, 0.10482180293501049, 0.4731488052992667, 0.38910505836575876, 1.3261210957948002, 11.179606797734088, 0.16381933068102036, 0.15408320493066258, 0.012711325791280032, 0.130718954248366, 1.6082294986960302, 0.025412960609911054, 0.250678922080635, 0.2883762200532387, 0.8665511265164645, 0.5867396831605711, 0.01882530120481928, 0.07336757153338225, 0.8547008547008548, 3.489499192245557, 22.03856749311295, 0.10086746015735323, 0.10156408693885843, 0.25597269624573377, 0.1310615989515072, 0.21253985122210414, 0.6975392365820577, 2.3801760678187156, 0.0643915003219575, 0.09737098344693282, 0.5830009205277692, 0.01889287738522577, 0.029498525073746312, 1.3999164229001253, 0.07777259293824856, 0.03567606136282554, 0.13120899718837864, 0.6089604175728578, 0.836635843240863, 1.0788381742738589, 2.1150424985174934, 0.04315925766076824, 0.07789678675754626, 0.2491506228765572, 0.8224993366940834, 0.7874015748031495, 0.9978048293753742, 0.5996002664890073, 0.29505778214900413, 0.14691478942213515, 0.3534956794972506, 0.03664345914254306, 0.5344503827820309, 3.1978680879413726, 0.044007627988851404, 0.09629272989889263, 0.1779359430604982, 0.045187528242205156, 0.09206407659731174, 0.7308467741935484, 0.04962779156327543, 0.8764940239043826, 0.17491254372813594, 0.02337540906965872, 1.1464968152866242, 12.654392915404333, 0.1128668171557562, 6.478624944909652, 0.14516421702050444, 0.028477858465043433, 1.9297036526533424, 0.01858736059479554, 0.05564830272676684, 0.2434705621956618, 0.03254678600488201, 0.034916201117318434, 0.12903225806451613, 0.14248397055331277, 0.6134969325153374, 0.23715415019762848, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "110", "112", "113", "114", "115", "120", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "139", "14", "143", "144", "147", "148", "150", "152", "154", "155", "158", "159", "161", "164", "165", "166", "168", "170", "175", "176", "180", "181", "186", "19", "20", "22", "23", "27", "28", "30", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "70", "71", "73", "75", "8", "80", "81", "82", "83", "87", "88", "90", "91", "94", "99", "108", "135", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "167", "17", "172", "173", "21", "24", "47", "48", "49", "55", "56", "59", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 0.030959752321981428, 1.1194029850746268, 0.0879120879120879, 0.026281208935611037, 1.7857142857142856, 0.16251354279523295, 0.01915341888527102, 1.8001800180018002, 0.27932960893854747, 0.07040600797934757, 0.03170577045022194, 0.6369426751592357, 0.19162332329592116, 0.044444444444444446, 0.19485580670303976, 0.1509813789632612, 0.6265664160401002, 1.3333333333333335, 1.8334606569900689, 0.48543689320388345, 0.10482180293501049, 0.4731488052992667, 0.38910505836575876, 1.3261210957948002, 11.179606797734088, 0.16381933068102036, 0.15408320493066258, 0.012711325791280032, 0.130718954248366, 1.6082294986960302, 0.025412960609911054, 0.250678922080635, 0.2883762200532387, 0.8665511265164645, 0.5867396831605711, 0.01882530120481928, 0.07336757153338225, 0.8547008547008548, 3.489499192245557, 22.03856749311295, 0.10086746015735323, 0.10156408693885843, 0.25597269624573377, 0.1310615989515072, 0.21253985122210414, 0.6975392365820577, 2.3801760678187156, 0.0643915003219575, 0.09737098344693282, 0.5830009205277692, 0.01889287738522577, 0.029498525073746312, 1.3999164229001253, 0.07777259293824856, 0.03567606136282554, 0.13120899718837864, 0.6089604175728578, 0.836635843240863, 1.0788381742738589, 2.1150424985174934, 0.04315925766076824, 0.07789678675754626, 0.2491506228765572, 0.8224993366940834, 0.7874015748031495, 0.9978048293753742, 0.5996002664890073, 0.29505778214900413, 0.14691478942213515, 0.3534956794972506, 0.03664345914254306, 0.5344503827820309, 3.1978680879413726, 0.044007627988851404, 0.09629272989889263, 0.1779359430604982, 0.045187528242205156, 0.09206407659731174, 0.7308467741935484, 0.04962779156327543, 0.8764940239043826, 0.17491254372813594, 0.02337540906965872, 1.1464968152866242, 12.654392915404333, 0.1128668171557562, 6.478624944909652, 0.14516421702050444, 0.028477858465043433, 1.9297036526533424, 0.01858736059479554, 0.05564830272676684, 0.2434705621956618, 0.03254678600488201, 0.034916201117318434, 0.12903225806451613, 0.14248397055331277, 0.6134969325153374, 0.23715415019762848, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] }, { "marker": { "color": "rgb(31, 120, 180)" }, "name": "B", "text": [ 0, 0, 0, 0.052562417871222074, 0, 0, 0.15322735108216817, 0, 0, 0, 0, 0.03352329869259135, 0, 0, 0, 0, 0.011392116655274549, 0.3660130718954248, 0.03819709702062643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.7407407407407408, 0, 0, 0, 0, 0, 0, 0.03765060240963856, 0, 0, 0.06462035541195477, 0, 0.0403469840629413, 0.14218972171440178, 0, 0.5242463958060288, 0, 0.019376089905057157, 0, 0, 0, 0, 0, 2.47787610619469, 0.020894274968658588, 0, 0, 0, 0, 0, 0, 0, 0, 0.019474196689386564, 0, 0.05306447333510214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0398406374501992, 0, 0, 0, 0, 0.02821670428893905, 0, 0, 0, 0.02297266253158741, 0.5204460966542751, 0, 0, 0, 0, 0, 0, 0, 0, 0.06901311249137336, 3.28416365154467, 0.7992007992007992, 0.04482294935006724, 0.06188118811881188, 0.14691478942213515, 0.6885998469778117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "110", "112", "113", "114", "115", "120", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "139", "14", "143", "144", "147", "148", "150", "152", "154", "155", "158", "159", "161", "164", "165", "166", "168", "170", "175", "176", "180", "181", "186", "19", "20", "22", "23", "27", "28", "30", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "70", "71", "73", "75", "8", "80", "81", "82", "83", "87", "88", "90", "91", "94", "99", "108", "135", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "167", "17", "172", "173", "21", "24", "47", "48", "49", "55", "56", "59", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 0, 0, 0, 0.052562417871222074, 0, 0, 0.15322735108216817, 0, 0, 0, 0, 0.03352329869259135, 0, 0, 0, 0, 0.011392116655274549, 0.3660130718954248, 0.03819709702062643, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.7407407407407408, 0, 0, 0, 0, 0, 0, 0.03765060240963856, 0, 0, 0.06462035541195477, 0, 0.0403469840629413, 0.14218972171440178, 0, 0.5242463958060288, 0, 0.019376089905057157, 0, 0, 0, 0, 0, 2.47787610619469, 0.020894274968658588, 0, 0, 0, 0, 0, 0, 0, 0, 0.019474196689386564, 0, 0.05306447333510214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0398406374501992, 0, 0, 0, 0, 0.02821670428893905, 0, 0, 0, 0.02297266253158741, 0.5204460966542751, 0, 0, 0, 0, 0, 0, 0, 0, 0.06901311249137336, 3.28416365154467, 0.7992007992007992, 0.04482294935006724, 0.06188118811881188, 0.14691478942213515, 0.6885998469778117, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] }, { "marker": { "color": "rgb(178, 223, 138)" }, "name": "TCD4", "text": [ 13.93188854489164, 4.904051172707889, 0.8791208791208791, 1.1826544021024967, 2.2556390977443606, 0.3250270855904659, 1.991955564068186, 0.7200720072007201, 3.35195530726257, 3.9192677775170144, 1.077996195307546, 1.6426416359369762, 6.131946345469477, 1.1111111111111112, 9.353078721745907, 2.7176648213387016, 1.1278195488721803, 14.143790849673202, 3.7815126050420167, 10.922330097087379, 6.184486373165619, 1.0172699313934233, 14.184648036788113, 3.78642470772989, 13.595468177274242, 0.5850690381465012, 2.6964560862865947, 2.4151519003432056, 0.34858387799564267, 0.7099391480730223, 2.9987293519695046, 0.50135784416127, 6.521739130434782, 1.6464471403812824, 5.671816937218853, 0.5271084337349398, 0.9537784299339692, 3.9316239316239314, 3.5541195476575123, 1.9283746556473829, 7.625579987895905, 1.360958764980703, 6.228668941979522, 0.655307994757536, 0.3188097768331562, 0.8331718659174578, 1.3694163677861102, 0.901481004507405, 2.044790652385589, 15.081313286284137, 0.49121481201587003, 0.14749262536873156, 4.9937317175094025, 0.6999533364442371, 0.9275775954334641, 18.481724461105905, 2.7838190517616357, 1.4971378247468077, 0.16597510373443983, 1.344139157936351, 0.02157962883038412, 0.3894839337877313, 5.458663646659117, 45.900769434863356, 60.23622047244095, 14.887248054280583, 2.9313790806129245, 1.1802311285960165, 4.521710741103494, 1.4532600157109192, 2.381824844265299, 1.314459049544995, 0.39973351099267157, 0.029338418659234266, 1.1073663938372653, 3.0249110320284696, 5.309534568459105, 2.1542993923770943, 1.7389112903225805, 0.5955334987593052, 0.6772908366533864, 5.022488755622189, 0.4908835904628331, 0.7825295723384895, 3.6588207876951757, 2.3702031602708806, 3.1511679153812255, 0.32661948829613496, 10.024206179695287, 1.6540317022742934, 0.2788104089219331, 0, 2.058432934926959, 7.518307567127747, 0.6983240223463687, 7.677419354838709, 15.696984089289955, 0.2044989775051125, 7.114624505928854, 0.2070393374741201, 2.9223490119677153, 0.07492507492507493, 0.22411474675033619, 3.248762376237624, 0.2938295788442703, 0.07651109410864575, 0.45126353790613716, 0.17538731365097923, 3.5419915348629982, 1.8327067669172932, 0.6085192697768762, 0.12626262626262627, 2.686428902269569, 0.37735849056603776, 0.639749786750071, 0.09342883836810963, 3.3608310418576233, 0.033681374200067365, 1.9677996422182469, 2.814191220685508, 0.47095761381475665, 0.43464762496119214, 1.2394366197183098, 0.26752273943285176, 0.10162601626016261, 0.026048450117218028, 0.39913520705138866, 0.5095541401273885, 0.18885741265344666, 0.8818342151675485, 0.14958863126402394, 2.552048354600403, 0.0992063492063492, 6.718682271348071, 0.6060606060606061, 3.8795303726391013, 6.315789473684211, 0, 0 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "110", "112", "113", "114", "115", "120", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "139", "14", "143", "144", "147", "148", "150", "152", "154", "155", "158", "159", "161", "164", "165", "166", "168", "170", "175", "176", "180", "181", "186", "19", "20", "22", "23", "27", "28", "30", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "70", "71", "73", "75", "8", "80", "81", "82", "83", "87", "88", "90", "91", "94", "99", "108", "135", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "167", "17", "172", "173", "21", "24", "47", "48", "49", "55", "56", "59", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 13.93188854489164, 4.904051172707889, 0.8791208791208791, 1.1826544021024967, 2.2556390977443606, 0.3250270855904659, 1.991955564068186, 0.7200720072007201, 3.35195530726257, 3.9192677775170144, 1.077996195307546, 1.6426416359369762, 6.131946345469477, 1.1111111111111112, 9.353078721745907, 2.7176648213387016, 1.1278195488721803, 14.143790849673202, 3.7815126050420167, 10.922330097087379, 6.184486373165619, 1.0172699313934233, 14.184648036788113, 3.78642470772989, 13.595468177274242, 0.5850690381465012, 2.6964560862865947, 2.4151519003432056, 0.34858387799564267, 0.7099391480730223, 2.9987293519695046, 0.50135784416127, 6.521739130434782, 1.6464471403812824, 5.671816937218853, 0.5271084337349398, 0.9537784299339692, 3.9316239316239314, 3.5541195476575123, 1.9283746556473829, 7.625579987895905, 1.360958764980703, 6.228668941979522, 0.655307994757536, 0.3188097768331562, 0.8331718659174578, 1.3694163677861102, 0.901481004507405, 2.044790652385589, 15.081313286284137, 0.49121481201587003, 0.14749262536873156, 4.9937317175094025, 0.6999533364442371, 0.9275775954334641, 18.481724461105905, 2.7838190517616357, 1.4971378247468077, 0.16597510373443983, 1.344139157936351, 0.02157962883038412, 0.3894839337877313, 5.458663646659117, 45.900769434863356, 60.23622047244095, 14.887248054280583, 2.9313790806129245, 1.1802311285960165, 4.521710741103494, 1.4532600157109192, 2.381824844265299, 1.314459049544995, 0.39973351099267157, 0.029338418659234266, 1.1073663938372653, 3.0249110320284696, 5.309534568459105, 2.1542993923770943, 1.7389112903225805, 0.5955334987593052, 0.6772908366533864, 5.022488755622189, 0.4908835904628331, 0.7825295723384895, 3.6588207876951757, 2.3702031602708806, 3.1511679153812255, 0.32661948829613496, 10.024206179695287, 1.6540317022742934, 0.2788104089219331, 0, 2.058432934926959, 7.518307567127747, 0.6983240223463687, 7.677419354838709, 15.696984089289955, 0.2044989775051125, 7.114624505928854, 0.2070393374741201, 2.9223490119677153, 0.07492507492507493, 0.22411474675033619, 3.248762376237624, 0.2938295788442703, 0.07651109410864575, 0.45126353790613716, 0.17538731365097923, 3.5419915348629982, 1.8327067669172932, 0.6085192697768762, 0.12626262626262627, 2.686428902269569, 0.37735849056603776, 0.639749786750071, 0.09342883836810963, 3.3608310418576233, 0.033681374200067365, 1.9677996422182469, 2.814191220685508, 0.47095761381475665, 0.43464762496119214, 1.2394366197183098, 0.26752273943285176, 0.10162601626016261, 0.026048450117218028, 0.39913520705138866, 0.5095541401273885, 0.18885741265344666, 0.8818342151675485, 0.14958863126402394, 2.552048354600403, 0.0992063492063492, 6.718682271348071, 0.6060606060606061, 3.8795303726391013, 6.315789473684211, 0, 0 ] }, { "marker": { "color": "rgb(51, 160, 44)" }, "name": "TCD8", "text": [ 0.37151702786377705, 2.4520255863539444, 0.6593406593406593, 0.6307490144546649, 17.387218045112782, 6.121343445287107, 1.762114537444934, 29.072907290729074, 3.55147645650439, 0.21121802393804273, 0.03170577045022194, 17.063359034528997, 0.3011223651793047, 0.26666666666666666, 0.03897116134060795, 0.20130850528434827, 1.948051948051948, 1.1764705882352942, 0.2291825821237586, 0.24271844660194172, 1.1530398322851152, 1.230186893778093, 0.21223912274495935, 0.24428546501483162, 0.4998333888703766, 0, 0.23112480739599386, 0.07626795474768018, 7.363834422657953, 0.3911909591422776, 0.20330368487928843, 0.9609358679757677, 1.4640638864241349, 0.6932409012131715, 0.8214355564247995, 0.1694277108433735, 0, 0.927960927960928, 3.1825525040387723, 11.937557392102846, 0.0403469840629413, 0.28437944342880356, 0.6825938566552902, 0.1310615989515072, 0.10626992561105207, 0.019376089905057157, 2.41278121943267, 0.19317450096587252, 0.9737098344693282, 3.958269407793802, 0.4345361798601928, 12.271386430678465, 15.670706226493941, 0, 0.8205494113449875, 2.7741330834114337, 1.4354066985645932, 19.154557463672393, 71.45228215767635, 25.677011267048822, 1.294777729823047, 0.4089581304771178, 0.7927519818799547, 0.02653223666755107, 2.3622047244094486, 9.5988824585911, 0.6662225183211192, 0.34423407917383825, 0.3917727717923604, 0.864100549882168, 1.667277390985709, 0.10111223458038424, 1.4434821230290917, 16.62021417045621, 0.9950248756218906, 6.93950177935943, 0.11296882060551287, 1.8228687166267723, 1.033266129032258, 7.626137303556659, 0.5179282868525896, 1.5492253873063468, 0.02337540906965872, 1.4194722474977253, 4.474481472850152, 3.470654627539503, 12.5605993829881, 2.558519324986391, 0.25630072618539085, 4.387778543533195, 2.5650557620817844, 26.26599888703395, 0.15493581230633025, 0.32546786004882017, 0.13966480446927373, 0.25806451612903225, 2.3509855141296603, 10.429447852760736, 1.8181818181818181, 0, 0.11132758140829391, 0.12487512487512488, 2.3756163155535632, 0.8353960396039605, 0.3428011753183154, 0, 27.707581227436823, 1.929260450160772, 0.06683002895967921, 1.3157894736842104, 0, 0.5050505050505051, 0, 0.25157232704402516, 0.5828831390389536, 0.21800062285892244, 0.5346776657500764, 0, 0.17889087656529518, 1.0944076969332532, 7.064364207221351, 0.3104625892579944, 2.873239436619718, 11.021936864633494, 5.7926829268292686, 0.3125814014066163, 1.1308830866456012, 0.12738853503184713, 0.09442870632672333, 0.5291005291005291, 1.6828721017202692, 0.1343183344526528, 0, 1.1847998844097674, 54.54545454545454, 0.10209290454313426, 1.3793103448275863, 4.634040710264184, 7.419354838709677 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "110", "112", "113", "114", "115", "120", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "139", "14", "143", "144", "147", "148", "150", "152", "154", "155", "158", "159", "161", "164", "165", "166", "168", "170", "175", "176", "180", "181", "186", "19", "20", "22", "23", "27", "28", "30", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "70", "71", "73", "75", "8", "80", "81", "82", "83", "87", "88", "90", "91", "94", "99", "108", "135", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "167", "17", "172", "173", "21", "24", "47", "48", "49", "55", "56", "59", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 0.37151702786377705, 2.4520255863539444, 0.6593406593406593, 0.6307490144546649, 17.387218045112782, 6.121343445287107, 1.762114537444934, 29.072907290729074, 3.55147645650439, 0.21121802393804273, 0.03170577045022194, 17.063359034528997, 0.3011223651793047, 0.26666666666666666, 0.03897116134060795, 0.20130850528434827, 1.948051948051948, 1.1764705882352942, 0.2291825821237586, 0.24271844660194172, 1.1530398322851152, 1.230186893778093, 0.21223912274495935, 0.24428546501483162, 0.4998333888703766, 0, 0.23112480739599386, 0.07626795474768018, 7.363834422657953, 0.3911909591422776, 0.20330368487928843, 0.9609358679757677, 1.4640638864241349, 0.6932409012131715, 0.8214355564247995, 0.1694277108433735, 0, 0.927960927960928, 3.1825525040387723, 11.937557392102846, 0.0403469840629413, 0.28437944342880356, 0.6825938566552902, 0.1310615989515072, 0.10626992561105207, 0.019376089905057157, 2.41278121943267, 0.19317450096587252, 0.9737098344693282, 3.958269407793802, 0.4345361798601928, 12.271386430678465, 15.670706226493941, 0, 0.8205494113449875, 2.7741330834114337, 1.4354066985645932, 19.154557463672393, 71.45228215767635, 25.677011267048822, 1.294777729823047, 0.4089581304771178, 0.7927519818799547, 0.02653223666755107, 2.3622047244094486, 9.5988824585911, 0.6662225183211192, 0.34423407917383825, 0.3917727717923604, 0.864100549882168, 1.667277390985709, 0.10111223458038424, 1.4434821230290917, 16.62021417045621, 0.9950248756218906, 6.93950177935943, 0.11296882060551287, 1.8228687166267723, 1.033266129032258, 7.626137303556659, 0.5179282868525896, 1.5492253873063468, 0.02337540906965872, 1.4194722474977253, 4.474481472850152, 3.470654627539503, 12.5605993829881, 2.558519324986391, 0.25630072618539085, 4.387778543533195, 2.5650557620817844, 26.26599888703395, 0.15493581230633025, 0.32546786004882017, 0.13966480446927373, 0.25806451612903225, 2.3509855141296603, 10.429447852760736, 1.8181818181818181, 0, 0.11132758140829391, 0.12487512487512488, 2.3756163155535632, 0.8353960396039605, 0.3428011753183154, 0, 27.707581227436823, 1.929260450160772, 0.06683002895967921, 1.3157894736842104, 0, 0.5050505050505051, 0, 0.25157232704402516, 0.5828831390389536, 0.21800062285892244, 0.5346776657500764, 0, 0.17889087656529518, 1.0944076969332532, 7.064364207221351, 0.3104625892579944, 2.873239436619718, 11.021936864633494, 5.7926829268292686, 0.3125814014066163, 1.1308830866456012, 0.12738853503184713, 0.09442870632672333, 0.5291005291005291, 1.6828721017202692, 0.1343183344526528, 0, 1.1847998844097674, 54.54545454545454, 0.10209290454313426, 1.3793103448275863, 4.634040710264184, 7.419354838709677 ] }, { "marker": { "color": "rgb(251, 154, 153)" }, "name": "M1", "text": [ 2.5851393188854486, 0, 0.13186813186813187, 0.1314060446780552, 0.21929824561403508, 0.16251354279523295, 0.03830683777054204, 0.6300630063006301, 0.03990422984836393, 0, 0.07926442612555486, 0, 0.32849712565015055, 0, 0, 0.050327126321087066, 0.011392116655274549, 0.052287581699346414, 0, 0, 0, 0.02365744026496333, 0.035373187124159884, 0.034897923573547374, 3.9986671109630127, 0, 0.07704160246533129, 0.025422651582560064, 0.261437908496732, 0, 0, 0.020889910173386254, 0.4658385093167702, 0, 0.019557989438685704, 0, 0, 0, 0.12924071082390953, 0, 0.0806939681258826, 0.14218972171440178, 0, 0, 0, 0.27126525867080026, 0.39126181936746, 0.128783000643915, 1.7526777020447908, 0.04602638846271863, 0, 2.0648967551622417, 0, 0.04666355576294914, 0.03567606136282554, 0.056232427366447985, 0, 0, 2.1576763485477177, 0.0197667523225934, 0, 0.07789678675754626, 0, 0.02653223666755107, 0, 0.9978048293753742, 0, 0, 0, 0.1178318931657502, 0.09160864785635764, 0.36111512350137226, 0, 0.044007627988851404, 0, 0, 0.022593764121102578, 0.055238445958387034, 0.12600806451612903, 0.016542597187758478, 0, 0.29985007496251875, 0.04675081813931744, 0.07279344858962694, 0.3262642740619902, 0, 0.3085059497576025, 0.07258210851025222, 0, 0.13783597518952445, 0.5390334572490706, 0.1669449081803005, 0.04426737494466578, 0.09764035801464606, 0.034916201117318434, 0.25806451612903225, 0.04749465685110425, 0, 0.3952569169960474, 0.06901311249137336, 0, 0, 0, 3.125, 0, 0, 0, 0, 0.022276676319893073, 0, 0.10141987829614604, 0.06313131313131314, 0.09263547938860583, 0, 0, 0.06228589224540642, 0.030553009471432937, 0, 6.350626118067979, 0, 0.15698587127158556, 0.03104625892579944, 0, 0, 0.1524390243902439, 0.052096900234436055, 0.2827207716614003, 0, 0.09442870632672333, 0, 0.1869857890800299, 0.2686366689053056, 0, 0, 0.1652892561983471, 0.10209290454313426, 0, 0.3897791251624079, 0.967741935483871 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "110", "112", "113", "114", "115", "120", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "139", "14", "143", "144", "147", "148", "150", "152", "154", "155", "158", "159", "161", "164", "165", "166", "168", "170", "175", "176", "180", "181", "186", "19", "20", "22", "23", "27", "28", "30", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "70", "71", "73", "75", "8", "80", "81", "82", "83", "87", "88", "90", "91", "94", "99", "108", "135", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "167", "17", "172", "173", "21", "24", "47", "48", "49", "55", "56", "59", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 2.5851393188854486, 0, 0.13186813186813187, 0.1314060446780552, 0.21929824561403508, 0.16251354279523295, 0.03830683777054204, 0.6300630063006301, 0.03990422984836393, 0, 0.07926442612555486, 0, 0.32849712565015055, 0, 0, 0.050327126321087066, 0.011392116655274549, 0.052287581699346414, 0, 0, 0, 0.02365744026496333, 0.035373187124159884, 0.034897923573547374, 3.9986671109630127, 0, 0.07704160246533129, 0.025422651582560064, 0.261437908496732, 0, 0, 0.020889910173386254, 0.4658385093167702, 0, 0.019557989438685704, 0, 0, 0, 0.12924071082390953, 0, 0.0806939681258826, 0.14218972171440178, 0, 0, 0, 0.27126525867080026, 0.39126181936746, 0.128783000643915, 1.7526777020447908, 0.04602638846271863, 0, 2.0648967551622417, 0, 0.04666355576294914, 0.03567606136282554, 0.056232427366447985, 0, 0, 2.1576763485477177, 0.0197667523225934, 0, 0.07789678675754626, 0, 0.02653223666755107, 0, 0.9978048293753742, 0, 0, 0, 0.1178318931657502, 0.09160864785635764, 0.36111512350137226, 0, 0.044007627988851404, 0, 0, 0.022593764121102578, 0.055238445958387034, 0.12600806451612903, 0.016542597187758478, 0, 0.29985007496251875, 0.04675081813931744, 0.07279344858962694, 0.3262642740619902, 0, 0.3085059497576025, 0.07258210851025222, 0, 0.13783597518952445, 0.5390334572490706, 0.1669449081803005, 0.04426737494466578, 0.09764035801464606, 0.034916201117318434, 0.25806451612903225, 0.04749465685110425, 0, 0.3952569169960474, 0.06901311249137336, 0, 0, 0, 3.125, 0, 0, 0, 0, 0.022276676319893073, 0, 0.10141987829614604, 0.06313131313131314, 0.09263547938860583, 0, 0, 0.06228589224540642, 0.030553009471432937, 0, 6.350626118067979, 0, 0.15698587127158556, 0.03104625892579944, 0, 0, 0.1524390243902439, 0.052096900234436055, 0.2827207716614003, 0, 0.09442870632672333, 0, 0.1869857890800299, 0.2686366689053056, 0, 0, 0.1652892561983471, 0.10209290454313426, 0, 0.3897791251624079, 0.967741935483871 ] }, { "marker": { "color": "rgb(227, 26, 28)" }, "name": "M2", "text": [ 1.5479876160990713, 0.15991471215351813, 0.04395604395604395, 0.026281208935611037, 0, 0.16251354279523295, 0, 1.4401440144014401, 0.11971268954509177, 0, 0.03170577045022194, 0, 0.08212428141253764, 0.044444444444444446, 0.03897116134060795, 0, 0.03417634996582365, 0.0784313725490196, 0.03819709702062643, 0, 0, 0, 0.035373187124159884, 0.034897923573547374, 0.049983338887037654, 0, 0.30816640986132515, 0.012711325791280032, 0.08714596949891067, 0, 0, 0.04177982034677251, 0.022182786157941437, 0, 0, 0.01882530120481928, 0, 0, 0.08077544426494346, 0, 0.0403469840629413, 0, 0.3412969283276451, 0.655307994757536, 0, 0, 2.184545158134985, 0, 0.4868549172346641, 0, 0, 0.029498525073746312, 0.06268282490597576, 0.031109037175299427, 0, 0, 0.04349717268377556, 0.08806693086745927, 1.0788381742738589, 0, 0, 0.07789678675754626, 0, 0.10612894667020428, 0, 0.23947315905008978, 0, 0, 0.04897159647404505, 0, 0, 0.01444460494005489, 0, 0.029338418659234266, 0, 0, 0.11296882060551287, 0.018412815319462345, 0, 0.5128205128205128, 0, 0.12493753123438281, 0, 0.03639672429481347, 0.745746912141692, 0.4514672686230248, 0.37461436756280303, 0.07258210851025222, 0, 0.1837813002526993, 0.966542750929368, 0.4451864218141347, 0.02213368747233289, 0.5044751830756713, 0.10474860335195531, 0.8387096774193548, 0.5224412253621468, 0, 0.3952569169960474, 0, 0, 0.04995004995004995, 0.08964589870013448, 0.09282178217821782, 0, 0, 0, 0.029231218941829874, 0, 0.046992481203007516, 0.3042596348884381, 0, 0, 0, 0.04264998578333807, 0.03114294612270321, 0, 0, 0.08944543828264759, 0, 0, 0, 0, 0, 0.35569105691056907, 0, 0.09978380176284717, 0.06369426751592357, 0.3777148253068933, 0, 0.037397157816005985, 0.0671591672263264, 0, 0.014448779078167894, 1.3774104683195594, 0.05104645227156713, 0, 0.6929406669553919, 4.838709677419355 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "110", "112", "113", "114", "115", "120", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "139", "14", "143", "144", "147", "148", "150", "152", "154", "155", "158", "159", "161", "164", "165", "166", "168", "170", "175", "176", "180", "181", "186", "19", "20", "22", "23", "27", "28", "30", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "70", "71", "73", "75", "8", "80", "81", "82", "83", "87", "88", "90", "91", "94", "99", "108", "135", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "167", "17", "172", "173", "21", "24", "47", "48", "49", "55", "56", "59", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 1.5479876160990713, 0.15991471215351813, 0.04395604395604395, 0.026281208935611037, 0, 0.16251354279523295, 0, 1.4401440144014401, 0.11971268954509177, 0, 0.03170577045022194, 0, 0.08212428141253764, 0.044444444444444446, 0.03897116134060795, 0, 0.03417634996582365, 0.0784313725490196, 0.03819709702062643, 0, 0, 0, 0.035373187124159884, 0.034897923573547374, 0.049983338887037654, 0, 0.30816640986132515, 0.012711325791280032, 0.08714596949891067, 0, 0, 0.04177982034677251, 0.022182786157941437, 0, 0, 0.01882530120481928, 0, 0, 0.08077544426494346, 0, 0.0403469840629413, 0, 0.3412969283276451, 0.655307994757536, 0, 0, 2.184545158134985, 0, 0.4868549172346641, 0, 0, 0.029498525073746312, 0.06268282490597576, 0.031109037175299427, 0, 0, 0.04349717268377556, 0.08806693086745927, 1.0788381742738589, 0, 0, 0.07789678675754626, 0, 0.10612894667020428, 0, 0.23947315905008978, 0, 0, 0.04897159647404505, 0, 0, 0.01444460494005489, 0, 0.029338418659234266, 0, 0, 0.11296882060551287, 0.018412815319462345, 0, 0.5128205128205128, 0, 0.12493753123438281, 0, 0.03639672429481347, 0.745746912141692, 0.4514672686230248, 0.37461436756280303, 0.07258210851025222, 0, 0.1837813002526993, 0.966542750929368, 0.4451864218141347, 0.02213368747233289, 0.5044751830756713, 0.10474860335195531, 0.8387096774193548, 0.5224412253621468, 0, 0.3952569169960474, 0, 0, 0.04995004995004995, 0.08964589870013448, 0.09282178217821782, 0, 0, 0, 0.029231218941829874, 0, 0.046992481203007516, 0.3042596348884381, 0, 0, 0, 0.04264998578333807, 0.03114294612270321, 0, 0, 0.08944543828264759, 0, 0, 0, 0, 0, 0.35569105691056907, 0, 0.09978380176284717, 0.06369426751592357, 0.3777148253068933, 0, 0.037397157816005985, 0.0671591672263264, 0, 0.014448779078167894, 1.3774104683195594, 0.05104645227156713, 0, 0.6929406669553919, 4.838709677419355 ] }, { "marker": { "color": "rgb(253, 191, 111)" }, "name": "Treg", "text": [ 0.07739938080495357, 0.053304904051172705, 0, 0, 0.03132832080200501, 0, 0, 0, 0.03990422984836393, 0.16428068528514433, 0, 0.1340931947703654, 0.027374760470845878, 0, 0, 0.10065425264217413, 0, 0.026143790849673207, 0, 0.08090614886731393, 0, 0.02365744026496333, 0.14149274849663954, 0, 0.049983338887037654, 0, 0.15408320493066258, 0, 0.17429193899782133, 0, 0.20330368487928843, 0, 0, 0, 0, 0.01882530120481928, 0, 0, 0, 0, 0.0403469840629413, 0.020312817387771683, 0.3412969283276451, 0.2621231979030144, 0, 0, 0, 0, 0, 0.0613685179502915, 0, 0, 0.020894274968658588, 0, 0, 0.09372071227741331, 0.04349717268377556, 0, 0.08298755186721991, 0, 0, 0.03894839337877313, 0, 0.02653223666755107, 0.7874015748031495, 0.6385950908002395, 0.06662225183211193, 0, 0, 0, 0.01832172957127153, 0, 0, 0, 0, 0.1779359430604982, 0, 0, 0, 0.033085194375516956, 0.0398406374501992, 0, 0.02337540906965872, 0, 0.04660918200885575, 0.02821670428893905, 0.4627589246364037, 0, 0.056955716930086865, 0, 0.01858736059479554, 0, 0.02213368747233289, 0, 0, 0.12903225806451613, 0.04749465685110425, 0, 0, 0, 0, 0.04995004995004995, 0, 0.03094059405940594, 0, 0, 0, 0, 0.022276676319893073, 0, 0.10141987829614604, 0, 0, 0, 0, 0, 0.015276504735716468, 0, 0, 0, 0, 0.03104625892579944, 0, 0, 0, 0, 0, 0, 0, 0, 0.037397157816005985, 0, 0, 0.014448779078167894, 0.055096418732782364, 0, 0.03629764065335753, 0.043308791684711995, 0 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "110", "112", "113", "114", "115", "120", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "139", "14", "143", "144", "147", "148", "150", "152", "154", "155", "158", "159", "161", "164", "165", "166", "168", "170", "175", "176", "180", "181", "186", "19", "20", "22", "23", "27", "28", "30", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "70", "71", "73", "75", "8", "80", "81", "82", "83", "87", "88", "90", "91", "94", "99", "108", "135", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "167", "17", "172", "173", "21", "24", "47", "48", "49", "55", "56", "59", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 0.07739938080495357, 0.053304904051172705, 0, 0, 0.03132832080200501, 0, 0, 0, 0.03990422984836393, 0.16428068528514433, 0, 0.1340931947703654, 0.027374760470845878, 0, 0, 0.10065425264217413, 0, 0.026143790849673207, 0, 0.08090614886731393, 0, 0.02365744026496333, 0.14149274849663954, 0, 0.049983338887037654, 0, 0.15408320493066258, 0, 0.17429193899782133, 0, 0.20330368487928843, 0, 0, 0, 0, 0.01882530120481928, 0, 0, 0, 0, 0.0403469840629413, 0.020312817387771683, 0.3412969283276451, 0.2621231979030144, 0, 0, 0, 0, 0, 0.0613685179502915, 0, 0, 0.020894274968658588, 0, 0, 0.09372071227741331, 0.04349717268377556, 0, 0.08298755186721991, 0, 0, 0.03894839337877313, 0, 0.02653223666755107, 0.7874015748031495, 0.6385950908002395, 0.06662225183211193, 0, 0, 0, 0.01832172957127153, 0, 0, 0, 0, 0.1779359430604982, 0, 0, 0, 0.033085194375516956, 0.0398406374501992, 0, 0.02337540906965872, 0, 0.04660918200885575, 0.02821670428893905, 0.4627589246364037, 0, 0.056955716930086865, 0, 0.01858736059479554, 0, 0.02213368747233289, 0, 0, 0.12903225806451613, 0.04749465685110425, 0, 0, 0, 0, 0.04995004995004995, 0, 0.03094059405940594, 0, 0, 0, 0, 0.022276676319893073, 0, 0.10141987829614604, 0, 0, 0, 0, 0, 0.015276504735716468, 0, 0, 0, 0, 0.03104625892579944, 0, 0, 0, 0, 0, 0, 0, 0, 0.037397157816005985, 0, 0, 0.014448779078167894, 0.055096418732782364, 0, 0.03629764065335753, 0.043308791684711995, 0 ] }, { "marker": { "color": "rgb(1.0, 0.4980392156862745, 0.0)" }, "name": "IMMUNE_OTHER", "text": [ 0.43343653250773995, 1.5991471215351813, 1.054945054945055, 0.9986859395532195, 2.443609022556391, 2.654387865655471, 1.742961118559663, 7.380738073807381, 1.5163607342378291, 2.1825862473597746, 0.30120481927710846, 4.793831713040563, 0.6022447303586094, 1.2, 1.0522213561964147, 0.9562154001006542, 1.9366598313966734, 6.431372549019608, 2.2536287242169597, 1.132686084142395, 2.515723270440252, 0.63875088715401, 0.3537318712415989, 0.9596928982725527, 0.733088970343219, 1.8956236835946643, 0.3852080123266564, 0.6737002669378416, 4.488017429193899, 0.275282526803825, 0.8640406607369758, 0.6893670357217464, 2.085181898846495, 4.419410745233969, 1.388617250146685, 1.8072289156626504, 0, 1.05006105006105, 2.245557350565428, 4.40771349862259, 0.685898729070002, 0.7312614259597806, 0.6825938566552902, 0.1310615989515072, 0.5313496280552604, 0.019376089905057157, 2.4779915226605804, 0.7726980038634901, 1.7526777020447908, 0.981896287204664, 2.871717362554317, 1.6814159292035398, 3.238612620142081, 0.15554518587649713, 3.2108455226542985, 1.3870665417057169, 1.1309264897781643, 9.64332892998679, 5.892116182572614, 7.96600118600514, 1.7911091929218816, 0.7984420642648491, 1.0192525481313703, 0.6102414433536747, 0.7874015748031495, 4.170824186789064, 0.4663557628247834, 0.09835259404966806, 1.305909239307868, 0.3534956794972506, 1.2092341517039207, 2.5278058645096055, 1.6655562958027983, 4.987531172069826, 0.6900978976087305, 1.0676156583629894, 1.6041572525982828, 1.067943288528816, 4.057459677419355, 3.391232423490488, 6.135458167330677, 1.9740129935032484, 0.23375409069658717, 4.112829845313922, 6.688417618270799, 2.5677200902934536, 11.943587483472895, 2.7399745962620217, 0.39869001851060804, 2.3661842407535034, 7.862453531598514, 10.684474123539232, 1.1730854360336431, 3.254678600488202, 1.291899441340782, 0.25806451612903225, 2.7546900973640467, 6.5439672801636, 0.9486166007905139, 0.4830917874396135, 1.057612023378792, 1.4735264735264737, 1.8825638727028238, 1.8254950495049505, 0.832517140058766, 6.809487375669472, 3.8808664259927803, 1.4907921660333234, 1.70416573847182, 0.9868421052631579, 1.1156186612576064, 1.6203703703703702, 0.7874015748031495, 1.509433962264151, 1.6917827694057437, 0.9342883836810962, 0.4277421326000611, 0.40417649040080833, 0.9838998211091234, 2.1286831028262174, 4.23861852433281, 0.37255510710959333, 0.7887323943661971, 4.5478865703584805, 2.9471544715447155, 0.5209690023443605, 0.7982704141027773, 0.1910828025477707, 1.2275731822474032, 1.9400352733686066, 4.18848167539267, 0.5372733378106112, 1.3888888888888888, 0.5201560468140443, 10.137741046831957, 0.20418580908626852, 2.0326678765880217, 2.468601126028584, 1.2903225806451613 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "110", "112", "113", "114", "115", "120", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "139", "14", "143", "144", "147", "148", "150", "152", "154", "155", "158", "159", "161", "164", "165", "166", "168", "170", "175", "176", "180", "181", "186", "19", "20", "22", "23", "27", "28", "30", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "70", "71", "73", "75", "8", "80", "81", "82", "83", "87", "88", "90", "91", "94", "99", "108", "135", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "167", "17", "172", "173", "21", "24", "47", "48", "49", "55", "56", "59", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 0.43343653250773995, 1.5991471215351813, 1.054945054945055, 0.9986859395532195, 2.443609022556391, 2.654387865655471, 1.742961118559663, 7.380738073807381, 1.5163607342378291, 2.1825862473597746, 0.30120481927710846, 4.793831713040563, 0.6022447303586094, 1.2, 1.0522213561964147, 0.9562154001006542, 1.9366598313966734, 6.431372549019608, 2.2536287242169597, 1.132686084142395, 2.515723270440252, 0.63875088715401, 0.3537318712415989, 0.9596928982725527, 0.733088970343219, 1.8956236835946643, 0.3852080123266564, 0.6737002669378416, 4.488017429193899, 0.275282526803825, 0.8640406607369758, 0.6893670357217464, 2.085181898846495, 4.419410745233969, 1.388617250146685, 1.8072289156626504, 0, 1.05006105006105, 2.245557350565428, 4.40771349862259, 0.685898729070002, 0.7312614259597806, 0.6825938566552902, 0.1310615989515072, 0.5313496280552604, 0.019376089905057157, 2.4779915226605804, 0.7726980038634901, 1.7526777020447908, 0.981896287204664, 2.871717362554317, 1.6814159292035398, 3.238612620142081, 0.15554518587649713, 3.2108455226542985, 1.3870665417057169, 1.1309264897781643, 9.64332892998679, 5.892116182572614, 7.96600118600514, 1.7911091929218816, 0.7984420642648491, 1.0192525481313703, 0.6102414433536747, 0.7874015748031495, 4.170824186789064, 0.4663557628247834, 0.09835259404966806, 1.305909239307868, 0.3534956794972506, 1.2092341517039207, 2.5278058645096055, 1.6655562958027983, 4.987531172069826, 0.6900978976087305, 1.0676156583629894, 1.6041572525982828, 1.067943288528816, 4.057459677419355, 3.391232423490488, 6.135458167330677, 1.9740129935032484, 0.23375409069658717, 4.112829845313922, 6.688417618270799, 2.5677200902934536, 11.943587483472895, 2.7399745962620217, 0.39869001851060804, 2.3661842407535034, 7.862453531598514, 10.684474123539232, 1.1730854360336431, 3.254678600488202, 1.291899441340782, 0.25806451612903225, 2.7546900973640467, 6.5439672801636, 0.9486166007905139, 0.4830917874396135, 1.057612023378792, 1.4735264735264737, 1.8825638727028238, 1.8254950495049505, 0.832517140058766, 6.809487375669472, 3.8808664259927803, 1.4907921660333234, 1.70416573847182, 0.9868421052631579, 1.1156186612576064, 1.6203703703703702, 0.7874015748031495, 1.509433962264151, 1.6917827694057437, 0.9342883836810962, 0.4277421326000611, 0.40417649040080833, 0.9838998211091234, 2.1286831028262174, 4.23861852433281, 0.37255510710959333, 0.7887323943661971, 4.5478865703584805, 2.9471544715447155, 0.5209690023443605, 0.7982704141027773, 0.1910828025477707, 1.2275731822474032, 1.9400352733686066, 4.18848167539267, 0.5372733378106112, 1.3888888888888888, 0.5201560468140443, 10.137741046831957, 0.20418580908626852, 2.0326678765880217, 2.468601126028584, 1.2903225806451613 ] }, { "marker": { "color": "rgb(202, 178, 214)" }, "name": "CANCER", "text": [ 61.62538699690403, 77.23880597014924, 83.34065934065934, 93.66622864651774, 67.57518796992481, 31.79848320693391, 68.22447806933538, 41.4041404140414, 65.0438946528332, 87.23304388641165, 96.92454026632848, 55.17934964800536, 78.0454421023816, 95.82222222222222, 76.34450506625097, 54.10166079516859, 88.12941444520392, 68.99346405228758, 76.54698242933537, 30.663430420711972, 56.49895178197065, 84.50437662644902, 62.7874071453838, 82.0275693596231, 38.97034321892702, 36.438099695764095, 11.864406779661017, 90.78428880132198, 82.35294117647058, 77.20950449145175, 62.10927573062261, 88.17631084186338, 57.298136645962735, 17.76429809358752, 70.38920398982984, 79.96987951807229, 34.62949376375642, 85.61660561660561, 72.60096930533118, 34.067952249770435, 88.5212830340932, 75.42149096079626, 76.36518771331058, 84.40366972477065, 98.61849096705633, 87.21178066266228, 48.64688620802087, 92.33741146168705, 89.87341772151899, 35.624424670144215, 81.56055167201964, 72.18289085545723, 70.41370664437943, 70.33753305335199, 35.06956831965751, 26.316776007497655, 51.63114397564158, 62.79172170849846, 15.684647302904564, 55.44574026487447, 94.00086318515322, 93.59298928919182, 88.08607021517554, 38.657468824621915, 27.95275590551181, 59.229694671722214, 65.48967355096602, 89.08286206048685, 71.12308194580477, 89.59151610369207, 57.80505679736167, 52.809475660840675, 68.37663779702422, 69.15065277981518, 92.52126464451933, 23.843416370106763, 73.99457749661093, 85.2329221137912, 80.49395161290323, 78.85856079404466, 81.63346613545816, 81.6591704147926, 92.56661991584852, 65.44131028207461, 63.41179212304824, 72.65801354401806, 52.53415601586602, 88.78606423516602, 64.27452655560302, 82.97725706409372, 54.62825278810409, 60.82359488035615, 75.27667109340416, 72.70951993490642, 86.90642458100558, 72.3225806451613, 59.677036333412495, 79.34560327198365, 34.30830039525692, 93.5127674258109, 70.52602282215419, 85.3896103896104, 82.65351860152398, 75.74257425742574, 50.783545543584715, 55.54705432287682, 64.71119133574007, 94.9137679041216, 82.9583426152818, 87.59398496240601, 31.237322515212984, 84.4486531986532, 91.29226493747105, 94.0880503144654, 80.56582314472563, 71.87791965119901, 63.0766880537733, 43.078477601886156, 86.6726296958855, 88.43054720384846, 72.68445839874411, 85.06674945669047, 70.53521126760563, 69.55591225254146, 74.13617886178862, 90.70070330815317, 90.63695326791951, 96.11464968152866, 64.30594900849859, 84.65608465608466, 90.42632759910246, 75.55406312961719, 82.49007936507937, 68.38607137696864, 23.360881542699723, 94.64012251148544, 79.60072595281306, 85.70809874404503, 48.70967741935484 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "110", "112", "113", "114", "115", "120", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "139", "14", "143", "144", "147", "148", "150", "152", "154", "155", "158", "159", "161", "164", "165", "166", "168", "170", "175", "176", "180", "181", "186", "19", "20", "22", "23", "27", "28", "30", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "70", "71", "73", "75", "8", "80", "81", "82", "83", "87", "88", "90", "91", "94", "99", "108", "135", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "167", "17", "172", "173", "21", "24", "47", "48", "49", "55", "56", "59", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 61.62538699690403, 77.23880597014924, 83.34065934065934, 93.66622864651774, 67.57518796992481, 31.79848320693391, 68.22447806933538, 41.4041404140414, 65.0438946528332, 87.23304388641165, 96.92454026632848, 55.17934964800536, 78.0454421023816, 95.82222222222222, 76.34450506625097, 54.10166079516859, 88.12941444520392, 68.99346405228758, 76.54698242933537, 30.663430420711972, 56.49895178197065, 84.50437662644902, 62.7874071453838, 82.0275693596231, 38.97034321892702, 36.438099695764095, 11.864406779661017, 90.78428880132198, 82.35294117647058, 77.20950449145175, 62.10927573062261, 88.17631084186338, 57.298136645962735, 17.76429809358752, 70.38920398982984, 79.96987951807229, 34.62949376375642, 85.61660561660561, 72.60096930533118, 34.067952249770435, 88.5212830340932, 75.42149096079626, 76.36518771331058, 84.40366972477065, 98.61849096705633, 87.21178066266228, 48.64688620802087, 92.33741146168705, 89.87341772151899, 35.624424670144215, 81.56055167201964, 72.18289085545723, 70.41370664437943, 70.33753305335199, 35.06956831965751, 26.316776007497655, 51.63114397564158, 62.79172170849846, 15.684647302904564, 55.44574026487447, 94.00086318515322, 93.59298928919182, 88.08607021517554, 38.657468824621915, 27.95275590551181, 59.229694671722214, 65.48967355096602, 89.08286206048685, 71.12308194580477, 89.59151610369207, 57.80505679736167, 52.809475660840675, 68.37663779702422, 69.15065277981518, 92.52126464451933, 23.843416370106763, 73.99457749661093, 85.2329221137912, 80.49395161290323, 78.85856079404466, 81.63346613545816, 81.6591704147926, 92.56661991584852, 65.44131028207461, 63.41179212304824, 72.65801354401806, 52.53415601586602, 88.78606423516602, 64.27452655560302, 82.97725706409372, 54.62825278810409, 60.82359488035615, 75.27667109340416, 72.70951993490642, 86.90642458100558, 72.3225806451613, 59.677036333412495, 79.34560327198365, 34.30830039525692, 93.5127674258109, 70.52602282215419, 85.3896103896104, 82.65351860152398, 75.74257425742574, 50.783545543584715, 55.54705432287682, 64.71119133574007, 94.9137679041216, 82.9583426152818, 87.59398496240601, 31.237322515212984, 84.4486531986532, 91.29226493747105, 94.0880503144654, 80.56582314472563, 71.87791965119901, 63.0766880537733, 43.078477601886156, 86.6726296958855, 88.43054720384846, 72.68445839874411, 85.06674945669047, 70.53521126760563, 69.55591225254146, 74.13617886178862, 90.70070330815317, 90.63695326791951, 96.11464968152866, 64.30594900849859, 84.65608465608466, 90.42632759910246, 75.55406312961719, 82.49007936507937, 68.38607137696864, 23.360881542699723, 94.64012251148544, 79.60072595281306, 85.70809874404503, 48.70967741935484 ] }, { "marker": { "color": "rgb(106, 61, 154)" }, "name": "αSMA_myCAF", "text": [ 6.006191950464396, 1.5991471215351813, 3.5604395604395607, 0.47306176084099866, 0.5325814536340852, 8.992416034669557, 3.466768818234055, 9.27092709270927, 8.419792498004789, 0.49284205585543295, 0.15852885225110971, 0.10056989607777406, 6.925814399124007, 0, 1.3250194855806703, 22.496225465525917, 0.37593984962406013, 0.8627450980392156, 1.2605042016806722, 16.50485436893204, 14.884696016771489, 2.389401466761296, 12.203749557835161, 0.17448961786773687, 2.149283572142619, 18.207348467119118, 55.007704160246526, 1.271132579128003, 2.6143790849673203, 9.171254708780063, 11.130876747141041, 2.3605598495926468, 2.1960958296362025, 9.272097053726169, 15.822413455896733, 5.779367469879518, 16.654438738077772, 0.2442002442002442, 0.5008077544426494, 10.1010101010101, 0.1613879362517652, 12.512695510867358, 0.3412969283276451, 1.7038007863695939, 0, 1.9182329006006589, 23.214867949135964, 0.7726980038634901, 0.2921129503407984, 23.672905799324948, 0.7557150954090308, 2.5958702064896757, 0.25073129962390306, 0.21776326022709597, 25.615412058508742, 19.66260543580131, 17.31187472814267, 3.742844561867019, 0.16597510373443983, 1.838307966001186, 0.7768666378938283, 1.8500486854917235, 0.4983012457531144, 0.29185460334306185, 1.574803149606299, 0.15964877270005987, 0.9993337774816788, 0.3688222276862552, 7.280444009141365, 0.8248232521602514, 16.049835104433857, 9.648996099956667, 3.7530535198756385, 1.3495672583247762, 0.4814636494944632, 21.70818505338078, 2.914595571622232, 7.1625851592708525, 3.7298387096774195, 3.854425144747725, 2.8685258964143427, 3.4482758620689653, 0.6778868630201029, 10.191082802547772, 2.6800279655092054, 7.900677200902935, 3.239312472454826, 0.7439666122300853, 3.3461483696426026, 1.0797151389846085, 24.423791821561338, 0.5564830272676683, 6.219566179725542, 2.196908055329536, 4.504189944134078, 8.580645161290322, 7.1954405129422945, 0, 31.067193675889328, 0.06901311249137336, 16.587809629835792, 6.8431568431568435, 0.9861048857014791, 0.8663366336633664, 0.3428011753183154, 16.985462892119358, 0, 0.08769365682548962, 0.08910670527957229, 0, 49.59432048681541, 6.228956228956229, 0.18527095877721167, 0.8805031446540881, 3.4119988626670454, 13.79632513235752, 21.387106630003057, 5.4563826204109125, 0.5366726296958855, 1.2988574864702345, 1.4128728414442702, 7.295870847562869, 17.464788732394364, 6.046013911182451, 0.1524390243902439, 5.183641573326387, 4.656577415599535, 0.7006369426751593, 24.45703493862134, 9.347442680776014, 1.2341062079281975, 7.118871725990597, 9.1765873015873, 0.9680681982372489, 7.7134986225895315, 0.05104645227156713, 1.0163339382940109, 4.634040710264184, 29.354838709677416 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "110", "112", "113", "114", "115", "120", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "139", "14", "143", "144", "147", "148", "150", "152", "154", "155", "158", "159", "161", "164", "165", "166", "168", "170", "175", "176", "180", "181", "186", "19", "20", "22", "23", "27", "28", "30", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "70", "71", "73", "75", "8", "80", "81", "82", "83", "87", "88", "90", "91", "94", "99", "108", "135", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "167", "17", "172", "173", "21", "24", "47", "48", "49", "55", "56", "59", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 6.006191950464396, 1.5991471215351813, 3.5604395604395607, 0.47306176084099866, 0.5325814536340852, 8.992416034669557, 3.466768818234055, 9.27092709270927, 8.419792498004789, 0.49284205585543295, 0.15852885225110971, 0.10056989607777406, 6.925814399124007, 0, 1.3250194855806703, 22.496225465525917, 0.37593984962406013, 0.8627450980392156, 1.2605042016806722, 16.50485436893204, 14.884696016771489, 2.389401466761296, 12.203749557835161, 0.17448961786773687, 2.149283572142619, 18.207348467119118, 55.007704160246526, 1.271132579128003, 2.6143790849673203, 9.171254708780063, 11.130876747141041, 2.3605598495926468, 2.1960958296362025, 9.272097053726169, 15.822413455896733, 5.779367469879518, 16.654438738077772, 0.2442002442002442, 0.5008077544426494, 10.1010101010101, 0.1613879362517652, 12.512695510867358, 0.3412969283276451, 1.7038007863695939, 0, 1.9182329006006589, 23.214867949135964, 0.7726980038634901, 0.2921129503407984, 23.672905799324948, 0.7557150954090308, 2.5958702064896757, 0.25073129962390306, 0.21776326022709597, 25.615412058508742, 19.66260543580131, 17.31187472814267, 3.742844561867019, 0.16597510373443983, 1.838307966001186, 0.7768666378938283, 1.8500486854917235, 0.4983012457531144, 0.29185460334306185, 1.574803149606299, 0.15964877270005987, 0.9993337774816788, 0.3688222276862552, 7.280444009141365, 0.8248232521602514, 16.049835104433857, 9.648996099956667, 3.7530535198756385, 1.3495672583247762, 0.4814636494944632, 21.70818505338078, 2.914595571622232, 7.1625851592708525, 3.7298387096774195, 3.854425144747725, 2.8685258964143427, 3.4482758620689653, 0.6778868630201029, 10.191082802547772, 2.6800279655092054, 7.900677200902935, 3.239312472454826, 0.7439666122300853, 3.3461483696426026, 1.0797151389846085, 24.423791821561338, 0.5564830272676683, 6.219566179725542, 2.196908055329536, 4.504189944134078, 8.580645161290322, 7.1954405129422945, 0, 31.067193675889328, 0.06901311249137336, 16.587809629835792, 6.8431568431568435, 0.9861048857014791, 0.8663366336633664, 0.3428011753183154, 16.985462892119358, 0, 0.08769365682548962, 0.08910670527957229, 0, 49.59432048681541, 6.228956228956229, 0.18527095877721167, 0.8805031446540881, 3.4119988626670454, 13.79632513235752, 21.387106630003057, 5.4563826204109125, 0.5366726296958855, 1.2988574864702345, 1.4128728414442702, 7.295870847562869, 17.464788732394364, 6.046013911182451, 0.1524390243902439, 5.183641573326387, 4.656577415599535, 0.7006369426751593, 24.45703493862134, 9.347442680776014, 1.2341062079281975, 7.118871725990597, 9.1765873015873, 0.9680681982372489, 7.7134986225895315, 0.05104645227156713, 1.0163339382940109, 4.634040710264184, 29.354838709677416 ] }, { "marker": { "color": "rgb(1.0, 1.0, 0.6)" }, "name": "STROMA_OTHER", "text": [ 8.204334365325078, 3.8912579957356077, 7.604395604395604, 2.3915900131406045, 4.1040100250626566, 47.724810400866744, 18.904424439762497, 7.110711071107111, 15.283320031923383, 3.9427364468434636, 0.6024096385542169, 18.739523969158565, 4.51683547768957, 1.1111111111111112, 10.366328916601715, 13.38701560140916, 3.30371383002962, 4.4183006535947715, 9.511077158135981, 29.773462783171524, 15.40880503144654, 8.493021055121835, 7.7467279801910145, 8.131216192636538, 23.60879706764412, 39.316639363444885, 24.65331278890601, 4.004067624253209, 0.4357298474945534, 9.330628803245435, 22.13468869123253, 5.765615207854606, 12.999112688553682, 60.65857885615251, 3.2270682573831406, 10.466867469879517, 45.8547322083639, 6.349206349206349, 13.021001615508885, 14.784205693296604, 1.9164817429897114, 6.581352833638025, 9.556313993174061, 9.305373525557012, 0.10626992561105207, 6.878511916295292, 15.128790348875123, 4.443013522215067, 1.557935735150925, 16.49278919914084, 12.091441526544493, 4.808259587020649, 2.632678646050982, 26.52045419194276, 32.28683553335712, 25.43580131208997, 11.43975641583297, 1.9815059445178336, 0.16597510373443983, 4.605653291164262, 0.49633146309883475, 1.6942551119766307, 3.2842582106455263, 11.223136110374105, 3.149606299212598, 5.807224106964678, 24.117255163224517, 7.892795672485862, 11.68788769180542, 6.009426551453259, 12.678636863319898, 30.680340892676583, 20.00888296691095, 5.867683731846853, 3.1134649333975286, 16.90391459074733, 13.985539990962495, 1.067943288528816, 6.628024193548388, 3.6228287841191067, 6.414342629482071, 5.072463768115942, 4.417952314165498, 13.757961783439491, 3.0062922395711955, 8.154627539503386, 7.073600705156456, 3.411359099981855, 18.4251744268831, 3.3769813921433496, 5.037174721189591, 0.5008347245409015, 12.107127047366092, 10.398698128559806, 4.888268156424581, 8.193548387096774, 8.287817620517691, 2.8629856850715747, 21.027667984189723, 5.106970324361629, 3.9521291399944336, 2.5474525474525476, 9.816225907664725, 9.498762376237623, 44.0254652301665, 19.204284621270084, 1.7148014440433215, 0.233849751534639, 7.329026509244821, 7.471804511278196, 16.227180527383368, 6.123737373737374, 0.2779064381658175, 2.515723270440252, 11.415979528006824, 11.398318280909374, 8.218759547815461, 49.882115190299764, 2.5044722719141324, 3.2471437161755863, 12.71585557299843, 5.867742936976095, 4.563380281690141, 1.5516318887105405, 14.329268292682926, 1.8233915082052619, 0.6485947114585066, 1.9745222929936306, 6.326723323890462, 0.7936507936507936, 1.5706806282722512, 12.088650100738752, 4.761904761904762, 18.971246929634447, 1.2121212121212122, 0.8167432363450741, 5.916515426497278, 0.043308791684711995, 6.451612903225806 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "110", "112", "113", "114", "115", "120", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "139", "14", "143", "144", "147", "148", "150", "152", "154", "155", "158", "159", "161", "164", "165", "166", "168", "170", "175", "176", "180", "181", "186", "19", "20", "22", "23", "27", "28", "30", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "70", "71", "73", "75", "8", "80", "81", "82", "83", "87", "88", "90", "91", "94", "99", "108", "135", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "167", "17", "172", "173", "21", "24", "47", "48", "49", "55", "56", "59", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 8.204334365325078, 3.8912579957356077, 7.604395604395604, 2.3915900131406045, 4.1040100250626566, 47.724810400866744, 18.904424439762497, 7.110711071107111, 15.283320031923383, 3.9427364468434636, 0.6024096385542169, 18.739523969158565, 4.51683547768957, 1.1111111111111112, 10.366328916601715, 13.38701560140916, 3.30371383002962, 4.4183006535947715, 9.511077158135981, 29.773462783171524, 15.40880503144654, 8.493021055121835, 7.7467279801910145, 8.131216192636538, 23.60879706764412, 39.316639363444885, 24.65331278890601, 4.004067624253209, 0.4357298474945534, 9.330628803245435, 22.13468869123253, 5.765615207854606, 12.999112688553682, 60.65857885615251, 3.2270682573831406, 10.466867469879517, 45.8547322083639, 6.349206349206349, 13.021001615508885, 14.784205693296604, 1.9164817429897114, 6.581352833638025, 9.556313993174061, 9.305373525557012, 0.10626992561105207, 6.878511916295292, 15.128790348875123, 4.443013522215067, 1.557935735150925, 16.49278919914084, 12.091441526544493, 4.808259587020649, 2.632678646050982, 26.52045419194276, 32.28683553335712, 25.43580131208997, 11.43975641583297, 1.9815059445178336, 0.16597510373443983, 4.605653291164262, 0.49633146309883475, 1.6942551119766307, 3.2842582106455263, 11.223136110374105, 3.149606299212598, 5.807224106964678, 24.117255163224517, 7.892795672485862, 11.68788769180542, 6.009426551453259, 12.678636863319898, 30.680340892676583, 20.00888296691095, 5.867683731846853, 3.1134649333975286, 16.90391459074733, 13.985539990962495, 1.067943288528816, 6.628024193548388, 3.6228287841191067, 6.414342629482071, 5.072463768115942, 4.417952314165498, 13.757961783439491, 3.0062922395711955, 8.154627539503386, 7.073600705156456, 3.411359099981855, 18.4251744268831, 3.3769813921433496, 5.037174721189591, 0.5008347245409015, 12.107127047366092, 10.398698128559806, 4.888268156424581, 8.193548387096774, 8.287817620517691, 2.8629856850715747, 21.027667984189723, 5.106970324361629, 3.9521291399944336, 2.5474525474525476, 9.816225907664725, 9.498762376237623, 44.0254652301665, 19.204284621270084, 1.7148014440433215, 0.233849751534639, 7.329026509244821, 7.471804511278196, 16.227180527383368, 6.123737373737374, 0.2779064381658175, 2.515723270440252, 11.415979528006824, 11.398318280909374, 8.218759547815461, 49.882115190299764, 2.5044722719141324, 3.2471437161755863, 12.71585557299843, 5.867742936976095, 4.563380281690141, 1.5516318887105405, 14.329268292682926, 1.8233915082052619, 0.6485947114585066, 1.9745222929936306, 6.326723323890462, 0.7936507936507936, 1.5706806282722512, 12.088650100738752, 4.761904761904762, 18.971246929634447, 1.2121212121212122, 0.8167432363450741, 5.916515426497278, 0.043308791684711995, 6.451612903225806 ] }, { "marker": { "color": "rgb(177, 89, 40)" }, "name": "ENDOTHELIAL", "text": [ 5.185758513931889, 6.982942430703624, 2.6373626373626373, 0.4204993429697766, 3.6654135338345863, 1.895991332611051, 3.6966098448573073, 1.17011701170117, 2.3543495610534717, 1.7836188688101384, 0.7609384908053266, 1.6761649346295675, 2.8469750889679712, 0.4, 1.2860483242400622, 5.8379466532460995, 2.4948735475051267, 2.1176470588235294, 4.507257448433919, 10.194174757281553, 3.2494758909853245, 1.20652945351313, 1.910152104704634, 3.2804048159134536, 5.1649450183272245, 3.3934004212497073, 4.468412942989214, 0.7245455701029617, 1.0021786492374727, 1.303969863807592, 0.3303684879288437, 1.2325047002297889, 16.65927240461402, 4.679376083188909, 2.0731468805006847, 1.1859939759036144, 1.834189288334556, 1.0256410256410255, 1.1308562197092082, 0.7346189164370982, 0.746419205164414, 2.701604712573634, 5.2047781569965865, 2.0969855832241153, 0.10626992561105207, 2.1313698895562876, 1.793283338767525, 0.38634900193174504, 1.1684518013631937, 3.4980055231666154, 1.7759304742112223, 1.710914454277286, 1.2954450480568325, 1.9132057862809144, 1.9978594363182305, 5.660731021555764, 13.571117877337974, 0.26420079260237783, 2.0746887966804977, 0.98833761612967, 1.5753129046180405, 0.9737098344693282, 0.6115515288788221, 2.255240116741841, 2.3622047244094486, 3.2727998403512273, 4.663557628247834, 0.7376444553725104, 3.493307215148547, 0.432050274941084, 8.061561011359473, 2.0078000866676295, 1.1547856984232734, 1.877658794190993, 0.9950248756218906, 26.156583629893237, 1.8978761861726163, 1.325722703001289, 1.4616935483870968, 1.4392059553349876, 0.796812749003984, 0.6746626686656672, 1.496026180458158, 3.0391264786169248, 2.307154509438359, 2.2573363431151243, 1.8730718378140152, 1.1431682090364725, 3.1895201480848643, 1.8837583275901677, 3.141263940520446, 0.5008347245409015, 2.6781761841522798, 2.9617575264442633, 1.3966480446927374, 1.3548387096774193, 3.2771313227261936, 0, 2.6877470355731226, 0.4830917874396135, 1.5585861397161147, 2.647352647352647, 1.9273868220528911, 4.672029702970297, 3.232125367286973, 0.6885998469778117, 1.5342960288808665, 1.140017538731365, 4.265983515259523, 0.7518796992481203, 0.7099391480730223, 0.8838383838383838, 4.678091709124595, 0.37735849056603776, 1.6491327836224055, 1.5882902522578637, 2.9483654139932782, 1.1451667228022904, 0.7155635062611807, 0.9861695730607337, 1.2558869701726845, 0.5898789195901893, 2.535211267605634, 7.009095773140716, 2.0325203252032518, 1.3805678562125552, 1.3470813237984367, 0.3184713375796179, 2.927289896128423, 1.8518518518518516, 0.48616305160807777, 1.6789791806581598, 2.083333333333333, 3.22207773443144, 0.8264462809917356, 0.1531393568147014, 3.7023593466424685, 1.3858813339107838, 0.967741935483871 ], "textposition": "auto", "type": "bar", "x": [ "10", "100", "101", "102", "103", "105", "106", "109", "110", "112", "113", "114", "115", "120", "122", "123", "124", "125", "126", "127", "128", "129", "131", "132", "133", "134", "139", "14", "143", "144", "147", "148", "150", "152", "154", "155", "158", "159", "161", "164", "165", "166", "168", "170", "175", "176", "180", "181", "186", "19", "20", "22", "23", "27", "28", "30", "33", "34", "35", "36", "37", "38", "39", "4", "41", "42", "43", "44", "45", "46", "50", "52", "53", "54", "57", "58", "6", "63", "64", "65", "66", "67", "68", "69", "70", "71", "73", "75", "8", "80", "81", "82", "83", "87", "88", "90", "91", "94", "99", "108", "135", "185", "25", "29", "3", "79", "107", "117", "12", "13", "130", "136", "142", "156", "16", "167", "17", "172", "173", "21", "24", "47", "48", "49", "55", "56", "59", "72", "74", "77", "78", "84", "86", "9", "92", "96", "97", "60", "62" ], "y": [ 5.185758513931889, 6.982942430703624, 2.6373626373626373, 0.4204993429697766, 3.6654135338345863, 1.895991332611051, 3.6966098448573073, 1.17011701170117, 2.3543495610534717, 1.7836188688101384, 0.7609384908053266, 1.6761649346295675, 2.8469750889679712, 0.4, 1.2860483242400622, 5.8379466532460995, 2.4948735475051267, 2.1176470588235294, 4.507257448433919, 10.194174757281553, 3.2494758909853245, 1.20652945351313, 1.910152104704634, 3.2804048159134536, 5.1649450183272245, 3.3934004212497073, 4.468412942989214, 0.7245455701029617, 1.0021786492374727, 1.303969863807592, 0.3303684879288437, 1.2325047002297889, 16.65927240461402, 4.679376083188909, 2.0731468805006847, 1.1859939759036144, 1.834189288334556, 1.0256410256410255, 1.1308562197092082, 0.7346189164370982, 0.746419205164414, 2.701604712573634, 5.2047781569965865, 2.0969855832241153, 0.10626992561105207, 2.1313698895562876, 1.793283338767525, 0.38634900193174504, 1.1684518013631937, 3.4980055231666154, 1.7759304742112223, 1.710914454277286, 1.2954450480568325, 1.9132057862809144, 1.9978594363182305, 5.660731021555764, 13.571117877337974, 0.26420079260237783, 2.0746887966804977, 0.98833761612967, 1.5753129046180405, 0.9737098344693282, 0.6115515288788221, 2.255240116741841, 2.3622047244094486, 3.2727998403512273, 4.663557628247834, 0.7376444553725104, 3.493307215148547, 0.432050274941084, 8.061561011359473, 2.0078000866676295, 1.1547856984232734, 1.877658794190993, 0.9950248756218906, 26.156583629893237, 1.8978761861726163, 1.325722703001289, 1.4616935483870968, 1.4392059553349876, 0.796812749003984, 0.6746626686656672, 1.496026180458158, 3.0391264786169248, 2.307154509438359, 2.2573363431151243, 1.8730718378140152, 1.1431682090364725, 3.1895201480848643, 1.8837583275901677, 3.141263940520446, 0.5008347245409015, 2.6781761841522798, 2.9617575264442633, 1.3966480446927374, 1.3548387096774193, 3.2771313227261936, 0, 2.6877470355731226, 0.4830917874396135, 1.5585861397161147, 2.647352647352647, 1.9273868220528911, 4.672029702970297, 3.232125367286973, 0.6885998469778117, 1.5342960288808665, 1.140017538731365, 4.265983515259523, 0.7518796992481203, 0.7099391480730223, 0.8838383838383838, 4.678091709124595, 0.37735849056603776, 1.6491327836224055, 1.5882902522578637, 2.9483654139932782, 1.1451667228022904, 0.7155635062611807, 0.9861695730607337, 1.2558869701726845, 0.5898789195901893, 2.535211267605634, 7.009095773140716, 2.0325203252032518, 1.3805678562125552, 1.3470813237984367, 0.3184713375796179, 2.927289896128423, 1.8518518518518516, 0.48616305160807777, 1.6789791806581598, 2.083333333333333, 3.22207773443144, 0.8264462809917356, 0.1531393568147014, 3.7023593466424685, 1.3858813339107838, 0.967741935483871 ] } ], "layout": { "barmode": "stack", "plot_bgcolor": "white", "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Cell subtypes proportions by Patient and tissue type - ACT group" }, "xaxis": { "autorange": true, "linecolor": "black", "range": [ -0.5, 138.5 ], "type": "category" }, "yaxis": { "autorange": true, "linecolor": "black", "range": [ 0, 105.26315789473688 ], "title": { "text": "Cell count (%)" }, "type": "linear" } } } }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "'temp-plot.html'" ] }, "execution_count": 66, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fig = go.Figure()\n", "title = 'Cell subtypes proportions by Patient and tissue type - ACT group'\n", "\n", "for cell_subtype in cell_subtypes:\n", " fig.add_trace(\n", " go.Bar(\n", " name=cell_subtype,\n", " x=counts_perc_patients['Patient'],\n", " y=counts_perc_patients[f'{cell_subtype.lower()}_perc'],\n", " text=counts_perc_patients[f'{cell_subtype.lower()}_perc'],\n", " textposition='auto',\n", " marker_color='rgb' + str(cell_subtype_color_dict[cell_subtype])))\n", "\n", "fig.update_layout(\n", " plot_bgcolor='white',\n", " barmode='stack',\n", " title=title,\n", " xaxis=dict(linecolor='black'),\n", " yaxis=dict(title='Cell count (%)', linecolor='black'))\n", "\n", "output_filename = title.replace(\" \", \"_\") + \".png\"\n", "#fig.write_image(output_images_dir + \"/\" + output_filename, scale=1000)\n", "\n", "fig.show()\n", "plot(fig)" ] }, { "cell_type": "code", "execution_count": null, "id": "7599e22c-8a7b-4c97-915d-203fd83a899a", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "58d1fe75-c053-4b11-97f9-1e707e79b7c0", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 67, "id": "736dd86d-e585-487f-8a67-9c61de47ca32", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Statistique de test de Mann-Whitney : 2845.0\n", "P-value associée : 0.44739619874878456\n", "Il n'y a pas de différence statistiquement significative entre les groupes.\n" ] } ], "source": [ "from scipy.stats import mannwhitneyu\n", "\n", "\n", "# Choisissez la colonne sur laquelle vous voulez effectuer la comparaison\n", "column_to_compare = 'm2'\n", "\n", "# Effectuez le test de Mann-Whitney\n", "statistic, p_value = mannwhitneyu(counts_perc_patients_NACT[column_to_compare], counts_perc_patients_ACT[column_to_compare])\n", "\n", "# Affichez les résultats\n", "print(\"Statistique de test de Mann-Whitney :\", statistic)\n", "print(\"P-value associée :\", p_value)\n", "\n", "# Interprétez les résultats\n", "alpha = 0.05\n", "if p_value < alpha:\n", " print(\"La différence entre les groupes est statistiquement significative.\")\n", "else:\n", " print(\"Il n'y a pas de différence statistiquement significative entre les groupes.\")" ] }, { "cell_type": "code", "execution_count": 68, "id": "fed49f2c-d2ea-450a-a7a1-c47acc8f5ebf", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "box": { "visible": true }, "meanline": { "visible": true }, "name": "NACT", "type": "violin", "y": [ 0, 3, 0, 0, 0, 1, 38, 1, 2, 3, 1, 14, 7, 0, 0, 0, 0, 3, 1, 11, 8, 0, 15, 6, 0, 16, 8, 44, 70, 2, 0, 0, 1, 0, 0, 0, 0, 19 ] }, { "box": { "visible": true }, "meanline": { "visible": true }, "name": "ACT", "type": "violin", "y": [ 100, 3, 1, 1, 0, 3, 0, 16, 3, 0, 2, 0, 3, 1, 1, 0, 3, 3, 1, 0, 0, 0, 1, 2, 3, 0, 4, 1, 2, 0, 0, 2, 1, 0, 0, 1, 0, 0, 5, 0, 2, 0, 4, 5, 0, 0, 67, 0, 5, 0, 0, 1, 3, 2, 0, 0, 1, 2, 13, 0, 0, 4, 0, 4, 0, 12, 0, 0, 3, 0, 0, 1, 0, 2, 0, 0, 5, 1, 0, 31, 0, 5, 0, 2, 32, 16, 17, 4, 0, 8, 52, 8, 1, 31, 3, 13, 22, 0, 5, 0, 0, 2, 2, 3, 0, 0, 0, 1, 0, 1, 3, 0, 0, 0, 3, 1, 0, 0, 1, 0, 0, 0, 0, 0, 7, 0, 6, 1, 4, 0, 1, 1, 0, 1, 25, 1, 0, 16, 15 ] } ], "layout": { "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Comparaison de la distribution de 'm2' entre les groupes NACT et ACT" }, "xaxis": { "autorange": true, "range": [ -0.5, 1.5 ], "title": { "text": "Groupe" }, "type": "category" }, "yaxis": { "autorange": true, "range": [ -12.07180287434527, 108.00377909864974 ], "title": { "text": "Valeurs de 'm2'" }, "type": "linear" } } } }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "'temp-plot.html'" ] }, "execution_count": 68, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import plotly.graph_objs as go\n", "\n", "# Données à comparer\n", "data1 = counts_perc_patients_NACT[column_to_compare]\n", "data2 = counts_perc_patients_ACT[column_to_compare]\n", "\n", "# Créer un graphique boxplot\n", "fig = go.Figure()\n", "\n", "# Ajouter les données de chaque groupe au graphique\n", "fig.add_trace(go.Violin(y=data1, name='NACT', box_visible=True, meanline_visible=True))\n", "fig.add_trace(go.Violin(y=data2, name='ACT', box_visible=True, meanline_visible=True))\n", "\n", "# Mettre en forme le titre et les axes\n", "fig.update_layout(\n", " title=\"Comparaison de la distribution de '{}' entre les groupes NACT et ACT\".format(column_to_compare),\n", " xaxis_title=\"Groupe\",\n", " yaxis_title=\"Valeurs de '{}'\".format(column_to_compare)\n", ")\n", "\n", "# Afficher le graphique\n", "fig.show()\n", "\n", "plot(fig)" ] }, { "cell_type": "code", "execution_count": null, "id": "c2c60153-a937-472b-b427-fb27ebca41c7", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "4c2baa6b-beff-4c73-a09e-c44b1fc7a75d", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "raw", "id": "ad91909f-ece5-4aef-aac2-3b21a056b531", "metadata": {}, "source": [ "Regarder les proportion d'immune checkpoint par patientes" ] }, { "cell_type": "code", "execution_count": 69, "id": "4499f228-c73e-47f3-a086-30ed17518e42", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Patient immune_checkpoint\n", "104 None 2461\n", " PDL1 20\n", " PD1 10\n", "11 None 6138\n", " PDL1 50\n", " ... \n", "95 B7H4_PDL1 1\n", "98 None 2901\n", " B7H4 487\n", " PDL1 321\n", " PD1 1\n", "Name: immune_checkpoint, Length: 155, dtype: int64\n", "Patient immune_checkpoint\n", "10 None 6427\n", " B7H4 23\n", " PD1 5\n", " PDL1 4\n", " B7H4_PD1 1\n", " ... \n", "97 B7H4 2\n", "99 None 1064\n", " B7H4 182\n", " PD1 13\n", " PDL1 6\n", "Name: immune_checkpoint, Length: 583, dtype: int64\n" ] } ], "source": [ "# Compter le nombre d'occurrences des checkpoints immunitaires par patiente\n", "occurrences_checkpoint_NACT = df_NACT.groupby('Patient')['immune_checkpoint'].value_counts()\n", "occurrences_checkpoint_ACT = df_ACT.groupby('Patient')['immune_checkpoint'].value_counts()\n", "\n", "# Afficher le résultat\n", "print(occurrences_checkpoint_NACT)\n", "print(occurrences_checkpoint_ACT)" ] }, { "cell_type": "code", "execution_count": 70, "id": "e0956b08-eb10-4f0b-94b7-1993184a6051", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Statistique de test de chi-deux : 609887.0\n", "P-valeur associée : 0.0\n", "Il y a une différence statistiquement significative entre les distributions des checkpoints immunitaires dans les deux groupes.\n" ] } ], "source": [ "from scipy.stats import chi2_contingency\n", "\n", "# Créer un tableau de contingence à partir des occurrences de checkpoints immunitaires dans chaque tableau\n", "contingency_table = pd.concat([occurrences_checkpoint_NACT, occurrences_checkpoint_ACT], axis=1, keys=['NACT', 'ACT'], sort=False).fillna(0)\n", "\n", "# Effectuer le test de chi-deux\n", "chi2_stat, p_val, _, _ = chi2_contingency(contingency_table)\n", "\n", "# Afficher les résultats\n", "print(\"Statistique de test de chi-deux :\", chi2_stat)\n", "print(\"P-valeur associée :\", p_val)\n", "\n", "# Interpréter les résultats\n", "alpha = 0.05\n", "if p_val < alpha:\n", " print(\"Il y a une différence statistiquement significative entre les distributions des checkpoints immunitaires dans les deux groupes.\")\n", "else:\n", " print(\"Il n'y a pas de différence statistiquement significative entre les distributions des checkpoints immunitaires dans les deux groupes.\")\n" ] }, { "cell_type": "code", "execution_count": 71, "id": "337ec728-0e6a-40ae-b9b8-2decc402a95c", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
NACTACT
Patientimmune_checkpoint
104None64.7631580.000000
PDL10.5263160.000000
PD10.2631580.000000
11None161.5263160.000000
PDL11.3157890.000000
............
97B7H40.0000000.014388
99None0.0000007.654676
B7H40.0000001.309353
PD10.0000000.093525
PDL10.0000000.043165
\n", "

738 rows × 2 columns

\n", "
" ], "text/plain": [ " NACT ACT\n", "Patient immune_checkpoint \n", "104 None 64.763158 0.000000\n", " PDL1 0.526316 0.000000\n", " PD1 0.263158 0.000000\n", "11 None 161.526316 0.000000\n", " PDL1 1.315789 0.000000\n", "... ... ...\n", "97 B7H4 0.000000 0.014388\n", "99 None 0.000000 7.654676\n", " B7H4 0.000000 1.309353\n", " PD1 0.000000 0.093525\n", " PDL1 0.000000 0.043165\n", "\n", "[738 rows x 2 columns]" ] }, "execution_count": 71, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import plotly.graph_objs as go\n", "\n", "# Concaténer les occurrences des checkpoints immunitaires dans les deux tableaux\n", "all_occurrences = pd.concat([occurrences_checkpoint_NACT, occurrences_checkpoint_ACT], axis=1, keys=['NACT', 'ACT'], sort=False).fillna(0)\n", "\n", "# Calculer le nombre total de patientes dans chaque groupe\n", "total_patients_NACT = len(df_NACT['Patient'].unique())\n", "total_patients_ACT = len(df_ACT['Patient'].unique())\n", "\n", "# Diviser le nombre d'occurrences de chaque checkpoint immunitaire par le nombre total de patientes dans le groupe correspondant\n", "all_occurrences_normalized = all_occurrences.copy()\n", "all_occurrences_normalized['NACT'] /= total_patients_NACT\n", "all_occurrences_normalized['ACT'] /= total_patients_ACT\n", "\n", "all_occurrences_normalized" ] }, { "cell_type": "code", "execution_count": 72, "id": "6ec09056-4b7f-4aa5-8a2c-529f99b921a3", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "array(['62', '63', '59', '60', '33', '35', '36', '37', '38', '30', '25',\n", " '27', '29', '20', '21', '22', '23', '24', '14', '16', '17', '19',\n", " '12', '8', '9', '10', '4', '52', '53', '54', '55', '56', '57',\n", " '50', '42', '43', '44', '45', '47', '39', '41', '49', '46', '48',\n", " '58', '28', '13', '6', '34', '3', '122', '125', '124', '94', '101',\n", " '86', '84', '83', '91', '88', '87', '75', '74', '82', '81', '80',\n", " '79', '67', '66', '65', '64', '73', '71', '69', '68', '123', '115',\n", " '114', '113', '120', '117', '126', '105', '103', '102', '110',\n", " '109', '106', '166', '112', '108', '107', '97', '96', '100', '78',\n", " '77', '70', '72', '99', '92', '90', '136', '135', '134', '133',\n", " '132', '131', '130', '129', '144', '143', '155', '154', '150',\n", " '148', '147', '164', '161', '159', '128', '127', '142', '139',\n", " '152', '158', '156', '172', '170', '168', '167', '165', '181',\n", " '180', '176', '173', '175', '185', '186'], dtype=object)" ] }, "execution_count": 72, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_ACT['Patient'].unique()" ] }, { "cell_type": "code", "execution_count": 73, "id": "ec75dc89-a6fa-46ad-9bdc-ba218985da88", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "name": "NACT", "type": "bar", "x": [ "None", "PDL1", "PD1", "None", "PDL1", "B7H4", "B7H4_PD1", "PD1", "None", "B7H4", "PD1", "B7H4_PD1", "PDL1", "None", "B7H4", "PDL1", "None", "B7H4", "PDL1", "B7H4_PDL1", "None", "B7H4", "PD1", "B7H4_PD1", "B7H4_PDL1", "PDL1", "None", "B7H4", "PDL1", "PD1", "None", "PD1", "PDL1", "None", "PDL1", "PD1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "PD1", "PDL1", "None", "B7H4", "PDL1", "B7H4_PDL1", "None", "PDL1", "B7H4", "PD1", "B7H4_PD1", "None", "PDL1", "B7H4", "B7H4_PD1", "None", "PDL1", "B7H4", "None", "B7H4", "PDL1", "None", "B7H4", "PDL1", "PD1", "B7H4_PD1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "None", "PDL1", "B7H4", "None", "B7H4", "None", "B7H4", "PDL1", "PD1", "B7H4_PDL1", "None", "PDL1", "B7H4", "None", "B7H4", "PDL1", "B7H4", "None", "B7H4_PDL1", "B7H4_PD1", "PD1", "PDL1", "None", "B7H4", "PDL1", "PD1", "None", "PDL1", "B7H4", "PD1", "None", "B7H4", "PDL1", "PD1", "B7H4_PDL1", "None", "B7H4", "PD1", "None", "PDL1", "PD1", "B7H4", "None", "B7H4", "B7H4_PD1", "None", "PDL1", "B7H4", "PD1", "None", "B7H4", "PDL1", "None", "B7H4", "PD1", "B7H4_PD1", "PD1_PDL1", "PDL1", "B7H4_PDL1", "None", "PD1", "B7H4", "PD1_PDL1", "PDL1", "B7H4_PD1", "None", "PD1", "B7H4", "PD1_PDL1", "PDL1", "B7H4_PD1", "B7H4_PDL1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "None", "B7H4", "PD1", "None", "B7H4", "PDL1", "None", "B7H4", "PDL1", "PD1", "B7H4_PD1", "None", "PDL1", "B7H4", "B7H4_PDL1", "None", "PDL1", "B7H4", "PD1", "None", "PDL1", "B7H4", "PD1", "None", "PDL1", "B7H4", "None", "B7H4", "PDL1", "None", "PDL1", "PD1", "None", "PDL1", "B7H4", "PD1", "None", "B7H4", "PDL1", "B7H4_PDL1", "PD1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "PDL1", "B7H4_PDL1", "PD1", "None", "B7H4", "PD1", "B7H4_PDL1", "PDL1", "None", "PDL1", "B7H4", "PD1", "PD1_PDL1", "None", "B7H4", "PDL1", "B7H4_PD1", "B7H4_PDL1", "PD1", "None", "PDL1", "B7H4", "None", "B7H4", "PDL1", "None", "B7H4", "PD1", "PDL1", "None", "B7H4", "PDL1", "PD1", "B7H4_PDL1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "None", "B7H4", "PDL1", "PD1", "B7H4_PDL1", "B7H4_PD1", "B7H4_PD1_PDL1", "PD1_PDL1", "None", "B7H4", "PDL1", "PD1", "None", "PD1", "None", "B7H4", "PDL1", "B7H4_PDL1", "PD1", "B7H4_PD1", "None", "PDL1", "B7H4", "PD1", "None", "PDL1", "PD1", "PD1_PDL1", "None", "PDL1", "B7H4", "B7H4_PD1", "None", "PDL1", "PD1", "B7H4", "B7H4_PD1", "None", "PDL1", "B7H4", "PD1", "None", "B7H4", "PDL1", "None", "B7H4", "PDL1", "PD1", "B7H4_PD1", "None", "PDL1", "B7H4", "None", "B7H4", "None", "PDL1", "B7H4", "PD1", "None", "B7H4", "PDL1", "None", "PDL1", "B7H4", "B7H4_PD1", "B7H4_PDL1", "PD1", "None", "PDL1", "B7H4", "PD1", "None", "B7H4", "B7H4_PDL1", "PDL1", "None", "B7H4", "PDL1", "B7H4_PDL1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "PDL1", "PD1", "None", "PDL1", "B7H4", "PD1", "None", "PDL1", "B7H4", "B7H4_PD1", "None", "B7H4", "PDL1", "None", "B7H4", "PDL1", "None", "B7H4", "PDL1", "PD1", "B7H4_PD1", "None", "PDL1", "PD1", "B7H4", "B7H4_PD1", "None", "PDL1", "B7H4", "PD1", "B7H4_PDL1", "None", "PDL1", "None", "B7H4", "PDL1", "B7H4_PDL1", "None", "B7H4", "PDL1", "PD1", "B7H4_PDL1", "B7H4_PD1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "B7H4_PDL1", "None", "PDL1", "B7H4", "None", "PDL1", "B7H4", "None", "PD1", "PDL1", "B7H4", "None", "PDL1", "None", "PDL1", "B7H4", "B7H4_PD1", "None", "PDL1", "PD1", "None", "PDL1", "B7H4", "None", "PDL1", "B7H4", "PD1", "B7H4", "None", "B7H4_PD1", "PD1", "B7H4_PDL1", "None", "PD1", "PDL1", "B7H4", "B7H4", "None", "PDL1", "B7H4_PDL1", "B7H4_PD1", "None", "PDL1", "PD1", "B7H4", "None", "PDL1", "PD1_PDL1", "PD1", "B7H4", "None", "B7H4", "PD1", "PDL1", "None", "B7H4", "PDL1", "B7H4_PDL1", "None", "B7H4", "PDL1", "PD1", "B7H4_PDL1", "None", "B7H4", "PDL1", "B7H4_PD1", "None", "B7H4", "PDL1", "None", "B7H4", "PDL1", "PD1", "None", "PDL1", "B7H4", "None", "B7H4", "PDL1", "PD1", "None", "PD1", "B7H4", "None", "B7H4", "PD1", "B7H4", "None", "B7H4_PDL1", "PDL1", "None", "B7H4", "PD1", "PDL1", "None", "B7H4", "PDL1", "PD1", "None", "PDL1", "B7H4", "PD1", "B7H4_PDL1", "None", "PDL1", "B7H4", "PD1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "None", "None", "B7H4", "PDL1", "B7H4_PDL1", "B7H4_PD1", "None", "PDL1", "B7H4", "None", "B7H4", "B7H4_PD1", "PD1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "None", "B7H4", "None", "B7H4", "None", "B7H4", "B7H4_PD1", "PD1", "None", "B7H4", "PD1", "None", "PDL1", "B7H4", "PD1", "B7H4_PD1", "None", "PDL1", "PD1", "B7H4", "B7H4_PD1", "None", "B7H4", "PDL1", "None", "PDL1", "B7H4", "B7H4_PD1", "PD1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "None", "B7H4", "B7H4_PD1", "PD1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "PD1", "PDL1", "None", "B7H4", "B7H4_PD1", "PDL1", "None", "B7H4", "PDL1", "None", "PDL1", "B7H4", "B7H4_PD1", "None", "B7H4", "PD1", "PDL1", "None", "B7H4", "PDL1", "PD1", "None", "PD1", "B7H4", "PDL1", "B7H4_PD1", "None", "PD1", "PD1_PDL1", "PDL1", "B7H4", "B7H4_PD1", "None", "PD1", "B7H4", "B7H4_PD1", "PD1_PDL1", "PDL1", "PD1", "None", "B7H4", "PD1_PDL1", "PDL1", "B7H4_PD1", "None", "PD1", "B7H4", "B7H4_PD1", "None", "PD1", "B7H4", "B7H4_PD1", "PDL1", "None", "PD1", "B7H4", "PDL1", "B7H4_PD1", "PD1_PDL1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "PD1_PDL1", "B7H4", "None", "PD1", "B7H4_PDL1", "PDL1", "None", "PD1", "B7H4", "PD1_PDL1", "PDL1", "B7H4_PD1", "None", "B7H4", "PD1", "PDL1", "B7H4_PDL1", "None", "PD1", "PDL1", "B7H4", "PD1_PDL1", "None", "PDL1", "PD1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "PDL1", "PD1", "B7H4_PD1", "B7H4_PDL1", "PD1_PDL1", "None", "PD1", "PDL1", "B7H4", "PD1_PDL1", "B7H4_PD1", "None", "PD1", "PDL1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "B7H4_PDL1", "None", "PDL1", "PD1", "B7H4", "None", "B7H4", "B7H4_PD1", "None", "B7H4", "B7H4_PD1", "PD1", "PDL1", "B7H4_PDL1", "PD1", "None", "B7H4_PD1", "B7H4", "PDL1", "PD1_PDL1", "None", "PDL1", "B7H4", "PD1", "PD1_PDL1", "None", "PD1", "PDL1", "None", "B7H4", "PD1", "PDL1", "None", "PD1", "PDL1", "PD1_PDL1", "B7H4", "B7H4_PD1", "None", "PDL1", "B7H4", "B7H4_PD1", "PD1", "None", "B7H4", "B7H4_PD1", "None", "PDL1", "B7H4", "None", "B7H4", "PD1", "PDL1" ], "y": [ 64.76315789473684, 0.5263157894736842, 0.2631578947368421, 161.52631578947367, 1.3157894736842106, 0.05263157894736842, 0.05263157894736842, 0.05263157894736842, 25.42105263157895, 0.9473684210526315, 0.5789473684210527, 0.02631578947368421, 0.02631578947368421, 4.473684210526316, 0.631578947368421, 0.10526315789473684, 60.94736842105263, 57.8421052631579, 0.47368421052631576, 0.02631578947368421, 81.60526315789474, 68.55263157894737, 1.6578947368421053, 0.2894736842105263, 0.13157894736842105, 0.10526315789473684, 54.23684210526316, 0.6578947368421053, 0.10526315789473684, 0.02631578947368421, 41.68421052631579, 0.13157894736842105, 0.07894736842105263, 28.94736842105263, 0.4473684210526316, 0.07894736842105263, 39.526315789473685, 1.9210526315789473, 0.05263157894736842, 0.02631578947368421, 81.13157894736842, 7.684210526315789, 0.07894736842105263, 0.02631578947368421, 50.86842105263158, 26.710526315789473, 0.18421052631578946, 0.07894736842105263, 107.05263157894737, 0.9473684210526315, 0.2894736842105263, 0.13157894736842105, 0.02631578947368421, 77.78947368421052, 0.18421052631578946, 0.13157894736842105, 0.02631578947368421, 31.473684210526315, 5.2105263157894735, 0.05263157894736842, 113.39473684210526, 1.105263157894737, 0.23684210526315788, 72.1842105263158, 3.8421052631578947, 0.34210526315789475, 0.13157894736842105, 0.10526315789473684, 43.71052631578947, 0.9736842105263158, 0.07894736842105263, 0.05263157894736842, 0.02631578947368421, 46.578947368421055, 1.236842105263158, 0.05263157894736842, 0.02631578947368421, 47.21052631578947, 3.3157894736842106, 51.21052631578947, 0.18421052631578946, 0.05263157894736842, 24.342105263157894, 0.18421052631578946, 237.07894736842104, 8.342105263157896, 8.105263157894736, 0.6052631578947368, 0.05263157894736842, 20.105263157894736, 1.4210526315789473, 1.0789473684210527, 44.526315789473685, 4.2105263157894735, 0.10526315789473684, 34.39473684210526, 14.605263157894736, 0.13157894736842105, 0.10526315789473684, 0.10526315789473684, 0.07894736842105263, 90.92105263157895, 0.7105263157894737, 0.18421052631578946, 0.02631578947368421, 97, 0.5263157894736842, 0.07894736842105263, 0.02631578947368421, 224.47368421052633, 5.815789473684211, 3.3157894736842106, 1.9473684210526316, 0.07894736842105263, 110.21052631578948, 2.3947368421052633, 0.07894736842105263, 68.15789473684211, 1.0789473684210527, 0.5526315789473685, 0.05263157894736842, 1.105263157894737, 0.02631578947368421, 0.02631578947368421, 48.55263157894737, 0.47368421052631576, 0.10526315789473684, 0.05263157894736842, 40.78947368421053, 0.39473684210526316, 0.21052631578947367, 58.13157894736842, 44.5, 31.68421052631579, 3.763157894736842, 0.23684210526315788, 0.23684210526315788, 0.02631578947368421, 73.26315789473684, 17.68421052631579, 4.342105263157895, 0.18421052631578946, 0.13157894736842105, 0.02631578947368421, 59.94736842105263, 22.263157894736842, 5.842105263157895, 2.736842105263158, 0.631578947368421, 0.23684210526315788, 0.02631578947368421, 76.34210526315789, 12.81578947368421, 8.447368421052632, 0.02631578947368421, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] }, { "name": "ACT", "type": "bar", "x": [ "None", "PDL1", "PD1", "None", "PDL1", "B7H4", "B7H4_PD1", "PD1", "None", "B7H4", "PD1", "B7H4_PD1", "PDL1", "None", "B7H4", "PDL1", "None", "B7H4", "PDL1", "B7H4_PDL1", "None", "B7H4", "PD1", "B7H4_PD1", "B7H4_PDL1", "PDL1", "None", "B7H4", "PDL1", "PD1", "None", "PD1", "PDL1", "None", "PDL1", "PD1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "PD1", "PDL1", "None", "B7H4", "PDL1", "B7H4_PDL1", "None", "PDL1", "B7H4", "PD1", "B7H4_PD1", "None", "PDL1", "B7H4", "B7H4_PD1", "None", "PDL1", "B7H4", "None", "B7H4", "PDL1", "None", "B7H4", "PDL1", "PD1", "B7H4_PD1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "None", "PDL1", "B7H4", "None", "B7H4", "None", "B7H4", "PDL1", "PD1", "B7H4_PDL1", "None", "PDL1", "B7H4", "None", "B7H4", "PDL1", "B7H4", "None", "B7H4_PDL1", "B7H4_PD1", "PD1", "PDL1", "None", "B7H4", "PDL1", "PD1", "None", "PDL1", "B7H4", "PD1", "None", "B7H4", "PDL1", "PD1", "B7H4_PDL1", "None", "B7H4", "PD1", "None", "PDL1", "PD1", "B7H4", "None", "B7H4", "B7H4_PD1", "None", "PDL1", "B7H4", "PD1", "None", "B7H4", "PDL1", "None", "B7H4", "PD1", "B7H4_PD1", "PD1_PDL1", "PDL1", "B7H4_PDL1", "None", "PD1", "B7H4", "PD1_PDL1", "PDL1", "B7H4_PD1", "None", "PD1", "B7H4", "PD1_PDL1", "PDL1", "B7H4_PD1", "B7H4_PDL1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "None", "B7H4", "PD1", "None", "B7H4", "PDL1", "None", "B7H4", "PDL1", "PD1", "B7H4_PD1", "None", "PDL1", "B7H4", "B7H4_PDL1", "None", "PDL1", "B7H4", "PD1", "None", "PDL1", "B7H4", "PD1", "None", "PDL1", "B7H4", "None", "B7H4", "PDL1", "None", "PDL1", "PD1", "None", "PDL1", "B7H4", "PD1", "None", "B7H4", "PDL1", "B7H4_PDL1", "PD1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "PDL1", "B7H4_PDL1", "PD1", "None", "B7H4", "PD1", "B7H4_PDL1", "PDL1", "None", "PDL1", "B7H4", "PD1", "PD1_PDL1", "None", "B7H4", "PDL1", "B7H4_PD1", "B7H4_PDL1", "PD1", "None", "PDL1", "B7H4", "None", "B7H4", "PDL1", "None", "B7H4", "PD1", "PDL1", "None", "B7H4", "PDL1", "PD1", "B7H4_PDL1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "None", "B7H4", "PDL1", "PD1", "B7H4_PDL1", "B7H4_PD1", "B7H4_PD1_PDL1", "PD1_PDL1", "None", "B7H4", "PDL1", "PD1", "None", "PD1", "None", "B7H4", "PDL1", "B7H4_PDL1", "PD1", "B7H4_PD1", "None", "PDL1", "B7H4", "PD1", "None", "PDL1", "PD1", "PD1_PDL1", "None", "PDL1", "B7H4", "B7H4_PD1", "None", "PDL1", "PD1", "B7H4", "B7H4_PD1", "None", "PDL1", "B7H4", "PD1", "None", "B7H4", "PDL1", "None", "B7H4", "PDL1", "PD1", "B7H4_PD1", "None", "PDL1", "B7H4", "None", "B7H4", "None", "PDL1", "B7H4", "PD1", "None", "B7H4", "PDL1", "None", "PDL1", "B7H4", "B7H4_PD1", "B7H4_PDL1", "PD1", "None", "PDL1", "B7H4", "PD1", "None", "B7H4", "B7H4_PDL1", "PDL1", "None", "B7H4", "PDL1", "B7H4_PDL1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "PDL1", "PD1", "None", "PDL1", "B7H4", "PD1", "None", "PDL1", "B7H4", "B7H4_PD1", "None", "B7H4", "PDL1", "None", "B7H4", "PDL1", "None", "B7H4", "PDL1", "PD1", "B7H4_PD1", "None", "PDL1", "PD1", "B7H4", "B7H4_PD1", "None", "PDL1", "B7H4", "PD1", "B7H4_PDL1", "None", "PDL1", "None", "B7H4", "PDL1", "B7H4_PDL1", "None", "B7H4", "PDL1", "PD1", "B7H4_PDL1", "B7H4_PD1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "B7H4_PDL1", "None", "PDL1", "B7H4", "None", "PDL1", "B7H4", "None", "PD1", "PDL1", "B7H4", "None", "PDL1", "None", "PDL1", "B7H4", "B7H4_PD1", "None", "PDL1", "PD1", "None", "PDL1", "B7H4", "None", "PDL1", "B7H4", "PD1", "B7H4", "None", "B7H4_PD1", "PD1", "B7H4_PDL1", "None", "PD1", "PDL1", "B7H4", "B7H4", "None", "PDL1", "B7H4_PDL1", "B7H4_PD1", "None", "PDL1", "PD1", "B7H4", "None", "PDL1", "PD1_PDL1", "PD1", "B7H4", "None", "B7H4", "PD1", "PDL1", "None", "B7H4", "PDL1", "B7H4_PDL1", "None", "B7H4", "PDL1", "PD1", "B7H4_PDL1", "None", "B7H4", "PDL1", "B7H4_PD1", "None", "B7H4", "PDL1", "None", "B7H4", "PDL1", "PD1", "None", "PDL1", "B7H4", "None", "B7H4", "PDL1", "PD1", "None", "PD1", "B7H4", "None", "B7H4", "PD1", "B7H4", "None", "B7H4_PDL1", "PDL1", "None", "B7H4", "PD1", "PDL1", "None", "B7H4", "PDL1", "PD1", "None", "PDL1", "B7H4", "PD1", "B7H4_PDL1", "None", "PDL1", "B7H4", "PD1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "None", "None", "B7H4", "PDL1", "B7H4_PDL1", "B7H4_PD1", "None", "PDL1", "B7H4", "None", "B7H4", "B7H4_PD1", "PD1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "None", "B7H4", "None", "B7H4", "None", "B7H4", "B7H4_PD1", "PD1", "None", "B7H4", "PD1", "None", "PDL1", "B7H4", "PD1", "B7H4_PD1", "None", "PDL1", "PD1", "B7H4", "B7H4_PD1", "None", "B7H4", "PDL1", "None", "PDL1", "B7H4", "B7H4_PD1", "PD1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "None", "B7H4", "B7H4_PD1", "PD1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "PD1", "PDL1", "None", "B7H4", "B7H4_PD1", "PDL1", "None", "B7H4", "PDL1", "None", "PDL1", "B7H4", "B7H4_PD1", "None", "B7H4", "PD1", "PDL1", "None", "B7H4", "PDL1", "PD1", "None", "PD1", "B7H4", "PDL1", "B7H4_PD1", "None", "PD1", "PD1_PDL1", "PDL1", "B7H4", "B7H4_PD1", "None", "PD1", "B7H4", "B7H4_PD1", "PD1_PDL1", "PDL1", "PD1", "None", "B7H4", "PD1_PDL1", "PDL1", "B7H4_PD1", "None", "PD1", "B7H4", "B7H4_PD1", "None", "PD1", "B7H4", "B7H4_PD1", "PDL1", "None", "PD1", "B7H4", "PDL1", "B7H4_PD1", "PD1_PDL1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "PD1_PDL1", "B7H4", "None", "PD1", "B7H4_PDL1", "PDL1", "None", "PD1", "B7H4", "PD1_PDL1", "PDL1", "B7H4_PD1", "None", "B7H4", "PD1", "PDL1", "B7H4_PDL1", "None", "PD1", "PDL1", "B7H4", "PD1_PDL1", "None", "PDL1", "PD1", "None", "B7H4", "PDL1", "PD1", "None", "B7H4", "PDL1", "PD1", "B7H4_PD1", "B7H4_PDL1", "PD1_PDL1", "None", "PD1", "PDL1", "B7H4", "PD1_PDL1", "B7H4_PD1", "None", "PD1", "PDL1", "None", "B7H4", "PD1", "PDL1", "B7H4_PD1", "B7H4_PDL1", "None", "PDL1", "PD1", "B7H4", "None", "B7H4", "B7H4_PD1", "None", "B7H4", "B7H4_PD1", "PD1", "PDL1", "B7H4_PDL1", "PD1", "None", "B7H4_PD1", "B7H4", "PDL1", "PD1_PDL1", "None", "PDL1", "B7H4", "PD1", "PD1_PDL1", "None", "PD1", "PDL1", "None", "B7H4", "PD1", "PDL1", "None", "PD1", "PDL1", "PD1_PDL1", "B7H4", "B7H4_PD1", "None", "PDL1", "B7H4", "B7H4_PD1", "PD1", "None", "B7H4", "B7H4_PD1", "None", "PDL1", "B7H4", "None", "B7H4", "PD1", "PDL1" ], "y": [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 46.23741007194245, 0.16546762589928057, 0.03597122302158273, 0.02877697841726619, 0.007194244604316547, 7.748201438848921, 5.719424460431655, 0.02877697841726619, 15.611510791366907, 0.460431654676259, 0.2949640287769784, 26.136690647482013, 0.9712230215827338, 0.22302158273381295, 0.03597122302158273, 0.007194244604316547, 21.971223021582734, 0.8633093525179856, 0.1223021582733813, 0.007194244604316547, 13.237410071942445, 0.02877697841726619, 0.007194244604316547, 0.007194244604316547, 37.32374100719424, 0.19424460431654678, 0.03597122302158273, 0.007194244604316547, 7.683453237410072, 0.26618705035971224, 0.02158273381294964, 10.410071942446043, 0.007194244604316547, 0.007194244604316547, 7.913669064748201, 0.06474820143884892, 0.014388489208633094, 17.949640287769785, 0.04316546762589928, 0.02158273381294964, 0.014388489208633094, 24.971223021582734, 4.402877697841727, 1.1223021582733812, 0.14388489208633093, 0.014388489208633094, 37.35251798561151, 7.920863309352518, 0.06474820143884892, 0.04316546762589928, 16.892086330935253, 4.287769784172662, 0.19424460431654678, 0.07913669064748201, 0.007194244604316547, 19.446043165467625, 6.7913669064748206, 0.02877697841726619, 0.007194244604316547, 0.007194244604316547, 23.848920863309353, 0.39568345323741005, 0.35251798561151076, 0.007194244604316547, 0.007194244604316547, 57.330935251798564, 6.446043165467626, 0.7769784172661871, 0.014388489208633094, 0.014388489208633094, 0.007194244604316547, 16.12230215827338, 0.050359712230215826, 0.014388489208633094, 18.43884892086331, 0.014388489208633094, 0.007194244604316547, 14.172661870503598, 0.06474820143884892, 0.02877697841726619, 0.02877697841726619, 60.68345323741007, 2.0575539568345325, 0.2949640287769784, 0.09352517985611511, 0.02158273381294964, 26.906474820143885, 0.4460431654676259, 0.11510791366906475, 0.04316546762589928, 0.007194244604316547, 17.690647482014388, 0.8561151079136691, 0.2014388489208633, 0.050359712230215826, 0.014388489208633094, 0.007194244604316547, 0.007194244604316547, 0.007194244604316547, 8.172661870503598, 0.6834532374100719, 0.02158273381294964, 0.014388489208633094, 6.827338129496403, 0.03597122302158273, 20.115107913669064, 9.985611510791367, 0.20863309352517986, 0.06474820143884892, 0.02158273381294964, 0.014388489208633094, 14.388489208633093, 0.8920863309352518, 0.02158273381294964, 0.007194244604316547, 6.9784172661870505, 0.09352517985611511, 0.014388489208633094, 0.007194244604316547, 20.223021582733814, 0.07913669064748201, 0.02877697841726619, 0.007194244604316547, 41.03597122302158, 0.08633093525179857, 0.04316546762589928, 0.03597122302158273, 0.02877697841726619, 43.03597122302158, 0.09352517985611511, 0.04316546762589928, 0.007194244604316547, 30.41726618705036, 0.17985611510791366, 0.14388489208633093, 20.172661870503596, 5.561151079136691, 0.07913669064748201, 0.02877697841726619, 0.007194244604316547, 34.014388489208635, 0.1079136690647482, 0.06474820143884892, 9.33093525179856, 0.007194244604316547, 53.669064748201436, 2.827338129496403, 0.07913669064748201, 0.02158273381294964, 13.81294964028777, 1.683453237410072, 0.03597122302158273, 15.863309352517986, 0.5971223021582733, 0.02877697841726619, 0.007194244604316547, 0.007194244604316547, 0.007194244604316547, 49.46762589928058, 0.11510791366906475, 0.05755395683453238, 0.014388489208633094, 15.83453237410072, 12.266187050359711, 0.1079136690647482, 0.10071942446043165, 33.13669064748201, 1.0215827338129497, 0.2589928057553957, 0.02158273381294964, 31.60431654676259, 0.5755395683453237, 0.2014388489208633, 0.050359712230215826, 8.179856115107913, 0.07913669064748201, 0.03597122302158273, 0.007194244604316547, 35.489208633093526, 0.7482014388489209, 0.5251798561151079, 0.02158273381294964, 37.56115107913669, 0.460431654676259, 0.17985611510791366, 0.014388489208633094, 5.510791366906475, 0.18705035971223022, 0.02158273381294964, 9.43884892086331, 0.35251798561151076, 0.014388489208633094, 23.928057553956833, 5.446043165467626, 0.04316546762589928, 0.03597122302158273, 0.007194244604316547, 50.34532374100719, 0.11510791366906475, 0.07913669064748201, 0.05755395683453238, 0.007194244604316547, 41.17985611510792, 2, 1.3021582733812949, 0.03597122302158273, 0.014388489208633094, 7.827338129496403, 0.007194244604316547, 30.381294964028775, 5.014388489208633, 0.2517985611510791, 0.014388489208633094, 30.33812949640288, 4.60431654676259, 0.2733812949640288, 0.1223021582733813, 0.06474820143884892, 0.014388489208633094, 21.26618705035971, 1.776978417266187, 0.050359712230215826, 0.007194244604316547, 6.848920863309353, 1.5107913669064748, 0.050359712230215826, 0.02158273381294964, 45.618705035971225, 1.4028776978417266, 0.02877697841726619, 0.02158273381294964, 0.014388489208633094, 0.007194244604316547, 5.41726618705036, 0.06474820143884892, 0.007194244604316547, 21.33093525179856, 0.02158273381294964, 0.007194244604316547, 7.798561151079137, 0.20863309352517986, 0.02158273381294964, 0.014388489208633094, 6.741007194244604, 0.02877697841726619, 36.82014388489208, 0.2014388489208633, 0.08633093525179857, 0.02158273381294964, 17.60431654676259, 4.330935251798561, 0.12949640287769784, 11.100719424460431, 0.05755395683453238, 0.014388489208633094, 28.26618705035971, 0.5107913669064749, 0.02158273381294964, 0.007194244604316547, 5.316546762589928, 1.9568345323741008, 0.06474820143884892, 0.04316546762589928, 0.007194244604316547, 46.719424460431654, 0.06474820143884892, 0.06474820143884892, 0.04316546762589928, 27.841726618705035, 9.956834532374101, 0.17266187050359713, 0.07913669064748201, 0.02877697841726619, 59.20863309352518, 0.3597122302158273, 0.16546762589928057, 0.08633093525179857, 14.647482014388489, 9.39568345323741, 0.19424460431654678, 0.1366906474820144, 0.014388489208633094, 33.7410071942446, 0.5107913669064749, 0.14388489208633093, 0.03597122302158273, 3.273381294964029, 1.2805755395683454, 0.02158273381294964, 0.007194244604316547, 11.956834532374101, 3.971223021582734, 0.06474820143884892, 0.050359712230215826, 0.007194244604316547, 45.15827338129496, 0.8848920863309353, 0.2014388489208633, 0.007194244604316547, 19.863309352517987, 0.2949640287769784, 0.007194244604316547, 21.02158273381295, 2.093525179856115, 0.10071942446043165, 0.03597122302158273, 14.633093525179856, 0.03597122302158273, 0.02158273381294964, 36.16546762589928, 2.1654676258992804, 0.04316546762589928, 0.007194244604316547, 16.47482014388489, 0.04316546762589928, 0.02158273381294964, 16.25179856115108, 0.050359712230215826, 0.03597122302158273, 5.438848920863309, 3.064748201438849, 0.11510791366906475, 0.050359712230215826, 35.726618705035975, 0.6474820143884892, 0.014388489208633094, 0.007194244604316547, 33.03597122302158, 0.18705035971223022, 0.07194244604316546, 0.04316546762589928, 36.46762589928058, 0.38848920863309355, 0.06474820143884892, 0.014388489208633094, 0.007194244604316547, 30.769784172661872, 0.9640287769784173, 0.02158273381294964, 0.007194244604316547, 26.92086330935252, 0.11510791366906475, 0.05755395683453238, 0.014388489208633094, 0.007194244604316547, 1.8273381294964028, 25.007194244604317, 10.877697841726619, 0.1223021582733813, 0.03597122302158273, 0.007194244604316547, 10.37410071942446, 0.31654676258992803, 0.1079136690647482, 23.280575539568346, 5.942446043165468, 0.02877697841726619, 0.007194244604316547, 42.410071942446045, 1.6115107913669064, 0.02158273381294964, 0.02158273381294964, 0.007194244604316547, 13.179856115107913, 5.136690647482014, 23.165467625899282, 0.007194244604316547, 12.633093525179856, 0.11510791366906475, 0.014388489208633094, 0.007194244604316547, 11.201438848920864, 2.223021582733813, 0.02158273381294964, 36.719424460431654, 2.014388489208633, 0.4892086330935252, 0.02877697841726619, 0.014388489208633094, 49.73381294964029, 0.02877697841726619, 0.02158273381294964, 0.014388489208633094, 0.007194244604316547, 31.35251798561151, 0.9496402877697842, 0.09352517985611511, 48.97122302158273, 0.03597122302158273, 0.02158273381294964, 0.007194244604316547, 0.007194244604316547, 11.517985611510792, 2.597122302158273, 0.02158273381294964, 0.014388489208633094, 0.007194244604316547, 27.53956834532374, 0.050359712230215826, 0.02158273381294964, 0.007194244604316547, 24.964028776978417, 19.841726618705035, 0.014388489208633094, 0.007194244604316547, 3.985611510791367, 0.04316546762589928, 0.007194244604316547, 0.007194244604316547, 42.65467625899281, 0.5683453237410072, 0.02158273381294964, 0.014388489208633094, 30.798561151079138, 0.9424460431654677, 0.10071942446043165, 16.510791366906474, 0.05755395683453238, 0.02158273381294964, 0.02158273381294964, 2.1510791366906474, 0.050359712230215826, 0.02158273381294964, 0.007194244604316547, 38.589928057553955, 0.45323741007194246, 0.02158273381294964, 0.007194244604316547, 27.323741007194243, 0.5323741007194245, 0.4892086330935252, 0.19424460431654678, 0.007194244604316547, 36.1294964028777, 6.58273381294964, 0.7122302158273381, 0.03597122302158273, 0.014388489208633094, 0.014388489208633094, 13.942446043165468, 3.7338129496402876, 0.31654676258992803, 0.050359712230215826, 0.007194244604316547, 0.007194244604316547, 13.431654676258994, 11.762589928057555, 3.539568345323741, 0.03597122302158273, 0.014388489208633094, 0.007194244604316547, 23.41007194244604, 6.345323741007194, 1.0071942446043165, 0.014388489208633094, 36.7410071942446, 2.172661870503597, 0.5467625899280576, 0.03597122302158273, 0.03597122302158273, 29.25179856115108, 0.7913669064748201, 0.7410071942446043, 0.06474820143884892, 0.014388489208633094, 0.007194244604316547, 25.035971223021583, 0.2733812949640288, 0.10071942446043165, 0.07913669064748201, 0.007194244604316547, 11.028776978417266, 0.22302158273381295, 0.02877697841726619, 0.014388489208633094, 29.784172661870503, 1.0431654676258992, 0.9712230215827338, 0.7697841726618705, 0.05755395683453238, 0.02158273381294964, 3.906474820143885, 3.6546762589928057, 0.02877697841726619, 0.02158273381294964, 0.007194244604316547, 26.633093525179856, 12.453237410071942, 0.2949640287769784, 0.16546762589928057, 0.08633093525179857, 0.014388489208633094, 6.028776978417266, 2.093525179856115, 0.014388489208633094, 0.014388489208633094, 0.007194244604316547, 16.0431654676259, 3.1007194244604315, 0.07194244604316546, 0.014388489208633094, 0.007194244604316547, 9.237410071942445, 0.1510791366906475, 0.014388489208633094, 50.02158273381295, 0.381294964028777, 0.1079136690647482, 0.014388489208633094, 25.97841726618705, 4.237410071942446, 0.6115107913669064, 0.4172661870503597, 0.04316546762589928, 0.02158273381294964, 0.007194244604316547, 33, 2.8920863309352516, 1.316546762589928, 1.2589928057553956, 0.22302158273381295, 0.014388489208633094, 12.654676258992806, 0.15827338129496402, 0.11510791366906475, 27.992805755395683, 4.223021582733813, 0.19424460431654678, 0.06474820143884892, 0.014388489208633094, 0.014388489208633094, 10.618705035971223, 0.07194244604316546, 0.014388489208633094, 0.007194244604316547, 14.402877697841726, 0.07913669064748201, 0.02158273381294964, 28.66906474820144, 11.366906474820144, 2.5611510791366907, 1.5611510791366907, 0.03597122302158273, 0.014388489208633094, 12.446043165467627, 7.661870503597123, 0.2589928057553957, 0.1366906474820144, 0.08633093525179857, 0.014388489208633094, 48.884892086330936, 0.6187050359712231, 0.2589928057553957, 0.02158273381294964, 0.007194244604316547, 10.525179856115107, 0.5179856115107914, 0.1079136690647482, 17.06474820143885, 11.496402877697841, 1.7050359712230216, 0.02877697841726619, 11.928057553956835, 0.8345323741007195, 0.2014388489208633, 0.050359712230215826, 0.03597122302158273, 0.007194244604316547, 3.4532374100719423, 0.04316546762589928, 0.007194244604316547, 0.007194244604316547, 0.007194244604316547, 8.050359712230216, 6.0359712230215825, 0.007194244604316547, 19.453237410071942, 0.35251798561151076, 0.014388489208633094, 7.654676258992806, 1.3093525179856116, 0.09352517985611511, 0.04316546762589928 ] } ], "layout": { "legend": { "title": { "text": "Groupe" } }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Comparaison des proportions de checkpoints immunitaires entre les groupes NACT et ACT" }, "xaxis": { "autorange": true, "range": [ -0.5, 7.5 ], "tickangle": -45, "title": { "text": "Checkpoint Immunitaire" }, "type": "category" }, "yaxis": { "autorange": true, "range": [ 0, 3360.8178720181763 ], "title": { "text": "Proportion d'Occurrences" }, "type": "linear" } } } }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "'temp-plot.html'" ] }, "execution_count": 73, "metadata": {}, "output_type": "execute_result" } ], "source": [ "import plotly.graph_objs as go\n", "\n", "# Calculer le nombre total de patientes dans chaque groupe\n", "total_patients_NACT = len(df_NACT['Patient'].unique())\n", "total_patients_ACT = len(df_ACT['Patient'].unique())\n", "\n", "# Diviser le nombre d'occurrences de chaque checkpoint immunitaire par le nombre total de patientes dans le groupe correspondant\n", "all_occurrences_normalized = all_occurrences.copy()\n", "all_occurrences_normalized['NACT'] /= total_patients_NACT\n", "all_occurrences_normalized['ACT'] /= total_patients_ACT\n", "\n", "# Créer un objet Figure de Plotly\n", "fig = go.Figure()\n", "\n", "# Ajouter les barres pour les proportions normalisées de chaque checkpoint immunitaire dans les deux groupes\n", "for col in all_occurrences_normalized.columns:\n", " fig.add_trace(go.Bar(x=all_occurrences_normalized.index.get_level_values('immune_checkpoint'), y=all_occurrences_normalized[col], name=col))\n", "\n", "# Mettre en forme le titre et les axes\n", "fig.update_layout(\n", " title=\"Comparaison des proportions de checkpoints immunitaires entre les groupes NACT et ACT\",\n", " xaxis_title=\"Checkpoint Immunitaire\",\n", " yaxis_title=\"Proportion d'Occurrences\",\n", " xaxis_tickangle=-45,\n", " legend_title=\"Groupe\"\n", ")\n", "\n", "# Afficher le graphique\n", "fig.show()\n", "plot(fig)" ] }, { "cell_type": "code", "execution_count": null, "id": "12a2c3e6-c90f-4a78-b19e-607fbb3219ab", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "935d8f96-9104-4778-b218-07291b128729", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "a841c9f8-3cfb-4a34-a99e-e14808dbde71", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "93837651-60b5-4749-b759-7210fb35c925", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "bc0bcd77-4132-4c6b-b179-033f06d6b71b", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "ef825078-cabe-4d97-b0f4-f0e64ba1f91d", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "27c4ad36-55cc-4402-8553-aaad40f129e4", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "6a796f99-a904-4a3c-870f-d7ff95593de5", "metadata": {}, "source": [ "### V.4.3. IMMUNE CHECKPOINT" ] }, { "cell_type": "markdown", "id": "9d172bdd-3ddd-4881-9d96-be3813e61572", "metadata": {}, "source": [ "#### V.4.3.1. NACT" ] }, { "cell_type": "code", "execution_count": 74, "id": "34ba6aef-4cee-4a56-9982-867439fae8bb", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
cell_typecell_subtypeimmune_checkpointcountpercentage
0CANCERCANCERB7H41082716.317273
1CANCERCANCERB7H4_PD11400.210993
2CANCERCANCERB7H4_PDL1190.028635
3CANCERCANCERNone5277879.541242
4CANCERCANCERPD115532.340512
..................
59STROMAαSMA_myCAFB7H4130.101634
60STROMAαSMA_myCAFB7H4_PD110.007818
61STROMAαSMA_myCAFNone1274699.648190
62STROMAαSMA_myCAFPD1150.117270
63STROMAαSMA_myCAFPDL1160.125088
\n", "

64 rows × 5 columns

\n", "
" ], "text/plain": [ " cell_type cell_subtype immune_checkpoint count percentage\n", "0 CANCER CANCER B7H4 10827 16.317273\n", "1 CANCER CANCER B7H4_PD1 140 0.210993\n", "2 CANCER CANCER B7H4_PDL1 19 0.028635\n", "3 CANCER CANCER None 52778 79.541242\n", "4 CANCER CANCER PD1 1553 2.340512\n", ".. ... ... ... ... ...\n", "59 STROMA αSMA_myCAF B7H4 13 0.101634\n", "60 STROMA αSMA_myCAF B7H4_PD1 1 0.007818\n", "61 STROMA αSMA_myCAF None 12746 99.648190\n", "62 STROMA αSMA_myCAF PD1 15 0.117270\n", "63 STROMA αSMA_myCAF PDL1 16 0.125088\n", "\n", "[64 rows x 5 columns]" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Count of each immune_checkpoint type by cell_subtype\n", "counts_NACT = df_NACT.groupby(['cell_type', 'cell_subtype', 'immune_checkpoint']).size().reset_index(name='count')\n", "\n", "# % for each cell_subtype\n", "counts_NACT['percentage'] = counts_NACT.groupby('cell_subtype')['count'].apply(lambda x: (x / x.sum()) * 100)\n", "\n", "display(counts_NACT)" ] }, { "cell_type": "code", "execution_count": 75, "id": "59093d4c-11e4-4a94-a4d3-e5837bd2314c", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "hovertemplate": "cell_type=CANCER
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "CANCER", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "CANCER", "offsetgroup": "CANCER", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x", "y": [ 16.317272768375204, 0.21099272075113407, 0.02863472638765391, 79.54124154145254, 2.34051210947508, 0.022606362937621506, 1.5387397706207708 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "cell_type=ENDOTHELIAL
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "ENDOTHELIAL", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "ENDOTHELIAL", "offsetgroup": "ENDOTHELIAL", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "None", "PD1", "PDL1" ], "xaxis": "x", "y": [ 0.6641366223908919, 98.60056925996204, 0.5218216318785579, 0.21347248576850095 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "cell_type=IMMUNE
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "IMMUNE", "marker": { "color": "#00cc96", "pattern": { "shape": "" } }, "name": "IMMUNE", "offsetgroup": "IMMUNE", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "None", "PD1_PDL1", "PDL1", "B7H4", "B7H4_PD1", "None", "PD1", "PD1_PDL1", "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1", "B7H4", "B7H4_PD1", "None", "PD1", "PD1_PDL1", "PDL1", "B7H4", "B7H4_PD1", "None", "PD1", "PD1_PDL1", "PDL1", "B7H4", "B7H4_PD1", "None", "PD1", "PDL1", "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1", "B7H4", "None", "PDL1" ], "xaxis": "x", "y": [ 7.547169811320755, 84.90566037735849, 1.8867924528301887, 5.660377358490567, 2.955665024630542, 0.3694581280788177, 87.192118226601, 7.8817733990147785, 1.600985221674877, 9.932279909706546, 0.5804579168010319, 0.032247662044501774, 64.49532408900355, 21.896162528216703, 1.3221541438245727, 1.7413737504030957, 0.8964143426294822, 0.398406374501992, 90.43824701195219, 5.278884462151394, 0.199203187250996, 2.788844621513944, 2.9197080291970803, 0.36496350364963503, 70.07299270072993, 15.693430656934307, 5.839416058394161, 5.109489051094891, 1.828890266584005, 0.04649721016738996, 93.83137011779293, 3.223806571605704, 1.069435833849969, 3.3856722276741906, 0.04906771344455348, 0.04906771344455348, 86.01570166830226, 7.065750736015702, 1.5701668302257115, 1.8645731108930326, 2.7027027027027026, 91.8918918918919, 5.405405405405405 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "cell_type=STROMA
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "STROMA", "marker": { "color": "#ab63fa", "pattern": { "shape": "" } }, "name": "STROMA", "offsetgroup": "STROMA", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "None", "PD1", "PDL1", "B7H4", "B7H4_PD1", "None", "PD1", "PDL1" ], "xaxis": "x", "y": [ 0.23769907297361542, 0.047539814594723076, 97.9676729260756, 1.1587829807463752, 0.5883052056096981, 0.10163396137909467, 0.007817997029161129, 99.64819013368775, 0.11726995543741693, 0.12508795246657806 ], "yaxis": "y" } ], "layout": { "barmode": "relative", "legend": { "title": { "text": "cell_type" }, "tracegroupgap": 0 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Percentage of Each Immune Checkpoint Type by Cell Subtype in NACT" }, "xaxis": { "anchor": "y", "autorange": true, "domain": [ 0, 1 ], "range": [ -0.5, 6.5 ], "title": { "text": "Immune Checkpoint" }, "type": "category" }, "yaxis": { "anchor": "x", "autorange": true, "domain": [ 0, 1 ], "range": [ 0, 1099.579978889274 ], "title": { "text": "Percentage" }, "type": "linear" } } } }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "'temp-plot.html'" ] }, "execution_count": 75, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fig = px.bar(counts_NACT, x='immune_checkpoint', y='percentage', color='cell_type', \n", " title='Percentage of Each Immune Checkpoint Type by Cell Subtype in NACT',\n", " labels={'immune_checkpoint': 'Immune Checkpoint', 'percentage': 'Percentage', 'cell_subtype': 'Cell Subtype'})\n", "\n", "fig.show()\n", "plot(fig)" ] }, { "cell_type": "markdown", "id": "0910a1d1-84bc-4df2-a490-b3c43e747939", "metadata": {}, "source": [ "#### V.4.3.2. ACT" ] }, { "cell_type": "code", "execution_count": 76, "id": "07a58e22-600b-4f32-a3b1-ad82ba09988a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " cell_type cell_subtype immune_checkpoint count percentage\n", "0 CANCER CANCER B7H4 32646 9.083725\n", "1 CANCER CANCER B7H4_PD1 425 0.118256\n", "2 CANCER CANCER B7H4_PDL1 84 0.023373\n", "3 CANCER CANCER None 314226 87.433151\n", "4 CANCER CANCER PD1 7532 2.095773\n", ".. ... ... ... ... ...\n", "66 STROMA STROMA_OTHER PDL1 160 0.332226\n", "67 STROMA αSMA_myCAF B7H4 51 0.185266\n", "68 STROMA αSMA_myCAF None 27200 98.808486\n", "69 STROMA αSMA_myCAF PD1 256 0.929962\n", "70 STROMA αSMA_myCAF PDL1 21 0.076286\n", "\n", "[71 rows x 5 columns]\n" ] } ], "source": [ "# Count of each immune_checkpoint type by cell_subtype\n", "counts_ACT = df_ACT.groupby(['cell_type', 'cell_subtype', 'immune_checkpoint']).size().reset_index(name='count')\n", "\n", "# % for each cell_subtype\n", "counts_ACT['percentage'] = counts_ACT.groupby('cell_subtype')['count'].apply(lambda x: (x / x.sum()) * 100)\n", "\n", "print(counts_ACT)" ] }, { "cell_type": "code", "execution_count": 77, "id": "c26c0ee1-0b90-48f4-9959-9d5ae9d5467a", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "hovertemplate": "cell_type=CANCER
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "CANCER", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "CANCER", "offsetgroup": "CANCER", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x", "y": [ 9.083725201035087, 0.11825593366537744, 0.02337293747739225, 87.4331506163221, 2.0957733938061716, 0.005843234369348063, 1.2398786833245221 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "cell_type=ENDOTHELIAL
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "ENDOTHELIAL", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "ENDOTHELIAL", "offsetgroup": "ENDOTHELIAL", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "None", "PD1", "PDL1" ], "xaxis": "x", "y": [ 1.0226320201173513, 0.07544006705783739, 97.88767812238055, 0.6454316848281643, 0.36881810561609385 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "cell_type=IMMUNE
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "IMMUNE", "marker": { "color": "#00cc96", "pattern": { "shape": "" } }, "name": "IMMUNE", "offsetgroup": "IMMUNE", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "None", "PD1", "PDL1", "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PDL1", "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1", "B7H4", "B7H4_PD1", "None", "PD1", "PD1_PDL1", "PDL1", "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1", "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1", "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1", "B7H4", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x", "y": [ 4.584527220630372, 77.36389684813754, 0.28653295128939826, 17.765042979942695, 3.9944521497919556, 0.08321775312066575, 0.055478502080443824, 90.98474341192788, 3.633841886269071, 1.248266296809986, 4.385964912280701, 0.2562586240883107, 0.03942440370589395, 84.72304356396609, 8.219988172678889, 0.29568302779420463, 2.0796372954859055, 5.770964833183047, 0.9017132551848512, 78.26871055004509, 10.18935978358882, 2.6149684400360687, 2.254283137962128, 2.3255813953488373, 0.15503875968992248, 0.7751937984496124, 81.55038759689923, 11.782945736434108, 2.0155038759689923, 1.3953488372093024, 2.3240517430388072, 0.05481254110940583, 0.005481254110940584, 95.94387195790397, 1.0633632975224732, 0.005481254110940584, 0.6029379522034641, 8.640796562777057, 0.09547841505831003, 0.22505626406601648, 81.67496419559436, 5.162654299938621, 0.7501875468867216, 3.45086271567892, 3.1446540880503147, 88.67924528301887, 1.257861635220126, 0.628930817610063, 6.289308176100629 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "cell_type=STROMA
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "STROMA", "marker": { "color": "#ab63fa", "pattern": { "shape": "" } }, "name": "STROMA", "offsetgroup": "STROMA", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PD1_PDL1", "None", "PD1", "PDL1", "B7H4", "None", "PD1", "PDL1" ], "xaxis": "x", "y": [ 0.3924418604651163, 0.008305647840531562, 0.0020764119601328905, 98.69393687707641, 0.5710132890365449, 0.33222591362126247, 0.18526591107236268, 98.8084859052601, 0.929962220284801, 0.07628596338273758 ], "yaxis": "y" } ], "layout": { "barmode": "relative", "legend": { "title": { "text": "cell_type" }, "tracegroupgap": 0 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Percentage of Each Immune Checkpoint Type by Cell Subtype in ACT" }, "xaxis": { "anchor": "y", "autorange": true, "domain": [ 0, 1 ], "range": [ -0.5, 7.5 ], "title": { "text": "Immune Checkpoint" }, "type": "category" }, "yaxis": { "anchor": "x", "autorange": true, "domain": [ 0, 1 ], "range": [ 0, 1117.9074893984548 ], "title": { "text": "Percentage" }, "type": "linear" } } } }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "'temp-plot.html'" ] }, "execution_count": 77, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Créer le graphique à barres avec Plotly Express\n", "fig = px.bar(counts_ACT, x='immune_checkpoint', y='percentage', color='cell_type', \n", " title='Percentage of Each Immune Checkpoint Type by Cell Subtype in ACT',\n", " labels={'immune_checkpoint': 'Immune Checkpoint', 'percentage': 'Percentage', 'cell_subtype': 'Cell Subtype'})\n", "\n", "# Afficher le graphique\n", "fig.show()\n", "plot(fig)" ] }, { "cell_type": "code", "execution_count": null, "id": "b81afd88-6cb5-4c12-a8ab-86b2218d6a3b", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "917007be-deb6-4c55-a116-0ca354fe218a", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 78, "id": "499dabdc-7da2-4610-ae96-a1cfeda7fd76", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=CANCER
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "CANCER", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "CANCER", "offsetgroup": "CANCER", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x2", "y": [ 16.317272768375204, 0.21099272075113407, 0.02863472638765391, 79.54124154145254, 2.34051210947508, 0.022606362937621506, 1.5387397706207708 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=CANCER
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "CANCER", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "CANCER", "offsetgroup": "CANCER", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x", "y": [ 9.083725201035087, 0.11825593366537744, 0.02337293747739225, 87.4331506163221, 2.0957733938061716, 0.005843234369348063, 1.2398786833245221 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=ENDOTHELIAL
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "ENDOTHELIAL", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "ENDOTHELIAL", "offsetgroup": "ENDOTHELIAL", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "None", "PD1", "PDL1" ], "xaxis": "x2", "y": [ 0.6641366223908919, 98.60056925996204, 0.5218216318785579, 0.21347248576850095 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=ENDOTHELIAL
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "ENDOTHELIAL", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "ENDOTHELIAL", "offsetgroup": "ENDOTHELIAL", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "None", "PD1", "PDL1" ], "xaxis": "x", "y": [ 1.0226320201173513, 0.07544006705783739, 97.88767812238055, 0.6454316848281643, 0.36881810561609385 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=B
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "B", "marker": { "color": "#00cc96", "pattern": { "shape": "" } }, "name": "B", "offsetgroup": "B", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "None", "PD1_PDL1", "PDL1" ], "xaxis": "x2", "y": [ 7.547169811320755, 84.90566037735849, 1.8867924528301887, 5.660377358490567 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=B
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "B", "marker": { "color": "#00cc96", "pattern": { "shape": "" } }, "name": "B", "offsetgroup": "B", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "None", "PD1", "PDL1" ], "xaxis": "x", "y": [ 4.584527220630372, 77.36389684813754, 0.28653295128939826, 17.765042979942695 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=DC
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "DC", "marker": { "color": "#ab63fa", "pattern": { "shape": "" } }, "name": "DC", "offsetgroup": "DC", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "None", "PD1", "PD1_PDL1" ], "xaxis": "x2", "y": [ 2.955665024630542, 0.3694581280788177, 87.192118226601, 7.8817733990147785, 1.600985221674877 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=DC
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "DC", "marker": { "color": "#ab63fa", "pattern": { "shape": "" } }, "name": "DC", "offsetgroup": "DC", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PDL1" ], "xaxis": "x", "y": [ 3.9944521497919556, 0.08321775312066575, 0.055478502080443824, 90.98474341192788, 3.633841886269071, 1.248266296809986 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=IMMUNE_OTHER
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "IMMUNE_OTHER", "marker": { "color": "#FFA15A", "pattern": { "shape": "" } }, "name": "IMMUNE_OTHER", "offsetgroup": "IMMUNE_OTHER", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x2", "y": [ 9.932279909706546, 0.5804579168010319, 0.032247662044501774, 64.49532408900355, 21.896162528216703, 1.3221541438245727, 1.7413737504030957 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=IMMUNE_OTHER
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "IMMUNE_OTHER", "marker": { "color": "#FFA15A", "pattern": { "shape": "" } }, "name": "IMMUNE_OTHER", "offsetgroup": "IMMUNE_OTHER", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x", "y": [ 4.385964912280701, 0.2562586240883107, 0.03942440370589395, 84.72304356396609, 8.219988172678889, 0.29568302779420463, 2.0796372954859055 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=M1
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "M1", "marker": { "color": "#19d3f3", "pattern": { "shape": "" } }, "name": "M1", "offsetgroup": "M1", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x2", "y": [ 0.8964143426294822, 0.398406374501992, 90.43824701195219, 5.278884462151394, 0.199203187250996, 2.788844621513944 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=M1
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "M1", "marker": { "color": "#19d3f3", "pattern": { "shape": "" } }, "name": "M1", "offsetgroup": "M1", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x", "y": [ 5.770964833183047, 0.9017132551848512, 78.26871055004509, 10.18935978358882, 2.6149684400360687, 2.254283137962128 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=M2
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "M2", "marker": { "color": "#FF6692", "pattern": { "shape": "" } }, "name": "M2", "offsetgroup": "M2", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x2", "y": [ 2.9197080291970803, 0.36496350364963503, 70.07299270072993, 15.693430656934307, 5.839416058394161, 5.109489051094891 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=M2
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "M2", "marker": { "color": "#FF6692", "pattern": { "shape": "" } }, "name": "M2", "offsetgroup": "M2", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x", "y": [ 2.3255813953488373, 0.15503875968992248, 0.7751937984496124, 81.55038759689923, 11.782945736434108, 2.0155038759689923, 1.3953488372093024 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=TCD4
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "TCD4", "marker": { "color": "#B6E880", "pattern": { "shape": "" } }, "name": "TCD4", "offsetgroup": "TCD4", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "None", "PD1", "PDL1" ], "xaxis": "x2", "y": [ 1.828890266584005, 0.04649721016738996, 93.83137011779293, 3.223806571605704, 1.069435833849969 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=TCD4
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "TCD4", "marker": { "color": "#B6E880", "pattern": { "shape": "" } }, "name": "TCD4", "offsetgroup": "TCD4", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x", "y": [ 2.3240517430388072, 0.05481254110940583, 0.005481254110940584, 95.94387195790397, 1.0633632975224732, 0.005481254110940584, 0.6029379522034641 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=TCD8
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "TCD8", "marker": { "color": "#FF97FF", "pattern": { "shape": "" } }, "name": "TCD8", "offsetgroup": "TCD8", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x2", "y": [ 3.3856722276741906, 0.04906771344455348, 0.04906771344455348, 86.01570166830226, 7.065750736015702, 1.5701668302257115, 1.8645731108930326 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=TCD8
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "TCD8", "marker": { "color": "#FF97FF", "pattern": { "shape": "" } }, "name": "TCD8", "offsetgroup": "TCD8", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x", "y": [ 8.640796562777057, 0.09547841505831003, 0.22505626406601648, 81.67496419559436, 5.162654299938621, 0.7501875468867216, 3.45086271567892 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=Treg
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "Treg", "marker": { "color": "#FECB52", "pattern": { "shape": "" } }, "name": "Treg", "offsetgroup": "Treg", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "None", "PDL1" ], "xaxis": "x2", "y": [ 2.7027027027027026, 91.8918918918919, 5.405405405405405 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=Treg
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "Treg", "marker": { "color": "#FECB52", "pattern": { "shape": "" } }, "name": "Treg", "offsetgroup": "Treg", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x", "y": [ 3.1446540880503147, 88.67924528301887, 1.257861635220126, 0.628930817610063, 6.289308176100629 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=STROMA_OTHER
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "STROMA_OTHER", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "STROMA_OTHER", "offsetgroup": "STROMA_OTHER", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "None", "PD1", "PDL1" ], "xaxis": "x2", "y": [ 0.23769907297361542, 0.047539814594723076, 97.9676729260756, 1.1587829807463752, 0.5883052056096981 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=STROMA_OTHER
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "STROMA_OTHER", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "STROMA_OTHER", "offsetgroup": "STROMA_OTHER", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PD1_PDL1", "None", "PD1", "PDL1" ], "xaxis": "x", "y": [ 0.3924418604651163, 0.008305647840531562, 0.0020764119601328905, 98.69393687707641, 0.5710132890365449, 0.33222591362126247 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=αSMA_myCAF
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "αSMA_myCAF", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "αSMA_myCAF", "offsetgroup": "αSMA_myCAF", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "None", "PD1", "PDL1" ], "xaxis": "x2", "y": [ 0.10163396137909467, 0.007817997029161129, 99.64819013368775, 0.11726995543741693, 0.12508795246657806 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=αSMA_myCAF
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "αSMA_myCAF", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "αSMA_myCAF", "offsetgroup": "αSMA_myCAF", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "None", "PD1", "PDL1" ], "xaxis": "x", "y": [ 0.18526591107236268, 98.8084859052601, 0.929962220284801, 0.07628596338273758 ], "yaxis": "y" } ], "layout": { "annotations": [ { "font": {}, "showarrow": false, "text": "Dataset=ACT", "x": 0.5, "xanchor": "center", "xref": "paper", "y": 0.46499999999999997, "yanchor": "bottom", "yref": "paper" }, { "font": {}, "showarrow": false, "text": "Dataset=NACT", "x": 0.5, "xanchor": "center", "xref": "paper", "y": 0.9999999999999999, "yanchor": "bottom", "yref": "paper" } ], "barmode": "relative", "legend": { "title": { "text": "Cell Subtype" }, "tracegroupgap": 0 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Percentage of Each Immune Checkpoint Type by Cell Subtype" }, "xaxis": { "anchor": "y", "autorange": true, "domain": [ 0, 1 ], "range": [ -0.5, 7.5 ], "title": { "text": "Immune Checkpoint" }, "type": "category" }, "xaxis2": { "anchor": "y2", "autorange": true, "domain": [ 0, 1 ], "matches": "x", "range": [ -0.5, 7.5 ], "showticklabels": false, "type": "category" }, "yaxis": { "anchor": "x", "autorange": true, "domain": [ 0, 0.46499999999999997 ], "range": [ 0, 1117.9074893984548 ], "title": { "text": "Percentage" }, "type": "linear" }, "yaxis2": { "anchor": "x2", "autorange": true, "domain": [ 0.5349999999999999, 0.9999999999999999 ], "matches": "y", "range": [ 0, 1117.9074893984548 ], "title": { "text": "Percentage" }, "type": "linear" } } } }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "'temp-plot.html'" ] }, "execution_count": 78, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Concaténer les deux DataFrames\n", "combined_counts = pd.concat([counts_NACT, counts_ACT])\n", "\n", "# Ajouter une colonne pour distinguer les deux ensembles de données\n", "combined_counts['dataset'] = ['NACT'] * len(counts_NACT) + ['ACT'] * len(counts_ACT)\n", "\n", "# Créer le graphique à barres avec Plotly Express\n", "fig = px.bar(combined_counts, x='immune_checkpoint', y='percentage', color='cell_subtype', \n", " facet_col='dataset', facet_col_wrap=1,\n", " title='Percentage of Each Immune Checkpoint Type by Cell Subtype',\n", " labels={'immune_checkpoint': 'Immune Checkpoint', 'percentage': 'Percentage', 'cell_subtype': 'Cell Subtype', 'dataset': 'Dataset'})\n", "\n", "# Afficher le graphique\n", "fig.show()\n", "plot(fig)" ] }, { "cell_type": "code", "execution_count": 79, "id": "33a95712-5262-41af-85f8-12305682ad5f", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=CANCER
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "CANCER", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "CANCER", "offsetgroup": "CANCER", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x2", "y": [ 16.317272768375204, 0.21099272075113407, 0.02863472638765391, 79.54124154145254, 2.34051210947508, 0.022606362937621506, 1.5387397706207708 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=CANCER
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "CANCER", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "CANCER", "offsetgroup": "CANCER", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x", "y": [ 9.083725201035087, 0.11825593366537744, 0.02337293747739225, 87.4331506163221, 2.0957733938061716, 0.005843234369348063, 1.2398786833245221 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=ENDOTHELIAL
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "ENDOTHELIAL", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "ENDOTHELIAL", "offsetgroup": "ENDOTHELIAL", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "None", "PD1", "PDL1" ], "xaxis": "x2", "y": [ 0.6641366223908919, 98.60056925996204, 0.5218216318785579, 0.21347248576850095 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=ENDOTHELIAL
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "ENDOTHELIAL", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "ENDOTHELIAL", "offsetgroup": "ENDOTHELIAL", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "None", "PD1", "PDL1" ], "xaxis": "x", "y": [ 1.0226320201173513, 0.07544006705783739, 97.88767812238055, 0.6454316848281643, 0.36881810561609385 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=B
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "B", "marker": { "color": "#00cc96", "pattern": { "shape": "" } }, "name": "B", "offsetgroup": "B", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "None", "PD1_PDL1", "PDL1" ], "xaxis": "x2", "y": [ 7.547169811320755, 84.90566037735849, 1.8867924528301887, 5.660377358490567 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=B
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "B", "marker": { "color": "#00cc96", "pattern": { "shape": "" } }, "name": "B", "offsetgroup": "B", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "None", "PD1", "PDL1" ], "xaxis": "x", "y": [ 4.584527220630372, 77.36389684813754, 0.28653295128939826, 17.765042979942695 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=DC
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "DC", "marker": { "color": "#ab63fa", "pattern": { "shape": "" } }, "name": "DC", "offsetgroup": "DC", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "None", "PD1", "PD1_PDL1" ], "xaxis": "x2", "y": [ 2.955665024630542, 0.3694581280788177, 87.192118226601, 7.8817733990147785, 1.600985221674877 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=DC
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "DC", "marker": { "color": "#ab63fa", "pattern": { "shape": "" } }, "name": "DC", "offsetgroup": "DC", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PDL1" ], "xaxis": "x", "y": [ 3.9944521497919556, 0.08321775312066575, 0.055478502080443824, 90.98474341192788, 3.633841886269071, 1.248266296809986 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=IMMUNE_OTHER
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "IMMUNE_OTHER", "marker": { "color": "#FFA15A", "pattern": { "shape": "" } }, "name": "IMMUNE_OTHER", "offsetgroup": "IMMUNE_OTHER", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x2", "y": [ 9.932279909706546, 0.5804579168010319, 0.032247662044501774, 64.49532408900355, 21.896162528216703, 1.3221541438245727, 1.7413737504030957 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=IMMUNE_OTHER
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "IMMUNE_OTHER", "marker": { "color": "#FFA15A", "pattern": { "shape": "" } }, "name": "IMMUNE_OTHER", "offsetgroup": "IMMUNE_OTHER", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x", "y": [ 4.385964912280701, 0.2562586240883107, 0.03942440370589395, 84.72304356396609, 8.219988172678889, 0.29568302779420463, 2.0796372954859055 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=M1
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "M1", "marker": { "color": "#19d3f3", "pattern": { "shape": "" } }, "name": "M1", "offsetgroup": "M1", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x2", "y": [ 0.8964143426294822, 0.398406374501992, 90.43824701195219, 5.278884462151394, 0.199203187250996, 2.788844621513944 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=M1
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "M1", "marker": { "color": "#19d3f3", "pattern": { "shape": "" } }, "name": "M1", "offsetgroup": "M1", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x", "y": [ 5.770964833183047, 0.9017132551848512, 78.26871055004509, 10.18935978358882, 2.6149684400360687, 2.254283137962128 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=M2
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "M2", "marker": { "color": "#FF6692", "pattern": { "shape": "" } }, "name": "M2", "offsetgroup": "M2", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x2", "y": [ 2.9197080291970803, 0.36496350364963503, 70.07299270072993, 15.693430656934307, 5.839416058394161, 5.109489051094891 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=M2
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "M2", "marker": { "color": "#FF6692", "pattern": { "shape": "" } }, "name": "M2", "offsetgroup": "M2", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x", "y": [ 2.3255813953488373, 0.15503875968992248, 0.7751937984496124, 81.55038759689923, 11.782945736434108, 2.0155038759689923, 1.3953488372093024 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=TCD4
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "TCD4", "marker": { "color": "#B6E880", "pattern": { "shape": "" } }, "name": "TCD4", "offsetgroup": "TCD4", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "None", "PD1", "PDL1" ], "xaxis": "x2", "y": [ 1.828890266584005, 0.04649721016738996, 93.83137011779293, 3.223806571605704, 1.069435833849969 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=TCD4
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "TCD4", "marker": { "color": "#B6E880", "pattern": { "shape": "" } }, "name": "TCD4", "offsetgroup": "TCD4", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x", "y": [ 2.3240517430388072, 0.05481254110940583, 0.005481254110940584, 95.94387195790397, 1.0633632975224732, 0.005481254110940584, 0.6029379522034641 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=TCD8
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "TCD8", "marker": { "color": "#FF97FF", "pattern": { "shape": "" } }, "name": "TCD8", "offsetgroup": "TCD8", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x2", "y": [ 3.3856722276741906, 0.04906771344455348, 0.04906771344455348, 86.01570166830226, 7.065750736015702, 1.5701668302257115, 1.8645731108930326 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=TCD8
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "TCD8", "marker": { "color": "#FF97FF", "pattern": { "shape": "" } }, "name": "TCD8", "offsetgroup": "TCD8", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PDL1", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x", "y": [ 8.640796562777057, 0.09547841505831003, 0.22505626406601648, 81.67496419559436, 5.162654299938621, 0.7501875468867216, 3.45086271567892 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=Treg
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "Treg", "marker": { "color": "#FECB52", "pattern": { "shape": "" } }, "name": "Treg", "offsetgroup": "Treg", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "None", "PDL1" ], "xaxis": "x2", "y": [ 2.7027027027027026, 91.8918918918919, 5.405405405405405 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=Treg
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "Treg", "marker": { "color": "#FECB52", "pattern": { "shape": "" } }, "name": "Treg", "offsetgroup": "Treg", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "None", "PD1", "PD1_PDL1", "PDL1" ], "xaxis": "x", "y": [ 3.1446540880503147, 88.67924528301887, 1.257861635220126, 0.628930817610063, 6.289308176100629 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=STROMA_OTHER
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "STROMA_OTHER", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "STROMA_OTHER", "offsetgroup": "STROMA_OTHER", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "None", "PD1", "PDL1" ], "xaxis": "x2", "y": [ 0.23769907297361542, 0.047539814594723076, 97.9676729260756, 1.1587829807463752, 0.5883052056096981 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=STROMA_OTHER
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "STROMA_OTHER", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "STROMA_OTHER", "offsetgroup": "STROMA_OTHER", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "B7H4_PD1_PDL1", "None", "PD1", "PDL1" ], "xaxis": "x", "y": [ 0.3924418604651163, 0.008305647840531562, 0.0020764119601328905, 98.69393687707641, 0.5710132890365449, 0.33222591362126247 ], "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=αSMA_myCAF
Dataset=NACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "αSMA_myCAF", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "αSMA_myCAF", "offsetgroup": "αSMA_myCAF", "orientation": "v", "showlegend": true, "textposition": "auto", "type": "bar", "x": [ "B7H4", "B7H4_PD1", "None", "PD1", "PDL1" ], "xaxis": "x2", "y": [ 0.10163396137909467, 0.007817997029161129, 99.64819013368775, 0.11726995543741693, 0.12508795246657806 ], "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Cell Subtype=αSMA_myCAF
Dataset=ACT
Immune Checkpoint=%{x}
Percentage=%{y}", "legendgroup": "αSMA_myCAF", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "αSMA_myCAF", "offsetgroup": "αSMA_myCAF", "orientation": "v", "showlegend": false, "textposition": "auto", "type": "bar", "x": [ "B7H4", "None", "PD1", "PDL1" ], "xaxis": "x", "y": [ 0.18526591107236268, 98.8084859052601, 0.929962220284801, 0.07628596338273758 ], "yaxis": "y" } ], "layout": { "annotations": [ { "font": {}, "showarrow": false, "text": "Dataset=ACT", "x": 0.5, "xanchor": "center", "xref": "paper", "y": 0.46499999999999997, "yanchor": "bottom", "yref": "paper" }, { "font": {}, "showarrow": false, "text": "Dataset=NACT", "x": 0.5, "xanchor": "center", "xref": "paper", "y": 0.9999999999999999, "yanchor": "bottom", "yref": "paper" } ], "barmode": "group", "legend": { "title": { "text": "Cell Subtype" }, "tracegroupgap": 0 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Percentage of Each Immune Checkpoint Type by Cell Subtype" }, "xaxis": { "anchor": "y", "autorange": true, "domain": [ 0, 1 ], "range": [ -0.5, 7.5 ], "title": { "text": "Immune Checkpoint" }, "type": "category" }, "xaxis2": { "anchor": "y2", "autorange": true, "domain": [ 0, 1 ], "matches": "x", "range": [ -0.5, 7.5 ], "showticklabels": false, "type": "category" }, "yaxis": { "anchor": "x", "autorange": true, "domain": [ 0, 0.46499999999999997 ], "range": [ 0, 104.89283171967132 ], "title": { "text": "Percentage" }, "type": "linear" }, "yaxis2": { "anchor": "x2", "autorange": true, "domain": [ 0.5349999999999999, 0.9999999999999999 ], "matches": "y", "range": [ 0, 104.89283171967132 ], "title": { "text": "Percentage" }, "type": "linear" } } } }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "'temp-plot.html'" ] }, "execution_count": 79, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Concaténer les deux DataFrames\n", "combined_counts = pd.concat([counts_NACT, counts_ACT])\n", "\n", "# Ajouter une colonne pour distinguer les deux ensembles de données\n", "combined_counts['dataset'] = ['NACT'] * len(counts_NACT) + ['ACT'] * len(counts_ACT)\n", "\n", "# Créer le graphique à barres groupées avec Plotly Express\n", "fig = px.bar(combined_counts, x='immune_checkpoint', y='percentage', color='cell_subtype', \n", " facet_col='dataset', facet_col_wrap=1,\n", " barmode='group',\n", " title='Percentage of Each Immune Checkpoint Type by Cell Subtype',\n", " labels={'immune_checkpoint': 'Immune Checkpoint', 'percentage': 'Percentage', 'cell_subtype': 'Cell Subtype', 'dataset': 'Dataset'})\n", "\n", "# Afficher le graphique\n", "fig.show()\n", "plot(fig)" ] }, { "cell_type": "code", "execution_count": 80, "id": "ba1d34e1-ad9d-4d49-a1dd-b31ba1e1348a", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
cell_typecell_subtypeimmune_checkpointcountpercentagedataset
0CANCERCANCERB7H41082716.317273NACT
1CANCERCANCERB7H4_PD11400.210993NACT
2CANCERCANCERB7H4_PDL1190.028635NACT
3CANCERCANCERNone5277879.541242NACT
4CANCERCANCERPD115532.340512NACT
.....................
66STROMASTROMA_OTHERPDL11600.332226ACT
67STROMAαSMA_myCAFB7H4510.185266ACT
68STROMAαSMA_myCAFNone2720098.808486ACT
69STROMAαSMA_myCAFPD12560.929962ACT
70STROMAαSMA_myCAFPDL1210.076286ACT
\n", "

135 rows × 6 columns

\n", "
" ], "text/plain": [ " cell_type cell_subtype immune_checkpoint count percentage dataset\n", "0 CANCER CANCER B7H4 10827 16.317273 NACT\n", "1 CANCER CANCER B7H4_PD1 140 0.210993 NACT\n", "2 CANCER CANCER B7H4_PDL1 19 0.028635 NACT\n", "3 CANCER CANCER None 52778 79.541242 NACT\n", "4 CANCER CANCER PD1 1553 2.340512 NACT\n", ".. ... ... ... ... ... ...\n", "66 STROMA STROMA_OTHER PDL1 160 0.332226 ACT\n", "67 STROMA αSMA_myCAF B7H4 51 0.185266 ACT\n", "68 STROMA αSMA_myCAF None 27200 98.808486 ACT\n", "69 STROMA αSMA_myCAF PD1 256 0.929962 ACT\n", "70 STROMA αSMA_myCAF PDL1 21 0.076286 ACT\n", "\n", "[135 rows x 6 columns]" ] }, "execution_count": 80, "metadata": {}, "output_type": "execute_result" } ], "source": [ "combined_counts" ] }, { "cell_type": "code", "execution_count": null, "id": "9fb00374-bd37-4d47-a465-c0ff2b3a308f", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "289bc49c-6d36-47f1-82d2-28f12df146ff", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "28838faa-aac4-4f8b-a123-a8006c28c45d", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "1c82387a-1035-4039-9c71-f7871f219961", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "10453d0f-75fd-487b-a696-7f57bebed76a", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "6e497d2e-05dd-4d40-94e0-d3b50906f90e", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "a60caf94-300d-4d5f-8111-d2bcd6437fe9", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "d8d0c3dc-d5db-452d-af17-ed5fe40c1d61", "metadata": {}, "source": [ "### V.4.4. NACT VS ACT" ] }, { "cell_type": "code", "execution_count": 81, "id": "7688f4a2-419f-44a9-b7f3-b22544a32e00", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
dcbtcd4tcd8m1m2tregimmune_othercancerαsma_mycafstroma_otherendothelial
DD3S1.csv11.00.05515397322.01110818611432380283
DD3S3.csv27.044.014417286919.022581396323345066321
DD4S1.csv48.03.01087211265.055318862274843778
DD4S2.csv28.01.0807477874.041616999334619268
DD4S3.csv82.01.03731445564.05917547437708178
DD5S1.csv55.01.08616934217.07548652917762269758
DD5S2.csv71.00.041363274.05247596326733198930
DD5S3.csv490.03.090423033269.07312809226571428581
DD3S2.csv0.00.015720.011722851563317119
\n", "
" ], "text/plain": [ " dc b tcd4 tcd8 m1 m2 treg immune_other cancer \\\n", "DD3S1.csv 11.0 0.0 551 539 73 22.0 1 110 8186 \n", "DD3S3.csv 27.0 44.0 1441 728 69 19.0 2 258 13963 \n", "DD4S1.csv 48.0 3.0 1087 211 26 5.0 5 531 8862 \n", "DD4S2.csv 28.0 1.0 807 47 78 74.0 4 161 6999 \n", "DD4S3.csv 82.0 1.0 373 144 55 64.0 5 917 5474 \n", "DD5S1.csv 55.0 1.0 861 69 342 17.0 7 548 6529 \n", "DD5S2.csv 71.0 0.0 413 63 27 4.0 5 247 5963 \n", "DD5S3.csv 490.0 3.0 904 230 332 69.0 7 312 8092 \n", "DD3S2.csv 0.0 0.0 15 7 2 0.0 1 17 2285 \n", "\n", " αsma_mycaf stroma_other endothelial \n", "DD3S1.csv 1143 2380 283 \n", "DD3S3.csv 2334 5066 321 \n", "DD4S1.csv 274 843 778 \n", "DD4S2.csv 334 619 268 \n", "DD4S3.csv 37 708 178 \n", "DD5S1.csv 1776 2269 758 \n", "DD5S2.csv 2673 3198 930 \n", "DD5S3.csv 2657 1428 581 \n", "DD3S2.csv 1563 317 119 " ] }, "execution_count": 81, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#######\n", "####### Count by cell SUBtype !! IN NACT !!\n", "#######\n", "cell_subtypes = ['DC', 'B', 'TCD4', 'TCD8', 'M1', 'M2', 'Treg', \\\n", " 'IMMUNE_OTHER', 'CANCER', 'αSMA_myCAF', 'STROMA_OTHER', 'ENDOTHELIAL']\n", "# Initialisation d'un dictionnaire pour stocker les counts des sous-types de cellules\n", "subtype_counts = {}\n", "\n", "# Boucle sur les sous-types de cellules pour compter les échantillons correspondants\n", "for subtype in cell_subtypes:\n", " subtype_counts[subtype.lower()] = pd.DataFrame({subtype.lower():\n", " df_NACT.loc[\n", " df_NACT['cell_subtype'] == subtype, 'Sample_ID'].value_counts()\n", " }).sort_index()\n", "\n", "# Concaténation des counts des sous-types de cellules en un seul DataFrame\n", "counts_subtypes = pd.concat([pd.DataFrame(v) for v in subtype_counts.values()], axis=1, sort=False)\n", "counts_subtypes = counts_subtypes.fillna(0)\n", "\n", "# Enregistrement des counts des sous-types de cellules dans un fichier CSV\n", "filename_subtypes = os.path.join(output_data_dir, project_name + \"_cell_subtypes_number.csv\")\n", "counts_subtypes.to_csv(filename_subtypes, index=False)\n", "counts_subtypes" ] }, { "cell_type": "code", "execution_count": 82, "id": "bbab2efd-bb51-4475-9c3f-75639b9260ba", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
dcbtcd4tcd8m1m2tregimmune_othercancerαsma_mycaf...tcd8_percm1_percm2_perctreg_percimmune_other_perccancer_percαsma_mycaf_percstroma_other_percendothelial_percSample_ID
DD3S1.csv11.00.05515397322.0111081861143...4.0516490.5485720.1653160.0075140.82657161.5080578.54877717.7892292.112465DD3S1.csv
DD3S3.csv27.044.014417286919.02258139632334...2.9985710.2841700.0782490.0082371.06253357.5019359.58908920.8051401.317163DD3S3.csv
DD4S1.csv48.03.01087211265.055318862274...1.6637780.2049880.0394200.0394204.18640169.8448992.1476796.6065286.093973DD4S1.csv
DD4S2.csv28.01.0807477874.041616999334...0.4984690.8272020.7847130.0424131.70713174.1990573.5132256.5086322.816027DD4S2.csv
DD4S3.csv82.01.03731445564.05917547437...1.7902270.6836150.7954120.06213511.39554667.9291230.4553108.7119332.187943DD4S3.csv
DD5S1.csv55.01.08616934217.0754865291776...0.5211902.5831890.1283790.0528614.13828049.28903513.35775917.0486135.688107DD5S1.csv
DD5S2.csv71.00.041363274.0524759632673...0.4633180.1985580.0294160.0367691.81640543.84525119.59110123.4053536.794795DD5S2.csv
DD5S3.csv490.03.090423033269.0731280922657...1.5217432.1963820.4564110.0463012.06370153.51663617.5101599.3999573.822127DD5S3.csv
DD3S2.csv0.00.015720.011722851563...0.1617990.0462270.0000000.0231130.39292052.80830635.6867317.1793102.690697DD3S2.csv
\n", "

9 rows × 25 columns

\n", "
" ], "text/plain": [ " dc b tcd4 tcd8 m1 m2 treg immune_other cancer \\\n", "DD3S1.csv 11.0 0.0 551 539 73 22.0 1 110 8186 \n", "DD3S3.csv 27.0 44.0 1441 728 69 19.0 2 258 13963 \n", "DD4S1.csv 48.0 3.0 1087 211 26 5.0 5 531 8862 \n", "DD4S2.csv 28.0 1.0 807 47 78 74.0 4 161 6999 \n", "DD4S3.csv 82.0 1.0 373 144 55 64.0 5 917 5474 \n", "DD5S1.csv 55.0 1.0 861 69 342 17.0 7 548 6529 \n", "DD5S2.csv 71.0 0.0 413 63 27 4.0 5 247 5963 \n", "DD5S3.csv 490.0 3.0 904 230 332 69.0 7 312 8092 \n", "DD3S2.csv 0.0 0.0 15 7 2 0.0 1 17 2285 \n", "\n", " αsma_mycaf ... tcd8_perc m1_perc m2_perc treg_perc \\\n", "DD3S1.csv 1143 ... 4.051649 0.548572 0.165316 0.007514 \n", "DD3S3.csv 2334 ... 2.998571 0.284170 0.078249 0.008237 \n", "DD4S1.csv 274 ... 1.663778 0.204988 0.039420 0.039420 \n", "DD4S2.csv 334 ... 0.498469 0.827202 0.784713 0.042413 \n", "DD4S3.csv 37 ... 1.790227 0.683615 0.795412 0.062135 \n", "DD5S1.csv 1776 ... 0.521190 2.583189 0.128379 0.052861 \n", "DD5S2.csv 2673 ... 0.463318 0.198558 0.029416 0.036769 \n", "DD5S3.csv 2657 ... 1.521743 2.196382 0.456411 0.046301 \n", "DD3S2.csv 1563 ... 0.161799 0.046227 0.000000 0.023113 \n", "\n", " immune_other_perc cancer_perc αsma_mycaf_perc stroma_other_perc \\\n", "DD3S1.csv 0.826571 61.508057 8.548777 17.789229 \n", "DD3S3.csv 1.062533 57.501935 9.589089 20.805140 \n", "DD4S1.csv 4.186401 69.844899 2.147679 6.606528 \n", "DD4S2.csv 1.707131 74.199057 3.513225 6.508632 \n", "DD4S3.csv 11.395546 67.929123 0.455310 8.711933 \n", "DD5S1.csv 4.138280 49.289035 13.357759 17.048613 \n", "DD5S2.csv 1.816405 43.845251 19.591101 23.405353 \n", "DD5S3.csv 2.063701 53.516636 17.510159 9.399957 \n", "DD3S2.csv 0.392920 52.808306 35.686731 7.179310 \n", "\n", " endothelial_perc Sample_ID \n", "DD3S1.csv 2.112465 DD3S1.csv \n", "DD3S3.csv 1.317163 DD3S3.csv \n", "DD4S1.csv 6.093973 DD4S1.csv \n", "DD4S2.csv 2.816027 DD4S2.csv \n", "DD4S3.csv 2.187943 DD4S3.csv \n", "DD5S1.csv 5.688107 DD5S1.csv \n", "DD5S2.csv 6.794795 DD5S2.csv \n", "DD5S3.csv 3.822127 DD5S3.csv \n", "DD3S2.csv 2.690697 DD3S2.csv \n", "\n", "[9 rows x 25 columns]" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Ajout des colonnes de pourcentages pour chaque sous-type de cellules\n", "counts_perc = counts_subtypes.copy()\n", "\n", "# Calcul des pourcentages pour chaque sous-type de cellules\n", "for col in counts_perc.columns:\n", " counts_perc[col + '_perc'] = (counts_perc[col] / counts_perc.sum(axis=1)) * 100\n", "\n", "# Affichage des pourcentages des sous-types de cellules\n", "\n", "counts_perc['Sample_ID'] = counts_perc.index\n", "counts_perc.columns.values\n", "display(counts_perc)" ] }, { "cell_type": "code", "execution_count": 83, "id": "dfd8e431-e4ae-414b-ab2c-a8045567977f", "metadata": { "tags": [] }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "marker": { "color": "rgb(166, 206, 227)" }, "name": "DC", "text": [ 0.0827129859387924, 0.11123928806855636, 0.3787579894263395, 0.29723991507431, 1.0201542672306545, 0.4156590084643289, 0.5222892452552597, 3.243958953988745, 0 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "DD3S2.csv" ], "y": [ 0.0827129859387924, 0.11123928806855636, 0.3787579894263395, 0.29723991507431, 1.0201542672306545, 0.4156590084643289, 0.5222892452552597, 3.243958953988745, 0 ] }, { "marker": { "color": "rgb(31, 120, 180)" }, "name": "B", "text": [ 0, 0.1812780090129917, 0.023671666863966878, 0.010615376293678553, 0.012439326942963133, 0.00755719912198505, 0, 0.019856708748881652, 0 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "DD3S2.csv" ], "y": [ 0, 0.1812780090129917, 0.023671666863966878, 0.010615376293678553, 0.012439326942963133, 0.00755719912198505, 0, 0.019856708748881652, 0 ] }, { "marker": { "color": "rgb(178, 223, 138)" }, "name": "TCD4", "text": [ 4.143142891065517, 5.936810455679476, 8.577017939999875, 8.566599015622506, 4.639861770149079, 6.506744727945322, 3.037988325097145, 5.98348037226371, 0.34674063800277394 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "DD3S2.csv" ], "y": [ 4.143142891065517, 5.936810455679476, 8.577017939999875, 8.566599015622506, 4.639861770149079, 6.506744727945322, 3.037988325097145, 5.98348037226371, 0.34674063800277394 ] }, { "marker": { "color": "rgb(51, 160, 44)" }, "name": "TCD8", "text": [ 4.051648869525014, 2.9985712309250405, 1.6637781260558058, 0.4984688281487404, 1.7902270486407794, 0.5211901581442018, 0.4633184094349682, 1.5217429984775828, 0.161799329079382 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "DD3S2.csv" ], "y": [ 4.051648869525014, 2.9985712309250405, 1.6637781260558058, 0.4984688281487404, 1.7902270486407794, 0.5211901581442018, 0.4633184094349682, 1.5217429984775828, 0.161799329079382 ] }, { "marker": { "color": "rgb(251, 154, 153)" }, "name": "M1", "text": [ 0.5485720123741454, 0.2841701428241529, 0.2049884212074979, 0.8272024092781988, 0.683615127818909, 2.583188654098764, 0.19855826701155652, 2.19638179931617, 0.046226650924748126 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "DD3S2.csv" ], "y": [ 0.5485720123741454, 0.2841701428241529, 0.2049884212074979, 0.8272024092781988, 0.683615127818909, 2.583188654098764, 0.19855826701155652, 2.19638179931617, 0.046226650924748126 ] }, { "marker": { "color": "rgb(227, 26, 28)" }, "name": "M2", "text": [ 0.1653162573143431, 0.0782488337048752, 0.03942021313708706, 0.7847129330749794, 0.795411836093024, 0.12837906596399754, 0.029415610030689036, 0.45641062192745147, 0 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "DD3S2.csv" ], "y": [ 0.1653162573143431, 0.0782488337048752, 0.03942021313708706, 0.7847129330749794, 0.795411836093024, 0.12837906596399754, 0.029415610030689036, 0.45641062192745147, 0 ] }, { "marker": { "color": "rgb(253, 191, 111)" }, "name": "Treg", "text": [ 0.007514281986421941, 0.008236692794049295, 0.03942009062313482, 0.04241338596665315, 0.06213540722152419, 0.05286145585611015, 0.036769432998897254, 0.046301129033429325, 0.02311307851031047 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "DD3S2.csv" ], "y": [ 0.007514281986421941, 0.008236692794049295, 0.03942009062313482, 0.04241338596665315, 0.06213540722152419, 0.05286145585611015, 0.036769432998897254, 0.046301129033429325, 0.02311307851031047 ] }, { "marker": { "color": "rgb(1.0, 0.4980392156862745, 0.0)" }, "name": "IMMUNE_OTHER", "text": [ 0.8265705517880316, 1.0625330100046495, 4.186400613316501, 1.7071311077824347, 11.395545692380658, 4.138280310256386, 1.8164050786181491, 2.063701145273896, 0.3929202356388057 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "DD3S2.csv" ], "y": [ 0.8265705517880316, 1.0625330100046495, 4.186400613316501, 1.7071311077824347, 11.395545692380658, 4.138280310256386, 1.8164050786181491, 2.063701145273896, 0.3929202356388057 ] }, { "marker": { "color": "rgb(202, 178, 214)" }, "name": "CANCER", "text": [ 61.50805729344066, 57.50193502100974, 69.84489878174446, 74.19905740837119, 67.92912258071058, 49.28903507122674, 43.84525054830309, 53.516636114275805, 52.8083064493023 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "DD3S2.csv" ], "y": [ 61.50805729344066, 57.50193502100974, 69.84489878174446, 74.19905740837119, 67.92912258071058, 49.28903507122674, 43.84525054830309, 53.516636114275805, 52.8083064493023 ] }, { "marker": { "color": "rgb(106, 61, 154)" }, "name": "αSMA_myCAF", "text": [ 8.548777014392844, 9.589089431425785, 2.147679059615977, 3.5132253959133983, 0.45531016793807066, 13.357759485108605, 19.591100824877437, 17.51015890901156, 35.68673127196452 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "DD3S2.csv" ], "y": [ 8.548777014392844, 9.589089431425785, 2.147679059615977, 3.5132253959133983, 0.45531016793807066, 13.357759485108605, 19.591100824877437, 17.51015890901156, 35.68673127196452 ] }, { "marker": { "color": "rgb(1.0, 1.0, 0.6)" }, "name": "STROMA_OTHER", "text": [ 17.789228909183365, 20.805139931914812, 6.606528173248096, 6.508632262536575, 8.711933470860176, 17.048612880820258, 23.40535281148082, 9.39995713999546, 7.179310443232148 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "DD3S2.csv" ], "y": [ 17.789228909183365, 20.805139931914812, 6.606528173248096, 6.508632262536575, 8.711933470860176, 17.048612880820258, 23.40535281148082, 9.39995713999546, 7.179310443232148 ] }, { "marker": { "color": "rgb(177, 89, 40)" }, "name": "ENDOTHELIAL", "text": [ 2.112465018885279, 1.3171631517495686, 6.093972871074612, 2.8160266766751407, 2.1879428780169374, 5.6881074409594685, 6.794795343838826, 3.8221273791194568, 2.6906974449716654 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv", "DD3S2.csv" ], "y": [ 2.112465018885279, 1.3171631517495686, 6.093972871074612, 2.8160266766751407, 2.1879428780169374, 5.6881074409594685, 6.794795343838826, 3.8221273791194568, 2.6906974449716654 ] } ], "layout": { "barmode": "stack", "plot_bgcolor": "white", "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "NACT_patients_Cell subtypes proportions by Sample ID and tissue type" }, "xaxis": { "autorange": true, "linecolor": "black", "range": [ -0.5, 8.5 ], "type": "category" }, "yaxis": { "autorange": true, "linecolor": "black", "range": [ 0, 105.1309633674881 ], "title": { "text": "Cell count (%)" }, "type": "linear" } } } }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "'temp-plot.html'" ] }, "execution_count": 83, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fig = go.Figure()\n", "title = 'NACT_patients_Cell subtypes proportions by Sample ID and tissue type'\n", "\n", "for cell_subtype in cell_subtypes:\n", " fig.add_trace(\n", " go.Bar(\n", " name=cell_subtype,\n", " x=counts_perc['Sample_ID'],\n", " y=counts_perc[f'{cell_subtype.lower()}_perc'],\n", " text=counts_perc[f'{cell_subtype.lower()}_perc'],\n", " textposition='auto',\n", " marker_color='rgb' + str(cell_subtype_color_dict[cell_subtype])))\n", "\n", "fig.update_layout(\n", " plot_bgcolor='white',\n", " barmode='stack',\n", " xaxis=dict(linecolor='black'),\n", " title=title,\n", " yaxis=dict(title='Cell count (%)', linecolor='black')\n", ")\n", "\n", "# Enregistrer l'image\n", "output_filename = title.replace(\" \", \"_\") + \".png\"\n", "#fig.write_image(output_images_dir + \"/\" + output_filename, scale=1000)\n", "\n", "# Afficher le graphique\n", "fig.show()\n", "plot(fig)" ] }, { "cell_type": "code", "execution_count": 84, "id": "ea307a4d-0bfa-41e3-b3e3-feee3254e12d", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
dcbtcd4tcd8m1m2tregimmune_othercancerαsma_mycafstroma_otherendothelial
DD3S1.csv700.024402310237107588440795282443431383
DD3S2.csv2940.019002343922537124448774322669581631
DD3S3.csv25394.05416282218377261616630375090109222457
DD4S1.csv22426.01580173950337185845151283233001275
DD4S2.csv10213.0113116473428156803247113303910964
DD4S3.csv106830.01980279610026433241945124364941221195
DD5S1.csv528138.01979467162112167237194520078222037
DD5S2.csv8916.0722821045992202487612034024405
DD5S3.csv97732.010964571474165532196821742759583
\n", "
" ], "text/plain": [ " dc b tcd4 tcd8 m1 m2 treg immune_other cancer \\\n", "DD3S1.csv 70 0.0 2440 2310 237 107 5 884 40795 \n", "DD3S2.csv 294 0.0 1900 2343 92 25 37 1244 48774 \n", "DD3S3.csv 253 94.0 5416 2822 183 77 26 1616 63037 \n", "DD4S1.csv 224 26.0 1580 1739 50 33 7 1858 45151 \n", "DD4S2.csv 102 13.0 1131 1647 34 28 15 680 32471 \n", "DD4S3.csv 1068 30.0 1980 2796 100 264 33 2419 45124 \n", "DD5S1.csv 528 138.0 1979 467 162 11 21 672 37194 \n", "DD5S2.csv 89 16.0 722 82 104 59 9 220 24876 \n", "DD5S3.csv 977 32.0 1096 457 147 41 6 553 21968 \n", "\n", " αsma_mycaf stroma_other endothelial \n", "DD3S1.csv 2824 4343 1383 \n", "DD3S2.csv 3226 6958 1631 \n", "DD3S3.csv 5090 10922 2457 \n", "DD4S1.csv 2832 3300 1275 \n", "DD4S2.csv 1330 3910 964 \n", "DD4S3.csv 3649 4122 1195 \n", "DD5S1.csv 5200 7822 2037 \n", "DD5S2.csv 1203 4024 405 \n", "DD5S3.csv 2174 2759 583 " ] }, "execution_count": 84, "metadata": {}, "output_type": "execute_result" } ], "source": [ "#######\n", "####### Count by cell SUBtype !! IN ACT !!\n", "#######\n", "cell_subtypes = ['DC', 'B', 'TCD4', 'TCD8', 'M1', 'M2', 'Treg', \\\n", " 'IMMUNE_OTHER', 'CANCER', 'αSMA_myCAF', 'STROMA_OTHER', 'ENDOTHELIAL']\n", "# Initialisation d'un dictionnaire pour stocker les counts des sous-types de cellules\n", "subtype_counts = {}\n", "\n", "# Boucle sur les sous-types de cellules pour compter les échantillons correspondants\n", "for subtype in cell_subtypes:\n", " subtype_counts[subtype.lower()] = pd.DataFrame({subtype.lower():\n", " df_ACT.loc[\n", " df_ACT['cell_subtype'] == subtype, 'Sample_ID'].value_counts()\n", " }).sort_index()\n", "\n", "# Concaténation des counts des sous-types de cellules en un seul DataFrame\n", "counts_subtypes = pd.concat([pd.DataFrame(v) for v in subtype_counts.values()], axis=1, sort=False)\n", "counts_subtypes = counts_subtypes.fillna(0)\n", "\n", "# Enregistrement des counts des sous-types de cellules dans un fichier CSV\n", "filename_subtypes = os.path.join(output_data_dir, project_name + \"_cell_subtypes_number.csv\")\n", "counts_subtypes.to_csv(filename_subtypes, index=False)\n", "counts_subtypes" ] }, { "cell_type": "code", "execution_count": 85, "id": "41dcf9da-7ae4-49e7-9062-1c762dbc9b9e", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
dcbtcd4tcd8m1m2tregimmune_othercancerαsma_mycaf...tcd8_percm1_percm2_perctreg_percimmune_other_perccancer_percαsma_mycaf_percstroma_other_percendothelial_percSample_ID
DD3S1.csv700.0244023102371075884407952824...4.1694850.4277460.1931160.0090241.59545773.6253225.0898897.8269682.492095DD3S1.csv
DD3S2.csv2940.0190023439225371244487743226...3.5218630.1382820.0375760.0556131.86980473.3080694.84339110.4457112.448158DD3S2.csv
DD3S3.csv25394.05416282218377261616630375090...3.0674160.1989080.0836930.0282601.75647168.5152025.52822711.8616252.668033DD3S3.csv
DD4S1.csv22426.015801739503371858451512832...2.9942410.0860860.0568170.0120523.19896477.7333034.8691395.6733102.191747DD4S1.csv
DD4S2.csv10213.011311647342815680324711330...3.8910470.0803180.0661440.0354341.60634976.7026243.1360299.2187712.272369DD4S2.csv
DD4S3.csv106830.019802796100264332419451243649...4.4533000.1592630.4204520.0525563.85252571.8605515.8044376.5562291.900504DD4S3.csv
DD5S1.csv528138.019794671621121672371945200...0.8304330.2880690.0195600.0373421.19494566.1366899.23554413.8901113.616361DD5S1.csv
DD5S2.csv8916.072282104599220248761203...0.2577680.3269220.1854640.0282910.69155478.1942283.77219112.6163751.269287DD5S2.csv
DD5S3.csv97732.01096457147416553219682174...1.4837740.4772520.1331090.0194791.79534171.3160057.0412828.9339771.887279DD5S3.csv
\n", "

9 rows × 25 columns

\n", "
" ], "text/plain": [ " dc b tcd4 tcd8 m1 m2 treg immune_other cancer \\\n", "DD3S1.csv 70 0.0 2440 2310 237 107 5 884 40795 \n", "DD3S2.csv 294 0.0 1900 2343 92 25 37 1244 48774 \n", "DD3S3.csv 253 94.0 5416 2822 183 77 26 1616 63037 \n", "DD4S1.csv 224 26.0 1580 1739 50 33 7 1858 45151 \n", "DD4S2.csv 102 13.0 1131 1647 34 28 15 680 32471 \n", "DD4S3.csv 1068 30.0 1980 2796 100 264 33 2419 45124 \n", "DD5S1.csv 528 138.0 1979 467 162 11 21 672 37194 \n", "DD5S2.csv 89 16.0 722 82 104 59 9 220 24876 \n", "DD5S3.csv 977 32.0 1096 457 147 41 6 553 21968 \n", "\n", " αsma_mycaf ... tcd8_perc m1_perc m2_perc treg_perc \\\n", "DD3S1.csv 2824 ... 4.169485 0.427746 0.193116 0.009024 \n", "DD3S2.csv 3226 ... 3.521863 0.138282 0.037576 0.055613 \n", "DD3S3.csv 5090 ... 3.067416 0.198908 0.083693 0.028260 \n", "DD4S1.csv 2832 ... 2.994241 0.086086 0.056817 0.012052 \n", "DD4S2.csv 1330 ... 3.891047 0.080318 0.066144 0.035434 \n", "DD4S3.csv 3649 ... 4.453300 0.159263 0.420452 0.052556 \n", "DD5S1.csv 5200 ... 0.830433 0.288069 0.019560 0.037342 \n", "DD5S2.csv 1203 ... 0.257768 0.326922 0.185464 0.028291 \n", "DD5S3.csv 2174 ... 1.483774 0.477252 0.133109 0.019479 \n", "\n", " immune_other_perc cancer_perc αsma_mycaf_perc stroma_other_perc \\\n", "DD3S1.csv 1.595457 73.625322 5.089889 7.826968 \n", "DD3S2.csv 1.869804 73.308069 4.843391 10.445711 \n", "DD3S3.csv 1.756471 68.515202 5.528227 11.861625 \n", "DD4S1.csv 3.198964 77.733303 4.869139 5.673310 \n", "DD4S2.csv 1.606349 76.702624 3.136029 9.218771 \n", "DD4S3.csv 3.852525 71.860551 5.804437 6.556229 \n", "DD5S1.csv 1.194945 66.136689 9.235544 13.890111 \n", "DD5S2.csv 0.691554 78.194228 3.772191 12.616375 \n", "DD5S3.csv 1.795341 71.316005 7.041282 8.933977 \n", "\n", " endothelial_perc Sample_ID \n", "DD3S1.csv 2.492095 DD3S1.csv \n", "DD3S2.csv 2.448158 DD3S2.csv \n", "DD3S3.csv 2.668033 DD3S3.csv \n", "DD4S1.csv 2.191747 DD4S1.csv \n", "DD4S2.csv 2.272369 DD4S2.csv \n", "DD4S3.csv 1.900504 DD4S3.csv \n", "DD5S1.csv 3.616361 DD5S1.csv \n", "DD5S2.csv 1.269287 DD5S2.csv \n", "DD5S3.csv 1.887279 DD5S3.csv \n", "\n", "[9 rows x 25 columns]" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Ajout des colonnes de pourcentages pour chaque sous-type de cellules\n", "counts_perc = counts_subtypes.copy()\n", "\n", "# Calcul des pourcentages pour chaque sous-type de cellules\n", "for col in counts_perc.columns:\n", " counts_perc[col + '_perc'] = (counts_perc[col] / counts_perc.sum(axis=1)) * 100\n", "\n", "# Affichage des pourcentages des sous-types de cellules\n", "\n", "counts_perc['Sample_ID'] = counts_perc.index\n", "counts_perc.columns.values\n", "display(counts_perc)" ] }, { "cell_type": "code", "execution_count": 86, "id": "7fe02123-a51b-41d3-a874-1dfdefe193a2", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "marker": { "color": "rgb(166, 206, 227)" }, "name": "DC", "text": [ 0.1263583522870862, 0.44194576393482055, 0.27502092550520146, 0.3857081360309944, 0.24099232132309512, 1.7011787193373686, 0.9389838345396667, 0.2797950265648087, 3.1727990127626406 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv" ], "y": [ 0.1263583522870862, 0.44194576393482055, 0.27502092550520146, 0.3857081360309944, 0.24099232132309512, 1.7011787193373686, 0.9389838345396667, 0.2797950265648087, 3.1727990127626406 ] }, { "marker": { "color": "rgb(31, 120, 180)" }, "name": "B", "text": [ 0, 0, 0.10218138225714654, 0.04476939702245929, 0.030714532735580807, 0.047784624240428966, 0.24541213142173884, 0.0502997870530273, 0.10390901560672446 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv" ], "y": [ 0, 0, 0.10218138225714654, 0.04476939702245929, 0.030714532735580807, 0.047784624240428966, 0.24541213142173884, 0.0502997870530273, 0.10390901560672446 ] }, { "marker": { "color": "rgb(178, 223, 138)" }, "name": "TCD4", "text": [ 4.404481090599421, 2.8560931056723975, 5.887380336183737, 2.7205997217898124, 2.6721624088637532, 3.1537827994503047, 3.5193368731056647, 2.2697743015899574, 3.558871776581617 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv" ], "y": [ 4.404481090599421, 2.8560931056723975, 5.887380336183737, 2.7205997217898124, 2.6721624088637532, 3.1537827994503047, 3.5193368731056647, 2.2697743015899574, 3.558871776581617 ] }, { "marker": { "color": "rgb(51, 160, 44)" }, "name": "TCD8", "text": [ 4.169484615593472, 3.5218625572784665, 3.067415824248211, 2.9942413243954746, 3.8910465509192713, 4.453299882146847, 0.8304332817076379, 0.2577676078454985, 1.4837741546245424 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv" ], "y": [ 4.169484615593472, 3.5218625572784665, 3.067415824248211, 2.9942413243954746, 3.8910465509192713, 4.453299882146847, 0.8304332817076379, 0.2577676078454985, 1.4837741546245424 ] }, { "marker": { "color": "rgb(251, 154, 153)" }, "name": "M1", "text": [ 0.4277461004063633, 0.13828177698141805, 0.19890800159614094, 0.08608645667323953, 0.0803178035339514, 0.15926266217270818, 0.2880689615783534, 0.3269221218943977, 0.47725228361395766 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv" ], "y": [ 0.4277461004063633, 0.13828177698141805, 0.19890800159614094, 0.08608645667323953, 0.0803178035339514, 0.15926266217270818, 0.2880689615783534, 0.3269221218943977, 0.47725228361395766 ] }, { "marker": { "color": "rgb(227, 26, 28)" }, "name": "M2", "text": [ 0.19311594685888067, 0.03757649173059919, 0.08369334978216912, 0.05681697719160057, 0.0661439480011151, 0.4204523616755389, 0.019560137935990707, 0.18546352857617837, 0.1331091186794271 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv" ], "y": [ 0.19311594685888067, 0.03757649173059919, 0.08369334978216912, 0.05681697719160057, 0.0661439480011151, 0.4204523616755389, 0.019560137935990707, 0.18546352857617837, 0.1331091186794271 ] }, { "marker": { "color": "rgb(253, 191, 111)" }, "name": "Treg", "text": [ 0.009024078213789965, 0.0556131763511265, 0.028260066426471966, 0.012052074281208806, 0.03543420249152224, 0.052556193281648726, 0.03734206852594778, 0.02829088179745908, 0.019479299042123373 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv" ], "y": [ 0.009024078213789965, 0.0556131763511265, 0.028260066426471966, 0.012052074281208806, 0.03543420249152224, 0.052556193281648726, 0.03734206852594778, 0.02829088179745908, 0.019479299042123373 ] }, { "marker": { "color": "rgb(1.0, 0.4980392156862745, 0.0)" }, "name": "IMMUNE_OTHER", "text": [ 1.5954567683492522, 1.869803609487587, 1.7564712814403198, 3.19896419541581, 1.6063491683461841, 3.852525004110784, 1.1949453993694665, 0.6915542733800497, 1.795340926332853 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv" ], "y": [ 1.5954567683492522, 1.869803609487587, 1.7564712814403198, 3.19896419541581, 1.6063491683461841, 3.852525004110784, 1.1949453993694665, 0.6915542733800497, 1.795340926332853 ] }, { "marker": { "color": "rgb(202, 178, 214)" }, "name": "CANCER", "text": [ 73.62532211002868, 73.3080693550564, 68.5152019449635, 77.73330336338945, 76.70262447548536, 71.86055096289236, 66.1366887232176, 78.19422792185516, 71.31600502211866 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv" ], "y": [ 73.62532211002868, 73.3080693550564, 68.5152019449635, 77.73330336338945, 76.70262447548536, 71.86055096289236, 66.1366887232176, 78.19422792185516, 71.31600502211866 ] }, { "marker": { "color": "rgb(106, 61, 154)" }, "name": "αSMA_myCAF", "text": [ 5.089888531903868, 4.8433908307482465, 5.528227303122323, 4.869139089480771, 3.1360287273659497, 5.8044369491344945, 9.235543716457371, 3.772190534565567, 7.041281739806083 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv" ], "y": [ 5.089888531903868, 4.8433908307482465, 5.528227303122323, 4.869139089480771, 3.1360287273659497, 5.8044369491344945, 9.235543716457371, 3.772190534565567, 7.041281739806083 ] }, { "marker": { "color": "rgb(1.0, 1.0, 0.6)" }, "name": "STROMA_OTHER", "text": [ 7.826968188430753, 10.44571078738319, 11.861625449529612, 5.673310006252082, 9.218771193764127, 6.556229162277743, 13.890110642897596, 12.616375290010604, 8.93397740824535 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv" ], "y": [ 7.826968188430753, 10.44571078738319, 11.861625449529612, 5.673310006252082, 9.218771193764127, 6.556229162277743, 13.890110642897596, 12.616375290010604, 8.93397740824535 ] }, { "marker": { "color": "rgb(177, 89, 40)" }, "name": "ENDOTHELIAL", "text": [ 2.492095397489472, 2.4481579532513242, 2.668033314022932, 2.1917469128865066, 2.27236937105123, 1.9005038655176862, 3.6163613074166885, 1.2692871846197977, 1.887278897927334 ], "textposition": "auto", "type": "bar", "x": [ "DD3S1.csv", "DD3S2.csv", "DD3S3.csv", "DD4S1.csv", "DD4S2.csv", "DD4S3.csv", "DD5S1.csv", "DD5S2.csv", "DD5S3.csv" ], "y": [ 2.492095397489472, 2.4481579532513242, 2.668033314022932, 2.1917469128865066, 2.27236937105123, 1.9005038655176862, 3.6163613074166885, 1.2692871846197977, 1.887278897927334 ] } ], "layout": { "barmode": "stack", "plot_bgcolor": "white", "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "ACT_patients_Cell subtypes proportions by Sample ID and tissue type" }, "xaxis": { "autorange": true, "linecolor": "black", "range": [ -0.5, 8.5 ], "type": "category" }, "yaxis": { "autorange": true, "linecolor": "black", "range": [ 0, 105.2341254516608 ], "title": { "text": "Cell count (%)" }, "type": "linear" } } } }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "'temp-plot.html'" ] }, "execution_count": 86, "metadata": {}, "output_type": "execute_result" } ], "source": [ "fig = go.Figure()\n", "title = 'ACT_patients_Cell subtypes proportions by Sample ID and tissue type'\n", "\n", "for cell_subtype in cell_subtypes:\n", " fig.add_trace(\n", " go.Bar(\n", " name=cell_subtype,\n", " x=counts_perc['Sample_ID'],\n", " y=counts_perc[f'{cell_subtype.lower()}_perc'],\n", " text=counts_perc[f'{cell_subtype.lower()}_perc'],\n", " textposition='auto',\n", " marker_color='rgb' + str(cell_subtype_color_dict[cell_subtype])))\n", "\n", "fig.update_layout(\n", " plot_bgcolor='white',\n", " barmode='stack',\n", " xaxis=dict(linecolor='black'),\n", " title=title,\n", " yaxis=dict(title='Cell count (%)', linecolor='black')\n", ")\n", "\n", "# Enregistrer l'image\n", "output_filename = title.replace(\" \", \"_\") + \".png\"\n", "#fig.write_image(output_images_dir + \"/\" + output_filename, scale=1000)\n", "\n", "# Afficher le graphique\n", "fig.show()\n", "plot(fig)" ] }, { "cell_type": "code", "execution_count": null, "id": "cc016170-cec5-4981-b074-0cf1622a73ec", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "471b7d74-09e9-4db8-b5d8-a9e764363439", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 87, "id": "d149cb8e-6819-40f5-89ec-827ff60ff3d1", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PDL1_Cytoplasm_Intensity_AverageHLA_Cytoplasm_Intensity_AverageCKs_Cytoplasm_Intensity_AverageKi67_Nucleus_Intensity_AverageCD163_Cytoplasm_Intensity_AverageColVI_Cytoplasm_Intensity_AverageCD20_Cytoplasm_Intensity_AveragePD1_Cytoplasm_Intensity_AverageAXL_Cytoplasm_Intensity_AverageCD31_Cytoplasm_Intensity_Average...Nuc_Y_InvNucleus_RoundnessNuc_XROI_indexNucleus_SizeSample_IDimmune_checkpointCell_SizePatientUnique_ROI_index
ID
DD3S1_Cell_0-0.677863-0.417494-0.912537-0.8178760.9300990.232078-0.4831581.5356040.8073391.167755...16632.2050780.9550401484.7717290127DD3S1.csvNone3396161a
DD3S1_Cell_1-0.677863-0.516487-0.838037-0.8696851.1149240.301333-0.3447701.6683680.8754551.643023...16627.3847660.9666431426.2500000112DD3S1.csvNone3446161a
DD3S1_Cell_2-0.677863-0.141921-1.016023-0.7558790.8345770.259216-0.4382921.3363080.7050881.053636...16622.2382810.7215341531.1104740181DD3S1.csvNone4226161a
DD3S1_Cell_3-0.741282-0.460472-0.491711-0.8180840.6482000.107027-0.4448891.2498050.6607071.165861...16623.0078120.5871961518.9075930119DD3S1.csvNone2786161a
DD3S1_Cell_6-0.621521-0.247254-0.867127-0.7425440.8105790.272128-0.5071171.2514340.9471722.545301...16619.9785160.9357161471.914917047DD3S1.csvNone2046161a
..................................................................
TMA_Cell_1157550.4782750.558670-0.9628401.7322910.507434-0.9126410.3113220.8160680.5965200.090397...2663.2534180.98219615564.45800859142TMA.csvNone386c59c59a
TMA_Cell_1157560.2974180.420594-0.9716321.9669550.304365-1.1641120.866636-0.092857-0.241830-0.617835...2661.7658690.77597715629.6806645947TMA.csvNone270c59c59a
TMA_Cell_1157570.3469500.453951-0.6028931.3389560.559435-0.8013330.4470610.9881561.5678690.403878...2657.0156250.68874715518.4218755964TMA.csvNone202c59c59a
TMA_Cell_115758-0.1894150.508840-0.8860410.647980-0.227224-1.022549-0.0992560.2197550.603715-0.219145...2660.2585450.75140215539.2753915958TMA.csvNone182c59c59a
TMA_Cell_1157600.2457770.460219-1.0038400.191158-0.313127-1.1206750.004962-0.3161991.727776-0.495501...2654.2924800.67412615542.96191459106TMA.csvNone295c59c59a
\n", "

704629 rows × 39 columns

\n", "
" ], "text/plain": [ " PDL1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.677863 \n", "DD3S1_Cell_1 -0.677863 \n", "DD3S1_Cell_2 -0.677863 \n", "DD3S1_Cell_3 -0.741282 \n", "DD3S1_Cell_6 -0.621521 \n", "... ... \n", "TMA_Cell_115755 0.478275 \n", "TMA_Cell_115756 0.297418 \n", "TMA_Cell_115757 0.346950 \n", "TMA_Cell_115758 -0.189415 \n", "TMA_Cell_115760 0.245777 \n", "\n", " HLA_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.417494 \n", "DD3S1_Cell_1 -0.516487 \n", "DD3S1_Cell_2 -0.141921 \n", "DD3S1_Cell_3 -0.460472 \n", "DD3S1_Cell_6 -0.247254 \n", "... ... \n", "TMA_Cell_115755 0.558670 \n", "TMA_Cell_115756 0.420594 \n", "TMA_Cell_115757 0.453951 \n", "TMA_Cell_115758 0.508840 \n", "TMA_Cell_115760 0.460219 \n", "\n", " CKs_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.912537 \n", "DD3S1_Cell_1 -0.838037 \n", "DD3S1_Cell_2 -1.016023 \n", "DD3S1_Cell_3 -0.491711 \n", "DD3S1_Cell_6 -0.867127 \n", "... ... \n", "TMA_Cell_115755 -0.962840 \n", "TMA_Cell_115756 -0.971632 \n", "TMA_Cell_115757 -0.602893 \n", "TMA_Cell_115758 -0.886041 \n", "TMA_Cell_115760 -1.003840 \n", "\n", " Ki67_Nucleus_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.817876 \n", "DD3S1_Cell_1 -0.869685 \n", "DD3S1_Cell_2 -0.755879 \n", "DD3S1_Cell_3 -0.818084 \n", "DD3S1_Cell_6 -0.742544 \n", "... ... \n", "TMA_Cell_115755 1.732291 \n", "TMA_Cell_115756 1.966955 \n", "TMA_Cell_115757 1.338956 \n", "TMA_Cell_115758 0.647980 \n", "TMA_Cell_115760 0.191158 \n", "\n", " CD163_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.930099 \n", "DD3S1_Cell_1 1.114924 \n", "DD3S1_Cell_2 0.834577 \n", "DD3S1_Cell_3 0.648200 \n", "DD3S1_Cell_6 0.810579 \n", "... ... \n", "TMA_Cell_115755 0.507434 \n", "TMA_Cell_115756 0.304365 \n", "TMA_Cell_115757 0.559435 \n", "TMA_Cell_115758 -0.227224 \n", "TMA_Cell_115760 -0.313127 \n", "\n", " ColVI_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.232078 \n", "DD3S1_Cell_1 0.301333 \n", "DD3S1_Cell_2 0.259216 \n", "DD3S1_Cell_3 0.107027 \n", "DD3S1_Cell_6 0.272128 \n", "... ... \n", "TMA_Cell_115755 -0.912641 \n", "TMA_Cell_115756 -1.164112 \n", "TMA_Cell_115757 -0.801333 \n", "TMA_Cell_115758 -1.022549 \n", "TMA_Cell_115760 -1.120675 \n", "\n", " CD20_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 -0.483158 \n", "DD3S1_Cell_1 -0.344770 \n", "DD3S1_Cell_2 -0.438292 \n", "DD3S1_Cell_3 -0.444889 \n", "DD3S1_Cell_6 -0.507117 \n", "... ... \n", "TMA_Cell_115755 0.311322 \n", "TMA_Cell_115756 0.866636 \n", "TMA_Cell_115757 0.447061 \n", "TMA_Cell_115758 -0.099256 \n", "TMA_Cell_115760 0.004962 \n", "\n", " PD1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 1.535604 \n", "DD3S1_Cell_1 1.668368 \n", "DD3S1_Cell_2 1.336308 \n", "DD3S1_Cell_3 1.249805 \n", "DD3S1_Cell_6 1.251434 \n", "... ... \n", "TMA_Cell_115755 0.816068 \n", "TMA_Cell_115756 -0.092857 \n", "TMA_Cell_115757 0.988156 \n", "TMA_Cell_115758 0.219755 \n", "TMA_Cell_115760 -0.316199 \n", "\n", " AXL_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_0 0.807339 \n", "DD3S1_Cell_1 0.875455 \n", "DD3S1_Cell_2 0.705088 \n", "DD3S1_Cell_3 0.660707 \n", "DD3S1_Cell_6 0.947172 \n", "... ... \n", "TMA_Cell_115755 0.596520 \n", "TMA_Cell_115756 -0.241830 \n", "TMA_Cell_115757 1.567869 \n", "TMA_Cell_115758 0.603715 \n", "TMA_Cell_115760 1.727776 \n", "\n", " CD31_Cytoplasm_Intensity_Average ... Nuc_Y_Inv \\\n", "ID ... \n", "DD3S1_Cell_0 1.167755 ... 16632.205078 \n", "DD3S1_Cell_1 1.643023 ... 16627.384766 \n", "DD3S1_Cell_2 1.053636 ... 16622.238281 \n", "DD3S1_Cell_3 1.165861 ... 16623.007812 \n", "DD3S1_Cell_6 2.545301 ... 16619.978516 \n", "... ... ... ... \n", "TMA_Cell_115755 0.090397 ... 2663.253418 \n", "TMA_Cell_115756 -0.617835 ... 2661.765869 \n", "TMA_Cell_115757 0.403878 ... 2657.015625 \n", "TMA_Cell_115758 -0.219145 ... 2660.258545 \n", "TMA_Cell_115760 -0.495501 ... 2654.292480 \n", "\n", " Nucleus_Roundness Nuc_X ROI_index Nucleus_Size \\\n", "ID \n", "DD3S1_Cell_0 0.955040 1484.771729 0 127 \n", "DD3S1_Cell_1 0.966643 1426.250000 0 112 \n", "DD3S1_Cell_2 0.721534 1531.110474 0 181 \n", "DD3S1_Cell_3 0.587196 1518.907593 0 119 \n", "DD3S1_Cell_6 0.935716 1471.914917 0 47 \n", "... ... ... ... ... \n", "TMA_Cell_115755 0.982196 15564.458008 59 142 \n", "TMA_Cell_115756 0.775977 15629.680664 59 47 \n", "TMA_Cell_115757 0.688747 15518.421875 59 64 \n", "TMA_Cell_115758 0.751402 15539.275391 59 58 \n", "TMA_Cell_115760 0.674126 15542.961914 59 106 \n", "\n", " Sample_ID immune_checkpoint Cell_Size Patient \\\n", "ID \n", "DD3S1_Cell_0 DD3S1.csv None 339 61 \n", "DD3S1_Cell_1 DD3S1.csv None 344 61 \n", "DD3S1_Cell_2 DD3S1.csv None 422 61 \n", "DD3S1_Cell_3 DD3S1.csv None 278 61 \n", "DD3S1_Cell_6 DD3S1.csv None 204 61 \n", "... ... ... ... ... \n", "TMA_Cell_115755 TMA.csv None 386 c59 \n", "TMA_Cell_115756 TMA.csv None 270 c59 \n", "TMA_Cell_115757 TMA.csv None 202 c59 \n", "TMA_Cell_115758 TMA.csv None 182 c59 \n", "TMA_Cell_115760 TMA.csv None 295 c59 \n", "\n", " Unique_ROI_index \n", "ID \n", "DD3S1_Cell_0 61a \n", "DD3S1_Cell_1 61a \n", "DD3S1_Cell_2 61a \n", "DD3S1_Cell_3 61a \n", "DD3S1_Cell_6 61a \n", "... ... \n", "TMA_Cell_115755 c59a \n", "TMA_Cell_115756 c59a \n", "TMA_Cell_115757 c59a \n", "TMA_Cell_115758 c59a \n", "TMA_Cell_115760 c59a \n", "\n", "[704629 rows x 39 columns]" ] }, "execution_count": 87, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df1" ] }, { "cell_type": "markdown", "id": "1f7aeca8-71f4-44fc-b869-d93911a13167", "metadata": {}, "source": [ "## RATIO M2/M1" ] }, { "cell_type": "code", "execution_count": 88, "id": "89bf3e70-3862-408b-a898-54a7c7da47be", "metadata": {}, "outputs": [], "source": [ "# Filtrer les lignes correspondant aux cellules M1 et M2 pour les patients NACT\n", "df_M1_NACT = df[(df['cell_subtype'] == 'M1') & df['Patient'].isin(num_NACT_patients)]\n", "df_M2_NACT = df[(df['cell_subtype'] == 'M2') & df['Patient'].isin(num_NACT_patients)]\n", "\n", "# Filtrer les lignes correspondant aux cellules M1 et M2 pour les patients ACT\n", "df_M1_ACT = df[(df['cell_subtype'] == 'M1') & df['Patient'].isin(num_ACT_patients)]\n", "df_M2_ACT = df[(df['cell_subtype'] == 'M2') & df['Patient'].isin(num_ACT_patients)]" ] }, { "cell_type": "code", "execution_count": 89, "id": "e474111d-be52-49f6-8543-1d407ec612af", "metadata": {}, "outputs": [], "source": [ "# Regrouper les données par patient et calculer le total de cellules M1 et M2 pour les patients NACT\n", "result_M1_NACT = df_M1_NACT.groupby('Patient').size().rename('total_M1_cells')\n", "result_M2_NACT = df_M2_NACT.groupby('Patient').size().rename('total_M2_cells')\n", "\n", "# Regrouper les données par patient et calculer le total de cellules M1 et M2 pour les patients ACT\n", "result_M1_ACT = df_M1_ACT.groupby('Patient').size().rename('total_M1_cells')\n", "result_M2_ACT = df_M2_ACT.groupby('Patient').size().rename('total_M2_cells')" ] }, { "cell_type": "code", "execution_count": 90, "id": "79c6b7fd-d9c8-475b-badd-734ab73733ed", "metadata": {}, "outputs": [], "source": [ "# Créer le DataFrame résultant avec Patient comme index pour les patients NACT\n", "result_NACT = pd.concat([result_M1_NACT, result_M2_NACT], axis=1, sort=False).fillna(0)\n", "\n", "# Créer le DataFrame résultant avec Patient comme index pour les patients ACT\n", "result_ACT = pd.concat([result_M1_ACT, result_M2_ACT], axis=1, sort=False).fillna(0)" ] }, { "cell_type": "code", "execution_count": 91, "id": "076cc0b8-e874-4fdb-9481-b2e3655d12e7", "metadata": {}, "outputs": [], "source": [ "# Ajouter une colonne pour le ratio de M2/M1 pour les patients NACT\n", "result_NACT['M2_M1_ratio'] = result_NACT['total_M2_cells'] / result_NACT['total_M1_cells']\n", "result_NACT['Treatment_Type'] = 'NACT' # Ajouter une colonne pour indiquer le traitement\n", "\n", "# Ajouter une colonne pour le ratio de M2/M1 pour les patients ACT\n", "result_ACT['M2_M1_ratio'] = result_ACT['total_M2_cells'] / result_ACT['total_M1_cells']\n", "result_ACT['Treatment_Type'] = 'ACT' # Ajouter une colonne pour indiquer le traitement" ] }, { "cell_type": "code", "execution_count": 92, "id": "d37f1727-7136-49a5-b563-07c7a7281379", "metadata": {}, "outputs": [], "source": [ "# Regrouper les données par patient et calculer le total de cellules M1 et M2 pour les patients NACT\n", "result_M1_NACT = df_M1_NACT.groupby('Patient').size().rename('total_M1_cells')\n", "result_M2_NACT = df_M2_NACT.groupby('Patient').size().rename('total_M2_cells')\n", "\n", "# Regrouper les données par patient et calculer le total de cellules M1 et M2 pour les patients ACT\n", "result_M1_ACT = df_M1_ACT.groupby('Patient').size().rename('total_M1_cells')\n", "result_M2_ACT = df_M2_ACT.groupby('Patient').size().rename('total_M2_cells')" ] }, { "cell_type": "code", "execution_count": 93, "id": "2b7dcdd6-e409-4295-ad02-25143ab87ff3", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
total_M1_cellstotal_M2_cellsM2_M1_ratioTreatment_Type
Patient
10167.0100.00.598802ACT
1013.01.00.333333ACT
1025.01.00.200000ACT
1037.00.00.000000ACT
1053.03.01.000000ACT
...............
340.02.0infACT
450.03.0infACT
710.016.0infACT
720.01.0infACT
90.01.0infACT
\n", "

103 rows × 4 columns

\n", "
" ], "text/plain": [ " total_M1_cells total_M2_cells M2_M1_ratio Treatment_Type\n", "Patient \n", "10 167.0 100.0 0.598802 ACT\n", "101 3.0 1.0 0.333333 ACT\n", "102 5.0 1.0 0.200000 ACT\n", "103 7.0 0.0 0.000000 ACT\n", "105 3.0 3.0 1.000000 ACT\n", "... ... ... ... ...\n", "34 0.0 2.0 inf ACT\n", "45 0.0 3.0 inf ACT\n", "71 0.0 16.0 inf ACT\n", "72 0.0 1.0 inf ACT\n", "9 0.0 1.0 inf ACT\n", "\n", "[103 rows x 4 columns]" ] }, "execution_count": 93, "metadata": {}, "output_type": "execute_result" } ], "source": [ "result_ACT" ] }, { "cell_type": "code", "execution_count": 94, "id": "09a86c99-e546-4c9a-81ae-5b77ed419fae", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
total_M1_cellstotal_M2_cellsM2_M1_ratioTreatment_Type
Patient
1041.02.02.000000NACT
11110.03.00.300000NACT
1193.00.00.000000NACT
1214.00.00.000000NACT
1371.01.01.000000NACT
140307.038.00.123779NACT
14110.01.00.100000NACT
1461.02.02.000000NACT
149275.03.00.010909NACT
157.01.00.142857NACT
15361.014.00.229508NACT
1572.07.03.500000NACT
1621.00.00.000000NACT
1691.00.00.000000NACT
17125.01.00.040000NACT
1741.00.00.000000NACT
1771.00.00.000000NACT
181.00.00.000000NACT
18413.011.00.846154NACT
1872.08.04.000000NACT
3252.015.00.288462NACT
401.00.00.000000NACT
578.06.00.076923NACT
511.00.00.000000NACT
614.019.04.750000NACT
8541.016.00.390244NACT
8922.08.00.363636NACT
955.044.08.800000NACT
9873.070.00.958904NACT
1820.03.0infNACT
1830.01.0infNACT
\n", "
" ], "text/plain": [ " total_M1_cells total_M2_cells M2_M1_ratio Treatment_Type\n", "Patient \n", "104 1.0 2.0 2.000000 NACT\n", "111 10.0 3.0 0.300000 NACT\n", "119 3.0 0.0 0.000000 NACT\n", "121 4.0 0.0 0.000000 NACT\n", "137 1.0 1.0 1.000000 NACT\n", "140 307.0 38.0 0.123779 NACT\n", "141 10.0 1.0 0.100000 NACT\n", "146 1.0 2.0 2.000000 NACT\n", "149 275.0 3.0 0.010909 NACT\n", "15 7.0 1.0 0.142857 NACT\n", "153 61.0 14.0 0.229508 NACT\n", "157 2.0 7.0 3.500000 NACT\n", "162 1.0 0.0 0.000000 NACT\n", "169 1.0 0.0 0.000000 NACT\n", "171 25.0 1.0 0.040000 NACT\n", "174 1.0 0.0 0.000000 NACT\n", "177 1.0 0.0 0.000000 NACT\n", "18 1.0 0.0 0.000000 NACT\n", "184 13.0 11.0 0.846154 NACT\n", "187 2.0 8.0 4.000000 NACT\n", "32 52.0 15.0 0.288462 NACT\n", "40 1.0 0.0 0.000000 NACT\n", "5 78.0 6.0 0.076923 NACT\n", "51 1.0 0.0 0.000000 NACT\n", "61 4.0 19.0 4.750000 NACT\n", "85 41.0 16.0 0.390244 NACT\n", "89 22.0 8.0 0.363636 NACT\n", "95 5.0 44.0 8.800000 NACT\n", "98 73.0 70.0 0.958904 NACT\n", "182 0.0 3.0 inf NACT\n", "183 0.0 1.0 inf NACT" ] }, "execution_count": 94, "metadata": {}, "output_type": "execute_result" } ], "source": [ "result_NACT" ] }, { "cell_type": "code", "execution_count": null, "id": "1def865f-3d17-4bf2-ab48-8a87cc564f58", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 95, "id": "f9acacbe-4654-45c4-86cf-a4d840f1f65f", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
total_M1_cellstotal_M2_cellsM2_M1_ratioTreatment_Type
Patient
10167.0100.00.598802ACT
1000.03.0infACT
1013.01.00.333333ACT
1025.01.00.200000ACT
1037.00.00.000000ACT
...............
923.025.08.333333ACT
955.044.08.800000NACT
962.01.00.500000ACT
9873.070.00.958904NACT
995.05.01.000000ACT
\n", "

134 rows × 4 columns

\n", "
" ], "text/plain": [ " total_M1_cells total_M2_cells M2_M1_ratio Treatment_Type\n", "Patient \n", "10 167.0 100.0 0.598802 ACT\n", "100 0.0 3.0 inf ACT\n", "101 3.0 1.0 0.333333 ACT\n", "102 5.0 1.0 0.200000 ACT\n", "103 7.0 0.0 0.000000 ACT\n", "... ... ... ... ...\n", "92 3.0 25.0 8.333333 ACT\n", "95 5.0 44.0 8.800000 NACT\n", "96 2.0 1.0 0.500000 ACT\n", "98 73.0 70.0 0.958904 NACT\n", "99 5.0 5.0 1.000000 ACT\n", "\n", "[134 rows x 4 columns]" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Concaténer les résultats pour obtenir le DataFrame final\n", "result_final = pd.concat([result_NACT, result_ACT])\n", "\n", "# Trier le DataFrame par index\n", "result_sorted = result_final.sort_index()\n", "\n", "# Définir l'option pour afficher toutes les lignes du DataFrame\n", "#pd.set_option('display.max_rows', None)\n", "\n", "display(result_sorted)" ] }, { "cell_type": "code", "execution_count": 96, "id": "492238f5-352d-412e-a960-166b0ea6808b", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
total_M1_cellstotal_M2_cellsM2_M1_ratioTreatment_Type
Patient
10167.0100.00.598802ACT
1000.03.0infACT
1013.01.00.333333ACT
1025.01.00.200000ACT
1037.00.00.000000ACT
...............
923.025.08.333333ACT
955.044.08.800000NACT
962.01.00.500000ACT
9873.070.00.958904NACT
995.05.01.000000ACT
\n", "

134 rows × 4 columns

\n", "
" ], "text/plain": [ " total_M1_cells total_M2_cells M2_M1_ratio Treatment_Type\n", "Patient \n", "10 167.0 100.0 0.598802 ACT\n", "100 0.0 3.0 inf ACT\n", "101 3.0 1.0 0.333333 ACT\n", "102 5.0 1.0 0.200000 ACT\n", "103 7.0 0.0 0.000000 ACT\n", "... ... ... ... ...\n", "92 3.0 25.0 8.333333 ACT\n", "95 5.0 44.0 8.800000 NACT\n", "96 2.0 1.0 0.500000 ACT\n", "98 73.0 70.0 0.958904 NACT\n", "99 5.0 5.0 1.000000 ACT\n", "\n", "[134 rows x 4 columns]" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Remplacer les valeurs négatives du ratio M2/M1 par 0\n", "#result_sorted['M2_M1_ratio'] = result_sorted['M2_M1_ratio'].clip(lower=0)\n", "\n", "#result_sorted['M2_M1_ratio'] = result_sorted['M2_M1_ratio'].replace([-float('inf'), float('inf')], 0)\n", "#result_sorted['M2_M1_ratio'] = result_sorted['M2_M1_ratio'].apply(lambda x: 0 if x < 0 else x)\n", "\n", "# Définir l'option pour afficher toutes les lignes du DataFrame\n", "#pd.set_option('display.max_rows', None)\n", "\n", "display(result_sorted)" ] }, { "cell_type": "code", "execution_count": 97, "id": "b873bac3-4490-4fcf-b964-6073acd2b5f5", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "box": { "visible": true }, "customdata": [ [ 167, 100 ], [ 0, 3 ], [ 3, 1 ], [ 5, 1 ], [ 7, 0 ], [ 1, 2 ], [ 3, 3 ], [ 2, 0 ], [ 1, 0 ], [ 7, 16 ], [ 1, 3 ], [ 10, 3 ], [ 5, 2 ], [ 12, 3 ], [ 0, 1 ], [ 3, 0 ], [ 2, 0 ], [ 0, 1 ], [ 4, 0 ], [ 0, 1 ], [ 1, 0 ], [ 1, 3 ], [ 2, 3 ], [ 0, 1 ], [ 1, 0 ], [ 0, 1 ], [ 1, 3 ], [ 1, 1 ], [ 2, 2 ], [ 240, 3 ], [ 3, 0 ], [ 1, 1 ], [ 1, 4 ], [ 2, 1 ], [ 307, 38 ], [ 10, 1 ], [ 2, 0 ], [ 6, 2 ], [ 1, 2 ], [ 1, 2 ], [ 275, 3 ], [ 7, 1 ], [ 21, 1 ], [ 61, 14 ], [ 1, 0 ], [ 0, 1 ], [ 2, 7 ], [ 0, 3 ], [ 8, 5 ], [ 1, 0 ], [ 4, 2 ], [ 7, 0 ], [ 2, 1 ], [ 0, 4 ], [ 1, 0 ], [ 2, 0 ], [ 0, 5 ], [ 25, 1 ], [ 71, 1 ], [ 1, 0 ], [ 14, 0 ], [ 1, 0 ], [ 1, 0 ], [ 12, 67 ], [ 2, 0 ], [ 0, 3 ], [ 0, 1 ], [ 13, 11 ], [ 0, 2 ], [ 18, 5 ], [ 2, 8 ], [ 3, 0 ], [ 70, 1 ], [ 0, 3 ], [ 1, 0 ], [ 0, 2 ], [ 3, 2 ], [ 1, 0 ], [ 101, 3 ], [ 3, 0 ], [ 52, 15 ], [ 0, 1 ], [ 0, 2 ], [ 26, 13 ], [ 1, 0 ], [ 4, 4 ], [ 1, 4 ], [ 1, 0 ], [ 50, 12 ], [ 0, 3 ], [ 3, 0 ], [ 1, 0 ], [ 78, 6 ], [ 5, 0 ], [ 1, 0 ], [ 25, 1 ], [ 3, 2 ], [ 3, 7 ], [ 2, 0 ], [ 17, 6 ], [ 1, 5 ], [ 9, 16 ], [ 4, 19 ], [ 3, 15 ], [ 3, 1 ], [ 5, 0 ], [ 1, 31 ], [ 12, 5 ], [ 2, 0 ], [ 4, 2 ], [ 14, 32 ], [ 0, 16 ], [ 0, 1 ], [ 14, 17 ], [ 1, 4 ], [ 4, 4 ], [ 5, 1 ], [ 6, 8 ], [ 29, 52 ], [ 3, 8 ], [ 2, 1 ], [ 4, 1 ], [ 41, 16 ], [ 6, 31 ], [ 1, 3 ], [ 22, 8 ], [ 0, 1 ], [ 4, 13 ], [ 2, 22 ], [ 3, 25 ], [ 5, 44 ], [ 2, 1 ], [ 73, 70 ], [ 5, 5 ] ], "hovertemplate": "Treatment_Type=%{x}
M2_M1_ratio=%{y}
total_M1_cells=%{customdata[0]}
total_M2_cells=%{customdata[1]}", "legendgroup": "", "marker": { "color": "#636efa" }, "name": "", "offsetgroup": "", "orientation": "v", "scalegroup": "True", "showlegend": false, "type": "violin", "x": [ "ACT", "ACT", "ACT", "ACT", "ACT", "NACT", "ACT", "ACT", "ACT", "ACT", "ACT", "NACT", "ACT", "ACT", "ACT", "NACT", "ACT", "ACT", "NACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "NACT", "ACT", "ACT", "NACT", "NACT", "ACT", "ACT", "NACT", "ACT", "NACT", "NACT", "ACT", "NACT", "ACT", "ACT", "NACT", "ACT", "ACT", "NACT", "ACT", "ACT", "ACT", "ACT", "NACT", "ACT", "ACT", "NACT", "ACT", "NACT", "ACT", "NACT", "NACT", "ACT", "ACT", "NACT", "NACT", "NACT", "ACT", "ACT", "NACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "NACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "NACT", "ACT", "ACT", "ACT", "ACT", "NACT", "ACT", "NACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "NACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "NACT", "ACT", "ACT", "NACT", "ACT", "ACT", "ACT", "ACT", "NACT", "ACT", "NACT", "ACT" ], "x0": " ", "xaxis": "x", "y": [ 0.5988023952095808, null, 0.3333333333333333, 0.2, 0, 2, 1, 0, 0, 2.2857142857142856, 3, 0.3, 0.4, 0.25, null, 0, 0, null, 0, null, 0, 3, 1.5, null, 0, null, 3, 1, 1, 0.0125, 0, 1, 4, 0.5, 0.1237785016286645, 0.1, 0, 0.3333333333333333, 2, 2, 0.01090909090909091, 0.14285714285714285, 0.047619047619047616, 0.22950819672131148, 0, null, 3.5, null, 0.625, 0, 0.5, 0, 0.5, null, 0, 0, null, 0.04, 0.014084507042253521, 0, 0, 0, 0, 5.583333333333333, 0, null, null, 0.8461538461538461, null, 0.2777777777777778, 4, 0, 0.014285714285714285, null, 0, null, 0.6666666666666666, 0, 0.0297029702970297, 0, 0.28846153846153844, null, null, 0.5, 0, 1, 4, 0, 0.24, null, 0, 0, 0.07692307692307693, 0, 0, 0.04, 0.6666666666666666, 2.3333333333333335, 0, 0.35294117647058826, 5, 1.7777777777777777, 4.75, 5, 0.3333333333333333, 0, 31, 0.4166666666666667, 0, 0.5, 2.2857142857142856, null, null, 1.2142857142857142, 4, 1, 0.2, 1.3333333333333333, 1.793103448275862, 2.6666666666666665, 0.5, 0.25, 0.3902439024390244, 5.166666666666667, 3, 0.36363636363636365, null, 3.25, 11, 8.333333333333334, 8.8, 0.5, 0.958904109589041, 1 ], "y0": " ", "yaxis": "y" } ], "layout": { "legend": { "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Violin Plot du Ratio M2/M1 en fonction du Traitement" }, "violinmode": "group", "xaxis": { "anchor": "y", "autorange": true, "domain": [ 0, 1 ], "range": [ -0.5, 1.5 ], "title": { "text": "Traitement" }, "type": "category" }, "yaxis": { "anchor": "x", "autorange": true, "domain": [ 0, 1 ], "range": [ -3.0062104703092807, 34.00621047030928 ], "title": { "text": "Ratio M2/M1" }, "type": "linear" } } } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Créer le violin plot avec des points individuels\n", "fig = px.violin(result_sorted, x='Treatment_Type', y='M2_M1_ratio', \n", " box=True, hover_data=result_sorted.columns)\n", "\n", "# Afficher le violin plot\n", "fig.update_layout(title=f'Violin Plot du Ratio M2/M1 en fonction du Traitement',\n", " xaxis_title='Traitement', yaxis_title='Ratio M2/M1')\n", "\n", "\n", "fig.show()\n", "plot(fig)\n", "import plotly.io as pio\n", "#pio.write_image(fig, 'Violinplot_ratio_M2_M1.png')" ] }, { "cell_type": "code", "execution_count": null, "id": "06291b29-7ce3-4629-a0d6-c301afeced76", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "67d75d80-d22e-40b9-9992-958d1d33b3bc", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "42cb23d6-bcbc-4069-94ad-fd4c385a5a51", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "raw", "id": "3b69fd7a-9b2f-4989-ab52-73aadbcb1d3e", "metadata": {}, "source": [ "Chercher parmis cellules cancer express B7H4" ] }, { "cell_type": "code", "execution_count": 98, "id": "4bea449b-6a2c-4ae5-a65f-29f5ec0ee85b", "metadata": {}, "outputs": [], "source": [ "# Filtrer les lignes correspondant aux cellules CANCER B7H4/PDL1 pour les patients NACT\n", "df_B7H4_NACT = df[(df['immune_checkpoint'] == 'B7H4') & df['Patient'].isin(num_NACT_patients) & (df['cell_type'] == 'CANCER')]\n", "df_PDL1_NACT = df[(df['immune_checkpoint'] == 'PDL1') & df['Patient'].isin(num_NACT_patients) & ((df['cell_type'] == 'CANCER') | (df['cell_type'] == 'IMMUNE'))]\n", "\n", "# Filtrer les lignes correspondant aux cellules CANCER B7H4/PDL1 pour les patients ACT\n", "df_B7H4_ACT = df[(df['immune_checkpoint'] == 'B7H4') & df['Patient'].isin(num_ACT_patients) & (df['cell_type'] == 'CANCER')]\n", "df_PDL1_ACT = df[(df['immune_checkpoint'] == 'PDL1') & df['Patient'].isin(num_ACT_patients) & ((df['cell_type'] == 'CANCER') | (df['cell_type'] == 'IMMUNE'))]\n" ] }, { "cell_type": "code", "execution_count": 99, "id": "22682aac-310a-419e-b5e5-0ab5e51cf234", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "(10827, 40)\n", "(1229, 40)\n", "(32646, 40)\n", "(5434, 40)\n" ] } ], "source": [ "#pd.set_option('display.max_rows', None)\n", "print(df_B7H4_NACT.shape)\n", "print(df_PDL1_NACT.shape)\n", "\n", "print(df_B7H4_ACT.shape)\n", "print(df_PDL1_ACT.shape)" ] }, { "cell_type": "raw", "id": "93b1f3f3-d201-43cc-b593-c9b769232501", "metadata": {}, "source": [ "# Filtrer les lignes correspondant aux cellules CANCER B7H4/PDL1 pour les patients NACT\n", "df_B7H4_NACT = df[(df['immune_checkpoint'] == 'B7H4') & df['Patient'].isin(num_NACT_patients) & (df['cell_type'] == 'CANCER')]\n", "df_PDL1_NACT = df[(df['immune_checkpoint'] == 'PDL1') & df['Patient'].isin(num_NACT_patients) & (df['cell_type'] == 'CANCER')]\n", "\n", "# Filtrer les lignes correspondant aux cellules CANCER B7H4/PDL1 pour les patients ACT\n", "df_B7H4_ACT = df[(df['immune_checkpoint'] == 'B7H4') & df['Patient'].isin(num_ACT_patients) & (df['cell_type'] == 'CANCER')]\n", "df_PDL1_ACT = df[(df['immune_checkpoint'] == 'PDL1') & df['Patient'].isin(num_ACT_patients) & (df['cell_type'] == 'CANCER')]\n" ] }, { "cell_type": "raw", "id": "821010a8-b0f4-4f40-9ea1-2a54337b22a3", "metadata": {}, "source": [ "#pd.set_option('display.max_rows', None)\n", "print(df_B7H4_NACT.shape)\n", "print(df_PDL1_NACT.shape)\n", "\n", "print(df_B7H4_ACT.shape)\n", "print(df_PDL1_ACT.shape)\n" ] }, { "cell_type": "code", "execution_count": 100, "id": "2d0a55fe-70ac-4b4c-b5db-65bd9cf1a525", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PDL1_Cytoplasm_Intensity_AverageHLA_Cytoplasm_Intensity_AverageCKs_Cytoplasm_Intensity_AverageKi67_Nucleus_Intensity_AverageCD163_Cytoplasm_Intensity_AverageColVI_Cytoplasm_Intensity_AverageCD20_Cytoplasm_Intensity_AveragePD1_Cytoplasm_Intensity_AverageAXL_Cytoplasm_Intensity_AverageCD31_Cytoplasm_Intensity_Average...Nucleus_RoundnessNuc_XROI_indexNucleus_SizeSample_IDimmune_checkpointCell_SizePatientUnique_ROI_indexPrimary_chem(1)_vs_surg(0)
ID
DD3S1_Cell_218281.6097922.5216150.2230231.0841660.338872-1.1123271.3746370.236768-0.450948-0.132787...0.8680003246.4506841191DD3S1.csvPDL12203232a1.0
DD3S1_Cell_218311.5906082.4937210.2317410.2515241.185084-1.2037951.610041-0.700345-0.673078-0.641906...0.5807562951.7856451170DD3S1.csvPDL11533232a1.0
DD3S1_Cell_219371.6112302.1895880.5586930.2493370.313269-1.2485141.501920-0.669547-0.781676-0.848153...0.8291053137.49511711101DD3S1.csvPDL12003232a1.0
DD3S1_Cell_219391.6309442.690321-0.1857651.2589370.552631-1.2235851.519502-0.700822-0.721136-0.785331...0.9256493217.1313481199DD3S1.csvPDL11833232a1.0
DD3S1_Cell_219591.5178872.7190760.000214-0.0395370.431631-1.2575831.471392-0.863404-0.803700-0.732914...0.7772692996.02856411105DD3S1.csvPDL11543232a1.0
\n", "

5 rows × 40 columns

\n", "
" ], "text/plain": [ " PDL1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_21828 1.609792 \n", "DD3S1_Cell_21831 1.590608 \n", "DD3S1_Cell_21937 1.611230 \n", "DD3S1_Cell_21939 1.630944 \n", "DD3S1_Cell_21959 1.517887 \n", "\n", " HLA_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_21828 2.521615 \n", "DD3S1_Cell_21831 2.493721 \n", "DD3S1_Cell_21937 2.189588 \n", "DD3S1_Cell_21939 2.690321 \n", "DD3S1_Cell_21959 2.719076 \n", "\n", " CKs_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_21828 0.223023 \n", "DD3S1_Cell_21831 0.231741 \n", "DD3S1_Cell_21937 0.558693 \n", "DD3S1_Cell_21939 -0.185765 \n", "DD3S1_Cell_21959 0.000214 \n", "\n", " Ki67_Nucleus_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_21828 1.084166 \n", "DD3S1_Cell_21831 0.251524 \n", "DD3S1_Cell_21937 0.249337 \n", "DD3S1_Cell_21939 1.258937 \n", "DD3S1_Cell_21959 -0.039537 \n", "\n", " CD163_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_21828 0.338872 \n", "DD3S1_Cell_21831 1.185084 \n", "DD3S1_Cell_21937 0.313269 \n", "DD3S1_Cell_21939 0.552631 \n", "DD3S1_Cell_21959 0.431631 \n", "\n", " ColVI_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_21828 -1.112327 \n", "DD3S1_Cell_21831 -1.203795 \n", "DD3S1_Cell_21937 -1.248514 \n", "DD3S1_Cell_21939 -1.223585 \n", "DD3S1_Cell_21959 -1.257583 \n", "\n", " CD20_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_21828 1.374637 \n", "DD3S1_Cell_21831 1.610041 \n", "DD3S1_Cell_21937 1.501920 \n", "DD3S1_Cell_21939 1.519502 \n", "DD3S1_Cell_21959 1.471392 \n", "\n", " PD1_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_21828 0.236768 \n", "DD3S1_Cell_21831 -0.700345 \n", "DD3S1_Cell_21937 -0.669547 \n", "DD3S1_Cell_21939 -0.700822 \n", "DD3S1_Cell_21959 -0.863404 \n", "\n", " AXL_Cytoplasm_Intensity_Average \\\n", "ID \n", "DD3S1_Cell_21828 -0.450948 \n", "DD3S1_Cell_21831 -0.673078 \n", "DD3S1_Cell_21937 -0.781676 \n", "DD3S1_Cell_21939 -0.721136 \n", "DD3S1_Cell_21959 -0.803700 \n", "\n", " CD31_Cytoplasm_Intensity_Average ... Nucleus_Roundness \\\n", "ID ... \n", "DD3S1_Cell_21828 -0.132787 ... 0.868000 \n", "DD3S1_Cell_21831 -0.641906 ... 0.580756 \n", "DD3S1_Cell_21937 -0.848153 ... 0.829105 \n", "DD3S1_Cell_21939 -0.785331 ... 0.925649 \n", "DD3S1_Cell_21959 -0.732914 ... 0.777269 \n", "\n", " Nuc_X ROI_index Nucleus_Size Sample_ID \\\n", "ID \n", "DD3S1_Cell_21828 3246.450684 11 91 DD3S1.csv \n", "DD3S1_Cell_21831 2951.785645 11 70 DD3S1.csv \n", "DD3S1_Cell_21937 3137.495117 11 101 DD3S1.csv \n", "DD3S1_Cell_21939 3217.131348 11 99 DD3S1.csv \n", "DD3S1_Cell_21959 2996.028564 11 105 DD3S1.csv \n", "\n", " immune_checkpoint Cell_Size Patient Unique_ROI_index \\\n", "ID \n", "DD3S1_Cell_21828 PDL1 220 32 32a \n", "DD3S1_Cell_21831 PDL1 153 32 32a \n", "DD3S1_Cell_21937 PDL1 200 32 32a \n", "DD3S1_Cell_21939 PDL1 183 32 32a \n", "DD3S1_Cell_21959 PDL1 154 32 32a \n", "\n", " Primary_chem(1)_vs_surg(0) \n", "ID \n", "DD3S1_Cell_21828 1.0 \n", "DD3S1_Cell_21831 1.0 \n", "DD3S1_Cell_21937 1.0 \n", "DD3S1_Cell_21939 1.0 \n", "DD3S1_Cell_21959 1.0 \n", "\n", "[5 rows x 40 columns]" ] }, "execution_count": 100, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df_PDL1_NACT.head()" ] }, { "cell_type": "code", "execution_count": 101, "id": "8b4bb2f2-baa7-4b68-a04c-d3ad2c26eeb0", "metadata": {}, "outputs": [], "source": [ "# Regrouper les données par patient et calculer le total de cellules B7H4 et PDL1 pour les patients NACT\n", "result_B7H4_NACT = df_B7H4_NACT.groupby('Patient').size().rename('B7H4_cells')\n", "result_PDL1_NACT = df_PDL1_NACT.groupby('Patient').size().rename('PDL1_cells')\n", "\n", "# Regrouper les données par patient et calculer le total de cellules B7H4 et PDL1 pour les patients ACT\n", "result_B7H4_ACT = df_B7H4_ACT.groupby('Patient').size().rename('B7H4_cells')\n", "result_PDL1_ACT = df_PDL1_ACT.groupby('Patient').size().rename('PDL1_cells')" ] }, { "cell_type": "code", "execution_count": 102, "id": "58019f7b-1ac3-481f-b878-86353d38d833", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Patient\n", "104 20\n", "111 1\n", "116 3\n", "119 18\n", "121 4\n", "137 4\n", "140 3\n", "141 2\n", "149 1\n", "15 6\n", "153 30\n", "157 7\n", "160 198\n", "162 5\n", "169 12\n", "171 1\n", "178 6\n", "18 307\n", "182 46\n", "183 2\n", "184 3\n", "187 7\n", "26 19\n", "32 126\n", "5 34\n", "61 18\n", "7 6\n", "85 9\n", "89 5\n", "95 23\n", "98 303\n", "Name: PDL1_cells, dtype: int64" ] }, "execution_count": 102, "metadata": {}, "output_type": "execute_result" } ], "source": [ "result_PDL1_NACT" ] }, { "cell_type": "code", "execution_count": 103, "id": "54c9bc84-f96c-4ea9-a5b1-c7d3240ca507", "metadata": {}, "outputs": [], "source": [ "# Créer le DataFrame résultant avec Patient comme index pour les patients NACT\n", "result_NACT = pd.concat([result_B7H4_NACT, result_PDL1_NACT], axis=1, sort=False).fillna(0)\n", "\n", "# Créer le DataFrame résultant avec Patient comme index pour les patients ACT\n", "result_ACT = pd.concat([result_B7H4_ACT, result_PDL1_ACT], axis=1, sort=False).fillna(0)" ] }, { "cell_type": "code", "execution_count": 104, "id": "f004e2a0-34c0-43ff-859e-e115e0582f7e", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
B7H4_cellsPDL1_cells
Patient
11135.01.0
11624.03.0
1192151.018.0
1212361.04.0
13725.04.0
\n", "
" ], "text/plain": [ " B7H4_cells PDL1_cells\n", "Patient \n", "111 35.0 1.0\n", "116 24.0 3.0\n", "119 2151.0 18.0\n", "121 2361.0 4.0\n", "137 25.0 4.0" ] }, "execution_count": 104, "metadata": {}, "output_type": "execute_result" } ], "source": [ "result_NACT.head()\n" ] }, { "cell_type": "code", "execution_count": 105, "id": "43bc13d1-bb0b-4116-9796-8d4fd8f3d17c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "66353" ] }, "execution_count": 105, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(df_NACT[df_NACT['cell_type'] == 'CANCER'])\n" ] }, { "cell_type": "code", "execution_count": 106, "id": "f4409dc4-7053-4bcf-bbb2-9239090f5cab", "metadata": {}, "outputs": [], "source": [ "# pour les patients NACT\n", "result_NACT['%_B7H4'] = result_NACT['B7H4_cells'] / len(df_NACT[df_NACT['cell_type'] == 'CANCER'])\n", "result_NACT['%_PDL1'] = result_NACT['PDL1_cells'] / len(df_NACT[(df_NACT['cell_type'] == 'CANCER') | (df_NACT['cell_type'] == 'IMMUNE')])\n", "result_NACT['Treatment_Type'] = 'NACT' # Ajouter une colonne pour indiquer le traitement\n", "\n", "# pour le ratio de M2/M1 pour les patients ACT\n", "result_ACT['%_B7H4'] = result_ACT['B7H4_cells'] / len(df_ACT[df_ACT['cell_type'] == 'CANCER'])\n", "result_ACT['%_PDL1'] = result_ACT['PDL1_cells'] / len(df_ACT[(df_ACT['cell_type'] == 'CANCER') | (df_ACT['cell_type'] == 'IMMUNE')])\n", "result_ACT['Treatment_Type'] = 'ACT' # Ajouter une colonne pour indiquer le traitement" ] }, { "cell_type": "code", "execution_count": 107, "id": "387e6ee3-c71a-4157-a538-79c0260b92f9", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "80124" ] }, "execution_count": 107, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(df_NACT[(df_NACT['cell_type'] == 'CANCER') | (df_NACT['cell_type'] == 'IMMUNE')])" ] }, { "cell_type": "code", "execution_count": 108, "id": "50f2ce62-fa9a-4560-ae82-2e99b5a6e3b8", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
B7H4_cellsPDL1_cells%_B7H4%_PDL1Treatment_Type
Patient
11135.01.00.0005270.000012NACT
11624.03.00.0003620.000037NACT
1192151.018.00.0324180.000225NACT
1212361.04.00.0355820.000050NACT
13725.04.00.0003770.000050NACT
14671.00.00.0010700.000000NACT
149281.01.00.0042350.000012NACT
151008.06.00.0151910.000075NACT
1539.030.00.0001360.000374NACT
1572.07.00.0000300.000087NACT
1601.0198.00.0000150.002471NACT
16240.05.00.0006030.000062NACT
169140.012.00.0021100.000150NACT
17128.01.00.0004220.000012NACT
17447.00.00.0007080.000000NACT
177124.00.00.0018690.000000NACT
1782.06.00.0000300.000075NACT
1796.00.00.0000900.000000NACT
18285.0307.00.0042950.003832NACT
18239.046.00.0005880.000574NACT
183152.02.00.0022910.000025NACT
1841260.03.00.0189890.000037NACT
18714.07.00.0002110.000087NACT
263.019.00.0000450.000237NACT
32215.0126.00.0032400.001573NACT
4090.00.00.0013560.000000NACT
51.034.00.0000150.000424NACT
612.018.00.0000300.000225NACT
715.06.00.0002260.000075NACT
851563.09.00.0235560.000112NACT
89154.05.00.0023210.000062NACT
95207.023.00.0031200.000287NACT
98472.0303.00.0071130.003782NACT
1040.020.00.0000000.000250NACT
1400.03.00.0000000.000037NACT
1410.02.00.0000000.000025NACT
\n", "
" ], "text/plain": [ " B7H4_cells PDL1_cells %_B7H4 %_PDL1 Treatment_Type\n", "Patient \n", "111 35.0 1.0 0.000527 0.000012 NACT\n", "116 24.0 3.0 0.000362 0.000037 NACT\n", "119 2151.0 18.0 0.032418 0.000225 NACT\n", "121 2361.0 4.0 0.035582 0.000050 NACT\n", "137 25.0 4.0 0.000377 0.000050 NACT\n", "146 71.0 0.0 0.001070 0.000000 NACT\n", "149 281.0 1.0 0.004235 0.000012 NACT\n", "15 1008.0 6.0 0.015191 0.000075 NACT\n", "153 9.0 30.0 0.000136 0.000374 NACT\n", "157 2.0 7.0 0.000030 0.000087 NACT\n", "160 1.0 198.0 0.000015 0.002471 NACT\n", "162 40.0 5.0 0.000603 0.000062 NACT\n", "169 140.0 12.0 0.002110 0.000150 NACT\n", "171 28.0 1.0 0.000422 0.000012 NACT\n", "174 47.0 0.0 0.000708 0.000000 NACT\n", "177 124.0 0.0 0.001869 0.000000 NACT\n", "178 2.0 6.0 0.000030 0.000075 NACT\n", "179 6.0 0.0 0.000090 0.000000 NACT\n", "18 285.0 307.0 0.004295 0.003832 NACT\n", "182 39.0 46.0 0.000588 0.000574 NACT\n", "183 152.0 2.0 0.002291 0.000025 NACT\n", "184 1260.0 3.0 0.018989 0.000037 NACT\n", "187 14.0 7.0 0.000211 0.000087 NACT\n", "26 3.0 19.0 0.000045 0.000237 NACT\n", "32 215.0 126.0 0.003240 0.001573 NACT\n", "40 90.0 0.0 0.001356 0.000000 NACT\n", "5 1.0 34.0 0.000015 0.000424 NACT\n", "61 2.0 18.0 0.000030 0.000225 NACT\n", "7 15.0 6.0 0.000226 0.000075 NACT\n", "85 1563.0 9.0 0.023556 0.000112 NACT\n", "89 154.0 5.0 0.002321 0.000062 NACT\n", "95 207.0 23.0 0.003120 0.000287 NACT\n", "98 472.0 303.0 0.007113 0.003782 NACT\n", "104 0.0 20.0 0.000000 0.000250 NACT\n", "140 0.0 3.0 0.000000 0.000037 NACT\n", "141 0.0 2.0 0.000000 0.000025 NACT" ] }, "execution_count": 108, "metadata": {}, "output_type": "execute_result" } ], "source": [ "result_NACT" ] }, { "cell_type": "code", "execution_count": 109, "id": "5bf30f0f-cf19-468d-b30a-aa3f1d3794a5", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
B7H4_cellsPDL1_cells%_B7H4%_PDL1Treatment_Type
Patient
1018.04.00.0000500.000010ACT
100663.00.00.0018450.000000ACT
10161.041.00.0001700.000100ACT
102135.031.00.0003760.000076ACT
10312.0120.00.0000330.000294ACT
..................
95207.023.00.0031200.000287NACT
96812.00.00.0022590.000000ACT
972.046.00.0000060.000113ACT
98472.0303.00.0071130.003782NACT
99161.02.00.0004480.000005ACT
\n", "

172 rows × 5 columns

\n", "
" ], "text/plain": [ " B7H4_cells PDL1_cells %_B7H4 %_PDL1 Treatment_Type\n", "Patient \n", "10 18.0 4.0 0.000050 0.000010 ACT\n", "100 663.0 0.0 0.001845 0.000000 ACT\n", "101 61.0 41.0 0.000170 0.000100 ACT\n", "102 135.0 31.0 0.000376 0.000076 ACT\n", "103 12.0 120.0 0.000033 0.000294 ACT\n", "... ... ... ... ... ...\n", "95 207.0 23.0 0.003120 0.000287 NACT\n", "96 812.0 0.0 0.002259 0.000000 ACT\n", "97 2.0 46.0 0.000006 0.000113 ACT\n", "98 472.0 303.0 0.007113 0.003782 NACT\n", "99 161.0 2.0 0.000448 0.000005 ACT\n", "\n", "[172 rows x 5 columns]" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Concaténer les résultats pour obtenir le DataFrame final\n", "result_final = pd.concat([result_NACT, result_ACT])\n", "\n", "# Trier le DataFrame par index\n", "result_sorted = result_final.sort_index()\n", "\n", "# Définir l'option pour afficher toutes les lignes du DataFrame\n", "#pd.set_option('display.max_rows', None)\n", "\n", "display(result_sorted)" ] }, { "cell_type": "code", "execution_count": null, "id": "2961b7b2", "metadata": {}, "outputs": [], "source": [ "\n" ] }, { "cell_type": "code", "execution_count": 120, "id": "3f238363-d9db-40a6-abb8-f3a12f2b26b8", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "customdata": [ [ 18, 4, 9.796478166099287e-06 ], [ 663, 0, 0 ], [ 61, 41, 0.0001004139012025177 ], [ 135, 31, 7.592270578726947e-05 ], [ 12, 120, 0.0002938943449829786 ], [ 1, 4, 9.796478166099287e-06 ], [ 5, 25, 6.122798853812054e-05 ], [ 0, 37, 9.061742303641841e-05 ], [ 1, 1, 2.4491195415248216e-06 ], [ 0, 9, 2.2042075873723398e-05 ], [ 1, 6, 1.469471724914893e-05 ], [ 605, 145, 0.00035512233352109917 ], [ 1093, 7, 1.7143836790673752e-05 ], [ 347, 27, 6.612622762117019e-05 ], [ 930, 1, 2.4491195415248216e-06 ], [ 48, 55, 0.0001347015747838652 ], [ 884, 100, 0.0002449119541524822 ], [ 2, 7, 1.7143836790673752e-05 ], [ 2, 1, 2.4491195415248216e-06 ], [ 9, 3, 7.347358624574465e-06 ], [ 284, 40, 9.796478166099288e-05 ], [ 56, 6, 1.469471724914893e-05 ], [ 115, 28, 6.857534716269501e-05 ], [ 88, 1, 2.4491195415248216e-06 ], [ 1350, 28, 6.857534716269501e-05 ], [ 3, 124, 0.0003036908231490779 ], [ 0, 12, 2.938943449829786e-05 ], [ 3, 6, 1.469471724914893e-05 ], [ 4, 9, 2.2042075873723398e-05 ], [ 0, 13, 3.183855403982268e-05 ], [ 22, 12, 2.938943449829786e-05 ], [ 753, 10, 2.449119541524822e-05 ], [ 7, 9, 2.2042075873723398e-05 ], [ 1, 0, 0 ], [ 10, 391, 0.0009576057407362054 ], [ 232, 5, 1.224559770762411e-05 ], [ 3, 82, 0.0002008278024050354 ], [ 6, 15, 3.6736793122872325e-05 ], [ 1685, 14, 3.4287673581347504e-05 ], [ 134, 33, 8.082094487031911e-05 ], [ 78, 24, 5.877886899659572e-05 ], [ 10, 0, 0 ], [ 68, 90, 0.00022042075873723396 ], [ 22, 63, 0.00015429453111606378 ], [ 25, 3, 7.347358624574465e-06 ], [ 34, 0, 0 ], [ 748, 5, 1.224559770762411e-05 ], [ 6, 13, 3.183855403982268e-05 ], [ 175, 273, 0.0006686096348362763 ], [ 0, 1, 2.4491195415248216e-06 ], [ 671, 35, 8.571918395336877e-05 ], [ 634, 36, 8.816830349489359e-05 ], [ 247, 6, 1.469471724914893e-05 ], [ 207, 7, 1.7143836790673752e-05 ], [ 192, 2, 4.898239083049643e-06 ], [ 1, 8, 1.9592956332198573e-05 ], [ 2, 3, 7.347358624574465e-06 ], [ 0, 4, 9.796478166099287e-06 ], [ 11, 27, 6.612622762117019e-05 ], [ 0, 583, 0.0014278366927089712 ], [ 2, 8, 1.9592956332198573e-05 ], [ 3, 71, 0.00017388748744826235 ], [ 708, 0, 0 ], [ 1, 7, 1.7143836790673752e-05 ], [ 3823, 20, 4.898239083049644e-05 ], [ 11, 50, 0.0001224559770762411 ], [ 1, 1285, 0.003147118610859396 ], [ 60, 4, 9.796478166099287e-06 ], [ 171, 3, 7.347358624574465e-06 ], [ 540, 7, 1.7143836790673752e-05 ], [ 121, 9, 2.2042075873723398e-05 ], [ 24, 0, 0 ], [ 251, 14, 3.4287673581347504e-05 ], [ 1, 4, 9.796478166099287e-06 ], [ 295, 4, 9.796478166099287e-06 ], [ 2, 0, 0 ], [ 5, 0, 0 ], [ 103, 7, 1.7143836790673752e-05 ], [ 59, 1, 2.4491195415248216e-06 ], [ 24, 8, 1.9592956332198573e-05 ], [ 7, 54, 0.00013225245524234037 ], [ 2, 133, 0.0003257328990228013 ], [ 10, 1, 2.4491195415248216e-06 ], [ 1133, 16, 3.9185912664397146e-05 ], [ 15, 36, 8.816830349489359e-05 ], [ 821, 0, 0 ], [ 221, 3, 7.347358624574465e-06 ], [ 694, 0, 0 ], [ 1, 0, 0 ], [ 16, 0, 0 ], [ 251, 0, 0 ], [ 7, 279, 0.0006833043520854253 ], [ 1, 4, 9.796478166099287e-06 ], [ 127, 13, 3.183855403982268e-05 ], [ 2, 5, 1.224559770762411e-05 ], [ 325, 2, 4.898239083049643e-06 ], [ 4, 0, 0 ], [ 2694, 2, 4.898239083049643e-06 ], [ 4, 1, 2.4491195415248216e-06 ], [ 78, 2, 4.898239083049643e-06 ], [ 129, 10, 2.449119541524822e-05 ], [ 1, 8, 1.9592956332198573e-05 ], [ 6, 1, 2.4491195415248216e-06 ], [ 53, 3, 7.347358624574465e-06 ], [ 67, 27, 6.612622762117019e-05 ], [ 2, 5, 1.224559770762411e-05 ], [ 37, 1, 2.4491195415248216e-06 ], [ 484, 2, 4.898239083049643e-06 ], [ 140, 0, 0 ], [ 76, 2, 4.898239083049643e-06 ], [ 90, 9, 2.2042075873723398e-05 ], [ 33, 9, 2.2042075873723398e-05 ], [ 29, 4, 9.796478166099287e-06 ], [ 57, 107, 0.00026205579094315594 ], [ 525, 0, 0 ], [ 39, 12, 2.938943449829786e-05 ], [ 283, 2, 4.898239083049643e-06 ], [ 2, 10, 2.449119541524822e-05 ], [ 0, 18, 4.4084151747446796e-05 ], [ 53, 13, 3.183855403982268e-05 ], [ 564, 85, 0.00020817516102960984 ], [ 169, 177, 0.00043349415884989345 ], [ 0, 16, 3.9185912664397146e-05 ], [ 560, 7, 1.7143836790673752e-05 ], [ 1, 7, 1.7143836790673752e-05 ], [ 11, 0, 0 ], [ 1497, 5, 1.224559770762411e-05 ], [ 16, 12, 2.938943449829786e-05 ], [ 29, 83, 0.0002032769219465602 ], [ 0, 15, 3.6736793122872325e-05 ], [ 1395, 4, 9.796478166099287e-06 ], [ 1, 28, 6.857534716269501e-05 ], [ 0, 6, 1.469471724914893e-05 ], [ 812, 0, 0 ], [ 2, 46, 0.0001126594989101418 ], [ 161, 2, 4.898239083049643e-06 ] ], "hovertemplate": "Treatment_Type=%{x}
%_B7H4=%{y}
B7H4_cells=%{customdata[0]}
PDL1_cells=%{customdata[1]}
%_PDL1=%{customdata[2]}", "legendgroup": "ACT", "marker": { "color": "#636efa" }, "name": "ACT", "notched": false, "offsetgroup": "ACT", "orientation": "v", "showlegend": true, "type": "box", "x": [ "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT" ], "x0": " ", "xaxis": "x", "y": [ 5.008486602298339e-05, 0.0018447925651798882, 0.00016973204596677704, 0.0003756364951723754, 3.338991068198893e-05, 2.7824925568324103e-06, 1.3912462784162053e-05, 0, 2.7824925568324103e-06, 0, 2.7824925568324103e-06, 0.0016834079968836083, 0.0030412643646178248, 0.0009655249172208464, 0.0025877180778541417, 0.0001335596427279557, 0.0024597234202398508, 5.564985113664821e-06, 5.564985113664821e-06, 2.5042433011491696e-05, 0.0007902278861404046, 0.00015581958318261499, 0.0003199866440357272, 0.0002448593450012521, 0.003756364951723754, 8.347477670497232e-06, 0, 8.347477670497232e-06, 1.1129970227329641e-05, 0, 6.121483625031303e-05, 0.002095216895294805, 1.9477447897826873e-05, 2.7824925568324103e-06, 2.7824925568324105e-05, 0.0006455382731851192, 8.347477670497232e-06, 1.6694955340994464e-05, 0.004688499958262611, 0.00037285400261554303, 0.00021703441943292801, 2.7824925568324105e-05, 0.0001892094938646039, 6.121483625031303e-05, 6.956231392081027e-05, 9.460474693230196e-05, 0.002081304432510643, 1.6694955340994464e-05, 0.00048693619744567183, 0, 0.0018670525056345474, 0.0017641002810317482, 0.0006872756615376054, 0.000575975959264309, 0.0005342385709118228, 2.7824925568324103e-06, 5.564985113664821e-06, 0, 3.0607418125156515e-05, 0, 5.564985113664821e-06, 8.347477670497232e-06, 0.0019700047302373467, 2.7824925568324103e-06, 0.010637469044770306, 3.0607418125156515e-05, 2.7824925568324103e-06, 0.00016694955340994464, 0.0004758062272183422, 0.0015025459806895017, 0.0003366815993767217, 6.677982136397785e-05, 0.000698405631764935, 2.7824925568324103e-06, 0.0008208353042655611, 5.564985113664821e-06, 1.3912462784162053e-05, 0.00028659673335373827, 0.0001641670608531122, 6.677982136397785e-05, 1.9477447897826873e-05, 5.564985113664821e-06, 2.7824925568324105e-05, 0.003152564066891121, 4.173738835248616e-05, 0.002284426389159409, 0.0006149308550599627, 0.0019310498344416928, 2.7824925568324103e-06, 4.4519880909318565e-05, 0.000698405631764935, 1.9477447897826873e-05, 2.7824925568324103e-06, 0.0003533765547177161, 5.564985113664821e-06, 0.0009043100809705334, 1.1129970227329641e-05, 0.007496034948106514, 1.1129970227329641e-05, 0.00021703441943292801, 0.000358941539831381, 2.7824925568324103e-06, 1.6694955340994464e-05, 0.00014747210551211776, 0.00018642700130777151, 5.564985113664821e-06, 0.00010295222460279918, 0.0013467263975068867, 0.0003895489579565375, 0.0002114694343192632, 0.00025042433011491697, 9.182225437546954e-05, 8.06922841481399e-05, 0.00015860207573944738, 0.0014608085923370154, 0.00010851720971646401, 0.0007874453935835722, 5.564985113664821e-06, 0, 0.00014747210551211776, 0.0015693258020534795, 0.0004702412421046774, 0, 0.00155819583182615, 2.7824925568324103e-06, 3.0607418125156515e-05, 0.004165391357578118, 4.4519880909318565e-05, 8.06922841481399e-05, 0, 0.0038815771167812125, 2.7824925568324103e-06, 0, 0.002259383956147917, 5.564985113664821e-06, 0.0004479813016500181 ], "y0": " ", "yaxis": "y" }, { "alignmentgroup": "True", "customdata": [ [ 0, 20, 0.000249613099695472 ], [ 35, 1, 1.2480654984773601e-05 ], [ 24, 3, 3.74419649543208e-05 ], [ 2151, 18, 0.00022465178972592482 ], [ 2361, 4, 4.9922619939094404e-05 ], [ 25, 4, 4.9922619939094404e-05 ], [ 0, 3, 3.74419649543208e-05 ], [ 0, 2, 2.4961309969547202e-05 ], [ 71, 0, 0 ], [ 281, 1, 1.2480654984773601e-05 ], [ 1008, 6, 7.48839299086416e-05 ], [ 9, 30, 0.00037441964954320803 ], [ 2, 7, 8.736458489341521e-05 ], [ 1, 198, 0.002471169686985173 ], [ 40, 5, 6.2403274923868e-05 ], [ 140, 12, 0.0001497678598172832 ], [ 28, 1, 1.2480654984773601e-05 ], [ 47, 0, 0 ], [ 124, 0, 0 ], [ 2, 6, 7.48839299086416e-05 ], [ 6, 0, 0 ], [ 285, 307, 0.0038315610803254956 ], [ 39, 46, 0.0005741101292995856 ], [ 152, 2, 2.4961309969547202e-05 ], [ 1260, 3, 3.74419649543208e-05 ], [ 14, 7, 8.736458489341521e-05 ], [ 3, 19, 0.00023713244471069842 ], [ 215, 126, 0.0015725625280814737 ], [ 90, 0, 0 ], [ 1, 34, 0.00042434226948230244 ], [ 2, 18, 0.00022465178972592482 ], [ 15, 6, 7.48839299086416e-05 ], [ 1563, 9, 0.00011232589486296241 ], [ 154, 5, 6.2403274923868e-05 ], [ 207, 23, 0.0002870550646497928 ], [ 472, 303, 0.0037816384603864012 ] ], "hovertemplate": "Treatment_Type=%{x}
%_B7H4=%{y}
B7H4_cells=%{customdata[0]}
PDL1_cells=%{customdata[1]}
%_PDL1=%{customdata[2]}", "legendgroup": "NACT", "marker": { "color": "#EF553B" }, "name": "NACT", "notched": false, "offsetgroup": "NACT", "orientation": "v", "showlegend": true, "type": "box", "x": [ "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT" ], "x0": " ", "xaxis": "x", "y": [ 0, 0.0005274818018778352, 0.00036170180700194414, 0.032417524452549244, 0.03558241526381625, 0.00037677271562702513, 0, 0, 0.0010700345123807514, 0.004234925323647763, 0.015191475894081654, 0.00013563817762572906, 3.0141817250162012e-05, 1.5070908625081006e-05, 0.0006028363450032402, 0.0021099272075113407, 0.00042198544150226817, 0.0007083327053788073, 0.0018687926695100448, 3.0141817250162012e-05, 9.042545175048603e-05, 0.004295208958148087, 0.0005877654363781593, 0.002290778111012313, 0.01898934486760207, 0.00021099272075113408, 4.521272587524302e-05, 0.003240245354392416, 0.0013563817762572905, 1.5070908625081006e-05, 3.0141817250162012e-05, 0.00022606362937621508, 0.023555830181001613, 0.002320919928262475, 0.003119678085391768, 0.007113468871038235 ], "y0": " ", "yaxis": "y" } ], "layout": { "boxmode": "overlay", "legend": { "title": { "font": { "family": "Arial, sans-serif", "size": 12 }, "text": "Treatment" }, "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "#C8D4E3", "linecolor": "#C8D4E3", "minorgridcolor": "#C8D4E3", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "#C8D4E3", "linecolor": "#C8D4E3", "minorgridcolor": "#C8D4E3", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "white", "showlakes": true, "showland": true, "subunitcolor": "#C8D4E3" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "white", "polar": { "angularaxis": { "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "" }, "bgcolor": "white", "radialaxis": { "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "white", "gridcolor": "#DFE8F3", "gridwidth": 2, "linecolor": "#EBF0F8", "showbackground": true, "ticks": "", "zerolinecolor": "#EBF0F8" }, "yaxis": { "backgroundcolor": "white", "gridcolor": "#DFE8F3", "gridwidth": 2, "linecolor": "#EBF0F8", "showbackground": true, "ticks": "", "zerolinecolor": "#EBF0F8" }, "zaxis": { "backgroundcolor": "white", "gridcolor": "#DFE8F3", "gridwidth": 2, "linecolor": "#EBF0F8", "showbackground": true, "ticks": "", "zerolinecolor": "#EBF0F8" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "#DFE8F3", "linecolor": "#A2B1C6", "ticks": "" }, "baxis": { "gridcolor": "#DFE8F3", "linecolor": "#A2B1C6", "ticks": "" }, "bgcolor": "white", "caxis": { "gridcolor": "#DFE8F3", "linecolor": "#A2B1C6", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "#EBF0F8", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "#EBF0F8", "zerolinewidth": 2 } } }, "title": { "font": { "family": "Arial, sans-serif", "size": 18 }, "text": "Distribution of % B7H4 in Cancer Cells by Treatment", "x": 0.5 }, "xaxis": { "anchor": "y", "autorange": true, "categoryarray": [ "ACT", "NACT" ], "categoryorder": "array", "domain": [ 0, 1 ], "linecolor": "black", "linewidth": 2, "mirror": true, "range": [ -0.5, 1.5 ], "showline": true, "tickangle": -45, "title": { "font": { "family": "Arial, sans-serif", "size": 14 }, "text": "Treatment Type" }, "type": "category" }, "yaxis": { "anchor": "x", "autorange": true, "domain": [ 0, 1 ], "gridcolor": "white", "gridwidth": 1, "linecolor": "black", "linewidth": 2, "mirror": true, "range": [ -0.0019768008479897916, 0.03755921611180604 ], "showgrid": true, "showline": true, "title": { "font": { "family": "Arial, sans-serif", "size": 14 }, "text": "% B7H4" }, "type": "linear" } } } }, "metadata": {}, "output_type": "display_data" }, { "ename": "AssertionError", "evalue": "", "output_type": "error", "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mAssertionError\u001b[0m Traceback (most recent call last)", "Cell \u001b[1;32mIn[120], line 41\u001b[0m\n\u001b[0;32m 37\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mstatsmodels\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mstats\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mmulticomp\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m pairwise_tukeyhsd\n\u001b[0;32m 39\u001b[0m \u001b[38;5;66;03m# Assuming 'result_sorted' is your DataFrame and already imported\u001b[39;00m\n\u001b[0;32m 40\u001b[0m \u001b[38;5;66;03m# Perform ANOVA\u001b[39;00m\n\u001b[1;32m---> 41\u001b[0m model \u001b[38;5;241m=\u001b[39m \u001b[43mols\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43m%\u001b[39;49m\u001b[38;5;124;43m_B7H4 ~ C(Treatment_Type)\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdata\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mresult_sorted\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241m.\u001b[39mfit()\n\u001b[0;32m 42\u001b[0m anova_table \u001b[38;5;241m=\u001b[39m sm\u001b[38;5;241m.\u001b[39mstats\u001b[38;5;241m.\u001b[39manova_lm(model, typ\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m2\u001b[39m) \u001b[38;5;66;03m# Type 2 ANOVA DataFrame\u001b[39;00m\n\u001b[0;32m 44\u001b[0m \u001b[38;5;28mprint\u001b[39m(anova_table)\n", "File \u001b[1;32mc:\\Logiciels\\Anaconda\\envs\\CycIF-python\\lib\\site-packages\\statsmodels\\base\\model.py:203\u001b[0m, in \u001b[0;36mModel.from_formula\u001b[1;34m(cls, formula, data, subset, drop_cols, *args, **kwargs)\u001b[0m\n\u001b[0;32m 200\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m missing \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mnone\u001b[39m\u001b[38;5;124m'\u001b[39m: \u001b[38;5;66;03m# with patsy it's drop or raise. let's raise.\u001b[39;00m\n\u001b[0;32m 201\u001b[0m missing \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mraise\u001b[39m\u001b[38;5;124m'\u001b[39m\n\u001b[1;32m--> 203\u001b[0m tmp \u001b[38;5;241m=\u001b[39m \u001b[43mhandle_formula_data\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdata\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mNone\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mformula\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdepth\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43meval_env\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 204\u001b[0m \u001b[43m \u001b[49m\u001b[43mmissing\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mmissing\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 205\u001b[0m ((endog, exog), missing_idx, design_info) \u001b[38;5;241m=\u001b[39m tmp\n\u001b[0;32m 206\u001b[0m max_endog \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mcls\u001b[39m\u001b[38;5;241m.\u001b[39m_formula_max_endog\n", "File \u001b[1;32mc:\\Logiciels\\Anaconda\\envs\\CycIF-python\\lib\\site-packages\\statsmodels\\formula\\formulatools.py:63\u001b[0m, in \u001b[0;36mhandle_formula_data\u001b[1;34m(Y, X, formula, depth, missing)\u001b[0m\n\u001b[0;32m 61\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 62\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m data_util\u001b[38;5;241m.\u001b[39m_is_using_pandas(Y, \u001b[38;5;28;01mNone\u001b[39;00m):\n\u001b[1;32m---> 63\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mdmatrices\u001b[49m\u001b[43m(\u001b[49m\u001b[43mformula\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mY\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdepth\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mreturn_type\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[38;5;124;43mdataframe\u001b[39;49m\u001b[38;5;124;43m'\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[0;32m 64\u001b[0m \u001b[43m \u001b[49m\u001b[43mNA_action\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mna_action\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 65\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 66\u001b[0m result \u001b[38;5;241m=\u001b[39m dmatrices(formula, Y, depth, return_type\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mdataframe\u001b[39m\u001b[38;5;124m'\u001b[39m,\n\u001b[0;32m 67\u001b[0m NA_action\u001b[38;5;241m=\u001b[39mna_action)\n", "File \u001b[1;32mc:\\Logiciels\\Anaconda\\envs\\CycIF-python\\lib\\site-packages\\patsy\\highlevel.py:309\u001b[0m, in \u001b[0;36mdmatrices\u001b[1;34m(formula_like, data, eval_env, NA_action, return_type)\u001b[0m\n\u001b[0;32m 299\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Construct two design matrices given a formula_like and data.\u001b[39;00m\n\u001b[0;32m 300\u001b[0m \n\u001b[0;32m 301\u001b[0m \u001b[38;5;124;03mThis function is identical to :func:`dmatrix`, except that it requires\u001b[39;00m\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 306\u001b[0m \u001b[38;5;124;03mSee :func:`dmatrix` for details.\u001b[39;00m\n\u001b[0;32m 307\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m 308\u001b[0m eval_env \u001b[38;5;241m=\u001b[39m EvalEnvironment\u001b[38;5;241m.\u001b[39mcapture(eval_env, reference\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1\u001b[39m)\n\u001b[1;32m--> 309\u001b[0m (lhs, rhs) \u001b[38;5;241m=\u001b[39m \u001b[43m_do_highlevel_design\u001b[49m\u001b[43m(\u001b[49m\u001b[43mformula_like\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdata\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43meval_env\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 310\u001b[0m \u001b[43m \u001b[49m\u001b[43mNA_action\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mreturn_type\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 311\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m lhs\u001b[38;5;241m.\u001b[39mshape[\u001b[38;5;241m1\u001b[39m] \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[0;32m 312\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m PatsyError(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmodel is missing required outcome variables\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n", "File \u001b[1;32mc:\\Logiciels\\Anaconda\\envs\\CycIF-python\\lib\\site-packages\\patsy\\highlevel.py:164\u001b[0m, in \u001b[0;36m_do_highlevel_design\u001b[1;34m(formula_like, data, eval_env, NA_action, return_type)\u001b[0m\n\u001b[0;32m 162\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mdata_iter_maker\u001b[39m():\n\u001b[0;32m 163\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28miter\u001b[39m([data])\n\u001b[1;32m--> 164\u001b[0m design_infos \u001b[38;5;241m=\u001b[39m \u001b[43m_try_incr_builders\u001b[49m\u001b[43m(\u001b[49m\u001b[43mformula_like\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdata_iter_maker\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43meval_env\u001b[49m\u001b[43m,\u001b[49m\n\u001b[0;32m 165\u001b[0m \u001b[43m \u001b[49m\u001b[43mNA_action\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 166\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m design_infos \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[0;32m 167\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m build_design_matrices(design_infos, data,\n\u001b[0;32m 168\u001b[0m NA_action\u001b[38;5;241m=\u001b[39mNA_action,\n\u001b[0;32m 169\u001b[0m return_type\u001b[38;5;241m=\u001b[39mreturn_type)\n", "File \u001b[1;32mc:\\Logiciels\\Anaconda\\envs\\CycIF-python\\lib\\site-packages\\patsy\\highlevel.py:62\u001b[0m, in \u001b[0;36m_try_incr_builders\u001b[1;34m(formula_like, data_iter_maker, eval_env, NA_action)\u001b[0m\n\u001b[0;32m 55\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m PatsyError(\n\u001b[0;32m 56\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mOn Python 2, formula strings must be either \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mstr\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m objects, \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 57\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mor else \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124municode\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m objects containing only ascii \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 58\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcharacters. You passed a unicode string with non-ascii \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 59\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcharacters. I\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mm afraid you\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mll have to either switch to \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 60\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mascii-only, or else upgrade to Python 3.\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 61\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(formula_like, \u001b[38;5;28mstr\u001b[39m):\n\u001b[1;32m---> 62\u001b[0m formula_like \u001b[38;5;241m=\u001b[39m \u001b[43mModelDesc\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mfrom_formula\u001b[49m\u001b[43m(\u001b[49m\u001b[43mformula_like\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 63\u001b[0m \u001b[38;5;66;03m# fallthrough\u001b[39;00m\n\u001b[0;32m 64\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(formula_like, ModelDesc):\n", "File \u001b[1;32mc:\\Logiciels\\Anaconda\\envs\\CycIF-python\\lib\\site-packages\\patsy\\desc.py:165\u001b[0m, in \u001b[0;36mModelDesc.from_formula\u001b[1;34m(cls, tree_or_string)\u001b[0m\n\u001b[0;32m 163\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 164\u001b[0m tree \u001b[38;5;241m=\u001b[39m parse_formula(tree_or_string)\n\u001b[1;32m--> 165\u001b[0m value \u001b[38;5;241m=\u001b[39m \u001b[43mEvaluator\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43meval\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtree\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mrequire_evalexpr\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m)\u001b[49m\n\u001b[0;32m 166\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(value, \u001b[38;5;28mcls\u001b[39m)\n\u001b[0;32m 167\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m value\n", "File \u001b[1;32mc:\\Logiciels\\Anaconda\\envs\\CycIF-python\\lib\\site-packages\\patsy\\desc.py:400\u001b[0m, in \u001b[0;36mEvaluator.eval\u001b[1;34m(self, tree, require_evalexpr)\u001b[0m\n\u001b[0;32m 396\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m key \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_evaluators:\n\u001b[0;32m 397\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m PatsyError(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mI don\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt know how to evaluate this \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 398\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m operator\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;241m%\u001b[39m (tree\u001b[38;5;241m.\u001b[39mtype,),\n\u001b[0;32m 399\u001b[0m tree\u001b[38;5;241m.\u001b[39mtoken)\n\u001b[1;32m--> 400\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_evaluators\u001b[49m\u001b[43m[\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m]\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtree\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 401\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m require_evalexpr \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(result, IntermediateExpr):\n\u001b[0;32m 402\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(result, ModelDesc):\n", "File \u001b[1;32mc:\\Logiciels\\Anaconda\\envs\\CycIF-python\\lib\\site-packages\\patsy\\desc.py:221\u001b[0m, in \u001b[0;36m_eval_any_tilde\u001b[1;34m(evaluator, tree)\u001b[0m\n\u001b[0;32m 220\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_eval_any_tilde\u001b[39m(evaluator, tree):\n\u001b[1;32m--> 221\u001b[0m exprs \u001b[38;5;241m=\u001b[39m [evaluator\u001b[38;5;241m.\u001b[39meval(arg) \u001b[38;5;28;01mfor\u001b[39;00m arg \u001b[38;5;129;01min\u001b[39;00m tree\u001b[38;5;241m.\u001b[39margs] \n\u001b[0;32m 222\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(exprs) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[0;32m 223\u001b[0m \u001b[38;5;66;03m# Formula was like: \"~ foo\"\u001b[39;00m\n\u001b[0;32m 224\u001b[0m \u001b[38;5;66;03m# We pretend that instead it was like: \"0 ~ foo\"\u001b[39;00m\n\u001b[0;32m 225\u001b[0m exprs\u001b[38;5;241m.\u001b[39minsert(\u001b[38;5;241m0\u001b[39m, IntermediateExpr(\u001b[38;5;28;01mFalse\u001b[39;00m, \u001b[38;5;28;01mNone\u001b[39;00m, \u001b[38;5;28;01mTrue\u001b[39;00m, []))\n", "File \u001b[1;32mc:\\Logiciels\\Anaconda\\envs\\CycIF-python\\lib\\site-packages\\patsy\\desc.py:221\u001b[0m, in \u001b[0;36m\u001b[1;34m(.0)\u001b[0m\n\u001b[0;32m 220\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_eval_any_tilde\u001b[39m(evaluator, tree):\n\u001b[1;32m--> 221\u001b[0m exprs \u001b[38;5;241m=\u001b[39m [\u001b[43mevaluator\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43meval\u001b[49m\u001b[43m(\u001b[49m\u001b[43marg\u001b[49m\u001b[43m)\u001b[49m \u001b[38;5;28;01mfor\u001b[39;00m arg \u001b[38;5;129;01min\u001b[39;00m tree\u001b[38;5;241m.\u001b[39margs] \n\u001b[0;32m 222\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(exprs) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m1\u001b[39m:\n\u001b[0;32m 223\u001b[0m \u001b[38;5;66;03m# Formula was like: \"~ foo\"\u001b[39;00m\n\u001b[0;32m 224\u001b[0m \u001b[38;5;66;03m# We pretend that instead it was like: \"0 ~ foo\"\u001b[39;00m\n\u001b[0;32m 225\u001b[0m exprs\u001b[38;5;241m.\u001b[39minsert(\u001b[38;5;241m0\u001b[39m, IntermediateExpr(\u001b[38;5;28;01mFalse\u001b[39;00m, \u001b[38;5;28;01mNone\u001b[39;00m, \u001b[38;5;28;01mTrue\u001b[39;00m, []))\n", "File \u001b[1;32mc:\\Logiciels\\Anaconda\\envs\\CycIF-python\\lib\\site-packages\\patsy\\desc.py:400\u001b[0m, in \u001b[0;36mEvaluator.eval\u001b[1;34m(self, tree, require_evalexpr)\u001b[0m\n\u001b[0;32m 396\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m key \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_evaluators:\n\u001b[0;32m 397\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m PatsyError(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mI don\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt know how to evaluate this \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 398\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m operator\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;241m%\u001b[39m (tree\u001b[38;5;241m.\u001b[39mtype,),\n\u001b[0;32m 399\u001b[0m tree\u001b[38;5;241m.\u001b[39mtoken)\n\u001b[1;32m--> 400\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_evaluators\u001b[49m\u001b[43m[\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m]\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtree\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 401\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m require_evalexpr \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(result, IntermediateExpr):\n\u001b[0;32m 402\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(result, ModelDesc):\n", "File \u001b[1;32mc:\\Logiciels\\Anaconda\\envs\\CycIF-python\\lib\\site-packages\\patsy\\desc.py:358\u001b[0m, in \u001b[0;36m_eval_python_expr\u001b[1;34m(evaluator, tree)\u001b[0m\n\u001b[0;32m 357\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_eval_python_expr\u001b[39m(evaluator, tree):\n\u001b[1;32m--> 358\u001b[0m factor \u001b[38;5;241m=\u001b[39m \u001b[43mEvalFactor\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtree\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtoken\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mextra\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43morigin\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtree\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43morigin\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 359\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m IntermediateExpr(\u001b[38;5;28;01mFalse\u001b[39;00m, \u001b[38;5;28;01mNone\u001b[39;00m, \u001b[38;5;28;01mFalse\u001b[39;00m, [Term([factor])])\n", "File \u001b[1;32mc:\\Logiciels\\Anaconda\\envs\\CycIF-python\\lib\\site-packages\\patsy\\eval.py:452\u001b[0m, in \u001b[0;36mEvalFactor.__init__\u001b[1;34m(self, code, origin)\u001b[0m\n\u001b[0;32m 430\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"A factor class that executes arbitrary Python code and supports\u001b[39;00m\n\u001b[0;32m 431\u001b[0m \u001b[38;5;124;03mstateful transforms.\u001b[39;00m\n\u001b[0;32m 432\u001b[0m \n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 446\u001b[0m \u001b[38;5;124;03m assert EvalFactor(\"a + b\") != EvalFactor(\"b + a\")\u001b[39;00m\n\u001b[0;32m 447\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m 449\u001b[0m \u001b[38;5;66;03m# For parsed formulas, the code will already have been normalized by\u001b[39;00m\n\u001b[0;32m 450\u001b[0m \u001b[38;5;66;03m# the parser. But let's normalize anyway, so we can be sure of having\u001b[39;00m\n\u001b[0;32m 451\u001b[0m \u001b[38;5;66;03m# consistent semantics for __eq__ and __hash__.\u001b[39;00m\n\u001b[1;32m--> 452\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mcode \u001b[38;5;241m=\u001b[39m \u001b[43mnormalize_token_spacing\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcode\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 453\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39morigin \u001b[38;5;241m=\u001b[39m origin\n", "File \u001b[1;32mc:\\Logiciels\\Anaconda\\envs\\CycIF-python\\lib\\site-packages\\patsy\\tokens.py:157\u001b[0m, in \u001b[0;36mnormalize_token_spacing\u001b[1;34m(code)\u001b[0m\n\u001b[0;32m 154\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mnormalize_token_spacing\u001b[39m(code):\n\u001b[0;32m 155\u001b[0m tokens \u001b[38;5;241m=\u001b[39m [(t[\u001b[38;5;241m0\u001b[39m], t[\u001b[38;5;241m1\u001b[39m])\n\u001b[0;32m 156\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m t \u001b[38;5;129;01min\u001b[39;00m tokenize\u001b[38;5;241m.\u001b[39mgenerate_tokens(StringIO(code)\u001b[38;5;241m.\u001b[39mreadline)]\n\u001b[1;32m--> 157\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mpretty_untokenize\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtokens\u001b[49m\u001b[43m)\u001b[49m\n", "File \u001b[1;32mc:\\Logiciels\\Anaconda\\envs\\CycIF-python\\lib\\site-packages\\patsy\\tokens.py:103\u001b[0m, in \u001b[0;36mpretty_untokenize\u001b[1;34m(typed_tokens)\u001b[0m\n\u001b[0;32m 101\u001b[0m brackets \u001b[38;5;241m=\u001b[39m []\n\u001b[0;32m 102\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m token_type, token \u001b[38;5;129;01min\u001b[39;00m typed_tokens:\n\u001b[1;32m--> 103\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m token_type \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m (tokenize\u001b[38;5;241m.\u001b[39mINDENT, tokenize\u001b[38;5;241m.\u001b[39mDEDENT,\n\u001b[0;32m 104\u001b[0m tokenize\u001b[38;5;241m.\u001b[39mNL)\n\u001b[0;32m 105\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m token_type \u001b[38;5;241m==\u001b[39m tokenize\u001b[38;5;241m.\u001b[39mNEWLINE:\n\u001b[0;32m 106\u001b[0m \u001b[38;5;28;01mcontinue\u001b[39;00m\n", "\u001b[1;31mAssertionError\u001b[0m: " ] } ], "source": [ "import plotly.express as px\n", "\n", "fig = px.box(result_sorted, x='Treatment_Type', y='%_B7H4', \n", " hover_data=result_sorted.columns,\n", " color='Treatment_Type', # This can be set to a single color if preferred\n", " template='plotly_white', # Starting with a clean white template\n", " )\n", "\n", "fig.update_layout(\n", " title_text='Distribution of % B7H4 in Cancer Cells by Treatment',\n", " title_x=0.5, # Center the title\n", " title_font=dict(size=18, family='Arial, sans-serif'),\n", " xaxis_title='Treatment Type',\n", " yaxis_title='% B7H4',\n", " xaxis=dict(tickangle=-45, title_font=dict(size=14, family='Arial, sans-serif')),\n", " yaxis=dict(title_font=dict(size=14, family='Arial, sans-serif')),\n", " legend_title_text='Treatment',\n", " legend_title_font=dict(size=12, family='Arial, sans-serif'),\n", ")\n", "\n", "# Adjusting gridlines to mimic R's ggplot2 style\n", "fig.update_yaxes(showgrid=True, gridwidth=1, gridcolor='white')\n", "fig.update_xaxes(showline=True, linewidth=2, linecolor='black', mirror=True)\n", "fig.update_yaxes(showline=True, linewidth=2, linecolor='black', mirror=True)\n", "\n", "fig.show()\n", "plot(fig)\n", "\n", "import plotly.io as pio\n", "#pio.write_image(fig, 'Violinplot_%B7H4.png')" ] }, { "cell_type": "code", "execution_count": 178, "id": "d65d70d0-84f0-49d0-afed-06629bf4fa45", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "customdata": [ [ 18, 4, 5.008486602298339e-05 ], [ 663, 0, 0.0018447925651798882 ], [ 61, 41, 0.00016973204596677704 ], [ 135, 31, 0.0003756364951723754 ], [ 12, 120, 3.338991068198893e-05 ], [ 1, 4, 2.7824925568324103e-06 ], [ 5, 25, 1.3912462784162053e-05 ], [ 0, 37, 0 ], [ 1, 1, 2.7824925568324103e-06 ], [ 0, 9, 0 ], [ 1, 6, 2.7824925568324103e-06 ], [ 605, 145, 0.0016834079968836083 ], [ 1093, 7, 0.0030412643646178248 ], [ 347, 27, 0.0009655249172208464 ], [ 930, 1, 0.0025877180778541417 ], [ 48, 55, 0.0001335596427279557 ], [ 884, 100, 0.0024597234202398508 ], [ 2, 7, 5.564985113664821e-06 ], [ 2, 1, 5.564985113664821e-06 ], [ 9, 3, 2.5042433011491696e-05 ], [ 284, 40, 0.0007902278861404046 ], [ 56, 6, 0.00015581958318261499 ], [ 115, 28, 0.0003199866440357272 ], [ 88, 1, 0.0002448593450012521 ], [ 1350, 28, 0.003756364951723754 ], [ 3, 124, 8.347477670497232e-06 ], [ 0, 12, 0 ], [ 3, 6, 8.347477670497232e-06 ], [ 4, 9, 1.1129970227329641e-05 ], [ 0, 13, 0 ], [ 22, 12, 6.121483625031303e-05 ], [ 753, 10, 0.002095216895294805 ], [ 7, 9, 1.9477447897826873e-05 ], [ 1, 0, 2.7824925568324103e-06 ], [ 10, 391, 2.7824925568324105e-05 ], [ 232, 5, 0.0006455382731851192 ], [ 3, 82, 8.347477670497232e-06 ], [ 6, 15, 1.6694955340994464e-05 ], [ 1685, 14, 0.004688499958262611 ], [ 134, 33, 0.00037285400261554303 ], [ 78, 24, 0.00021703441943292801 ], [ 10, 0, 2.7824925568324105e-05 ], [ 68, 90, 0.0001892094938646039 ], [ 22, 63, 6.121483625031303e-05 ], [ 25, 3, 6.956231392081027e-05 ], [ 34, 0, 9.460474693230196e-05 ], [ 748, 5, 0.002081304432510643 ], [ 6, 13, 1.6694955340994464e-05 ], [ 175, 273, 0.00048693619744567183 ], [ 0, 1, 0 ], [ 671, 35, 0.0018670525056345474 ], [ 634, 36, 0.0017641002810317482 ], [ 247, 6, 0.0006872756615376054 ], [ 207, 7, 0.000575975959264309 ], [ 192, 2, 0.0005342385709118228 ], [ 1, 8, 2.7824925568324103e-06 ], [ 2, 3, 5.564985113664821e-06 ], [ 0, 4, 0 ], [ 11, 27, 3.0607418125156515e-05 ], [ 0, 583, 0 ], [ 2, 8, 5.564985113664821e-06 ], [ 3, 71, 8.347477670497232e-06 ], [ 708, 0, 0.0019700047302373467 ], [ 1, 7, 2.7824925568324103e-06 ], [ 3823, 20, 0.010637469044770306 ], [ 11, 50, 3.0607418125156515e-05 ], [ 1, 1285, 2.7824925568324103e-06 ], [ 60, 4, 0.00016694955340994464 ], [ 171, 3, 0.0004758062272183422 ], [ 540, 7, 0.0015025459806895017 ], [ 121, 9, 0.0003366815993767217 ], [ 24, 0, 6.677982136397785e-05 ], [ 251, 14, 0.000698405631764935 ], [ 1, 4, 2.7824925568324103e-06 ], [ 295, 4, 0.0008208353042655611 ], [ 2, 0, 5.564985113664821e-06 ], [ 5, 0, 1.3912462784162053e-05 ], [ 103, 7, 0.00028659673335373827 ], [ 59, 1, 0.0001641670608531122 ], [ 24, 8, 6.677982136397785e-05 ], [ 7, 54, 1.9477447897826873e-05 ], [ 2, 133, 5.564985113664821e-06 ], [ 10, 1, 2.7824925568324105e-05 ], [ 1133, 16, 0.003152564066891121 ], [ 15, 36, 4.173738835248616e-05 ], [ 821, 0, 0.002284426389159409 ], [ 221, 3, 0.0006149308550599627 ], [ 694, 0, 0.0019310498344416928 ], [ 1, 0, 2.7824925568324103e-06 ], [ 16, 0, 4.4519880909318565e-05 ], [ 251, 0, 0.000698405631764935 ], [ 7, 279, 1.9477447897826873e-05 ], [ 1, 4, 2.7824925568324103e-06 ], [ 127, 13, 0.0003533765547177161 ], [ 2, 5, 5.564985113664821e-06 ], [ 325, 2, 0.0009043100809705334 ], [ 4, 0, 1.1129970227329641e-05 ], [ 2694, 2, 0.007496034948106514 ], [ 4, 1, 1.1129970227329641e-05 ], [ 78, 2, 0.00021703441943292801 ], [ 129, 10, 0.000358941539831381 ], [ 1, 8, 2.7824925568324103e-06 ], [ 6, 1, 1.6694955340994464e-05 ], [ 53, 3, 0.00014747210551211776 ], [ 67, 27, 0.00018642700130777151 ], [ 2, 5, 5.564985113664821e-06 ], [ 37, 1, 0.00010295222460279918 ], [ 484, 2, 0.0013467263975068867 ], [ 140, 0, 0.0003895489579565375 ], [ 76, 2, 0.0002114694343192632 ], [ 90, 9, 0.00025042433011491697 ], [ 33, 9, 9.182225437546954e-05 ], [ 29, 4, 8.06922841481399e-05 ], [ 57, 107, 0.00015860207573944738 ], [ 525, 0, 0.0014608085923370154 ], [ 39, 12, 0.00010851720971646401 ], [ 283, 2, 0.0007874453935835722 ], [ 2, 10, 5.564985113664821e-06 ], [ 0, 18, 0 ], [ 53, 13, 0.00014747210551211776 ], [ 564, 85, 0.0015693258020534795 ], [ 169, 177, 0.0004702412421046774 ], [ 0, 16, 0 ], [ 560, 7, 0.00155819583182615 ], [ 1, 7, 2.7824925568324103e-06 ], [ 11, 0, 3.0607418125156515e-05 ], [ 1497, 5, 0.004165391357578118 ], [ 16, 12, 4.4519880909318565e-05 ], [ 29, 83, 8.06922841481399e-05 ], [ 0, 15, 0 ], [ 1395, 4, 0.0038815771167812125 ], [ 1, 28, 2.7824925568324103e-06 ], [ 0, 6, 0 ], [ 812, 0, 0.002259383956147917 ], [ 2, 46, 5.564985113664821e-06 ], [ 161, 2, 0.0004479813016500181 ] ], "hovertemplate": "Treatment_Type=%{x}
%_PDL1=%{y}
B7H4_cells=%{customdata[0]}
PDL1_cells=%{customdata[1]}
%_B7H4=%{customdata[2]}", "legendgroup": "ACT", "marker": { "color": "#636efa" }, "name": "ACT", "notched": false, "offsetgroup": "ACT", "orientation": "v", "showlegend": true, "type": "box", "x": [ "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT" ], "x0": " ", "xaxis": "x", "y": [ 9.796478166099287e-06, 0, 0.0001004139012025177, 7.592270578726947e-05, 0.0002938943449829786, 9.796478166099287e-06, 6.122798853812054e-05, 9.061742303641841e-05, 2.4491195415248216e-06, 2.2042075873723398e-05, 1.469471724914893e-05, 0.00035512233352109917, 1.7143836790673752e-05, 6.612622762117019e-05, 2.4491195415248216e-06, 0.0001347015747838652, 0.0002449119541524822, 1.7143836790673752e-05, 2.4491195415248216e-06, 7.347358624574465e-06, 9.796478166099288e-05, 1.469471724914893e-05, 6.857534716269501e-05, 2.4491195415248216e-06, 6.857534716269501e-05, 0.0003036908231490779, 2.938943449829786e-05, 1.469471724914893e-05, 2.2042075873723398e-05, 3.183855403982268e-05, 2.938943449829786e-05, 2.449119541524822e-05, 2.2042075873723398e-05, 0, 0.0009576057407362054, 1.224559770762411e-05, 0.0002008278024050354, 3.6736793122872325e-05, 3.4287673581347504e-05, 8.082094487031911e-05, 5.877886899659572e-05, 0, 0.00022042075873723396, 0.00015429453111606378, 7.347358624574465e-06, 0, 1.224559770762411e-05, 3.183855403982268e-05, 0.0006686096348362763, 2.4491195415248216e-06, 8.571918395336877e-05, 8.816830349489359e-05, 1.469471724914893e-05, 1.7143836790673752e-05, 4.898239083049643e-06, 1.9592956332198573e-05, 7.347358624574465e-06, 9.796478166099287e-06, 6.612622762117019e-05, 0.0014278366927089712, 1.9592956332198573e-05, 0.00017388748744826235, 0, 1.7143836790673752e-05, 4.898239083049644e-05, 0.0001224559770762411, 0.003147118610859396, 9.796478166099287e-06, 7.347358624574465e-06, 1.7143836790673752e-05, 2.2042075873723398e-05, 0, 3.4287673581347504e-05, 9.796478166099287e-06, 9.796478166099287e-06, 0, 0, 1.7143836790673752e-05, 2.4491195415248216e-06, 1.9592956332198573e-05, 0.00013225245524234037, 0.0003257328990228013, 2.4491195415248216e-06, 3.9185912664397146e-05, 8.816830349489359e-05, 0, 7.347358624574465e-06, 0, 0, 0, 0, 0.0006833043520854253, 9.796478166099287e-06, 3.183855403982268e-05, 1.224559770762411e-05, 4.898239083049643e-06, 0, 4.898239083049643e-06, 2.4491195415248216e-06, 4.898239083049643e-06, 2.449119541524822e-05, 1.9592956332198573e-05, 2.4491195415248216e-06, 7.347358624574465e-06, 6.612622762117019e-05, 1.224559770762411e-05, 2.4491195415248216e-06, 4.898239083049643e-06, 0, 4.898239083049643e-06, 2.2042075873723398e-05, 2.2042075873723398e-05, 9.796478166099287e-06, 0.00026205579094315594, 0, 2.938943449829786e-05, 4.898239083049643e-06, 2.449119541524822e-05, 4.4084151747446796e-05, 3.183855403982268e-05, 0.00020817516102960984, 0.00043349415884989345, 3.9185912664397146e-05, 1.7143836790673752e-05, 1.7143836790673752e-05, 0, 1.224559770762411e-05, 2.938943449829786e-05, 0.0002032769219465602, 3.6736793122872325e-05, 9.796478166099287e-06, 6.857534716269501e-05, 1.469471724914893e-05, 0, 0.0001126594989101418, 4.898239083049643e-06 ], "y0": " ", "yaxis": "y" }, { "alignmentgroup": "True", "customdata": [ [ 0, 20, 0 ], [ 35, 1, 0.0005274818018778352 ], [ 24, 3, 0.00036170180700194414 ], [ 2151, 18, 0.032417524452549244 ], [ 2361, 4, 0.03558241526381625 ], [ 25, 4, 0.00037677271562702513 ], [ 0, 3, 0 ], [ 0, 2, 0 ], [ 71, 0, 0.0010700345123807514 ], [ 281, 1, 0.004234925323647763 ], [ 1008, 6, 0.015191475894081654 ], [ 9, 30, 0.00013563817762572906 ], [ 2, 7, 3.0141817250162012e-05 ], [ 1, 198, 1.5070908625081006e-05 ], [ 40, 5, 0.0006028363450032402 ], [ 140, 12, 0.0021099272075113407 ], [ 28, 1, 0.00042198544150226817 ], [ 47, 0, 0.0007083327053788073 ], [ 124, 0, 0.0018687926695100448 ], [ 2, 6, 3.0141817250162012e-05 ], [ 6, 0, 9.042545175048603e-05 ], [ 285, 307, 0.004295208958148087 ], [ 39, 46, 0.0005877654363781593 ], [ 152, 2, 0.002290778111012313 ], [ 1260, 3, 0.01898934486760207 ], [ 14, 7, 0.00021099272075113408 ], [ 3, 19, 4.521272587524302e-05 ], [ 215, 126, 0.003240245354392416 ], [ 90, 0, 0.0013563817762572905 ], [ 1, 34, 1.5070908625081006e-05 ], [ 2, 18, 3.0141817250162012e-05 ], [ 15, 6, 0.00022606362937621508 ], [ 1563, 9, 0.023555830181001613 ], [ 154, 5, 0.002320919928262475 ], [ 207, 23, 0.003119678085391768 ], [ 472, 303, 0.007113468871038235 ] ], "hovertemplate": "Treatment_Type=%{x}
%_PDL1=%{y}
B7H4_cells=%{customdata[0]}
PDL1_cells=%{customdata[1]}
%_B7H4=%{customdata[2]}", "legendgroup": "NACT", "marker": { "color": "#EF553B" }, "name": "NACT", "notched": false, "offsetgroup": "NACT", "orientation": "v", "showlegend": true, "type": "box", "x": [ "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT" ], "x0": " ", "xaxis": "x", "y": [ 0.000249613099695472, 1.2480654984773601e-05, 3.74419649543208e-05, 0.00022465178972592482, 4.9922619939094404e-05, 4.9922619939094404e-05, 3.74419649543208e-05, 2.4961309969547202e-05, 0, 1.2480654984773601e-05, 7.48839299086416e-05, 0.00037441964954320803, 8.736458489341521e-05, 0.002471169686985173, 6.2403274923868e-05, 0.0001497678598172832, 1.2480654984773601e-05, 0, 0, 7.48839299086416e-05, 0, 0.0038315610803254956, 0.0005741101292995856, 2.4961309969547202e-05, 3.74419649543208e-05, 8.736458489341521e-05, 0.00023713244471069842, 0.0015725625280814737, 0, 0.00042434226948230244, 0.00022465178972592482, 7.48839299086416e-05, 0.00011232589486296241, 6.2403274923868e-05, 0.0002870550646497928, 0.0037816384603864012 ], "y0": " ", "yaxis": "y" } ], "layout": { "boxmode": "overlay", "legend": { "title": { "font": { "family": "Arial, sans-serif", "size": 12 }, "text": "Treatment" }, "tracegroupgap": 0 }, "margin": { "t": 60 }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "#C8D4E3", "linecolor": "#C8D4E3", "minorgridcolor": "#C8D4E3", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "#C8D4E3", "linecolor": "#C8D4E3", "minorgridcolor": "#C8D4E3", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "white", "showlakes": true, "showland": true, "subunitcolor": "#C8D4E3" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "white", "polar": { "angularaxis": { "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "" }, "bgcolor": "white", "radialaxis": { "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "white", "gridcolor": "#DFE8F3", "gridwidth": 2, "linecolor": "#EBF0F8", "showbackground": true, "ticks": "", "zerolinecolor": "#EBF0F8" }, "yaxis": { "backgroundcolor": "white", "gridcolor": "#DFE8F3", "gridwidth": 2, "linecolor": "#EBF0F8", "showbackground": true, "ticks": "", "zerolinecolor": "#EBF0F8" }, "zaxis": { "backgroundcolor": "white", "gridcolor": "#DFE8F3", "gridwidth": 2, "linecolor": "#EBF0F8", "showbackground": true, "ticks": "", "zerolinecolor": "#EBF0F8" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "#DFE8F3", "linecolor": "#A2B1C6", "ticks": "" }, "baxis": { "gridcolor": "#DFE8F3", "linecolor": "#A2B1C6", "ticks": "" }, "bgcolor": "white", "caxis": { "gridcolor": "#DFE8F3", "linecolor": "#A2B1C6", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "#EBF0F8", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "#EBF0F8", "zerolinewidth": 2 } } }, "title": { "font": { "family": "Arial, sans-serif", "size": 18 }, "text": "Distribution of % PDL1 in Cancer Cells by Treatment", "x": 0.5 }, "xaxis": { "anchor": "y", "autorange": true, "categoryarray": [ "ACT", "NACT" ], "categoryorder": "array", "domain": [ 0, 1 ], "linecolor": "black", "linewidth": 2, "mirror": true, "range": [ -0.5, 1.5 ], "showline": true, "tickangle": -45, "title": { "font": { "family": "Arial, sans-serif", "size": 14 }, "text": "Treatment Type" }, "type": "category" }, "yaxis": { "anchor": "x", "autorange": true, "domain": [ 0, 1 ], "gridcolor": "white", "gridwidth": 1, "linecolor": "black", "linewidth": 2, "mirror": true, "range": [ -0.00021286450446252752, 0.0040444255847880235 ], "showgrid": true, "showline": true, "title": { "font": { "family": "Arial, sans-serif", "size": 14 }, "text": "% PDL1" }, "type": "linear" } } } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "fig = px.box(result_sorted, x='Treatment_Type', y='%_PDL1', \n", " hover_data=result_sorted.columns,\n", " color='Treatment_Type', # This can be set to a single color if preferred\n", " template='plotly_white', # Starting with a clean white template\n", " )\n", "\n", "fig.update_layout(\n", " title_text='Distribution of % PDL1 in Cancer Cells by Treatment',\n", " title_x=0.5, # Center the title\n", " title_font=dict(size=18, family='Arial, sans-serif'),\n", " xaxis_title='Treatment Type',\n", " yaxis_title='% PDL1',\n", " xaxis=dict(tickangle=-45, title_font=dict(size=14, family='Arial, sans-serif')),\n", " yaxis=dict(title_font=dict(size=14, family='Arial, sans-serif')),\n", " legend_title_text='Treatment',\n", " legend_title_font=dict(size=12, family='Arial, sans-serif'),\n", ")\n", "\n", "# Adjusting gridlines to mimic R's ggplot2 style\n", "fig.update_yaxes(showgrid=True, gridwidth=1, gridcolor='white')\n", "fig.update_xaxes(showline=True, linewidth=2, linecolor='black', mirror=True)\n", "fig.update_yaxes(showline=True, linewidth=2, linecolor='black', mirror=True)\n", "\n", "\n", "fig.show()\n", "plot(fig)\n", "\n", "\n", "import plotly.io as pio\n", "#pio.write_image(fig, 'Violinplot_%PDL1.png')" ] }, { "cell_type": "code", "execution_count": 194, "id": "b846e26c-ffe2-4996-8c80-b7e80d85aa73", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "alignmentgroup": "True", "hovertemplate": "Treatment_Type=%{x}
%_B7H4=%{y}", "legendgroup": "ACT", "marker": { "color": "#327EBA" }, "name": "ACT", "notched": false, "offsetgroup": "ACT", "orientation": "v", "showlegend": true, "type": "box", "x": [ "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT" ], "x0": " ", "xaxis": "x", "y": [ 5.008486602298339e-05, 0.0018447925651798882, 0.00016973204596677704, 0.0003756364951723754, 3.338991068198893e-05, 2.7824925568324103e-06, 1.3912462784162053e-05, 0, 2.7824925568324103e-06, 0, 2.7824925568324103e-06, 0.0016834079968836083, 0.0030412643646178248, 0.0009655249172208464, 0.0025877180778541417, 0.0001335596427279557, 0.0024597234202398508, 5.564985113664821e-06, 5.564985113664821e-06, 2.5042433011491696e-05, 0.0007902278861404046, 0.00015581958318261499, 0.0003199866440357272, 0.0002448593450012521, 0.003756364951723754, 8.347477670497232e-06, 0, 8.347477670497232e-06, 1.1129970227329641e-05, 0, 6.121483625031303e-05, 0.002095216895294805, 1.9477447897826873e-05, 2.7824925568324103e-06, 2.7824925568324105e-05, 0.0006455382731851192, 8.347477670497232e-06, 1.6694955340994464e-05, 0.004688499958262611, 0.00037285400261554303, 0.00021703441943292801, 2.7824925568324105e-05, 0.0001892094938646039, 6.121483625031303e-05, 6.956231392081027e-05, 9.460474693230196e-05, 0.002081304432510643, 1.6694955340994464e-05, 0.00048693619744567183, 0, 0.0018670525056345474, 0.0017641002810317482, 0.0006872756615376054, 0.000575975959264309, 0.0005342385709118228, 2.7824925568324103e-06, 5.564985113664821e-06, 0, 3.0607418125156515e-05, 0, 5.564985113664821e-06, 8.347477670497232e-06, 0.0019700047302373467, 2.7824925568324103e-06, 0.010637469044770306, 3.0607418125156515e-05, 2.7824925568324103e-06, 0.00016694955340994464, 0.0004758062272183422, 0.0015025459806895017, 0.0003366815993767217, 6.677982136397785e-05, 0.000698405631764935, 2.7824925568324103e-06, 0.0008208353042655611, 5.564985113664821e-06, 1.3912462784162053e-05, 0.00028659673335373827, 0.0001641670608531122, 6.677982136397785e-05, 1.9477447897826873e-05, 5.564985113664821e-06, 2.7824925568324105e-05, 0.003152564066891121, 4.173738835248616e-05, 0.002284426389159409, 0.0006149308550599627, 0.0019310498344416928, 2.7824925568324103e-06, 4.4519880909318565e-05, 0.000698405631764935, 1.9477447897826873e-05, 2.7824925568324103e-06, 0.0003533765547177161, 5.564985113664821e-06, 0.0009043100809705334, 1.1129970227329641e-05, 0.007496034948106514, 1.1129970227329641e-05, 0.00021703441943292801, 0.000358941539831381, 2.7824925568324103e-06, 1.6694955340994464e-05, 0.00014747210551211776, 0.00018642700130777151, 5.564985113664821e-06, 0.00010295222460279918, 0.0013467263975068867, 0.0003895489579565375, 0.0002114694343192632, 0.00025042433011491697, 9.182225437546954e-05, 8.06922841481399e-05, 0.00015860207573944738, 0.0014608085923370154, 0.00010851720971646401, 0.0007874453935835722, 5.564985113664821e-06, 0, 0.00014747210551211776, 0.0015693258020534795, 0.0004702412421046774, 0, 0.00155819583182615, 2.7824925568324103e-06, 3.0607418125156515e-05, 0.004165391357578118, 4.4519880909318565e-05, 8.06922841481399e-05, 0, 0.0038815771167812125, 2.7824925568324103e-06, 0, 0.002259383956147917, 5.564985113664821e-06, 0.0004479813016500181 ], "y0": " ", "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Treatment_Type=%{x}
%_B7H4=%{y}", "legendgroup": "NACT", "marker": { "color": "#E06663" }, "name": "NACT", "notched": false, "offsetgroup": "NACT", "orientation": "v", "showlegend": true, "type": "box", "x": [ "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT" ], "x0": " ", "xaxis": "x", "y": [ 0, 0.0005274818018778352, 0.00036170180700194414, 0.032417524452549244, 0.03558241526381625, 0.00037677271562702513, 0, 0, 0.0010700345123807514, 0.004234925323647763, 0.015191475894081654, 0.00013563817762572906, 3.0141817250162012e-05, 1.5070908625081006e-05, 0.0006028363450032402, 0.0021099272075113407, 0.00042198544150226817, 0.0007083327053788073, 0.0018687926695100448, 3.0141817250162012e-05, 9.042545175048603e-05, 0.004295208958148087, 0.0005877654363781593, 0.002290778111012313, 0.01898934486760207, 0.00021099272075113408, 4.521272587524302e-05, 0.003240245354392416, 0.0013563817762572905, 1.5070908625081006e-05, 3.0141817250162012e-05, 0.00022606362937621508, 0.023555830181001613, 0.002320919928262475, 0.003119678085391768, 0.007113468871038235 ], "y0": " ", "yaxis": "y" }, { "alignmentgroup": "True", "hovertemplate": "Treatment_Type=%{x}
%_PDL1=%{y}", "legendgroup": "ACT", "marker": { "color": "#327EBA" }, "name": "ACT", "notched": false, "offsetgroup": "ACT", "orientation": "v", "showlegend": true, "type": "box", "x": [ "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT", "ACT" ], "x0": " ", "xaxis": "x2", "y": [ 9.796478166099287e-06, 0, 0.0001004139012025177, 7.592270578726947e-05, 0.0002938943449829786, 9.796478166099287e-06, 6.122798853812054e-05, 9.061742303641841e-05, 2.4491195415248216e-06, 2.2042075873723398e-05, 1.469471724914893e-05, 0.00035512233352109917, 1.7143836790673752e-05, 6.612622762117019e-05, 2.4491195415248216e-06, 0.0001347015747838652, 0.0002449119541524822, 1.7143836790673752e-05, 2.4491195415248216e-06, 7.347358624574465e-06, 9.796478166099288e-05, 1.469471724914893e-05, 6.857534716269501e-05, 2.4491195415248216e-06, 6.857534716269501e-05, 0.0003036908231490779, 2.938943449829786e-05, 1.469471724914893e-05, 2.2042075873723398e-05, 3.183855403982268e-05, 2.938943449829786e-05, 2.449119541524822e-05, 2.2042075873723398e-05, 0, 0.0009576057407362054, 1.224559770762411e-05, 0.0002008278024050354, 3.6736793122872325e-05, 3.4287673581347504e-05, 8.082094487031911e-05, 5.877886899659572e-05, 0, 0.00022042075873723396, 0.00015429453111606378, 7.347358624574465e-06, 0, 1.224559770762411e-05, 3.183855403982268e-05, 0.0006686096348362763, 2.4491195415248216e-06, 8.571918395336877e-05, 8.816830349489359e-05, 1.469471724914893e-05, 1.7143836790673752e-05, 4.898239083049643e-06, 1.9592956332198573e-05, 7.347358624574465e-06, 9.796478166099287e-06, 6.612622762117019e-05, 0.0014278366927089712, 1.9592956332198573e-05, 0.00017388748744826235, 0, 1.7143836790673752e-05, 4.898239083049644e-05, 0.0001224559770762411, 0.003147118610859396, 9.796478166099287e-06, 7.347358624574465e-06, 1.7143836790673752e-05, 2.2042075873723398e-05, 0, 3.4287673581347504e-05, 9.796478166099287e-06, 9.796478166099287e-06, 0, 0, 1.7143836790673752e-05, 2.4491195415248216e-06, 1.9592956332198573e-05, 0.00013225245524234037, 0.0003257328990228013, 2.4491195415248216e-06, 3.9185912664397146e-05, 8.816830349489359e-05, 0, 7.347358624574465e-06, 0, 0, 0, 0, 0.0006833043520854253, 9.796478166099287e-06, 3.183855403982268e-05, 1.224559770762411e-05, 4.898239083049643e-06, 0, 4.898239083049643e-06, 2.4491195415248216e-06, 4.898239083049643e-06, 2.449119541524822e-05, 1.9592956332198573e-05, 2.4491195415248216e-06, 7.347358624574465e-06, 6.612622762117019e-05, 1.224559770762411e-05, 2.4491195415248216e-06, 4.898239083049643e-06, 0, 4.898239083049643e-06, 2.2042075873723398e-05, 2.2042075873723398e-05, 9.796478166099287e-06, 0.00026205579094315594, 0, 2.938943449829786e-05, 4.898239083049643e-06, 2.449119541524822e-05, 4.4084151747446796e-05, 3.183855403982268e-05, 0.00020817516102960984, 0.00043349415884989345, 3.9185912664397146e-05, 1.7143836790673752e-05, 1.7143836790673752e-05, 0, 1.224559770762411e-05, 2.938943449829786e-05, 0.0002032769219465602, 3.6736793122872325e-05, 9.796478166099287e-06, 6.857534716269501e-05, 1.469471724914893e-05, 0, 0.0001126594989101418, 4.898239083049643e-06 ], "y0": " ", "yaxis": "y2" }, { "alignmentgroup": "True", "hovertemplate": "Treatment_Type=%{x}
%_PDL1=%{y}", "legendgroup": "NACT", "marker": { "color": "#E06663" }, "name": "NACT", "notched": false, "offsetgroup": "NACT", "orientation": "v", "showlegend": true, "type": "box", "x": [ "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT", "NACT" ], "x0": " ", "xaxis": "x2", "y": [ 0.000249613099695472, 1.2480654984773601e-05, 3.74419649543208e-05, 0.00022465178972592482, 4.9922619939094404e-05, 4.9922619939094404e-05, 3.74419649543208e-05, 2.4961309969547202e-05, 0, 1.2480654984773601e-05, 7.48839299086416e-05, 0.00037441964954320803, 8.736458489341521e-05, 0.002471169686985173, 6.2403274923868e-05, 0.0001497678598172832, 1.2480654984773601e-05, 0, 0, 7.48839299086416e-05, 0, 0.0038315610803254956, 0.0005741101292995856, 2.4961309969547202e-05, 3.74419649543208e-05, 8.736458489341521e-05, 0.00023713244471069842, 0.0015725625280814737, 0, 0.00042434226948230244, 0.00022465178972592482, 7.48839299086416e-05, 0.00011232589486296241, 6.2403274923868e-05, 0.0002870550646497928, 0.0037816384603864012 ], "y0": " ", "yaxis": "y2" } ], "layout": { "annotations": [ { "font": { "size": 16 }, "showarrow": false, "text": "Distribution of % B7H4", "x": 0.2475, "xanchor": "center", "xref": "paper", "y": 1, "yanchor": "bottom", "yref": "paper" }, { "font": { "size": 16 }, "showarrow": false, "text": "Distribution of % PDL1", "x": 0.7525, "xanchor": "center", "xref": "paper", "y": 1, "yanchor": "bottom", "yref": "paper" } ], "height": 700, "legend": { "title": { "font": { "family": "Arial, sans-serif", "size": 12 }, "text": "Treatment" } }, "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "#C8D4E3", "linecolor": "#C8D4E3", "minorgridcolor": "#C8D4E3", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "#C8D4E3", "linecolor": "#C8D4E3", "minorgridcolor": "#C8D4E3", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ], "sequentialminus": [ [ 0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "white", "showlakes": true, "showland": true, "subunitcolor": "#C8D4E3" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "white", "polar": { "angularaxis": { "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "" }, "bgcolor": "white", "radialaxis": { "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "white", "gridcolor": "#DFE8F3", "gridwidth": 2, "linecolor": "#EBF0F8", "showbackground": true, "ticks": "", "zerolinecolor": "#EBF0F8" }, "yaxis": { "backgroundcolor": "white", "gridcolor": "#DFE8F3", "gridwidth": 2, "linecolor": "#EBF0F8", "showbackground": true, "ticks": "", "zerolinecolor": "#EBF0F8" }, "zaxis": { "backgroundcolor": "white", "gridcolor": "#DFE8F3", "gridwidth": 2, "linecolor": "#EBF0F8", "showbackground": true, "ticks": "", "zerolinecolor": "#EBF0F8" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "#DFE8F3", "linecolor": "#A2B1C6", "ticks": "" }, "baxis": { "gridcolor": "#DFE8F3", "linecolor": "#A2B1C6", "ticks": "" }, "bgcolor": "white", "caxis": { "gridcolor": "#DFE8F3", "linecolor": "#A2B1C6", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "#EBF0F8", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "#EBF0F8", "zerolinewidth": 2 } } }, "title": { "font": { "family": "Arial, sans-serif", "size": 18 }, "text": "Distribution of % B7H4 and % PDL1 in Cancer Cells by Treatment", "x": 0.5 }, "width": 950, "xaxis": { "anchor": "y", "autorange": true, "domain": [ 0, 0.495 ], "linecolor": "black", "linewidth": 2, "mirror": true, "range": [ -0.5, 1.5 ], "showline": true, "tickangle": -45, "title": { "font": { "family": "Arial, sans-serif", "size": 14 }, "text": "Treatment Type" }, "type": "category" }, "xaxis2": { "anchor": "y2", "autorange": true, "domain": [ 0.505, 1 ], "linecolor": "black", "linewidth": 2, "mirror": true, "range": [ -0.5, 1.5 ], "showline": true, "type": "category" }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "gridcolor": "white", "gridwidth": 1, "linecolor": "black", "linewidth": 2, "mirror": true, "range": [ -0.001, 0.036 ], "showgrid": true, "showline": true, "title": { "font": { "family": "Arial, sans-serif", "size": 14 }, "text": "Percentage" }, "type": "linear" }, "yaxis2": { "anchor": "x2", "domain": [ 0, 1 ], "gridcolor": "white", "gridwidth": 1, "linecolor": "black", "linewidth": 2, "matches": "y", "mirror": true, "range": [ -0.001, 0.036 ], "showgrid": true, "showline": true, "showticklabels": false, "type": "linear" } } } }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/plain": [ "'temp-plot.html'" ] }, "execution_count": 194, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# both on the same plot\n", "import plotly.graph_objects as go\n", "from plotly.subplots import make_subplots\n", "import plotly.express as px\n", "\n", "# Assuming 'result_sorted' is your DataFrame\n", "\n", "# Create subplots with a shared y-axis\n", "fig = make_subplots(rows=1, cols=2,\n", " shared_yaxes=True, \n", " horizontal_spacing=0.01,\n", " subplot_titles=('Distribution of % B7H4', 'Distribution of % PDL1'))\n", "\n", "# Define a color map for the treatment types\n", "color_map = {'ACT': \"#327EBA\", 'NACT': \"#E06663\"}\n", "\n", "# Add first plot for % B7H4\n", "fig1 = px.box(result_sorted, x='Treatment_Type', y='%_B7H4', template='plotly_white',\n", " color='Treatment_Type', color_discrete_map=color_map)\n", "for trace in fig1.data:\n", " fig.add_trace(trace, row=1, col=1)\n", "\n", "# Add second plot for % PDL1\n", "fig2 = px.box(result_sorted, x='Treatment_Type', y='%_PDL1', template='plotly_white',\n", " color='Treatment_Type', color_discrete_map=color_map)\n", "for trace in fig2.data:\n", " fig.add_trace(trace, row=1, col=2)\n", "\n", "# Update layout to match the style and adjust gridlines\n", "fig.update_layout(\n", " title_text='Distribution of % B7H4 and % PDL1 in Cancer Cells by Treatment',\n", " title_x=0.5,\n", " title_font=dict(size=18, family='Arial, sans-serif'),\n", " xaxis_title='Treatment Type',\n", " yaxis_title='Percentage',\n", " xaxis=dict(tickangle=-45, title_font=dict(size=14, family='Arial, sans-serif')),\n", " yaxis=dict(title_font=dict(size=14, family='Arial, sans-serif')),\n", " legend_title_text='Treatment',\n", " legend_title_font=dict(size=12, family='Arial, sans-serif'),\n", " template='plotly_white',\n", " width=950, # Increase the width of the figure\n", " height=700, # Increase the height of the figure\n", ")\n", "\n", "# Set y-axis range to enhance visibility\n", "fig.update_yaxes(range=[-0.001, 0.036]) # Adjust this range based on your data\n", " \n", "# Adjust grid and lines\n", "fig.update_yaxes(showgrid=True, gridwidth=1, gridcolor='white')\n", "fig.update_xaxes(showline=True, linewidth=2, linecolor='black', mirror=True)\n", "fig.update_yaxes(showline=True, linewidth=2, linecolor='black', mirror=True)\n", "\n", "fig.show()\n", "\n", "\n", "plot(fig)" ] }, { "cell_type": "code", "execution_count": null, "id": "81ee2131-cf48-466b-8919-63a3da78b30c", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "a81b0396", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "e33eb527", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "0d82f232-533c-46b5-9f6a-051d9271f51b", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "6961332e-8b09-41f6-8360-53799f0a348b", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "03832944-4339-4a44-b3c1-070ce13595ce", "metadata": {}, "outputs": [], "source": [ "f=" ] }, { "cell_type": "markdown", "id": "857a014e-49d0-4a4c-b582-09e28d44e754", "metadata": {}, "source": [ "## V.5. XY MAPS" ] }, { "cell_type": "markdown", "id": "51c2588d-e4ba-4891-80bd-e30dd1cd3ee9", "metadata": {}, "source": [ "#### V.5.1. CELL SUBTYPES" ] }, { "cell_type": "code", "execution_count": null, "id": "f175de05-afb0-43e0-b145-d380b7a28643", "metadata": {}, "outputs": [], "source": [ "#Create a x, y map and visualize the tissues architecture\n", "for sample in ls_samples:\n", " sample_id = sample.split('_')[0] + '.csv'\n", " sample_id2 = sample.split('_')[0]\n", " location_colors = df.loc[df['Sample_ID'] == sample_id,['Nuc_X','Nuc_Y_Inv','cell_type']]\n", "\n", " #print('nb c endo',len(location_colors.loc[location_colors['cell_type']=='ENDOTHELIAL']))\n", " #print('nb c immune',len(location_colors.loc[location_colors['cell_type']=='IMMUNE']))\n", " #print('nb c cancer',len(location_colors.loc[location_colors['cell_type']=='CANCER']))\n", "\n", " fig = go.Figure()\n", " title = sample_id2 + \" Background Subtracted XY Map cell types\"\n", "\n", " for celltype in df.loc[df['Sample_ID'] == sample_id,'cell_type'].unique():\n", " fig.add_scatter(\n", " mode = 'markers',\n", " marker=dict(size=3, opacity=0.5, color='rgb' + str(cell_type_color_dict[celltype])),\n", " x = location_colors.loc[location_colors['cell_type']==celltype,'Nuc_X'],\n", " y = location_colors.loc[location_colors['cell_type']==celltype,'Nuc_Y_Inv'],\n", " name = celltype)\n", "\n", " fig.update_layout(title = title, plot_bgcolor = 'white')\n", " fig.update_xaxes(title_text = 'Nuc_X', linecolor = 'black')\n", " fig.update_yaxes(title_text = 'Nuc_Y_Inv', linecolor = 'black')\n", " \n", " # Adjust the size of the points\n", " for trace in fig.data:\n", " trace.marker.size = 2 \n", " # Adjust the size of the points\n", " for trace in fig.data:\n", " trace.marker.size = 2 \n", " fig.update_layout(\n", " title=title,\n", " plot_bgcolor='white',\n", " legend=dict(\n", " title='Cell Types', # Titre de la légende\n", " font=dict(\n", " family='Arial',\n", " size=12,\n", " color='black'\n", " ),\n", " bgcolor='white',\n", " bordercolor='black',\n", " borderwidth=0.4,\n", " itemsizing='constant'\n", " )\n", " )\n", " \n", "\n", " #fig.write_image(output_images_dir + \"/\" + title.replace(\" \", \"_\") + \".png\", width=1200, height=800, scale=4)\n", " print(sample_id, \"processed!\")\n", "\n", " fig.show(renderer='png') # Display the figure as png\n", " plot(fig)" ] }, { "cell_type": "code", "execution_count": null, "id": "aeab8d32-f133-4853-85e3-b7643458c415", "metadata": {}, "outputs": [], "source": [ "#Create a x,y map and visualize the tissues architecture\n", "for sample in ls_samples:\n", " sample_id = sample.split('_')[0] + '.csv'\n", " sample_id2 = sample.split('_')[0]\n", " location_colors = df.loc[df['Sample_ID'] == sample_id,['Nuc_X','Nuc_Y_Inv','cell_subtype']]\n", "\n", " fig = go.Figure()\n", " title = sample_id2 + \" Background Subtracted XY Map cell subtypes\"\n", "\n", " for cellsubtype in df.loc[df['Sample_ID'] == sample_id,'cell_subtype'].unique():\n", " fig.add_scatter(\n", " mode = 'markers',\n", " marker = dict(size=3, \n", " opacity=0.5, \n", " color='rgb' + str(cell_subtype_color_dict[cellsubtype])),\n", " x = location_colors.loc[location_colors['cell_subtype']==cellsubtype,'Nuc_X'],\n", " y = location_colors.loc[location_colors['cell_subtype']==cellsubtype,'Nuc_Y_Inv'],\n", " name = cellsubtype)\n", "\n", " fig.update_layout(title = title, plot_bgcolor = 'white')\n", " fig.update_xaxes(title_text = 'Nuc_X', linecolor = 'black')\n", " fig.update_yaxes(title_text = 'Nuc_Y_Inv', linecolor = 'black')\n", " \n", " # Adjust the size of the points\n", " for trace in fig.data:\n", " trace.marker.size = 2 \n", " fig.update_layout(\n", " title=title,\n", " plot_bgcolor='white',\n", " legend=dict(\n", " title='Cell Subtypes', #Legende title\n", " font=dict(\n", " family='Arial',\n", " size=12,\n", " color='black'\n", " ),\n", " bgcolor='white',\n", " bordercolor='black',\n", " borderwidth=0.4,\n", " itemsizing='constant'\n", " )\n", " )\n", " \n", "\n", " fig.write_image(output_images_dir + \"/\" + title.replace(\" \", \"_\") + \".png\", width=1200, height=800, scale=4)\n", " print(sample_id, \"processed!\")\n", "\n", " plot(fig)\n", " fig.show(renderer='png') # Display the figure as png" ] }, { "cell_type": "markdown", "id": "09d8a845-4bdd-4c86-b17f-84639d88b8fc", "metadata": {}, "source": [ "#### V.5.1. IMMUNE CHECKPOINTS" ] }, { "cell_type": "code", "execution_count": null, "id": "55cccde4-5288-45d9-aedf-6d49c0eb5187", "metadata": {}, "outputs": [], "source": [ "immune_checkpoint_color_dict" ] }, { "cell_type": "code", "execution_count": null, "id": "af2bd6ea-df4c-4e66-8a69-f5c491a35384", "metadata": {}, "outputs": [], "source": [ "# !!!! test for B7H4 !!!!\n", "\n", "\n", "for sample in ls_samples:\n", " sample_id = sample.split('_')[0] + '.csv'\n", " sample_id2 = sample.split('_')[0]\n", " location_colors = df.loc[df['Sample_ID'] == sample_id,['Nuc_X','Nuc_Y_Inv','immune_checkpoint']]\n", "\n", "\n", " fig = go.Figure()\n", " title = sample_id2 + \" Background Subtracted XY Map immune checkpoint\"\n", "\n", " for immunecheckpoint in df.loc[df['Sample_ID'] == sample_id,'immune_checkpoint'].unique():\n", " fig.add_scatter(\n", " mode = 'markers',\n", " marker=dict(size=3, opacity=0.5, color='rgb' + str(immune_checkpoint_color_dict[immunecheckpoint])),\n", " x = location_colors.loc[location_colors['immune_checkpoint']==immunecheckpoint,'Nuc_X'],\n", " y = location_colors.loc[location_colors['immune_checkpoint']==immunecheckpoint,'Nuc_Y_Inv'],\n", " name = immunecheckpoint)\n", "\n", " fig.update_layout(title = title, plot_bgcolor = 'white')\n", " fig.update_xaxes(title_text = 'Nuc_X', linecolor = 'black')\n", " fig.update_yaxes(title_text = 'Nuc_Y_Inv', linecolor = 'black')\n", " \n", " # Adjust the size of the points\n", " for trace in fig.data:\n", " trace.marker.size = 2 \n", " # Adjust the size of the points\n", " for trace in fig.data:\n", " trace.marker.size = 2 \n", " fig.update_layout(\n", " title=title,\n", " plot_bgcolor='white',\n", " legend=dict(\n", " title='Immune checkpoint', # Titre de la légende\n", " font=dict(\n", " family='Arial',\n", " size=12,\n", " color='black'\n", " ),\n", " bgcolor='white',\n", " bordercolor='black',\n", " borderwidth=0.4,\n", " itemsizing='constant'\n", " )\n", " )\n", " \n", "\n", " fig.write_image(output_images_dir + \"/\" + title.replace(\" \", \"_\") + \".png\", width=1200, height=800, scale=4)\n", " print(sample_id, \"processed!\")\n", "\n", " fig.show(renderer='png') # Display the figure as png\n", " plot(fig)" ] }, { "cell_type": "code", "execution_count": null, "id": "67915e19-5963-4441-a86d-7181d39f01cd", "metadata": {}, "outputs": [], "source": [ "for sample in ls_samples:\n", " sample_id = sample.split('_')[0] + '.csv'\n", " sample_id2 = sample.split('_')[0]\n", " location_colors = df.loc[df['Sample_ID'] == sample_id, ['Nuc_X', 'Nuc_Y_Inv', 'immune_checkpoint']]\n", "\n", " fig = go.Figure()\n", " title = sample_id2 + \" Background Subtracted XY Map immune checkpoint\"\n", "\n", " for immunecheckpoint in df.loc[df['Sample_ID'] == sample_id, 'immune_checkpoint'].unique():\n", " # Vérifier si la combinaison est dans le dictionnaire avant d'ajouter la trace\n", " if immunecheckpoint in immune_checkpoint_color_dict:\n", " color = 'rgb' + str(immune_checkpoint_color_dict[immunecheckpoint])\n", " \n", " fig.add_scatter(\n", " mode='markers',\n", " marker=dict(size=3, opacity=0.5, color=color),\n", " x=location_colors.loc[location_colors['immune_checkpoint'] == immunecheckpoint, 'Nuc_X'],\n", " y=location_colors.loc[location_colors['immune_checkpoint'] == immunecheckpoint, 'Nuc_Y_Inv'],\n", " name=immunecheckpoint\n", " )\n", " \n", " fig.update_layout(\n", " title=title,\n", " plot_bgcolor='white',\n", " xaxis_title='Nuc_X',\n", " yaxis_title='Nuc_Y_Inv',\n", " legend_title='Immune checkpoint',\n", " legend=dict(\n", " font=dict(\n", " family='Arial',\n", " size=12,\n", " color='black'\n", " ),\n", " bgcolor='white',\n", " bordercolor='black',\n", " borderwidth=0.4,\n", " itemsizing='constant'\n", " )\n", " )\n", " \n", " fig.write_image(output_images_dir + \"/\" + title.replace(\" \", \"_\") + \".png\", width=1200, height=800, scale=4)\n", " print(sample_id, \"processed!\")\n", "\n", " fig.show(renderer='png') # Display the figure as png\n", " plot(fig)\n" ] }, { "cell_type": "code", "execution_count": null, "id": "29ffb8ee-aed1-4f0e-b229-9cd3da3896f1", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "23803970-60db-4ad1-988f-6e3cc5febe45", "metadata": {}, "source": [ "### V.5.2. CELL SUBTYPE DENSITY" ] }, { "cell_type": "markdown", "id": "b3feb8aa-727a-4356-97a4-18ca52c584ae", "metadata": {}, "source": [] }, { "cell_type": "code", "execution_count": null, "id": "9ba082fc-7b05-462d-a7fb-880043b381e4", "metadata": {}, "outputs": [], "source": [ "from shapely.geometry import MultiPoint\n", "\n", " \n", "\n", "# Convert pixel to mm\n", "\n", "df['x_mm'] = df['Nuc_X'] * 0.650 / 1000\n", "\n", "df['y_mm'] = df['Nuc_Y_Inv'] * 0.650 / 1000\n", "\n", " \n", "\n", "# Group by Sample_ID and ROI_Index and calculate the convex hull for each group\n", "\n", "df_grouped = df.groupby(['Sample_ID', 'ROI_index']).apply(lambda group: MultiPoint(group[['x_mm', 'y_mm']].values).convex_hull)\n", "\n", " \n", "\n", "# Calculate the area of each convex hull\n", "\n", "df_area = df_grouped.apply(lambda hull: hull.area if hull.geom_type == 'Polygon' else 0)\n", "\n", " \n", "\n", "# Convert to DataFrame\n", "\n", "df_area = pd.DataFrame(df_area, columns=['Area_mm2'])\n", "\n", " \n", "\n", "print(df_area)" ] }, { "cell_type": "code", "execution_count": null, "id": "cfd53782-4f82-49ac-a9e0-9a6ead74914c", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "405c5c7b-4d99-433e-8b62-176298d61e3f", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "cdfe357d-a691-49a5-836b-0b49c4dd8f6f", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "da02b174-decc-483f-bc5a-9e4828ce96f7", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "83d006dd-7e2a-4e57-9d21-b76717d7b4f3", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "raw", "id": "d0999992-3a79-4c69-8b8c-e25eb084ccc7", "metadata": {}, "source": [] }, { "cell_type": "raw", "id": "24ce3877-172e-47d8-9fbb-4006fd72e04e", "metadata": {}, "source": [] }, { "cell_type": "raw", "id": "463687d9-ce5a-4ab0-9993-2b30402379a0", "metadata": {}, "source": [] }, { "cell_type": "markdown", "id": "953cd672-52c6-4a72-9ad7-1833e2c07cf4", "metadata": {}, "source": [ "## V.6. CORRELATION PLOTS" ] }, { "cell_type": "raw", "id": "483b222a-93ed-456f-9eb8-3f5d03fe4b92", "metadata": {}, "source": [ "!! Correlation plots are not relevant !!\n", "!! We can keep this code but do not use this as interpretation material !!" ] }, { "cell_type": "code", "execution_count": null, "id": "4340ae3a-7c78-41c5-9dbf-27cdd35e38a1", "metadata": {}, "outputs": [], "source": [ "# Get Pearson correlations and P values for all marker values\n", "# First, get we need to determine how many columns we will be evaluating. \n", "# And prepare empty Numpy arrays to hold our data." ] }, { "cell_type": "code", "execution_count": null, "id": "08144838-b58e-425d-b154-808ed22a195c", "metadata": {}, "outputs": [], "source": [ "#This is a work in progress section, need to run this on individual cell types instead of all cell types together\n", "\n", "keep_sample_Set_A = [ 'TMA.csv', 'D3S1.csv', 'D3S2.csv','D3S3.csv','D4S1.csv','D4S2.csv','D4S3.csv','D5S1.csv','D5S2.csv','D5S3.csv']\n", "keep_sample_Set_B = [ 'TMA.csv', 'DD3S1.csv','DD3S2.csv','DD3S3.csv','DD4S1.csv','DD4S2.csv','DD4S3.csv','DD5S1.csv','DD5S2.csv','DD5S3.csv']\n", "keep_cell_type = [ 'CANCER', 'STROMA', 'ENDOTHELIAL', 'IMMUNE' ]\n", "\n", "# Check project name and execute corresponding operations\n", "if project_name == 'Set_A':\n", " keep_sample = keep_sample_Set_A\n", "elif project_name == 'Set_B':\n", " keep_sample = keep_sample_Set_B\n", "else:\n", " raise ValueError(\"Unknown project name.\")\n", "\n", "df_keep_sample = df.loc[(df['Sample_ID'].isin(keep_sample))\n", " & (df['Sample_ID'].isin(keep_sample)), :].copy()\n", "\n", "# df_keep_sample will change regarding which sample you decided to keep in the kee_sample_proj list\n", "df_keep_sample" ] }, { "cell_type": "code", "execution_count": null, "id": "e82126b0-dcc2-4a2f-800b-be7b9beef32f", "metadata": {}, "outputs": [], "source": [ "# n_corr_cols is the number of colums you will compute the correlations with\n", "# (columns in df_keep_sample that are not in the list not_intensities)\n", "n_corr_cols = len(df_keep_sample.columns[~df_keep_sample.columns.isin(not_intensities)])\n", "print(n_corr_cols)" ] }, { "cell_type": "code", "execution_count": null, "id": "8c25e4d8-75d9-40a6-b8cd-5585af9c3dc0", "metadata": {}, "outputs": [], "source": [ "# An empty 2D NumPy array is created with dimensions n_corr_cols by n_corr_cols and assigned to the variable pvalues \n", "# This array is intended to store p-values.\n", "pvalues = np.empty((n_corr_cols, n_corr_cols))\n", "\n", "# Similarly, another empty 2D NumPy array with dimensions n_corr_cols by n_corr_cols is created and assigned to the variable corrvalues. \n", "# This array is intended to store correlation values.\n", "corrvalues = np.empty((n_corr_cols,n_corr_cols))\n", "\n", "#print(pvalues)\n", "#print(corrvalues)" ] }, { "cell_type": "code", "execution_count": null, "id": "b86a1fb3-74e9-4925-aaaa-690dcf8531cc", "metadata": {}, "outputs": [], "source": [ "# Columns of the DataFrame for_corr are renamed using the dictionary full_to_short_names\n", "for_corr = df_keep_sample.loc[:,~df_keep_sample.columns.isin(not_intensities)].copy()\n", "for_corr = for_corr.rename(columns = full_to_short_names)\n", "for_corr.shape" ] }, { "cell_type": "code", "execution_count": null, "id": "fbf3be17-3e89-466f-9258-5c990a540ecf", "metadata": {}, "outputs": [], "source": [ "# Compute Pearson correlation coefficient and the corresponding p-value for each pair of columns in dataframe\n", "for i in range(for_corr.shape[1]):\n", " for j in range(0,for_corr.shape[1]):\n", " col1 = for_corr[for_corr.columns.values[i]]\n", " col2 = for_corr[for_corr.columns.values[j]]\n", " corrvalues[i,j] = pearsonr(col1,col2)[0]\n", " pvalues[i,j] = pearsonr(col1,col2)[1]" ] }, { "cell_type": "code", "execution_count": null, "id": "6b2928ab-4f81-44b1-8fea-ca7295febf58", "metadata": {}, "outputs": [], "source": [ "# Correlation and p-value calculations are being organized and formatted into dataframes\n", "corrvalues = pd.DataFrame(corrvalues).round(3)\n", "corrvalues.columns = for_corr.columns.values\n", "corrvalues.index = for_corr.columns.values\n", "\n", "pvalues = pd.DataFrame(pvalues)\n", "pvalues.columns = for_corr.columns.values\n", "pvalues.index = for_corr.columns.values" ] }, { "cell_type": "markdown", "id": "e595da1a-aa7e-44c0-a203-a052576c2fd7", "metadata": {}, "source": [ "### V.6.1. OPTION 1" ] }, { "cell_type": "raw", "id": "75a032cd-2002-4a10-a8cb-e90af570b5ae", "metadata": {}, "source": [ "Option 1: no correlation value on plot, just put p value and have star is p<=0.05" ] }, { "cell_type": "code", "execution_count": null, "id": "be4d1d04-11d5-4e3b-a01e-a7d2ba898a62", "metadata": {}, "outputs": [], "source": [ "# Visualizing and marking statistically significant p-values with an asterisk (*) \n", "# for ease of interpretation\n", "# p-values that are less than or equal to 0.05\n", "\n", "# p_add_star() in my_modules.py\n", "p_w_star = pvalues.copy()\n", "p_w_star = p_w_star.apply(lambda row: p_add_star(row), axis = 1)\n", "p_w_star.columns = for_corr.columns.values\n", "p_w_star.head()" ] }, { "cell_type": "code", "execution_count": null, "id": "d98ac87b-f60b-4a80-a04f-6692c4180423", "metadata": {}, "outputs": [], "source": [ "# Check if there is non-significant values\n", "for index, row in p_w_star.iterrows():\n", " for col in p_w_star.columns:\n", " value = p_w_star.loc[index, col]\n", " if \"*\" not in value:\n", " print(f\"Value without asterisk found at index: {index}, column: {col}, value: {value}\")" ] }, { "cell_type": "code", "execution_count": null, "id": "4024da71-dd6b-4b05-a92c-36e8a6ecc90a", "metadata": {}, "outputs": [], "source": [ "# Correlation visualization\n", "sb.set()\n", "\n", "x_axis_labels = for_corr.columns.values.tolist()\n", "y_axis_labels = for_corr.columns.values.tolist()\n", "\n", "ax = sb.heatmap(corrvalues, \n", " annot = p_w_star, \n", " annot_kws = {\"size\": 1.25},\n", " fmt = 's',\n", " xticklabels = x_axis_labels, \n", " yticklabels = y_axis_labels,\n", " cbar_kws = {'label':'Pearson correlation'},\n", " linecolor = 'black', \n", " linewidth = 0.5,\n", " cmap = 'coolwarm')\n", "\n", "plt.yticks(rotation=0, size = 5)\n", "ax.xaxis.tick_top() # x axis on top\n", "ax.xaxis.set_label_position('top')\n", "ax.tick_params(length=0)\n", "plt.xticks(rotation=45, size = 5)\n", "plt.setp(ax.xaxis.get_majorticklabels(), ha='left')\n", "\n", "ax.set_title(label = \"Correlations option 1\", fontsize = 20)\n", "plt.tight_layout()\n", "\n", "filename = \"correlations_option1.png\"\n", "filename = os.path.join(output_images_dir, filename)\n", "plt.savefig(filename,dpi=500)" ] }, { "cell_type": "markdown", "id": "dcf458a5-00a4-4e63-b583-668c23fef0b1", "metadata": {}, "source": [ "### V.6.2. OPTION 2" ] }, { "cell_type": "raw", "id": "44434cb5-7ff3-468c-ad6b-5d49ee50debe", "metadata": {}, "source": [ "Option 2: include correlation and 1-3 stars depending on p-value. \n", "1 star: p-value <= 0.05; \n", "2 stars: p-value <= 0.01; \n", "3 stars: p-value <= 0.001." ] }, { "cell_type": "code", "execution_count": null, "id": "7428d69a-00a7-44b1-af3f-ad14a395d448", "metadata": {}, "outputs": [], "source": [ "# If the item is less than or equal to 0.001, it assigns 3 asterisks, \n", "# if less than or equal to 0.01, it assigns 2 asterisks, \n", "# if less than or equal to 0.05, it assigns 1 asterisk, \n", "# and if greater than 0.05, it assigns 0 asterisks. \n", "\n", "# p_to_star() in my_modules.py\n", "p_as_stars = pvalues.copy()\n", "p_as_stars = p_as_stars.apply(lambda row: p_to_star(row), axis = 1)\n", "p_as_stars.columns = for_corr.columns.values\n", "p_as_stars.head()" ] }, { "cell_type": "code", "execution_count": null, "id": "42327081-1765-4335-bda6-907ac21455d3", "metadata": {}, "outputs": [], "source": [ "corr_w_star = corrvalues.round(2).astype(str) + p_as_stars\n", "corr_w_star.head()" ] }, { "cell_type": "code", "execution_count": null, "id": "aa5b1ca4-4bd7-4987-b41d-6f7d6b5eef82", "metadata": {}, "outputs": [], "source": [ "# Check if there is non-significant values\n", "for index, row in corr_w_star.iterrows():\n", " for col in corr_w_star.columns:\n", " value = corr_w_star.loc[index, col]\n", " if \"*\" not in value:\n", " print(f\"Value without asterisk found at index: {index}, column: {col}, value: {value}\")" ] }, { "cell_type": "code", "execution_count": null, "id": "7b8134e4-58ff-4a6c-b194-008ce95b6734", "metadata": {}, "outputs": [], "source": [ "corrvalues.shape" ] }, { "cell_type": "code", "execution_count": null, "id": "4837b7b3-bee4-42cf-afd1-013dfd9b7c32", "metadata": {}, "outputs": [], "source": [ "corr_w_star.shape" ] }, { "cell_type": "code", "execution_count": null, "id": "d0527383-3b44-4277-88e8-cbcf3bb2bfd0", "metadata": {}, "outputs": [], "source": [ "# Correlation visualization\n", "sb.set()\n", "\n", "x_axis_labels = for_corr.columns.values.tolist()\n", "y_axis_labels = for_corr.columns.values.tolist()\n", "\n", "ax = sb.heatmap(corrvalues, \n", " annot = corr_w_star, \n", " annot_kws = {\"size\": 1.25},\n", " fmt = 's',\n", " xticklabels = x_axis_labels, \n", " yticklabels=y_axis_labels,\n", " cbar_kws = {'label':'Pearson correlation'},\n", " linecolor = 'black', linewidth = 0.5,\n", " cmap = 'coolwarm')\n", "\n", "plt.yticks(rotation=0, size = 5)\n", "ax.xaxis.tick_top() # x axis on top\n", "ax.xaxis.set_label_position('top')\n", "ax.tick_params(length=0)\n", "plt.xticks(rotation=45, size = 5)\n", "plt.setp(ax.xaxis.get_majorticklabels(), ha='left')\n", "\n", "ax.set_title(label = \"Correlations option 2\", fontsize = 20)\n", "plt.tight_layout()\n", "\n", "filename = \"correlations_option2.png\"\n", "filename = os.path.join(output_images_dir, filename)\n", "plt.savefig(filename,dpi=500)" ] }, { "cell_type": "code", "execution_count": null, "id": "ccf3ece0-a64b-49b9-b4d4-255ba5744ae0", "metadata": {}, "outputs": [], "source": [ "filename = \"zscore_pearson_correlations.csv\"\n", "filename = os.path.join(output_data_dir, filename)\n", "corrvalues.to_csv(filename, index = True)\n", "\n", "filename = \"zscore_pearson_p-values.csv\"\n", "filename = os.path.join(output_data_dir, filename)\n", "pvalues.to_csv(filename, index = True)" ] }, { "cell_type": "code", "execution_count": null, "id": "d306e691-e82f-4fd5-a818-e7ac594e2d35", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "9a0bcaff-b1bd-4f60-9ff5-faafc907134c", "metadata": {}, "source": [ "## V.7. PCA" ] }, { "cell_type": "code", "execution_count": null, "id": "aeda3882-5cca-4fb8-8239-2872eb4184cd", "metadata": { "tags": [] }, "outputs": [], "source": [ "def demo_PCA(data, c):\n", " reduced_data = PCA(n_components=2).fit_transform(data)\n", " kmeans = KMeans(init=\"k-means++\", n_clusters=c, n_init=4)\n", " kmeans.fit(reduced_data)\n", "\n", " # Step size of the mesh. Decrease to increase the quality of the VQ.\n", " h = 0.02 # point in the mesh [x_min, x_max]x[y_min, y_max].\n", "\n", " # Plot the decision boundary. For that, we will assign a color to each\n", " x_min, x_max = reduced_data[:, 0].min() - 1, reduced_data[:, 0].max() + 1\n", " y_min, y_max = reduced_data[:, 1].min() - 1, reduced_data[:, 1].max() + 1\n", " xx, yy = np.meshgrid(np.arange(x_min, x_max, h), np.arange(y_min, y_max, h))\n", "\n", " # Obtain labels for each point in mesh. Use last trained model.\n", " Z = kmeans.predict(np.c_[xx.ravel(), yy.ravel()])\n", "\n", " # Put the result into a color plot\n", " Z = Z.reshape(xx.shape)\n", " plt.figure(1)\n", " plt.clf()\n", " plt.imshow(\n", " Z,\n", " interpolation=\"nearest\",\n", " extent=(xx.min(), xx.max(), yy.min(), yy.max()),\n", " cmap=plt.cm.Paired,\n", " aspect=\"auto\",\n", " origin=\"lower\",\n", " )\n", "\n", " plt.plot(reduced_data[:, 0], reduced_data[:, 1], \"k.\", markersize=2)\n", " # Plot the centroids as a white X\n", " centroids = kmeans.cluster_centers_\n", " plt.scatter(\n", " centroids[:, 0],\n", " centroids[:, 1],\n", " marker=\"x\",\n", " s=169,\n", " linewidths=3,\n", " color=\"w\",\n", " zorder=10,\n", " )\n", " plt.title(\n", " \"K-means clustering on the dataset (PCA-reduced data)\\n\"\n", " \"Centroids are marked with white cross\"\n", " )\n", " plt.xlim(x_min, x_max)\n", " plt.ylim(y_min, y_max)\n", " plt.xticks(())\n", " plt.yticks(())\n", " plt.show()\n", " \n", " return None\n", "\n", "\n", "def other_PCA(data, c):\n", " reduced_data = PCA(n_components=2).fit_transform(data)\n", " ###kmeans = KMeans(init=\"k-means++\", n_clusters=c, n_init=4)\n", " ###kmeans.fit(reduced_data)\n", " \n", " plt.scatter(reduced_data[:,0], reduced_data[:,1], cmap = 'plasma')\n", " plt.xlabel('1st Principal Component')\n", " plt.ylabel('2nd Principal Component')\n", " plt.title('Scatter Plot of the 2 Principal Component')\n", " plt.show()\n", " \n", " return None" ] }, { "cell_type": "code", "execution_count": null, "id": "e0b598d9-7355-4f58-8065-e6e4cf073526", "metadata": {}, "outputs": [], "source": [ "df_test=df.loc[:,~df.columns.isin(not_intensities)]\n", "demo_PCA(df_test, 100)" ] }, { "cell_type": "code", "execution_count": null, "id": "e15b7d17-f6ce-498d-b92f-5c11081798f0", "metadata": {}, "outputs": [], "source": [ "other_PCA(df_test, 100)" ] }, { "cell_type": "code", "execution_count": null, "id": "1bd0536e-59f9-4d21-916b-93151a94cf5f", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "6fb1db45-9f4a-480e-b51e-3f8722cf8292", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "24c08b97-1995-4f15-9587-396c369a6ce1", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "efaea32f-0cbc-4f11-9618-efc8736a87d1", "metadata": {}, "source": [ "## V.8. KMEANS" ] }, { "cell_type": "code", "execution_count": null, "id": "978dc47e-e957-4922-a731-87bec80112c2", "metadata": {}, "outputs": [], "source": [ "# Define number of clusters - according to set & cell type\n", "\n", "def kmeans_analysis(df, c):\n", " analyzed_df = df.loc[:,~df.columns.isin(not_intensities)]\n", " ###kM = KMeans(n_clusters=c).fit_predict(analyzed_df)\n", " kM = KMeans(n_clusters=c).fit(analyzed_df)\n", " ###centroids = kmeans.cluster_centers_ #list of clusters. Each cluster is a matrix of means for each parameter (protein) analyzed\n", " labels = kM.labels_\n", " clusterCount = np.bincount(labels) #holds information for how many points are in each cluster\n", " ###plt.scatter(normed_V1, normed_V2, s=10, c=labels, cmap='coolwarm') # instead of c=bn_class\n", " return None\n", "\n", "def scale_data(df):\n", " pca = PCA(n_components=2) #We are doing a 2D data visualisation, so we need to select 2 principal components for PCA\n", " sc = StandardScaler()\n", " df_scaled = sc.fit_transform(df.loc[:,~df.columns.isin(not_intensities)])\n", " PCs = pca.fit_transform(df_scaled)\n", " return PCs, df_scaled\n", "\n", "def plot_kmeans(df, nb_cl):\n", " pc, scaled_df = scale_data(df)\n", " ###kmeans = KMeans(n_clusters= nb_cl).fit(scaled_df)\n", " ###df_predict = kmeans.predict(scaled_df)\n", " test = KMeans(n_clusters= nb_cl).fit_predict(scaled_df)\n", " sb.scatterplot(x=pc[:,0],y=pc[:,1],hue=test)\n", " return None\n", "\n", "def kmeans_plotting(df, c):\n", " analyzed_df = df.loc[:,~df.columns.isin(not_intensities)]\n", " #Initialize the class object\n", " kmeans = KMeans(n_clusters= c)\n", " #Predict the labels of clusters.\n", " l = kmeans.fit_predict(analyzed_df) #returns the array of cluster labels each data point belongs to\n", " plot_results(l)\n", " return l\n", "\n", "def plot_results(label): #https://www.askpython.com/python/examples/plot-k-means-clusters-python\n", " #Getting unique labels\n", " u_labels = np.unique(label)\n", " #Plotting the results\n", " for i in u_labels:\n", " plt.scatter(df.iloc[label == i , 0] , df.iloc[label == i , 1] , label = i)\n", " plt.title(\"K-means clustering\")\n", " plt.legend(loc='center left', title = \"Clusters\", bbox_to_anchor=(1, 0.5))\n", " plt.show()\n", " return None" ] }, { "cell_type": "code", "execution_count": null, "id": "a63f40f4-0756-46e5-97e0-0d07fa066bc1", "metadata": {}, "outputs": [], "source": [ "# Define number of clusters - according to set & cell type\n", "\n", "clusterList = kmeans_analysis(df, 20)\n", "plot_kmeans(df, 20)" ] }, { "cell_type": "code", "execution_count": null, "id": "caebf01f-b05b-4b39-a6ae-daa55646cff1", "metadata": { "tags": [] }, "outputs": [], "source": [ "clusterLabels_array = kmeans_plotting(df, 20)" ] }, { "cell_type": "markdown", "id": "213f638b-5d2d-49fd-af69-34835c7f854b", "metadata": {}, "source": [ "## pca + kmean" ] }, { "cell_type": "code", "execution_count": null, "id": "efa95946-e460-4d62-910c-99f43c28cc37", "metadata": { "tags": [] }, "outputs": [], "source": [ "def standardization(df):\n", " df = df.loc[:,~df.columns.isin(not_intensities)]\n", " scaler = StandardScaler()\n", " data_std = scaler.fit_transform(df)\n", " return data_std\n", "\n", "def determine_features_kept(x, y):\n", " real_componentValue = np.interp(0.8, y, x)\n", " rounded_componentValue = round(real_componentValue)\n", " print(\"Number of features/components kept : {}\".format(rounded_componentValue))\n", " return rounded_componentValue\n", "\n", "def explained_variance(pCA):\n", " y = pCA.explained_variance_ratio_\n", " max_range = len(y) + 1\n", " x = range(1,max_range)\n", " plt.figure(figsize = (10,8))\n", " plt.plot(x, y.cumsum(), marker = 'o', linestyle = '--')\n", " plt.title(\"Explained Variance by Components\")\n", " plt.xlabel(\"Number of components\")\n", " plt.ylabel(\"Cumulative Explained Variance\")\n", " plt.show()\n", " nb_features = determine_features_kept(x, y.cumsum())\n", " return nb_features\n", "\n", "def pca_analysis(nb_feat, df):\n", " pca = PCA(n_components = nb_feat)\n", " pca.fit(df)\n", " scores_pca = pca.transform(df)\n", " return scores_pca\n", "\n", "def dimensionality_reduction(df): #using PCA\n", " standard_df = standardization(df)\n", " pca = PCA()\n", " pca.fit(standard_df)\n", " nb_components = explained_variance(pca)\n", " pca_scores = pca_analysis(nb_components, standard_df)\n", " return pca_scores" ] }, { "cell_type": "code", "execution_count": null, "id": "fe2808df-29f3-40d1-94e2-83ae0e95c9ab", "metadata": { "tags": [] }, "outputs": [], "source": [ "scoresPCA = dimensionality_reduction(df)" ] }, { "cell_type": "code", "execution_count": null, "id": "0c60a038-0950-49e6-adaf-b56be3a7d3b7", "metadata": { "tags": [] }, "outputs": [], "source": [ "def determine_slope(a, b):\n", " return abs((b[1] - a[1]) / (b[0] - a[0]))\n", "\n", "def record_slopes(X, Y):\n", " slope_list = []\n", " if len(X) == len(Y):\n", " for i in range(len(X)-1):\n", " A = (X[i], Y[i])\n", " B = (X[i+1], Y[i+1])\n", " slope = determine_slope(A, B)\n", " slope_list.append(slope)\n", " else:\n", " print(\"Error! length of X and Y coordinates do not match!\")\n", " slope_list.append(0)\n", " return slope_list\n", "\n", "def elbow_coordinates(diff_ls, x_coord):\n", " max_diff = max(diff_ls) #the slopes with the highest difference correspond to the \"sharpest\" elbow\n", " index_max = diff_ls.index(max_diff) \n", " s_coord = x_coord[index_max+1] #we determine the X position of the elbow\n", " return s_coord\n", "\n", "def highest_slope_diff(ls_slopes, coord_x):\n", " ls_diffs = [] #list of slope differences\n", " for i in range(len(ls_slopes)-1):\n", " diff = abs(ls_slopes[i] - ls_slopes[i+1]) #compare differences between each slope\n", " ls_diffs.append(diff)\n", " elbow = elbow_coordinates(ls_diffs, coord_x) #returns the X coordinates where the elbow is\n", " return elbow" ] }, { "cell_type": "code", "execution_count": null, "id": "d61cc628-2bc0-4c78-bdde-1e99fa75b6ed", "metadata": { "tags": [] }, "outputs": [], "source": [ "liste = [46405799.34079681, 38240577.23298195, 35026058.95518527, 32185738.815936424, 30500185.571518555, 28678764.340087377, 27418667.363556623, 26234063.97845333, 25405258.778627113, 24454635.699228957]\n", "x = list(range(1, 11))\n", "\n", "highest_slope_diff(liste, x)" ] }, { "cell_type": "code", "execution_count": null, "id": "b83187a4-476e-4d54-b3f3-e152b6ab654e", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "50092353-e190-42d5-bf76-1f59b9579989", "metadata": {}, "source": [ "## V.9. T-SNE" ] }, { "cell_type": "code", "execution_count": null, "id": "34e3b33d-f2f6-4791-9c20-e69c69917b9f", "metadata": {}, "outputs": [], "source": [ "# Implémente notre dataset\n", "## A partir df_tsne, ajoute colonne(s) d'intérêt\n", "cols = list(df.columns)\n", "df['Patient']= df['Patient']\n", "df['cell_type']= df['cell_type']\n", "print('Size of the dataframe: {}'.format(df.shape))\n", "\n", "## Selectionner nb random de valeurs (temp, pr performance)\n", "np.random.seed(50)\n", "rndperm = np.random.permutation(df.shape[0])" ] }, { "cell_type": "code", "execution_count": null, "id": "3caff5dd-8998-49ae-b920-990d66d3770e", "metadata": { "tags": [] }, "outputs": [], "source": [ "#Remove index values (unneeded & handicapping for T-SNE analysis)\n", "df = df.reset_index(drop=True)\n", "df.head()" ] }, { "cell_type": "code", "execution_count": null, "id": "4e98e3e1-7e1c-4e45-809e-314a6298c812", "metadata": { "tags": [] }, "outputs": [], "source": [ "#Keep only the numbers in the patient ID column\n", "df['Patient'] = df['Patient'].map(lambda x: x.lstrip('Pt'))\n", "df.head()" ] }, { "cell_type": "code", "execution_count": null, "id": "161bb688-aada-4219-a8bf-701ca75c5527", "metadata": { "tags": [] }, "outputs": [], "source": [ "#t-sne\n", "N = 20000\n", "\n", "df_subset = df.loc[rndperm[:N],:].copy() #remove later for full subset? (since it is already a subset)\n", "\n", "data_subset = df_subset[cols].values\n", "\n", "pca = PCA(n_components=3)\n", "data_subset" ] }, { "cell_type": "code", "execution_count": null, "id": "5f025c11-0ad8-4fe9-97e8-5e909bedbb51", "metadata": { "tags": [] }, "outputs": [], "source": [ "\n", "pca_result = pca.fit_transform(data_subset)\n", "\n", "df_subset['pca-one'] = pca_result[:,0]\n", "df_subset['pca-two'] = pca_result[:,1] \n", "df_subset['pca-three'] = pca_result[:,2]\n", "\n", "print('Explained variation per principal component: {}'.format(pca.explained_variance_ratio_))" ] }, { "cell_type": "code", "execution_count": null, "id": "01654dbe-b1ab-4e59-98bd-ac66b4092d6e", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "b64686e7-ed59-4fc5-9047-7b957f2265f5", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "2c7ac1e3-0dea-4143-aea0-71247e2272e2", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "09ff9130-a963-4fdd-aa66-353f559292b6", "metadata": {}, "source": [ "## V.10. SAVE" ] }, { "cell_type": "code", "execution_count": null, "id": "c06a342d-a60e-4688-ace6-e358590f70e5", "metadata": {}, "outputs": [], "source": [ "# Save the data by Sample_ID\n", "# Check for the existence of the output file first\n", "for sample in ls_samples:\n", " sample_id = sample.split('_')[0]\n", " filename = os.path.join(output_data_dir, sample_id + \"_\" + step_suffix + \".csv\")\n", " if os.path.exists(filename):\n", " print(\"File by name \"+filename+\" already exists.\")\n", " else:\n", " sample_id_csv = sample_id + '.csv'\n", " df_save = df.loc[df['Sample_ID'] == sample_id_csv, :]\n", " #print(df_save)\n", " filename = os.path.join(output_data_dir, sample_id + \"_\" + step_suffix + \".csv\")\n", " df_save.to_csv(filename, index=True, index_label='ID') # Set index parameter to True to retain the index column\n", " print(\"File \" + filename + \" was created!\")" ] }, { "cell_type": "code", "execution_count": null, "id": "2701ab54-d228-46f3-ba6f-7698ceede677", "metadata": {}, "outputs": [], "source": [ "# Save the dataset as a single file for TSNE/UMAP notebook\n", "filename = \"all_Samples_\" + project_name + \".csv\"\n", "filename = os.path.join(output_data_dir, filename)\n", "\n", "if os.path.exists(filename):\n", " print(\"File by name \"+filename+\" already exists.\")\n", "else :\n", " df.to_csv(filename, index = False)\n", " print(\"File \" + filename + \" was created!\")" ] }, { "cell_type": "code", "execution_count": null, "id": "b09ecaa6-e836-4380-b1f2-428a02049481", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.7" } }, "nbformat": 4, "nbformat_minor": 5 }