diff --git a/notebooks/therapeutics.ipynb b/notebooks/therapeutics.ipynb index 2cade080..a7e7a27d 100644 --- a/notebooks/therapeutics.ipynb +++ b/notebooks/therapeutics.ipynb @@ -12,6 +12,17 @@ "**Current Data Version**: 5.20.0" ] }, + { + "cell_type": "code", + "execution_count": 215, + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.express as px\n", + "import plotly.io as pio" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -21,7 +32,7 @@ }, { "cell_type": "code", - "execution_count": 144, + "execution_count": 197, "metadata": {}, "outputs": [], "source": [ @@ -77,7 +88,7 @@ }, { "cell_type": "code", - "execution_count": 147, + "execution_count": 199, "metadata": {}, "outputs": [ { @@ -209,215 +220,48 @@ " 0\n", " []\n", " \n", - " \n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " ...\n", - " \n", - " \n", - " 1037\n", - " somatic\n", - " moa.assertion:961\n", - " none\n", - " predictsSensitivityTo\n", - " VariantTherapeuticResponseStudy\n", - " NaN\n", - " moa.variant:66\n", - " ABL1 p.T315I (Missense)\n", - " None\n", - " TherapeuticAgent\n", - " None\n", - " moa.normalize.therapy.rxcui:1364347\n", - " Ponatinib\n", - " 0\n", - " []\n", - " \n", - " \n", - " 1038\n", - " somatic\n", - " moa.assertion:963\n", - " none\n", - " predictsSensitivityTo\n", - " VariantTherapeuticResponseStudy\n", - " NaN\n", - " moa.variant:146\n", - " BRAF p.V600K (Missense)\n", - " None\n", - " TherapeuticAgent\n", - " None\n", - " moa.normalize.therapy.ncit:C106254\n", - " Tovorafenib\n", - " 0\n", - " []\n", - " \n", - " \n", - " 1039\n", - " somatic\n", - " moa.assertion:967\n", - " none\n", - " predictsSensitivityTo\n", - " VariantTherapeuticResponseStudy\n", - " NaN\n", - " moa.variant:254\n", - " EGFR p.L858R (Missense)\n", - " None\n", - " TherapeuticAgent\n", - " None\n", - " moa.normalize.therapy.rxcui:337525\n", - " Erlotinib\n", - " 0\n", - " []\n", - " \n", - " \n", - " 1040\n", - " somatic\n", - " moa.assertion:969\n", - " none\n", - " predictsSensitivityTo\n", - " VariantTherapeuticResponseStudy\n", - " NaN\n", - " moa.variant:254\n", - " EGFR p.L858R (Missense)\n", - " None\n", - " TherapeuticAgent\n", - " None\n", - " moa.normalize.therapy.rxcui:328134\n", - " Gefitinib\n", - " 0\n", - " []\n", - " \n", - " \n", - " 1041\n", - " somatic\n", - " moa.assertion:973\n", - " none\n", - " predictsSensitivityTo\n", - " VariantTherapeuticResponseStudy\n", - " NaN\n", - " moa.variant:372\n", - " KRAS p.G12C (Missense)\n", - " None\n", - " CombinationTherapy\n", - " None\n", - " moa.ctid:5e89NyyfMGR167xjfPQC_QJBxBI9OYZx\n", - " None\n", - " 2\n", - " [{'id': 'moa.normalize.therapy.ncit:C157493', ...\n", - " \n", " \n", "\n", - "

1042 rows × 15 columns

\n", "" ], "text/plain": [ - " study_allele_origin study_id study_direction \\\n", - "0 somatic civic.eid:238 supports \n", - "1 somatic civic.eid:1409 supports \n", - "2 somatic civic.eid:1592 supports \n", - "3 somatic civic.eid:1867 supports \n", - "4 somatic civic.eid:2994 supports \n", - "... ... ... ... \n", - "1037 somatic moa.assertion:961 none \n", - "1038 somatic moa.assertion:963 none \n", - "1039 somatic moa.assertion:967 none \n", - "1040 somatic moa.assertion:969 none \n", - "1041 somatic moa.assertion:973 none \n", - "\n", - " study_predicate study_type \\\n", - "0 predictsResistanceTo VariantTherapeuticResponseStudy \n", - "1 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "2 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "3 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "4 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "... ... ... \n", - "1037 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "1038 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "1039 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "1040 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "1041 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "\n", - " variant_mp_score variant_id variant_label \\\n", - "0 406.25 civic.mpid:34 EGFR T790M \n", - "1 1378.50 civic.mpid:12 BRAF V600E \n", - "2 406.25 civic.mpid:34 EGFR T790M \n", - "3 406.25 civic.mpid:34 EGFR T790M \n", - "4 379.00 civic.mpid:33 EGFR L858R \n", - "... ... ... ... \n", - "1037 NaN moa.variant:66 ABL1 p.T315I (Missense) \n", - "1038 NaN moa.variant:146 BRAF p.V600K (Missense) \n", - "1039 NaN moa.variant:254 EGFR p.L858R (Missense) \n", - "1040 NaN moa.variant:254 EGFR p.L858R (Missense) \n", - "1041 NaN moa.variant:372 KRAS p.G12C (Missense) \n", - "\n", - " variant_type therapeutic_type \\\n", - "0 [{\"label\": \"missense_variant\", \"system\": \"http... TherapeuticAgent \n", - "1 [{\"label\": \"missense_variant\", \"system\": \"http... TherapeuticAgent \n", - "2 [{\"label\": \"missense_variant\", \"system\": \"http... TherapeuticAgent \n", - "3 [{\"label\": \"missense_variant\", \"system\": \"http... TherapeuticAgent \n", - "4 [{\"label\": \"missense_variant\", \"system\": \"http... TherapeuticAgent \n", - "... ... ... \n", - "1037 None TherapeuticAgent \n", - "1038 None TherapeuticAgent \n", - "1039 None TherapeuticAgent \n", - "1040 None TherapeuticAgent \n", - "1041 None CombinationTherapy \n", + " study_allele_origin study_id study_direction study_predicate \\\n", + "0 somatic civic.eid:238 supports predictsResistanceTo \n", + "1 somatic civic.eid:1409 supports predictsSensitivityTo \n", + "2 somatic civic.eid:1592 supports predictsSensitivityTo \n", + "3 somatic civic.eid:1867 supports predictsSensitivityTo \n", + "4 somatic civic.eid:2994 supports predictsSensitivityTo \n", "\n", - " therapeutic_civic_type therapeutic_id \\\n", - "0 None civic.tid:15 \n", - "1 None civic.tid:4 \n", - "2 None civic.tid:187 \n", - "3 None civic.tid:187 \n", - "4 None civic.tid:15 \n", - "... ... ... \n", - "1037 None moa.normalize.therapy.rxcui:1364347 \n", - "1038 None moa.normalize.therapy.ncit:C106254 \n", - "1039 None moa.normalize.therapy.rxcui:337525 \n", - "1040 None moa.normalize.therapy.rxcui:328134 \n", - "1041 None moa.ctid:5e89NyyfMGR167xjfPQC_QJBxBI9OYZx \n", + " study_type variant_mp_score variant_id \\\n", + "0 VariantTherapeuticResponseStudy 406.25 civic.mpid:34 \n", + "1 VariantTherapeuticResponseStudy 1378.50 civic.mpid:12 \n", + "2 VariantTherapeuticResponseStudy 406.25 civic.mpid:34 \n", + "3 VariantTherapeuticResponseStudy 406.25 civic.mpid:34 \n", + "4 VariantTherapeuticResponseStudy 379.00 civic.mpid:33 \n", "\n", - " therapeutic_label number_of_components \\\n", - "0 Erlotinib 0 \n", - "1 Vemurafenib 0 \n", - "2 Osimertinib 0 \n", - "3 Osimertinib 0 \n", - "4 Erlotinib 0 \n", - "... ... ... \n", - "1037 Ponatinib 0 \n", - "1038 Tovorafenib 0 \n", - "1039 Erlotinib 0 \n", - "1040 Gefitinib 0 \n", - "1041 None 2 \n", + " variant_label variant_type \\\n", + "0 EGFR T790M [{\"label\": \"missense_variant\", \"system\": \"http... \n", + "1 BRAF V600E [{\"label\": \"missense_variant\", \"system\": \"http... \n", + "2 EGFR T790M [{\"label\": \"missense_variant\", \"system\": \"http... \n", + "3 EGFR T790M [{\"label\": \"missense_variant\", \"system\": \"http... \n", + "4 EGFR L858R [{\"label\": \"missense_variant\", \"system\": \"http... \n", "\n", - " combination_therapy_components \n", - "0 [] \n", - "1 [] \n", - "2 [] \n", - "3 [] \n", - "4 [] \n", - "... ... \n", - "1037 [] \n", - "1038 [] \n", - "1039 [] \n", - "1040 [] \n", - "1041 [{'id': 'moa.normalize.therapy.ncit:C157493', ... \n", + " therapeutic_type therapeutic_civic_type therapeutic_id therapeutic_label \\\n", + "0 TherapeuticAgent None civic.tid:15 Erlotinib \n", + "1 TherapeuticAgent None civic.tid:4 Vemurafenib \n", + "2 TherapeuticAgent None civic.tid:187 Osimertinib \n", + "3 TherapeuticAgent None civic.tid:187 Osimertinib \n", + "4 TherapeuticAgent None civic.tid:15 Erlotinib \n", "\n", - "[1042 rows x 15 columns]" + " number_of_components combination_therapy_components \n", + "0 0 [] \n", + "1 0 [] \n", + "2 0 [] \n", + "3 0 [] \n", + "4 0 [] " ] }, - "execution_count": 147, + "execution_count": 199, "metadata": {}, "output_type": "execute_result" } @@ -449,12 +293,12 @@ "\n", "df = pd.DataFrame(data)\n", "\n", - "df" + "df[0:5]" ] }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 200, "metadata": {}, "outputs": [], "source": [ @@ -555,7 +399,43 @@ }, { "cell_type": "code", - "execution_count": 149, + "execution_count": 233, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "count 123.000000\n", + "mean 798.526423\n", + "std 669.656836\n", + "min 0.750000\n", + "25% 24.500000\n", + "50% 1378.500000\n", + "75% 1378.500000\n", + "max 1378.500000\n", + "Name: variant_mp_score, dtype: float64" + ] + }, + "execution_count": 233, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "braf_df['variant_mp_score'].describe()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Distribution of Variant MP Scores\n", + "Upon manual inspection, I noticed that BRAF containing variants tended to have huge Variant MP Scores and wondered how this compared to the rest of the data set of gene variants with therapeutic data." + ] + }, + { + "cell_type": "code", + "execution_count": 206, "metadata": {}, "outputs": [ { @@ -3562,10 +3442,8 @@ } ], "source": [ - "\n", - "\n", + "braf_df = df[df['variant_label'].str.contains('BRAF')]\n", "not_braf_df = df[~df['variant_label'].str.contains('BRAF')]\n", - "not_braf_df\n", "\n", "combined_df = pd.concat([\n", " pd.DataFrame({'variant_mp_score': df['variant_mp_score'], 'source': 'Combined'}),\n", @@ -3583,372 +3461,175 @@ ")\n", "\n", "# Show the plot\n", - "fig.show()" + "fig.show()\n", + "pio.write_image(fig, \"Var_mp_score_dist_BRAF_vs_Other.png\", format='png', width=1200, height=400, scale=5)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Evidence Only Containing BRAF" + "### Fetch Combination Therapy Components\n", + "Initial query grabbed just the Combo therapy ID. This additional query takes the ctid from each row and just quickly grabs the associated properties to fill out the dataset." + ] + }, + { + "cell_type": "code", + "execution_count": 207, + "metadata": {}, + "outputs": [], + "source": [ + "\n", + "def neo4j_query(combo_id):\n", + " # query for the specific therapy ID components\n", + " query_components = f\"\"\"\n", + " MATCH (c:CombinationTherapy)-[:HAS_COMPONENTS]-(t)\n", + " WHERE c.id = \\'{combo_id}\\'\n", + " RETURN properties(t) AS Therapeutic\n", + " \"\"\"\n", + "\n", + " # Execute the query\n", + " result = execute_query(driver, query_components)\n", + "\n", + " # Close the connection\n", + " driver.close()\n", + " return(result)\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 208, + "metadata": {}, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/var/folders/5t/sfw5tjx56m10xb861_pd3wfm0000gq/T/ipykernel_11898/1403308090.py:2: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/5t/sfw5tjx56m10xb861_pd3wfm0000gq/T/ipykernel_11898/1451180034.py:10: DeprecationWarning:\n", + "\n", + "Using a driver after it has been closed is deprecated. Future versions of the driver will raise an error.\n", + "\n", + "/var/folders/5t/sfw5tjx56m10xb861_pd3wfm0000gq/T/ipykernel_11898/1451180034.py:10: DeprecationWarning:\n", + "\n", + "Using a driver after it has been closed is deprecated. Future versions of the driver will raise an error.\n", + "\n", + "/var/folders/5t/sfw5tjx56m10xb861_pd3wfm0000gq/T/ipykernel_11898/1403308090.py:2: SettingWithCopyWarning:\n", + "\n", + "\n", + "A value is trying to be set on a copy of a slice from a DataFrame.\n", + "Try using .loc[row_indexer,col_indexer] = value instead\n", + "\n", + "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", + "\n", + "/var/folders/5t/sfw5tjx56m10xb861_pd3wfm0000gq/T/ipykernel_11898/1451180034.py:10: DeprecationWarning:\n", + "\n", + "Using a driver after it has been closed is deprecated. Future versions of the driver will raise an error.\n", + "\n" + ] + } + ], + "source": [ + "def get_combination_therapies(tdf):\n", + " tdf['combination_components'] = None\n", + "\n", + " for idx, row in tdf.iterrows():\n", + " result = neo4j_query(row['therapeutic_id'])\n", + " therapeutics = []\n", + " for record in result:\n", + " therapeutics.append(record['Therapeutic'].get('label', None))\n", + " tdf.at[idx, 'combination_components'] = therapeutics\n", + "\n", + " for idx, row in tdf.iterrows():\n", + " if row['therapeutic_type'] == 'CombinationTherapy':\n", + " components = row['combination_components']\n", + " if components is not None: # Check if components is not None\n", + " sorted_components = tuple(sorted(components))\n", + " tdf.at[idx, 'combination_components'] = sorted_components\n", + " return(tdf)\n", + "\n", + "braf_df = get_combination_therapies(braf_df)\n", + "df = get_combination_therapies(df)\n", + "not_braf_df = get_combination_therapies(not_braf_df)" ] }, { "cell_type": "code", - "execution_count": 148, + "execution_count": 209, "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", - "
study_allele_originstudy_idstudy_directionstudy_predicatestudy_typevariant_mp_scorevariant_idvariant_labelvariant_typetherapeutic_typetherapeutic_civic_typetherapeutic_idtherapeutic_labelnumber_of_componentscombination_therapy_components
1somaticcivic.eid:1409supportspredictsSensitivityToVariantTherapeuticResponseStudy1378.5civic.mpid:12BRAF V600E[{\"label\": \"missense_variant\", \"system\": \"http...TherapeuticAgentNonecivic.tid:4Vemurafenib0[]
8somaticcivic.eid:9851supportspredictsSensitivityToVariantTherapeuticResponseStudy1378.5civic.mpid:12BRAF V600E[{\"label\": \"missense_variant\", \"system\": \"http...CombinationTherapyCOMBINATIONcivic.ctid:P1PY89shAjemg7jquQ0V9pg1VnYnkPeKNone2[{'id': 'civic.tid:16', 'regulatory_approval':...
9somaticcivic.eid:3017supportspredictsSensitivityToVariantTherapeuticResponseStudy1378.5civic.mpid:12BRAF V600E[{\"label\": \"missense_variant\", \"system\": \"http...CombinationTherapyCOMBINATIONcivic.ctid:oBrlcO23adoVXv51xh-5Wigy0QyDWtfrNone2[{'id': 'civic.tid:19', 'regulatory_approval':...
12somaticcivic.eid:2505supportspredictsSensitivityToVariantTherapeuticResponseStudy107.5civic.mpid:559BRAF V600K[{\"label\": \"missense_variant\", \"system\": \"http...TherapeuticAgentNonecivic.tid:22Dabrafenib0[]
16somaticcivic.eid:94supportspredictsSensitivityToVariantTherapeuticResponseStudy47.0civic.mpid:11BRAF V600D[{\"label\": \"missense_variant\", \"system\": \"http...TherapeuticAgentNonecivic.tid:22Dabrafenib0[]
................................................
1029somaticmoa.assertion:865nonepredictsSensitivityToVariantTherapeuticResponseStudyNaNmoa.variant:144BRAF p.V600E (Missense)NoneCombinationTherapyNonemoa.ctid:IAMn2xc8QDzi0_zvPzrGlronyv01CoqsNone2[{'id': 'moa.normalize.therapy.rxcui:1424911',...
1032somaticmoa.assertion:911nonepredictsSensitivityToVariantTherapeuticResponseStudyNaNmoa.variant:144BRAF p.V600E (Missense)NoneCombinationTherapyNonemoa.ctid:PGEv4QIKz-vDJF0eyrAfZYTl1fFtDNokNone2[{'id': 'moa.normalize.therapy.rxcui:2049122',...
1033somaticmoa.assertion:944nonepredictsSensitivityToVariantTherapeuticResponseStudyNaNmoa.variant:144BRAF p.V600E (Missense)NoneTherapeuticAgentNonemoa.normalize.therapy.rxcui:1147220Vemurafenib0[]
1034somaticmoa.assertion:945nonepredictsSensitivityToVariantTherapeuticResponseStudyNaNmoa.variant:146BRAF p.V600K (Missense)NoneTherapeuticAgentNonemoa.normalize.therapy.rxcui:1147220Vemurafenib0[]
1038somaticmoa.assertion:963nonepredictsSensitivityToVariantTherapeuticResponseStudyNaNmoa.variant:146BRAF p.V600K (Missense)NoneTherapeuticAgentNonemoa.normalize.therapy.ncit:C106254Tovorafenib0[]
\n", - "

160 rows × 15 columns

\n", - "
" - ], "text/plain": [ - " study_allele_origin study_id study_direction \\\n", - "1 somatic civic.eid:1409 supports \n", - "8 somatic civic.eid:9851 supports \n", - "9 somatic civic.eid:3017 supports \n", - "12 somatic civic.eid:2505 supports \n", - "16 somatic civic.eid:94 supports \n", - "... ... ... ... \n", - "1029 somatic moa.assertion:865 none \n", - "1032 somatic moa.assertion:911 none \n", - "1033 somatic moa.assertion:944 none \n", - "1034 somatic moa.assertion:945 none \n", - "1038 somatic moa.assertion:963 none \n", - "\n", - " study_predicate study_type \\\n", - "1 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "8 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "9 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "12 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "16 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "... ... ... \n", - "1029 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "1032 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "1033 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "1034 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "1038 predictsSensitivityTo VariantTherapeuticResponseStudy \n", - "\n", - " variant_mp_score variant_id variant_label \\\n", - "1 1378.5 civic.mpid:12 BRAF V600E \n", - "8 1378.5 civic.mpid:12 BRAF V600E \n", - "9 1378.5 civic.mpid:12 BRAF V600E \n", - "12 107.5 civic.mpid:559 BRAF V600K \n", - "16 47.0 civic.mpid:11 BRAF V600D \n", - "... ... ... ... \n", - "1029 NaN moa.variant:144 BRAF p.V600E (Missense) \n", - "1032 NaN moa.variant:144 BRAF p.V600E (Missense) \n", - "1033 NaN moa.variant:144 BRAF p.V600E (Missense) \n", - "1034 NaN moa.variant:146 BRAF p.V600K (Missense) \n", - "1038 NaN moa.variant:146 BRAF p.V600K (Missense) \n", - "\n", - " variant_type therapeutic_type \\\n", - "1 [{\"label\": \"missense_variant\", \"system\": \"http... TherapeuticAgent \n", - "8 [{\"label\": \"missense_variant\", \"system\": \"http... CombinationTherapy \n", - "9 [{\"label\": \"missense_variant\", \"system\": \"http... CombinationTherapy \n", - "12 [{\"label\": \"missense_variant\", \"system\": \"http... TherapeuticAgent \n", - "16 [{\"label\": \"missense_variant\", \"system\": \"http... TherapeuticAgent \n", - "... ... ... \n", - "1029 None CombinationTherapy \n", - "1032 None CombinationTherapy \n", - "1033 None TherapeuticAgent \n", - "1034 None TherapeuticAgent \n", - "1038 None TherapeuticAgent \n", - "\n", - " therapeutic_civic_type therapeutic_id \\\n", - "1 None civic.tid:4 \n", - "8 COMBINATION civic.ctid:P1PY89shAjemg7jquQ0V9pg1VnYnkPeK \n", - "9 COMBINATION civic.ctid:oBrlcO23adoVXv51xh-5Wigy0QyDWtfr \n", - "12 None civic.tid:22 \n", - "16 None civic.tid:22 \n", - "... ... ... \n", - "1029 None moa.ctid:IAMn2xc8QDzi0_zvPzrGlronyv01Coqs \n", - "1032 None moa.ctid:PGEv4QIKz-vDJF0eyrAfZYTl1fFtDNok \n", - "1033 None moa.normalize.therapy.rxcui:1147220 \n", - "1034 None moa.normalize.therapy.rxcui:1147220 \n", - "1038 None moa.normalize.therapy.ncit:C106254 \n", - "\n", - " therapeutic_label number_of_components \\\n", - "1 Vemurafenib 0 \n", - "8 None 2 \n", - "9 None 2 \n", - "12 Dabrafenib 0 \n", - "16 Dabrafenib 0 \n", - "... ... ... \n", - "1029 None 2 \n", - "1032 None 2 \n", - "1033 Vemurafenib 0 \n", - "1034 Vemurafenib 0 \n", - "1038 Tovorafenib 0 \n", - "\n", - " combination_therapy_components \n", - "1 [] \n", - "8 [{'id': 'civic.tid:16', 'regulatory_approval':... \n", - "9 [{'id': 'civic.tid:19', 'regulatory_approval':... \n", - "12 [] \n", - "16 [] \n", - "... ... \n", - "1029 [{'id': 'moa.normalize.therapy.rxcui:1424911',... \n", - "1032 [{'id': 'moa.normalize.therapy.rxcui:2049122',... \n", - "1033 [] \n", - "1034 [] \n", - "1038 [] \n", - "\n", - "[160 rows x 15 columns]" + "combination_components\n", + "(Cetuximab, Irinotecan) 12\n", + "(Dactolisib, Selumetinib) 8\n", + "(Lapatinib, Neratinib, Trastuzumab) 4\n", + "(Lapatinib, Trastuzumab) 2\n", + "(Adagrasib, Cetuximab) 2\n", + "(Cetuximab, Fluorouracil, Oxaliplatin) 2\n", + "(Cetuximab, Irinotecan, Vemurafenib) 2\n", + "(Alpelisib, Fulvestrant) 2\n", + "(Azacitidine, Ivosidenib) 2\n", + "(Docetaxel, Selumetinib) 2\n", + "(Capivasertib, Trastuzumab) 1\n", + "(Durvalumab, Osimertinib) 1\n", + "(Daunorubicin, Sunitinib) 1\n", + "(Cytarabine, Sunitinib) 1\n", + "(Cetuximab, Dactolisib) 1\n", + "(Akt Inhibitor MK2206, Vemurafenib) 1\n", + "(Lometrexol, Mercaptopurine) 1\n", + "(Cisplatin, Pictilisib) 1\n", + "(Capivasertib, Lapatinib) 1\n", + "(Erlotinib, Pemetrexed) 1\n", + "(Dasatinib, Erlotinib) 1\n", + "(Capivasertib, PI3K/BET Inhibitor LY294002) 1\n", + "(Cisplatin, Fluorouracil) 1\n", + "(Carboplatin, Paclitaxel) 1\n", + "(Letrozole, Palbociclib) 1\n", + "(Checkpoint Kinase Inhibitor AZD7762, Irinotecan) 1\n", + "(Everolimus, Fulvestrant) 1\n", + "(Olaparib, Temozolomide) 1\n", + "(Fluorouracil, Leucovorin, Trastuzumab) 1\n", + "(Binimetinib, Everolimus) 1\n", + "Name: count, dtype: int64" ] }, - "execution_count": 148, + "execution_count": 209, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "\n", - "braf_df = df[df['variant_label'].str.contains('BRAF')]\n", - "braf_df" + "not_braf_df['combination_components'].value_counts()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Quantify & Graph Therapeutic Application across BRAF/Non-BRAF Variants\n", + "While looking at all variant data in MetaKB that has an attached Therapeutic Application, quantify and graph the distribution of what therapeutic evidence is being applied where for BRAF vs non-BRAF variants" ] }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 210, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": 211, "metadata": {}, "outputs": [ { @@ -3975,7 +3656,7 @@ "Name: count, dtype: int64" ] }, - "execution_count": 72, + "execution_count": 211, "metadata": {}, "output_type": "execute_result" } @@ -3986,3223 +3667,1651 @@ }, { "cell_type": "code", - "execution_count": 66, + "execution_count": 212, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "variant_mp_score\n", - "1378.50 70\n", - "107.50 8\n", - "43.50 7\n", - "5.00 6\n", - "47.00 5\n", - "14.00 4\n", - "6.00 4\n", - "7.50 3\n", - "14.50 3\n", - "0.75 3\n", - "19.00 2\n", - "30.00 2\n", - "12.00 2\n", - "9.50 2\n", - "3.00 1\n", - "2.00 1\n", - "Name: count, dtype: int64" + "therapeutic_label\n", + "Erlotinib 59\n", + "Imatinib 43\n", + "Cetuximab 37\n", + "Gefitinib 31\n", + "Pictilisib 30\n", + " ..\n", + "JAK2 Inhibitor AZD1480 1\n", + "Patidegib 1\n", + "PD173074 1\n", + "AZD3463 1\n", + "Larotrectinib 1\n", + "Name: count, Length: 113, dtype: int64" ] }, - "execution_count": 66, + "execution_count": 212, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "braf_df['variant_mp_score'].value_counts()" + "not_braf_df['therapeutic_label'].value_counts()" ] }, { "cell_type": "code", - "execution_count": 150, + "execution_count": 213, "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " therapeutic_label braf_count general_count not_braf_count\n", + "0 AGI-5198 0 2 2\n", + "1 AZD3463 0 1 1\n", + "2 Abemaciclib 0 1 1\n", + "3 Adagrasib 0 2 2\n", + "4 Afatinib 0 19 19\n", + ".. ... ... ... ...\n", + "118 U0126 2 2 0\n", + "119 Uprosertib 0 1 1\n", + "120 Vemurafenib 52 71 19\n", + "121 Venetoclax 0 4 4\n", + "122 Vismodegib 0 4 4\n", + "\n", + "[123 rows x 4 columns]\n" + ] + } + ], "source": [ + "# Perform value_counts on the 'therapeutic_label' column\n", + "braf_counts = braf_df['therapeutic_label'].value_counts().rename_axis('therapeutic_label').reset_index(name='braf_count')\n", + "df_counts = df['therapeutic_label'].value_counts().rename_axis('therapeutic_label').reset_index(name='general_count')\n", + "not_braf_counts = not_braf_df['therapeutic_label'].value_counts().rename_axis('therapeutic_label').reset_index(name='not_braf_count')\n", "\n", - "def neo4j_query(combo_id):\n", - " # query for the specific therapy ID components\n", - " query_components = f\"\"\"\n", - " MATCH (c:CombinationTherapy)-[:HAS_COMPONENTS]-(t)\n", - " WHERE c.id = \\'{combo_id}\\'\n", - " RETURN properties(t) AS Therapeutic\n", - " \"\"\"\n", + "# Combine the three DataFrames into one\n", + "combined_df = pd.merge(pd.merge(braf_counts, df_counts, on='therapeutic_label', how='outer'), not_braf_counts, on='therapeutic_label', how='outer').fillna(0)\n", "\n", - " # Execute the query\n", - " result = execute_query(driver, query_components)\n", + "# Convert counts to integers (optional, in case NaNs were filled)\n", + "combined_df[['braf_count', 'general_count', 'not_braf_count']] = combined_df[['braf_count', 'general_count', 'not_braf_count']].astype(int)\n", "\n", - " # Close the connection\n", - " driver.close()\n", - " return(result)\n", - "\n" + "# Display the combined DataFrame\n", + "print(combined_df)\n" ] }, { "cell_type": "code", - "execution_count": 151, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/var/folders/5t/sfw5tjx56m10xb861_pd3wfm0000gq/T/ipykernel_11898/1389204329.py:2: SettingWithCopyWarning:\n", - "\n", - "\n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", - "\n", - "/var/folders/5t/sfw5tjx56m10xb861_pd3wfm0000gq/T/ipykernel_11898/1451180034.py:10: DeprecationWarning:\n", - "\n", - "Using a driver after it has been closed is deprecated. Future versions of the driver will raise an error.\n", - "\n", - "/var/folders/5t/sfw5tjx56m10xb861_pd3wfm0000gq/T/ipykernel_11898/1451180034.py:10: DeprecationWarning:\n", - "\n", - "Using a driver after it has been closed is deprecated. Future versions of the driver will raise an error.\n", - "\n", - "/var/folders/5t/sfw5tjx56m10xb861_pd3wfm0000gq/T/ipykernel_11898/1389204329.py:2: SettingWithCopyWarning:\n", - "\n", - "\n", - "A value is trying to be set on a copy of a slice from a DataFrame.\n", - "Try using .loc[row_indexer,col_indexer] = value instead\n", - "\n", - "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n", - "\n", - "/var/folders/5t/sfw5tjx56m10xb861_pd3wfm0000gq/T/ipykernel_11898/1451180034.py:10: DeprecationWarning:\n", - "\n", - "Using a driver after it has been closed is deprecated. Future versions of the driver will raise an error.\n", - "\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", - "
study_allele_originstudy_idstudy_directionstudy_predicatestudy_typevariant_mp_scorevariant_idvariant_labelvariant_typetherapeutic_typetherapeutic_civic_typetherapeutic_idtherapeutic_labelnumber_of_componentscombination_therapy_componentscombination_components
0somaticcivic.eid:238supportspredictsResistanceToVariantTherapeuticResponseStudy406.25civic.mpid:34EGFR T790M[{\"label\": \"missense_variant\", \"system\": \"http...TherapeuticAgentNonecivic.tid:15Erlotinib0[]None
2somaticcivic.eid:1592supportspredictsSensitivityToVariantTherapeuticResponseStudy406.25civic.mpid:34EGFR T790M[{\"label\": \"missense_variant\", \"system\": \"http...TherapeuticAgentNonecivic.tid:187Osimertinib0[]None
3somaticcivic.eid:1867supportspredictsSensitivityToVariantTherapeuticResponseStudy406.25civic.mpid:34EGFR T790M[{\"label\": \"missense_variant\", \"system\": \"http...TherapeuticAgentNonecivic.tid:187Osimertinib0[]None
\n", - "
" - ], - "text/plain": [ - " study_allele_origin study_id study_direction study_predicate \\\n", - "0 somatic civic.eid:238 supports predictsResistanceTo \n", - "2 somatic civic.eid:1592 supports predictsSensitivityTo \n", - "3 somatic civic.eid:1867 supports predictsSensitivityTo \n", - "\n", - " study_type variant_mp_score variant_id \\\n", - "0 VariantTherapeuticResponseStudy 406.25 civic.mpid:34 \n", - "2 VariantTherapeuticResponseStudy 406.25 civic.mpid:34 \n", - "3 VariantTherapeuticResponseStudy 406.25 civic.mpid:34 \n", - "\n", - " variant_label variant_type \\\n", - "0 EGFR T790M [{\"label\": \"missense_variant\", \"system\": \"http... \n", - "2 EGFR T790M [{\"label\": \"missense_variant\", \"system\": \"http... \n", - "3 EGFR T790M [{\"label\": \"missense_variant\", \"system\": \"http... \n", - "\n", - " therapeutic_type therapeutic_civic_type therapeutic_id therapeutic_label \\\n", - "0 TherapeuticAgent None civic.tid:15 Erlotinib \n", - "2 TherapeuticAgent None civic.tid:187 Osimertinib \n", - "3 TherapeuticAgent None civic.tid:187 Osimertinib \n", - "\n", - " number_of_components combination_therapy_components combination_components \n", - "0 0 [] None \n", - "2 0 [] None \n", - "3 0 [] None " - ] - }, - "execution_count": 151, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "def get_combination_therapies(tdf):\n", - " tdf['combination_components'] = None\n", - "\n", - " for idx, row in tdf.iterrows():\n", - " result = neo4j_query(row['therapeutic_id'])\n", - " therapeutics = []\n", - " for record in result:\n", - " therapeutics.append(record['Therapeutic'].get('label', None))\n", - " tdf.at[idx, 'combination_components'] = therapeutics\n", - "\n", - " for idx, row in tdf.iterrows():\n", - " if row['therapeutic_type'] == 'CombinationTherapy':\n", - " components = row['combination_components']\n", - " if components is not None: # Check if components is not None\n", - " sorted_components = tuple(sorted(components))\n", - " tdf.at[idx, 'combination_components'] = sorted_components\n", - " return(tdf)\n", - "\n", - "braf_df = get_combination_therapies(braf_df)\n", - "df = get_combination_therapies(df)\n", - "not_braf_df = get_combination_therapies(not_braf_df)\n", - "\n", - "# braf_df['combination_components'] = None\n", - "\n", - "# for idx, row in braf_df.iterrows():\n", - "# result = neo4j_query(row['therapeutic_id'])\n", - "# therapeutics = []\n", - "# for record in result:\n", - "# therapeutics.append(record['Therapeutic'].get('label', None))\n", - "# braf_df.at[idx, 'combination_components'] = therapeutics\n", - "\n", - "# for idx, row in braf_df.iterrows():\n", - "# if row['therapeutic_type'] == 'CombinationTherapy':\n", - "# components = row['combination_components']\n", - "# if components is not None: # Check if components is not None\n", - "# sorted_components = tuple(sorted(components))\n", - "# braf_df.at[idx, 'combination_components'] = sorted_components\n", - "# #braf_df['combination_components'] = braf_df['combination_components'].apply(lambda x: tuple(sorted(x)))\n", - "\n", - "not_braf_df[0:3]" - ] - }, - { - "cell_type": "code", - "execution_count": 152, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "combination_components\n", - "(Cetuximab, Irinotecan) 12\n", - "(Dactolisib, Selumetinib) 8\n", - "(Lapatinib, Neratinib, Trastuzumab) 4\n", - "(Lapatinib, Trastuzumab) 2\n", - "(Adagrasib, Cetuximab) 2\n", - "(Cetuximab, Fluorouracil, Oxaliplatin) 2\n", - "(Cetuximab, Irinotecan, Vemurafenib) 2\n", - "(Alpelisib, Fulvestrant) 2\n", - "(Azacitidine, Ivosidenib) 2\n", - "(Docetaxel, Selumetinib) 2\n", - "(Capivasertib, Trastuzumab) 1\n", - "(Durvalumab, Osimertinib) 1\n", - "(Daunorubicin, Sunitinib) 1\n", - "(Cytarabine, Sunitinib) 1\n", - "(Cetuximab, Dactolisib) 1\n", - "(Akt Inhibitor MK2206, Vemurafenib) 1\n", - "(Lometrexol, Mercaptopurine) 1\n", - "(Cisplatin, Pictilisib) 1\n", - "(Capivasertib, Lapatinib) 1\n", - "(Erlotinib, Pemetrexed) 1\n", - "(Dasatinib, Erlotinib) 1\n", - "(Capivasertib, PI3K/BET Inhibitor LY294002) 1\n", - "(Cisplatin, Fluorouracil) 1\n", - "(Carboplatin, Paclitaxel) 1\n", - "(Letrozole, Palbociclib) 1\n", - "(Checkpoint Kinase Inhibitor AZD7762, Irinotecan) 1\n", - "(Everolimus, Fulvestrant) 1\n", - "(Olaparib, Temozolomide) 1\n", - "(Fluorouracil, Leucovorin, Trastuzumab) 1\n", - "(Binimetinib, Everolimus) 1\n", - "Name: count, dtype: int64" - ] - }, - "execution_count": 152, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "not_braf_df['combination_components'].value_counts()" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "## Therapeutics for Combined, BRAF, Not BRAF" - ] - }, - { - "cell_type": "code", - "execution_count": 153, + "execution_count": 218, "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", - "
study_allele_originstudy_idstudy_directionstudy_predicatestudy_typevariant_mp_scorevariant_idvariant_labelvariant_typetherapeutic_typetherapeutic_civic_typetherapeutic_idtherapeutic_labelnumber_of_componentscombination_therapy_componentscombination_components
1somaticcivic.eid:1409supportspredictsSensitivityToVariantTherapeuticResponseStudy1378.5civic.mpid:12BRAF V600E[{\"label\": \"missense_variant\", \"system\": \"http...TherapeuticAgentNonecivic.tid:4Vemurafenib0[]None
8somaticcivic.eid:9851supportspredictsSensitivityToVariantTherapeuticResponseStudy1378.5civic.mpid:12BRAF V600E[{\"label\": \"missense_variant\", \"system\": \"http...CombinationTherapyCOMBINATIONcivic.ctid:P1PY89shAjemg7jquQ0V9pg1VnYnkPeKNone2[{'id': 'civic.tid:16', 'regulatory_approval':...(Cetuximab, Encorafenib)
9somaticcivic.eid:3017supportspredictsSensitivityToVariantTherapeuticResponseStudy1378.5civic.mpid:12BRAF V600E[{\"label\": \"missense_variant\", \"system\": \"http...CombinationTherapyCOMBINATIONcivic.ctid:oBrlcO23adoVXv51xh-5Wigy0QyDWtfrNone2[{'id': 'civic.tid:19', 'regulatory_approval':...(Dabrafenib, Trametinib)
\n", - "
" - ], - "text/plain": [ - " study_allele_origin study_id study_direction study_predicate \\\n", - "1 somatic civic.eid:1409 supports predictsSensitivityTo \n", - "8 somatic civic.eid:9851 supports predictsSensitivityTo \n", - "9 somatic civic.eid:3017 supports predictsSensitivityTo \n", - "\n", - " study_type variant_mp_score variant_id \\\n", - "1 VariantTherapeuticResponseStudy 1378.5 civic.mpid:12 \n", - "8 VariantTherapeuticResponseStudy 1378.5 civic.mpid:12 \n", - "9 VariantTherapeuticResponseStudy 1378.5 civic.mpid:12 \n", - "\n", - " variant_label variant_type \\\n", - "1 BRAF V600E [{\"label\": \"missense_variant\", \"system\": \"http... \n", - "8 BRAF V600E [{\"label\": \"missense_variant\", \"system\": \"http... \n", - "9 BRAF V600E [{\"label\": \"missense_variant\", \"system\": \"http... \n", - "\n", - " therapeutic_type therapeutic_civic_type \\\n", - "1 TherapeuticAgent None \n", - "8 CombinationTherapy COMBINATION \n", - "9 CombinationTherapy COMBINATION \n", - "\n", - " therapeutic_id therapeutic_label \\\n", - "1 civic.tid:4 Vemurafenib \n", - "8 civic.ctid:P1PY89shAjemg7jquQ0V9pg1VnYnkPeK None \n", - "9 civic.ctid:oBrlcO23adoVXv51xh-5Wigy0QyDWtfr None \n", - "\n", - " number_of_components combination_therapy_components \\\n", - "1 0 [] \n", - "8 2 [{'id': 'civic.tid:16', 'regulatory_approval':... \n", - "9 2 [{'id': 'civic.tid:19', 'regulatory_approval':... \n", - "\n", - " combination_components \n", - "1 None \n", - "8 (Cetuximab, Encorafenib) \n", - "9 (Dabrafenib, Trametinib) " - ] - }, - "execution_count": 153, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "braf_df[0:3]" - ] - }, - { - "cell_type": "code", - "execution_count": 92, - "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", - "
study_allele_originstudy_idstudy_directionstudy_predicatestudy_typevariant_mp_scorevariant_idvariant_labelvariant_typetherapeutic_typetherapeutic_civic_typetherapeutic_idtherapeutic_labelnumber_of_componentscombination_therapy_componentscombination_components
0somaticcivic.eid:238supportspredictsResistanceToVariantTherapeuticResponseStudy406.25civic.mpid:34EGFR T790M[{\"label\": \"missense_variant\", \"system\": \"http...TherapeuticAgentNonecivic.tid:15Erlotinib0[]None
2somaticcivic.eid:1592supportspredictsSensitivityToVariantTherapeuticResponseStudy406.25civic.mpid:34EGFR T790M[{\"label\": \"missense_variant\", \"system\": \"http...TherapeuticAgentNonecivic.tid:187Osimertinib0[]None
3somaticcivic.eid:1867supportspredictsSensitivityToVariantTherapeuticResponseStudy406.25civic.mpid:34EGFR T790M[{\"label\": \"missense_variant\", \"system\": \"http...TherapeuticAgentNonecivic.tid:187Osimertinib0[]None
\n", - "
" - ], - "text/plain": [ - " study_allele_origin study_id study_direction study_predicate \\\n", - "0 somatic civic.eid:238 supports predictsResistanceTo \n", - "2 somatic civic.eid:1592 supports predictsSensitivityTo \n", - "3 somatic civic.eid:1867 supports predictsSensitivityTo \n", - "\n", - " study_type variant_mp_score variant_id \\\n", - "0 VariantTherapeuticResponseStudy 406.25 civic.mpid:34 \n", - "2 VariantTherapeuticResponseStudy 406.25 civic.mpid:34 \n", - "3 VariantTherapeuticResponseStudy 406.25 civic.mpid:34 \n", - "\n", - " variant_label variant_type \\\n", - "0 EGFR T790M [{\"label\": \"missense_variant\", \"system\": \"http... \n", - "2 EGFR T790M [{\"label\": \"missense_variant\", \"system\": \"http... \n", - "3 EGFR T790M [{\"label\": \"missense_variant\", \"system\": \"http... \n", - "\n", - " therapeutic_type therapeutic_civic_type therapeutic_id therapeutic_label \\\n", - "0 TherapeuticAgent None civic.tid:15 Erlotinib \n", - "2 TherapeuticAgent None civic.tid:187 Osimertinib \n", - "3 TherapeuticAgent None civic.tid:187 Osimertinib \n", - "\n", - " number_of_components combination_therapy_components combination_components \n", - "0 0 [] None \n", - "2 0 [] None \n", - "3 0 [] None " - ] - }, - "execution_count": 92, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "not_braf_df[0:3]" - ] - }, - { - "cell_type": "code", - "execution_count": 93, - "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", - "
study_allele_originstudy_idstudy_directionstudy_predicatestudy_typevariant_mp_scorevariant_idvariant_labelvariant_typetherapeutic_typetherapeutic_civic_typetherapeutic_idtherapeutic_labelnumber_of_componentscombination_therapy_componentscombination_components
0somaticcivic.eid:238supportspredictsResistanceToVariantTherapeuticResponseStudy406.25civic.mpid:34EGFR T790M[{\"label\": \"missense_variant\", \"system\": \"http...TherapeuticAgentNonecivic.tid:15Erlotinib0[]None
1somaticcivic.eid:1409supportspredictsSensitivityToVariantTherapeuticResponseStudy1378.50civic.mpid:12BRAF V600E[{\"label\": \"missense_variant\", \"system\": \"http...TherapeuticAgentNonecivic.tid:4Vemurafenib0[]None
2somaticcivic.eid:1592supportspredictsSensitivityToVariantTherapeuticResponseStudy406.25civic.mpid:34EGFR T790M[{\"label\": \"missense_variant\", \"system\": \"http...TherapeuticAgentNonecivic.tid:187Osimertinib0[]None
\n", - "
" - ], - "text/plain": [ - " study_allele_origin study_id study_direction study_predicate \\\n", - "0 somatic civic.eid:238 supports predictsResistanceTo \n", - "1 somatic civic.eid:1409 supports predictsSensitivityTo \n", - "2 somatic civic.eid:1592 supports predictsSensitivityTo \n", - "\n", - " study_type variant_mp_score variant_id \\\n", - "0 VariantTherapeuticResponseStudy 406.25 civic.mpid:34 \n", - "1 VariantTherapeuticResponseStudy 1378.50 civic.mpid:12 \n", - "2 VariantTherapeuticResponseStudy 406.25 civic.mpid:34 \n", - "\n", - " variant_label variant_type \\\n", - "0 EGFR T790M [{\"label\": \"missense_variant\", \"system\": \"http... \n", - "1 BRAF V600E [{\"label\": \"missense_variant\", \"system\": \"http... \n", - "2 EGFR T790M [{\"label\": \"missense_variant\", \"system\": \"http... \n", - "\n", - " therapeutic_type therapeutic_civic_type therapeutic_id therapeutic_label \\\n", - "0 TherapeuticAgent None civic.tid:15 Erlotinib \n", - "1 TherapeuticAgent None civic.tid:4 Vemurafenib \n", - "2 TherapeuticAgent None civic.tid:187 Osimertinib \n", - "\n", - " number_of_components combination_therapy_components combination_components \n", - "0 0 [] None \n", - "1 0 [] None \n", - "2 0 [] None " - ] - }, - "execution_count": 93, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "df[0:3]" - ] - }, - { - "cell_type": "code", - "execution_count": 154, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "therapeutic_label\n", - "Vemurafenib 52\n", - "Trametinib 9\n", - "Dabrafenib 5\n", - "Encorafenib 2\n", - "U0126 2\n", - "Sorafenib 2\n", - "Panitumumab 2\n", - "Irinotecan 2\n", - "Oxaliplatin 2\n", - "Cetuximab 2\n", - "MEK Inhibitor REC-4881 1\n", - "MEK Inhibitor RO4987655 1\n", - "BRAF Inhibitor 1\n", - "Pictilisib 1\n", - "Cobimetinib 1\n", - "Bleomycin 1\n", - "Tovorafenib 1\n", - "Name: count, dtype: int64" - ] - }, - "execution_count": 154, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "braf_df['therapeutic_label'].value_counts()" - ] - }, - { - "cell_type": "code", - "execution_count": 97, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "therapeutic_label\n", - "Erlotinib 59\n", - "Imatinib 43\n", - "Cetuximab 37\n", - "Gefitinib 31\n", - "Pictilisib 30\n", - " ..\n", - "JAK2 Inhibitor AZD1480 1\n", - "Patidegib 1\n", - "PD173074 1\n", - "AZD3463 1\n", - "Larotrectinib 1\n", - "Name: count, Length: 113, dtype: int64" - ] - }, - "execution_count": 97, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "not_braf_df['therapeutic_label'].value_counts()" - ] - }, - { - "cell_type": "code", - "execution_count": 155, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - " therapeutic_label braf_count general_count not_braf_count\n", - "0 AGI-5198 0 2 2\n", - "1 AZD3463 0 1 1\n", - "2 Abemaciclib 0 1 1\n", - "3 Adagrasib 0 2 2\n", - "4 Afatinib 0 19 19\n", - ".. ... ... ... ...\n", - "118 U0126 2 2 0\n", - "119 Uprosertib 0 1 1\n", - "120 Vemurafenib 52 71 19\n", - "121 Venetoclax 0 4 4\n", - "122 Vismodegib 0 4 4\n", - "\n", - "[123 rows x 4 columns]\n" - ] - } - ], - "source": [ - "import pandas as pd\n", - "\n", - "# Assuming 'braf_df', 'df', and 'not_braf_df' are your DataFrames\n", - "\n", - "# Perform value_counts on the 'therapeutic_label' column\n", - "braf_counts = braf_df['therapeutic_label'].value_counts().rename_axis('therapeutic_label').reset_index(name='braf_count')\n", - "df_counts = df['therapeutic_label'].value_counts().rename_axis('therapeutic_label').reset_index(name='general_count')\n", - "not_braf_counts = not_braf_df['therapeutic_label'].value_counts().rename_axis('therapeutic_label').reset_index(name='not_braf_count')\n", - "\n", - "# Combine the three DataFrames into one\n", - "combined_df = pd.merge(pd.merge(braf_counts, df_counts, on='therapeutic_label', how='outer'), not_braf_counts, on='therapeutic_label', how='outer').fillna(0)\n", - "\n", - "# Convert counts to integers (optional, in case NaNs were filled)\n", - "combined_df[['braf_count', 'general_count', 'not_braf_count']] = combined_df[['braf_count', 'general_count', 'not_braf_count']].astype(int)\n", - "\n", - "# Display the combined DataFrame\n", - "print(combined_df)\n" - ] - }, - { - "cell_type": "code", - "execution_count": 156, - "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.plotly.v1+json": { - "config": { - "plotlyServerURL": "https://plot.ly" - }, - "data": [ - { - "alignmentgroup": "True", - "hovertemplate": "Dataset=braf_count
therapeutic_label=%{x}
Count=%{y}", - "legendgroup": "braf_count", - "marker": { - "color": "#636efa", - "pattern": { - "shape": "" - } - }, - "name": "braf_count", - "offsetgroup": "braf_count", - "orientation": "v", - "showlegend": true, - "textposition": "auto", - "type": "bar", - "x": [ - "Vemurafenib", - "Erlotinib", - "Imatinib", - "Cetuximab", - "Pictilisib", - "Gefitinib", - "Selumetinib", - "Dasatinib", - "Sunitinib", - "Osimertinib", - "Afatinib", - "Melphalan", - "Regorafenib", - "Crizotinib", - "MDM2 Inhibitor AMGMDS3", - "Panitumumab", - "Trametinib", - "Doxorubicin", - "Bosutinib", - "Nilotinib", - "Lapatinib", - "Neratinib", - "Ivosidenib", - "Trastuzumab Deruxtecan", - "Ponatinib", - "Sorafenib", - "Dabrafenib", - "Dacomitinib", - "Trastuzumab", - "Ceritinib", - "Sirolimus", - "Tazemetostat", - "Ibrutinib", - "Imatinib Mesylate", - "Hormone Therapy", - "Crenolanib", - "Olaparib", - "Olutasidenib", - "Dactolisib", - "PI-103", - "Ruxolitinib", - "Trastuzumab Emtansine", - "Gilteritinib", - "Venetoclax", - "Vismodegib", - "Erdafitinib", - "Cisplatin", - "Enasidenib", - "Quizartinib", - "Lorlatinib", - "Rociletinib", - "Avapritinib", - "TAE684", - "Temozolomide", - "Everolimus", - "Midostaurin", - "Pembrolizumab", - "Cytarabine", - "PU-H71", - "Fluorouracil", - "Pazopanib", - "PF-06747775", - "Oxaliplatin", - "Palbociclib", - "Capivasertib", - "EGF816", - "Cabozantinib", - "Sotorasib", - "Apitolisib", - "Akt Inhibitor MK2206", - "U0126", - "Adagrasib", - "Canertinib", - "AGI-5198", - "Irinotecan", - "LOXO-292", - "Encorafenib", - "Motesanib", - "Lestaurtinib", - "Izorlisib", - "Olmutinib", - "Epidermal Growth Factor Receptor Tyrosine Kinase Inhibitor", - "Staurosporine", - "Aromatase Inhibitor", - "JAK2 Inhibitor AZD1480", - "Tandutinib", - "Tanespimycin", - "Taselisib", - "Therapeutic Tumor Infiltrating Lymphocytes", - "Bleomycin", - "Tovorafenib", - "Amrubicin", - "Alpelisib", - "Alectinib", - "FLT3/ABL/Aurora Kinase Inhibitor KW-2449", - "Idelalisib", - "Uprosertib", - "Fedratinib", - "Abemaciclib", - "BRAF Inhibitor", - "Savolitinib", - "Selpercatinib", - "Dordaviprone", - "Omacetaxine", - "Divarasib", - "PD173074", - "Entrectinib", - "PLX4720", - "Meloxicam", - "MTOR Kinase Inhibitor AZD8055", - "Cobimetinib", - "Patidegib", - "MTOR Inhibitor", - "Peginterferon Alfa-2b", - "MK-2206", - "Pemigatinib", - "MEK Inhibitor RO4987655", - "MEK Inhibitor REC-4881", - "AZD3463", - "Letrozole", - "Larotrectinib", - "SU11274", - "Futuximab/Modotuximab Mixture" - ], - "xaxis": "x", - "y": [ - 52, - 0, - 0, - 2, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 2, - 9, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 2, - 5, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 2, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 2, - 0, - 0, - 0, - 2, - 0, - 2, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 1, - 0, - 0, - 0, - 0, - 0, - 1, - 1, - 0, - 0, - 0, - 0, - 0 - ], - "yaxis": "y" - }, - { - "alignmentgroup": "True", - "hovertemplate": "Dataset=not_braf_count
therapeutic_label=%{x}
Count=%{y}", - "legendgroup": "not_braf_count", - "marker": { - "color": "#EF553B", - "pattern": { - "shape": "" - } - }, - "name": "not_braf_count", - "offsetgroup": "not_braf_count", - "orientation": "v", - "showlegend": true, - "textposition": "auto", - "type": "bar", - "x": [ - "Vemurafenib", - "Erlotinib", - "Imatinib", - "Cetuximab", - "Pictilisib", - "Gefitinib", - "Selumetinib", - "Dasatinib", - "Sunitinib", - "Osimertinib", - "Afatinib", - "Melphalan", - "Regorafenib", - "Crizotinib", - "MDM2 Inhibitor AMGMDS3", - "Panitumumab", - "Trametinib", - "Doxorubicin", - "Bosutinib", - "Nilotinib", - "Lapatinib", - "Neratinib", - "Ivosidenib", - "Trastuzumab Deruxtecan", - "Ponatinib", - "Sorafenib", - "Dabrafenib", - "Dacomitinib", - "Trastuzumab", - "Ceritinib", - "Sirolimus", - "Tazemetostat", - "Ibrutinib", - "Imatinib Mesylate", - "Hormone Therapy", - "Crenolanib", - "Olaparib", - "Olutasidenib", - "Dactolisib", - "PI-103", - "Ruxolitinib", - "Trastuzumab Emtansine", - "Gilteritinib", - "Venetoclax", - "Vismodegib", - "Erdafitinib", - "Cisplatin", - "Enasidenib", - "Quizartinib", - "Lorlatinib", - "Rociletinib", - "Avapritinib", - "TAE684", - "Temozolomide", - "Everolimus", - "Midostaurin", - "Pembrolizumab", - "Cytarabine", - "PU-H71", - "Fluorouracil", - "Pazopanib", - "PF-06747775", - "Oxaliplatin", - "Palbociclib", - "Capivasertib", - "EGF816", - "Cabozantinib", - "Sotorasib", - "Apitolisib", - "Akt Inhibitor MK2206", - "U0126", - "Adagrasib", - "Canertinib", - "AGI-5198", - "Irinotecan", - "LOXO-292", - "Encorafenib", - "Motesanib", - "Lestaurtinib", - "Izorlisib", - "Olmutinib", - "Epidermal Growth Factor Receptor Tyrosine Kinase Inhibitor", - "Staurosporine", - "Aromatase Inhibitor", - "JAK2 Inhibitor AZD1480", - "Tandutinib", - "Tanespimycin", - "Taselisib", - "Therapeutic Tumor Infiltrating Lymphocytes", - "Bleomycin", - "Tovorafenib", - "Amrubicin", - "Alpelisib", - "Alectinib", - "FLT3/ABL/Aurora Kinase Inhibitor KW-2449", - "Idelalisib", - "Uprosertib", - "Fedratinib", - "Abemaciclib", - "BRAF Inhibitor", - "Savolitinib", - "Selpercatinib", - "Dordaviprone", - "Omacetaxine", - "Divarasib", - "PD173074", - "Entrectinib", - "PLX4720", - "Meloxicam", - "MTOR Kinase Inhibitor AZD8055", - "Cobimetinib", - "Patidegib", - "MTOR Inhibitor", - "Peginterferon Alfa-2b", - "MK-2206", - "Pemigatinib", - "MEK Inhibitor RO4987655", - "MEK Inhibitor REC-4881", - "AZD3463", - "Letrozole", - "Larotrectinib", - "SU11274", - "Futuximab/Modotuximab Mixture" - ], - "xaxis": "x", - "y": [ - 19, - 59, - 43, - 37, - 30, - 31, - 24, - 23, - 20, - 20, - 19, - 16, - 15, - 14, - 14, - 11, - 3, - 12, - 12, - 12, - 11, - 11, - 10, - 9, - 9, - 6, - 2, - 7, - 7, - 6, - 6, - 6, - 6, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 5, - 4, - 4, - 4, - 4, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 3, - 2, - 2, - 2, - 2, - 2, - 0, - 2, - 2, - 2, - 2, - 2, - 2, - 2, - 0, - 2, - 2, - 2, - 0, - 2, - 0, - 2, - 2, - 2, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 0, - 1, - 1, - 1, - 1, - 1, - 0, - 0, - 1, - 1, - 1, - 1, - 1 - ], - "yaxis": "y" - } - ], - "layout": { - "barmode": "stack", - "legend": { - "title": { - "text": "Dataset" - }, - "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": "Therapeutic Label Counts Sorted by Total Count" - }, - "xaxis": { - "anchor": "y", - "domain": [ - 0, - 1 - ], - "title": { - "text": "therapeutic_label" - } - }, - "yaxis": { - "anchor": "x", - "domain": [ - 0, - 1 - ], - "title": { - "text": "Count" - } - } - } - } - }, - "metadata": {}, - "output_type": "display_data" - } - ], - "source": [ - "import pandas as pd\n", - "import plotly.express as px\n", - "\n", - "# Assuming 'combined_df' is already created as before\n", - "\n", - "# Add a new column for the total counts\n", - "combined_df['total_count'] = combined_df[['braf_count', 'general_count', 'not_braf_count']].sum(axis=1)\n", - "\n", - "# Sort the DataFrame by the total counts in ascending order\n", - "sorted_df = combined_df.sort_values('total_count', ascending=False)\n", - "\n", - "# Create a bar plot for each therapeutic label count\n", - "fig = px.bar(sorted_df, x='therapeutic_label', y=['braf_count', 'not_braf_count'], \n", - " title='Therapeutic Label Counts Sorted by Total Count',\n", - " labels={'value': 'Count', 'variable': 'Dataset'},\n", - " barmode='stack')\n", - "\n", - "# Show the figure\n", - "fig.show()\n" - ] - }, - { - "cell_type": "code", - "execution_count": 157, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - " combination_components braf_count \\\n", - "0 (Adagrasib, Cetuximab) 0 \n", - "1 (Akt Inhibitor MK2206, Vemurafenib) 0 \n", - "2 (Alpelisib, Fulvestrant) 0 \n", - "3 (Azacitidine, Ivosidenib) 0 \n", - "4 (BRAF Inhibitor, Mitogen-Activated Protein Kin... 2 \n", - "5 (Bevacizumab, Capecitabine, Oxaliplatin) 1 \n", - "6 (Bevacizumab, Capecitabine, Vemurafenib) 1 \n", - "7 (Bevacizumab, Dabrafenib) 1 \n", - "8 (Binimetinib, Cetuximab, Encorafenib) 2 \n", - "9 (Binimetinib, Encorafenib) 1 \n", - "10 (Binimetinib, Everolimus) 0 \n", - "11 (Capivasertib, Lapatinib) 0 \n", - "12 (Capivasertib, PI3K/BET Inhibitor LY294002) 0 \n", - "13 (Capivasertib, Trastuzumab) 0 \n", - "14 (Carboplatin, Paclitaxel) 0 \n", - "15 (Cetuximab, Dactolisib) 0 \n", - "16 (Cetuximab, Encorafenib) 2 \n", - "17 (Cetuximab, Fluorouracil, Oxaliplatin) 0 \n", - "18 (Cetuximab, Gefitinib, Vemurafenib) 1 \n", - "19 (Cetuximab, Irinotecan) 2 \n", - "20 (Cetuximab, Irinotecan, Vemurafenib) 2 \n", - "21 (Cetuximab, Vemurafenib) 1 \n", - "22 (Checkpoint Kinase Inhibitor AZD7762, Irinotecan) 0 \n", - "23 (Cisplatin, Fluorouracil) 0 \n", - "24 (Cisplatin, Pictilisib) 0 \n", - "25 (Cobimetinib, Vemurafenib) 2 \n", - "26 (Cytarabine, Sunitinib) 0 \n", - "27 (Dabrafenib, Omipalisib) 1 \n", - "28 (Dabrafenib, Panitumumab, Trametinib) 1 \n", - "29 (Dabrafenib, Trametinib) 24 \n", - "30 (Dabrafenib, Trametinib, Vemurafenib) 1 \n", - "31 (Dactolisib, GDC-0879) 1 \n", - "32 (Dactolisib, Selumetinib) 1 \n", - "33 (Dasatinib, Erlotinib) 0 \n", - "34 (Daunorubicin, Sunitinib) 0 \n", - "35 (Docetaxel, Selumetinib) 0 \n", - "36 (Durvalumab, Osimertinib) 0 \n", - "37 (Erlotinib, Pemetrexed) 0 \n", - "38 (Erlotinib, Vemurafenib) 1 \n", - "39 (Everolimus, Fulvestrant) 0 \n", - "40 (Fluorouracil, Leucovorin, Trastuzumab) 0 \n", - "41 (Interferon-alpha, Ixazomib) 1 \n", - "42 (Ipilimumab, Vemurafenib) 2 \n", - "43 (Irinotecan, Panitumumab) 1 \n", - "44 (Irinotecan, Panitumumab, Vemurafenib) 1 \n", - "45 (Lapatinib, Neratinib, Trastuzumab) 0 \n", - "46 (Lapatinib, Trastuzumab) 0 \n", - "47 (Letrozole, Palbociclib) 0 \n", - "48 (Lometrexol, Mercaptopurine) 0 \n", - "49 (Neratinib, Vemurafenib) 1 \n", - "50 (Nutlin-3, PLX4720) 1 \n", - "51 (Olaparib, Temozolomide) 0 \n", - "52 (PLX4720, Pictilisib Bismesylate) 1 \n", - "53 (Panitumumab, Sorafenib) 1 \n", - "54 (Panitumumab, Trametinib) 1 \n", - "55 (Panitumumab, Vemurafenib) 2 \n", - "56 (Pertuzumab, Vemurafenib) 1 \n", - "57 (Trametinib, Vemurafenib) 1 \n", - "\n", - " general_count not_braf_count \n", - "0 2 2 \n", - "1 1 1 \n", - "2 2 2 \n", - "3 2 2 \n", - "4 2 0 \n", - "5 1 0 \n", - "6 1 0 \n", - "7 1 0 \n", - "8 2 0 \n", - "9 1 0 \n", - "10 1 1 \n", - "11 1 1 \n", - "12 1 1 \n", - "13 1 1 \n", - "14 1 1 \n", - "15 1 1 \n", - "16 2 0 \n", - "17 2 2 \n", - "18 1 0 \n", - "19 14 12 \n", - "20 4 2 \n", - "21 1 0 \n", - "22 1 1 \n", - "23 1 1 \n", - "24 1 1 \n", - "25 2 0 \n", - "26 1 1 \n", - "27 1 0 \n", - "28 1 0 \n", - "29 24 0 \n", - "30 1 0 \n", - "31 1 0 \n", - "32 9 8 \n", - "33 1 1 \n", - "34 1 1 \n", - "35 2 2 \n", - "36 1 1 \n", - "37 1 1 \n", - "38 1 0 \n", - "39 1 1 \n", - "40 1 1 \n", - "41 1 0 \n", - "42 2 0 \n", - "43 1 0 \n", - "44 1 0 \n", - "45 4 4 \n", - "46 2 2 \n", - "47 1 1 \n", - "48 1 1 \n", - "49 1 0 \n", - "50 1 0 \n", - "51 1 1 \n", - "52 1 0 \n", - "53 1 0 \n", - "54 1 0 \n", - "55 2 0 \n", - "56 1 0 \n", - "57 1 0 \n" - ] - } - ], - "source": [ - "import pandas as pd\n", - "\n", - "# Assuming 'braf_df', 'df', and 'not_braf_df' are your DataFrames\n", - "\n", - "# Perform value_counts on the 'therapeutic_label' column\n", - "braf_counts = braf_df['combination_components'].value_counts().rename_axis('combination_components').reset_index(name='braf_count')\n", - "df_counts = df['combination_components'].value_counts().rename_axis('combination_components').reset_index(name='general_count')\n", - "not_braf_counts = not_braf_df['combination_components'].value_counts().rename_axis('combination_components').reset_index(name='not_braf_count')\n", - "\n", - "# Combine the three DataFrames into one\n", - "combined_df = pd.merge(pd.merge(braf_counts, df_counts, on='combination_components', how='outer'), not_braf_counts, on='combination_components', how='outer').fillna(0)\n", - "\n", - "# Convert counts to integers (optional, in case NaNs were filled)\n", - "combined_df[['braf_count', 'general_count', 'not_braf_count']] = combined_df[['braf_count', 'general_count', 'not_braf_count']].astype(int)\n", - "\n", - "# Display the combined DataFrame\n", - "print(combined_df)\n" - ] - }, - { - "cell_type": "code", - "execution_count": 160, - "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", - "
combination_componentsbraf_countgeneral_countnot_braf_counttotal_countLabels
29(Dabrafenib, Trametinib)2424048None
19(Cetuximab, Irinotecan)2141228None
32(Dactolisib, Selumetinib)19818None
45(Lapatinib, Neratinib, Trastuzumab)0448None
20(Cetuximab, Irinotecan, Vemurafenib)2428('Dabrafenib', 'Trametinib')
16(Cetuximab, Encorafenib)2204None
55(Panitumumab, Vemurafenib)2204('Dabrafenib', 'Trametinib')
46(Lapatinib, Trastuzumab)0224None
42(Ipilimumab, Vemurafenib)2204None
35(Docetaxel, Selumetinib)0224None
25(Cobimetinib, Vemurafenib)2204None
17(Cetuximab, Fluorouracil, Oxaliplatin)0224('Dabrafenib', 'Trametinib')
0(Adagrasib, Cetuximab)0224None
8(Binimetinib, Cetuximab, Encorafenib)2204('Cetuximab', 'Encorafenib')
2(Alpelisib, Fulvestrant)0224None
4(BRAF Inhibitor, Mitogen-Activated Protein Kin...2204None
3(Azacitidine, Ivosidenib)0224None
13(Capivasertib, Trastuzumab)0112None
38(Erlotinib, Vemurafenib)1102None
39(Everolimus, Fulvestrant)0112None
40(Fluorouracil, Leucovorin, Trastuzumab)0112None
41(Interferon-alpha, Ixazomib)1102None
5(Bevacizumab, Capecitabine, Oxaliplatin)1102None
43(Irinotecan, Panitumumab)1102('Cobimetinib', 'Vemurafenib')
44(Irinotecan, Panitumumab, Vemurafenib)1102None
47(Letrozole, Palbociclib)0112None
36(Durvalumab, Osimertinib)0112None
48(Lometrexol, Mercaptopurine)0112None
49(Neratinib, Vemurafenib)1102('Cetuximab', 'Irinotecan', 'Vemurafenib')
50(Nutlin-3, PLX4720)1102None
51(Olaparib, Temozolomide)0112None
52(PLX4720, Pictilisib Bismesylate)1102('Cisplatin', 'Fluorouracil')
53(Panitumumab, Sorafenib)1102None
54(Panitumumab, Trametinib)1102None
56(Pertuzumab, Vemurafenib)1102None
37(Erlotinib, Pemetrexed)0112None
6(Bevacizumab, Capecitabine, Vemurafenib)1102('Alpelisib', 'Fulvestrant')
14(Carboplatin, Paclitaxel)0112None
23(Cisplatin, Fluorouracil)0112None
15(Cetuximab, Dactolisib)0112None
12(Capivasertib, PI3K/BET Inhibitor LY294002)0112None
11(Capivasertib, Lapatinib)0112('Alpelisib', 'Fulvestrant')
18(Cetuximab, Gefitinib, Vemurafenib)1102None
10(Binimetinib, Everolimus)0112('Adagrasib', 'Cetuximab')
9(Binimetinib, Encorafenib)1102('Dabrafenib', 'Trametinib')
21(Cetuximab, Vemurafenib)1102('Dabrafenib', 'Trametinib')
22(Checkpoint Kinase Inhibitor AZD7762, Irinotecan)0112('Binimetinib', 'Cetuximab', 'Encorafenib')
24(Cisplatin, Pictilisib)0112None
34(Daunorubicin, Sunitinib)0112None
26(Cytarabine, Sunitinib)0112None
27(Dabrafenib, Omipalisib)1102None
28(Dabrafenib, Panitumumab, Trametinib)1102None
1(Akt Inhibitor MK2206, Vemurafenib)0112None
30(Dabrafenib, Trametinib, Vemurafenib)1102None
31(Dactolisib, GDC-0879)1102None
7(Bevacizumab, Dabrafenib)1102None
33(Dasatinib, Erlotinib)0112None
57(Trametinib, Vemurafenib)1102('Dabrafenib', 'Panitumumab', 'Trametinib')
\n", - "
" - ], - "text/plain": [ - " combination_components braf_count \\\n", - "29 (Dabrafenib, Trametinib) 24 \n", - "19 (Cetuximab, Irinotecan) 2 \n", - "32 (Dactolisib, Selumetinib) 1 \n", - "45 (Lapatinib, Neratinib, Trastuzumab) 0 \n", - "20 (Cetuximab, Irinotecan, Vemurafenib) 2 \n", - "16 (Cetuximab, Encorafenib) 2 \n", - "55 (Panitumumab, Vemurafenib) 2 \n", - "46 (Lapatinib, Trastuzumab) 0 \n", - "42 (Ipilimumab, Vemurafenib) 2 \n", - "35 (Docetaxel, Selumetinib) 0 \n", - "25 (Cobimetinib, Vemurafenib) 2 \n", - "17 (Cetuximab, Fluorouracil, Oxaliplatin) 0 \n", - "0 (Adagrasib, Cetuximab) 0 \n", - "8 (Binimetinib, Cetuximab, Encorafenib) 2 \n", - "2 (Alpelisib, Fulvestrant) 0 \n", - "4 (BRAF Inhibitor, Mitogen-Activated Protein Kin... 2 \n", - "3 (Azacitidine, Ivosidenib) 0 \n", - "13 (Capivasertib, Trastuzumab) 0 \n", - "38 (Erlotinib, Vemurafenib) 1 \n", - "39 (Everolimus, Fulvestrant) 0 \n", - "40 (Fluorouracil, Leucovorin, Trastuzumab) 0 \n", - "41 (Interferon-alpha, Ixazomib) 1 \n", - "5 (Bevacizumab, Capecitabine, Oxaliplatin) 1 \n", - "43 (Irinotecan, Panitumumab) 1 \n", - "44 (Irinotecan, Panitumumab, Vemurafenib) 1 \n", - "47 (Letrozole, Palbociclib) 0 \n", - "36 (Durvalumab, Osimertinib) 0 \n", - "48 (Lometrexol, Mercaptopurine) 0 \n", - "49 (Neratinib, Vemurafenib) 1 \n", - "50 (Nutlin-3, PLX4720) 1 \n", - "51 (Olaparib, Temozolomide) 0 \n", - "52 (PLX4720, Pictilisib Bismesylate) 1 \n", - "53 (Panitumumab, Sorafenib) 1 \n", - "54 (Panitumumab, Trametinib) 1 \n", - "56 (Pertuzumab, Vemurafenib) 1 \n", - "37 (Erlotinib, Pemetrexed) 0 \n", - "6 (Bevacizumab, Capecitabine, Vemurafenib) 1 \n", - "14 (Carboplatin, Paclitaxel) 0 \n", - "23 (Cisplatin, Fluorouracil) 0 \n", - "15 (Cetuximab, Dactolisib) 0 \n", - "12 (Capivasertib, PI3K/BET Inhibitor LY294002) 0 \n", - "11 (Capivasertib, Lapatinib) 0 \n", - "18 (Cetuximab, Gefitinib, Vemurafenib) 1 \n", - "10 (Binimetinib, Everolimus) 0 \n", - "9 (Binimetinib, Encorafenib) 1 \n", - "21 (Cetuximab, Vemurafenib) 1 \n", - "22 (Checkpoint Kinase Inhibitor AZD7762, Irinotecan) 0 \n", - "24 (Cisplatin, Pictilisib) 0 \n", - "34 (Daunorubicin, Sunitinib) 0 \n", - "26 (Cytarabine, Sunitinib) 0 \n", - "27 (Dabrafenib, Omipalisib) 1 \n", - "28 (Dabrafenib, Panitumumab, Trametinib) 1 \n", - "1 (Akt Inhibitor MK2206, Vemurafenib) 0 \n", - "30 (Dabrafenib, Trametinib, Vemurafenib) 1 \n", - "31 (Dactolisib, GDC-0879) 1 \n", - "7 (Bevacizumab, Dabrafenib) 1 \n", - "33 (Dasatinib, Erlotinib) 0 \n", - "57 (Trametinib, Vemurafenib) 1 \n", - "\n", - " general_count not_braf_count total_count \\\n", - "29 24 0 48 \n", - "19 14 12 28 \n", - "32 9 8 18 \n", - "45 4 4 8 \n", - "20 4 2 8 \n", - "16 2 0 4 \n", - "55 2 0 4 \n", - "46 2 2 4 \n", - "42 2 0 4 \n", - "35 2 2 4 \n", - "25 2 0 4 \n", - "17 2 2 4 \n", - "0 2 2 4 \n", - "8 2 0 4 \n", - "2 2 2 4 \n", - "4 2 0 4 \n", - "3 2 2 4 \n", - "13 1 1 2 \n", - "38 1 0 2 \n", - "39 1 1 2 \n", - "40 1 1 2 \n", - "41 1 0 2 \n", - "5 1 0 2 \n", - "43 1 0 2 \n", - "44 1 0 2 \n", - "47 1 1 2 \n", - "36 1 1 2 \n", - "48 1 1 2 \n", - "49 1 0 2 \n", - "50 1 0 2 \n", - "51 1 1 2 \n", - "52 1 0 2 \n", - "53 1 0 2 \n", - "54 1 0 2 \n", - "56 1 0 2 \n", - "37 1 1 2 \n", - "6 1 0 2 \n", - "14 1 1 2 \n", - "23 1 1 2 \n", - "15 1 1 2 \n", - "12 1 1 2 \n", - "11 1 1 2 \n", - "18 1 0 2 \n", - "10 1 1 2 \n", - "9 1 0 2 \n", - "21 1 0 2 \n", - "22 1 1 2 \n", - "24 1 1 2 \n", - "34 1 1 2 \n", - "26 1 1 2 \n", - "27 1 0 2 \n", - "28 1 0 2 \n", - "1 1 1 2 \n", - "30 1 0 2 \n", - "31 1 0 2 \n", - "7 1 0 2 \n", - "33 1 1 2 \n", - "57 1 0 2 \n", - "\n", - " Labels \n", - "29 None \n", - "19 None \n", - "32 None \n", - "45 None \n", - "20 ('Dabrafenib', 'Trametinib') \n", - "16 None \n", - "55 ('Dabrafenib', 'Trametinib') \n", - "46 None \n", - "42 None \n", - "35 None \n", - "25 None \n", - "17 ('Dabrafenib', 'Trametinib') \n", - "0 None \n", - "8 ('Cetuximab', 'Encorafenib') \n", - "2 None \n", - "4 None \n", - "3 None \n", - "13 None \n", - "38 None \n", - "39 None \n", - "40 None \n", - "41 None \n", - "5 None \n", - "43 ('Cobimetinib', 'Vemurafenib') \n", - "44 None \n", - "47 None \n", - "36 None \n", - "48 None \n", - "49 ('Cetuximab', 'Irinotecan', 'Vemurafenib') \n", - "50 None \n", - "51 None \n", - "52 ('Cisplatin', 'Fluorouracil') \n", - "53 None \n", - "54 None \n", - "56 None \n", - "37 None \n", - "6 ('Alpelisib', 'Fulvestrant') \n", - "14 None \n", - "23 None \n", - "15 None \n", - "12 None \n", - "11 ('Alpelisib', 'Fulvestrant') \n", - "18 None \n", - "10 ('Adagrasib', 'Cetuximab') \n", - "9 ('Dabrafenib', 'Trametinib') \n", - "21 ('Dabrafenib', 'Trametinib') \n", - "22 ('Binimetinib', 'Cetuximab', 'Encorafenib') \n", - "24 None \n", - "34 None \n", - "26 None \n", - "27 None \n", - "28 None \n", - "1 None \n", - "30 None \n", - "31 None \n", - "7 None \n", - "33 None \n", - "57 ('Dabrafenib', 'Panitumumab', 'Trametinib') " - ] + "application/vnd.plotly.v1+json": { + "config": { + "plotlyServerURL": "https://plot.ly" + }, + "data": [ + { + "alignmentgroup": "True", + "hovertemplate": "Dataset=braf_count
therapeutic_label=%{x}
Count=%{y}", + "legendgroup": "braf_count", + "marker": { + "color": "#636efa", + "pattern": { + "shape": "" + } + }, + "name": "braf_count", + "offsetgroup": "braf_count", + "orientation": "v", + "showlegend": true, + "textposition": "auto", + "type": "bar", + "x": [ + "Vemurafenib", + "Erlotinib", + "Imatinib", + "Cetuximab", + "Pictilisib", + "Gefitinib", + "Selumetinib", + "Dasatinib", + "Sunitinib", + "Osimertinib", + "Afatinib", + "Melphalan", + "Regorafenib", + "Crizotinib", + "MDM2 Inhibitor AMGMDS3", + "Panitumumab", + "Trametinib", + "Doxorubicin", + "Bosutinib", + "Nilotinib", + "Lapatinib", + "Neratinib", + "Ivosidenib", + "Trastuzumab Deruxtecan", + "Ponatinib", + "Sorafenib", + "Dabrafenib", + "Dacomitinib", + "Trastuzumab", + "Ceritinib", + "Sirolimus", + "Tazemetostat", + "Ibrutinib", + "Imatinib Mesylate", + "Hormone Therapy", + "Crenolanib", + "Olaparib", + "Olutasidenib", + "Dactolisib", + "PI-103", + "Ruxolitinib", + "Trastuzumab Emtansine", + "Gilteritinib", + "Venetoclax", + "Vismodegib", + "Erdafitinib", + "Cisplatin", + "Enasidenib", + "Quizartinib", + "Lorlatinib", + "Rociletinib", + "Avapritinib", + "TAE684", + "Temozolomide", + "Everolimus", + "Midostaurin", + "Pembrolizumab", + "Cytarabine", + "PU-H71", + "Fluorouracil", + "Pazopanib", + "PF-06747775", + "Oxaliplatin", + "Palbociclib", + "Capivasertib", + "EGF816", + "Cabozantinib", + "Sotorasib", + "Apitolisib", + "Akt Inhibitor MK2206", + "U0126", + "Adagrasib", + "Canertinib", + "AGI-5198", + "Irinotecan", + "LOXO-292", + "Encorafenib", + "Motesanib", + "Lestaurtinib", + "Izorlisib", + "Olmutinib", + "Epidermal Growth Factor Receptor Tyrosine Kinase Inhibitor", + "Staurosporine", + "Aromatase Inhibitor", + "JAK2 Inhibitor AZD1480", + "Tandutinib", + "Tanespimycin", + "Taselisib", + "Therapeutic Tumor Infiltrating Lymphocytes", + "Bleomycin", + "Tovorafenib", + "Amrubicin", + "Alpelisib", + "Alectinib", + "FLT3/ABL/Aurora Kinase Inhibitor KW-2449", + "Idelalisib", + "Uprosertib", + "Fedratinib", + "Abemaciclib", + "BRAF Inhibitor", + "Savolitinib", + "Selpercatinib", + "Dordaviprone", + "Omacetaxine", + "Divarasib", + "PD173074", + "Entrectinib", + "PLX4720", + "Meloxicam", + "MTOR Kinase Inhibitor AZD8055", + "Cobimetinib", + "Patidegib", + "MTOR Inhibitor", + "Peginterferon Alfa-2b", + "MK-2206", + "Pemigatinib", + "MEK Inhibitor RO4987655", + "MEK Inhibitor REC-4881", + "AZD3463", + "Letrozole", + "Larotrectinib", + "SU11274", + "Futuximab/Modotuximab Mixture" + ], + "xaxis": "x", + "y": [ + 52, + 0, + 0, + 2, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 9, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 5, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 2, + 0, + 0, + 0, + 2, + 0, + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 0, + 0, + 0, + 0, + 0 + ], + "yaxis": "y" + }, + { + "alignmentgroup": "True", + "hovertemplate": "Dataset=not_braf_count
therapeutic_label=%{x}
Count=%{y}", + "legendgroup": "not_braf_count", + "marker": { + "color": "#EF553B", + "pattern": { + "shape": "" + } + }, + "name": "not_braf_count", + "offsetgroup": "not_braf_count", + "orientation": "v", + "showlegend": true, + "textposition": "auto", + "type": "bar", + "x": [ + "Vemurafenib", + "Erlotinib", + "Imatinib", + "Cetuximab", + "Pictilisib", + "Gefitinib", + "Selumetinib", + "Dasatinib", + "Sunitinib", + "Osimertinib", + "Afatinib", + "Melphalan", + "Regorafenib", + "Crizotinib", + "MDM2 Inhibitor AMGMDS3", + "Panitumumab", + "Trametinib", + "Doxorubicin", + "Bosutinib", + "Nilotinib", + "Lapatinib", + "Neratinib", + "Ivosidenib", + "Trastuzumab Deruxtecan", + "Ponatinib", + "Sorafenib", + "Dabrafenib", + "Dacomitinib", + "Trastuzumab", + "Ceritinib", + "Sirolimus", + "Tazemetostat", + "Ibrutinib", + "Imatinib Mesylate", + "Hormone Therapy", + "Crenolanib", + "Olaparib", + "Olutasidenib", + "Dactolisib", + "PI-103", + "Ruxolitinib", + "Trastuzumab Emtansine", + "Gilteritinib", + "Venetoclax", + "Vismodegib", + "Erdafitinib", + "Cisplatin", + "Enasidenib", + "Quizartinib", + "Lorlatinib", + "Rociletinib", + "Avapritinib", + "TAE684", + "Temozolomide", + "Everolimus", + "Midostaurin", + "Pembrolizumab", + "Cytarabine", + "PU-H71", + "Fluorouracil", + "Pazopanib", + "PF-06747775", + "Oxaliplatin", + "Palbociclib", + "Capivasertib", + "EGF816", + "Cabozantinib", + "Sotorasib", + "Apitolisib", + "Akt Inhibitor MK2206", + "U0126", + "Adagrasib", + "Canertinib", + "AGI-5198", + "Irinotecan", + "LOXO-292", + "Encorafenib", + "Motesanib", + "Lestaurtinib", + "Izorlisib", + "Olmutinib", + "Epidermal Growth Factor Receptor Tyrosine Kinase Inhibitor", + "Staurosporine", + "Aromatase Inhibitor", + "JAK2 Inhibitor AZD1480", + "Tandutinib", + "Tanespimycin", + "Taselisib", + "Therapeutic Tumor Infiltrating Lymphocytes", + "Bleomycin", + "Tovorafenib", + "Amrubicin", + "Alpelisib", + "Alectinib", + "FLT3/ABL/Aurora Kinase Inhibitor KW-2449", + "Idelalisib", + "Uprosertib", + "Fedratinib", + "Abemaciclib", + "BRAF Inhibitor", + "Savolitinib", + "Selpercatinib", + "Dordaviprone", + "Omacetaxine", + "Divarasib", + "PD173074", + "Entrectinib", + "PLX4720", + "Meloxicam", + "MTOR Kinase Inhibitor AZD8055", + "Cobimetinib", + "Patidegib", + "MTOR Inhibitor", + "Peginterferon Alfa-2b", + "MK-2206", + "Pemigatinib", + "MEK Inhibitor RO4987655", + "MEK Inhibitor REC-4881", + "AZD3463", + "Letrozole", + "Larotrectinib", + "SU11274", + "Futuximab/Modotuximab Mixture" + ], + "xaxis": "x", + "y": [ + 19, + 59, + 43, + 37, + 30, + 31, + 24, + 23, + 20, + 20, + 19, + 16, + 15, + 14, + 14, + 11, + 3, + 12, + 12, + 12, + 11, + 11, + 10, + 9, + 9, + 6, + 2, + 7, + 7, + 6, + 6, + 6, + 6, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 5, + 4, + 4, + 4, + 4, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 3, + 2, + 2, + 2, + 2, + 2, + 0, + 2, + 2, + 2, + 2, + 2, + 2, + 2, + 0, + 2, + 2, + 2, + 0, + 2, + 0, + 2, + 2, + 2, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 1, + 1, + 1, + 1, + 0, + 0, + 1, + 1, + 1, + 1, + 1 + ], + "yaxis": "y" + } + ], + "layout": { + "barmode": "stack", + "legend": { + "title": { + "text": "Dataset" + }, + "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": "Application of Therapeutic Evidence to Variants in MetaKB v2 (BRAF Variants vs All Others)" + }, + "xaxis": { + "anchor": "y", + "domain": [ + 0, + 1 + ], + "title": { + "text": "therapeutic_label" + } + }, + "yaxis": { + "anchor": "x", + "domain": [ + 0, + 1 + ], + "title": { + "text": "Count" + } + } + } + } }, - "execution_count": 160, "metadata": {}, - "output_type": "execute_result" + "output_type": "display_data" + } + ], + "source": [ + "# Add a new column for the total counts\n", + "combined_df['total_count'] = combined_df[['braf_count', 'general_count', 'not_braf_count']].sum(axis=1)\n", + "\n", + "# Sort the DataFrame by the total counts in ascending order\n", + "sorted_df = combined_df.sort_values('total_count', ascending=False)\n", + "\n", + "# Create a bar plot for each therapeutic label count\n", + "fig = px.bar(sorted_df, x='therapeutic_label', y=['braf_count', 'not_braf_count'], \n", + " title='Application of Therapeutic Evidence to Variants in MetaKB v2 (BRAF Variants vs All Others)',\n", + " labels={'value': 'Count', 'variable': 'Dataset'},\n", + " barmode='stack')\n", + "\n", + "# Show the figure\n", + "fig.show()\n", + "pio.write_image(fig, \"Application_of_Therapeutics_BRAF_vs_NonBRAF.png\", format='png', width=2000, height=500, scale=5)\n" + ] + }, + { + "cell_type": "code", + "execution_count": 221, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " combination_components braf_count \\\n", + "0 (Adagrasib, Cetuximab) 0 \n", + "1 (Akt Inhibitor MK2206, Vemurafenib) 0 \n", + "2 (Alpelisib, Fulvestrant) 0 \n", + "3 (Azacitidine, Ivosidenib) 0 \n", + "4 (BRAF Inhibitor, Mitogen-Activated Protein Kin... 2 \n", + "5 (Bevacizumab, Capecitabine, Oxaliplatin) 1 \n", + "6 (Bevacizumab, Capecitabine, Vemurafenib) 1 \n", + "7 (Bevacizumab, Dabrafenib) 1 \n", + "8 (Binimetinib, Cetuximab, Encorafenib) 2 \n", + "9 (Binimetinib, Encorafenib) 1 \n", + "10 (Binimetinib, Everolimus) 0 \n", + "11 (Capivasertib, Lapatinib) 0 \n", + "12 (Capivasertib, PI3K/BET Inhibitor LY294002) 0 \n", + "13 (Capivasertib, Trastuzumab) 0 \n", + "14 (Carboplatin, Paclitaxel) 0 \n", + "15 (Cetuximab, Dactolisib) 0 \n", + "16 (Cetuximab, Encorafenib) 2 \n", + "17 (Cetuximab, Fluorouracil, Oxaliplatin) 0 \n", + "18 (Cetuximab, Gefitinib, Vemurafenib) 1 \n", + "19 (Cetuximab, Irinotecan) 2 \n", + "20 (Cetuximab, Irinotecan, Vemurafenib) 2 \n", + "21 (Cetuximab, Vemurafenib) 1 \n", + "22 (Checkpoint Kinase Inhibitor AZD7762, Irinotecan) 0 \n", + "23 (Cisplatin, Fluorouracil) 0 \n", + "24 (Cisplatin, Pictilisib) 0 \n", + "25 (Cobimetinib, Vemurafenib) 2 \n", + "26 (Cytarabine, Sunitinib) 0 \n", + "27 (Dabrafenib, Omipalisib) 1 \n", + "28 (Dabrafenib, Panitumumab, Trametinib) 1 \n", + "29 (Dabrafenib, Trametinib) 24 \n", + "30 (Dabrafenib, Trametinib, Vemurafenib) 1 \n", + "31 (Dactolisib, GDC-0879) 1 \n", + "32 (Dactolisib, Selumetinib) 1 \n", + "33 (Dasatinib, Erlotinib) 0 \n", + "34 (Daunorubicin, Sunitinib) 0 \n", + "35 (Docetaxel, Selumetinib) 0 \n", + "36 (Durvalumab, Osimertinib) 0 \n", + "37 (Erlotinib, Pemetrexed) 0 \n", + "38 (Erlotinib, Vemurafenib) 1 \n", + "39 (Everolimus, Fulvestrant) 0 \n", + "40 (Fluorouracil, Leucovorin, Trastuzumab) 0 \n", + "41 (Interferon-alpha, Ixazomib) 1 \n", + "42 (Ipilimumab, Vemurafenib) 2 \n", + "43 (Irinotecan, Panitumumab) 1 \n", + "44 (Irinotecan, Panitumumab, Vemurafenib) 1 \n", + "45 (Lapatinib, Neratinib, Trastuzumab) 0 \n", + "46 (Lapatinib, Trastuzumab) 0 \n", + "47 (Letrozole, Palbociclib) 0 \n", + "48 (Lometrexol, Mercaptopurine) 0 \n", + "49 (Neratinib, Vemurafenib) 1 \n", + "50 (Nutlin-3, PLX4720) 1 \n", + "51 (Olaparib, Temozolomide) 0 \n", + "52 (PLX4720, Pictilisib Bismesylate) 1 \n", + "53 (Panitumumab, Sorafenib) 1 \n", + "54 (Panitumumab, Trametinib) 1 \n", + "55 (Panitumumab, Vemurafenib) 2 \n", + "56 (Pertuzumab, Vemurafenib) 1 \n", + "57 (Trametinib, Vemurafenib) 1 \n", + "\n", + " general_count not_braf_count \n", + "0 2 2 \n", + "1 1 1 \n", + "2 2 2 \n", + "3 2 2 \n", + "4 2 0 \n", + "5 1 0 \n", + "6 1 0 \n", + "7 1 0 \n", + "8 2 0 \n", + "9 1 0 \n", + "10 1 1 \n", + "11 1 1 \n", + "12 1 1 \n", + "13 1 1 \n", + "14 1 1 \n", + "15 1 1 \n", + "16 2 0 \n", + "17 2 2 \n", + "18 1 0 \n", + "19 14 12 \n", + "20 4 2 \n", + "21 1 0 \n", + "22 1 1 \n", + "23 1 1 \n", + "24 1 1 \n", + "25 2 0 \n", + "26 1 1 \n", + "27 1 0 \n", + "28 1 0 \n", + "29 24 0 \n", + "30 1 0 \n", + "31 1 0 \n", + "32 9 8 \n", + "33 1 1 \n", + "34 1 1 \n", + "35 2 2 \n", + "36 1 1 \n", + "37 1 1 \n", + "38 1 0 \n", + "39 1 1 \n", + "40 1 1 \n", + "41 1 0 \n", + "42 2 0 \n", + "43 1 0 \n", + "44 1 0 \n", + "45 4 4 \n", + "46 2 2 \n", + "47 1 1 \n", + "48 1 1 \n", + "49 1 0 \n", + "50 1 0 \n", + "51 1 1 \n", + "52 1 0 \n", + "53 1 0 \n", + "54 1 0 \n", + "55 2 0 \n", + "56 1 0 \n", + "57 1 0 \n" + ] } ], "source": [ - "sorted_df" + "# Perform value_counts on the 'therapeutic_label' column\n", + "braf_counts = braf_df['combination_components'].value_counts().rename_axis('combination_components').reset_index(name='braf_count')\n", + "df_counts = df['combination_components'].value_counts().rename_axis('combination_components').reset_index(name='general_count')\n", + "not_braf_counts = not_braf_df['combination_components'].value_counts().rename_axis('combination_components').reset_index(name='not_braf_count')\n", + "\n", + "# Combine the three DataFrames into one\n", + "combined_df = pd.merge(pd.merge(braf_counts, df_counts, on='combination_components', how='outer'), not_braf_counts, on='combination_components', how='outer').fillna(0)\n", + "\n", + "# Convert counts to integers (optional, in case NaNs were filled)\n", + "combined_df[['braf_count', 'general_count', 'not_braf_count']] = combined_df[['braf_count', 'general_count', 'not_braf_count']].astype(int)\n", + "\n", + "# Display the combined DataFrame\n", + "print(combined_df)\n" ] }, { "cell_type": "code", - "execution_count": 163, + "execution_count": 225, "metadata": {}, "outputs": [ { @@ -8316,7 +6425,7 @@ } }, "title": { - "text": "Therapeutic Label Counts Sorted by Total Count" + "text": "Application of Combination Therapeutics to Variant Evidence in MetaKB v2 (BRAF vs All Other)" }, "xaxis": { "anchor": "y", @@ -8346,11 +6455,6 @@ } ], "source": [ - "import pandas as pd\n", - "import plotly.express as px\n", - "\n", - "# Assuming 'combined_df' is already created as before\n", - "\n", "# Add a new column for the total counts\n", "combined_df['total_count'] = combined_df[['braf_count', 'general_count', 'not_braf_count']].sum(axis=1)\n", "\n", @@ -8360,17 +6464,18 @@ "\n", "# Create a bar plot for each therapeutic label count\n", "fig = px.bar(sorted_df, x='Labels', y=['braf_count', 'not_braf_count'], \n", - " title='Therapeutic Label Counts Sorted by Total Count',\n", + " title='Application of Combination Therapeutics to Variant Evidence in MetaKB v2 (BRAF vs All Other)',\n", " labels={'value': 'Count', 'variable': 'Dataset'},\n", " barmode='stack')\n", "\n", "# Show the figure\n", - "fig.show()" + "fig.show()\n", + "pio.write_image(fig, \"Application_of_Combo_Therap_BRAF_vs_NonBRAF.png\", format='png', width=2000, height=500, scale=5)\n" ] }, { "cell_type": "code", - "execution_count": 167, + "execution_count": 227, "metadata": {}, "outputs": [ { @@ -8379,7 +6484,7 @@ "{'count': [62, 58], 'category': ['BRAF', 'Not BRAF']}" ] }, - "execution_count": 167, + "execution_count": 227, "metadata": {}, "output_type": "execute_result" } @@ -8395,7 +6500,7 @@ }, { "cell_type": "code", - "execution_count": 194, + "execution_count": 230, "metadata": {}, "outputs": [ { @@ -8438,9 +6543,6 @@ "legend": { "tracegroupgap": 0 }, - "margin": { - "t": 60 - }, "template": { "data": { "bar": [ @@ -9256,6 +7358,9 @@ "zerolinewidth": 2 } } + }, + "title": { + "text": "Distribution of Combination Therapeutic Evidence for Variants in MetaKB v2" } } } @@ -9265,25 +7370,27 @@ } ], "source": [ - "fig = px.pie(pd.DataFrame(data), values='count', names='category')\n", + "fig = px.pie(pd.DataFrame(data), values='count', names='category', title='Distribution of Combination Therapeutic Evidence for Variants in MetaKB v2')\n", "\n", "fig.update_traces(textinfo='label+percent+value', \n", " hoverinfo='label+percent+value',\n", " textposition='inside')\n", "\n", - "fig.show()" + "fig.show()\n", + "pio.write_image(fig, \"Dist_Combo_Therapy_BRAF_v_NonBRAF.png\", format='png', width=700, height=500, scale=5)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "### Combinations?" + "### Breakdown of Combination Therapeutic Evidence Application for Non-BRAF Variants, BRAF Variants\n", + "The fact that 51.7% of combination therapy evidence present in MetaKB v2 thus far is applied to BRAF based variant evidence was interesting. I wanted to follow-up and see of the non-BRAF variants, what genes are commonly applied combination therapy. Additionally, of the BRAF variant evidence, what specific variants are applied combination therapies." ] }, { "cell_type": "code", - "execution_count": 178, + "execution_count": 231, "metadata": {}, "outputs": [ { @@ -9429,18 +7536,19 @@ "11 (Alpelisib, Fulvestrant) " ] }, - "execution_count": 178, + "execution_count": 231, "metadata": {}, "output_type": "execute_result" } ], "source": [ + "# TODO: START HERE WITH TIDYING UP\n", "not_braf_df[not_braf_df['therapeutic_type'].str.contains('CombinationTherapy')][0:3]" ] }, { "cell_type": "code", - "execution_count": 190, + "execution_count": 232, "metadata": {}, "outputs": [ {