From ded6ebd28af8d8de030753a8c59e8cee3cf6e027 Mon Sep 17 00:00:00 2001 From: Andrew Gartland Date: Thu, 28 May 2020 22:16:39 -0700 Subject: [PATCH 1/2] Fixed distance computation in notebook --- important_notebooks/hierdiff_example.ipynb | 63 ++++++++++++---------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/important_notebooks/hierdiff_example.ipynb b/important_notebooks/hierdiff_example.ipynb index 8528666..dd2e190 100644 --- a/important_notebooks/hierdiff_example.ipynb +++ b/important_notebooks/hierdiff_example.ipynb @@ -16,7 +16,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -49,7 +49,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -75,7 +75,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -315,7 +315,7 @@ "[947 rows x 11 columns]" ] }, - "execution_count": 4, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -351,7 +351,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -360,14 +360,21 @@ "(947, 947)" ] }, - "execution_count": 5, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "tr.compute_pairwise_all('beta', metric='nw', processes=3)\n", - "pw = tr.pmhc_b_aa_pw\n", + "cdr_weights = {'cdr3_b_aa_pw':3,\n", + " 'cdr2_b_aa_pw':1,\n", + " 'pmhc_b_aa_pw':1,\n", + " 'cdr1_b_aa_pw':1}\n", + "tr.compute_paired_tcrdist(chains=[\"beta\"], \n", + " replacement_weights=cdr_weights)\n", + "\n", + "pw = tr.paired_tcrdist\n", "pw.shape" ] }, @@ -385,7 +392,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ @@ -421,7 +428,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -752,7 +759,7 @@ "461 0.000002 0.001419 " ] }, - "execution_count": 23, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -773,7 +780,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 10, "metadata": {}, "outputs": [ { @@ -1104,7 +1111,7 @@ "717 0.064949 1.00000 " ] }, - "execution_count": 24, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -1125,7 +1132,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -1141,7 +1148,7 @@ "" ] }, - "execution_count": 20, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -1163,7 +1170,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -1179,7 +1186,7 @@ "" ] }, - "execution_count": 21, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -1202,7 +1209,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -1218,7 +1225,7 @@ "" ] }, - "execution_count": 10, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -1233,7 +1240,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -1249,7 +1256,7 @@ "" ] }, - "execution_count": 11, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -1275,7 +1282,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -1344,7 +1351,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 16, "metadata": {}, "outputs": [ { @@ -1731,7 +1738,7 @@ "[946 rows x 20 columns]" ] }, - "execution_count": 25, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -1745,7 +1752,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ @@ -1760,7 +1767,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 18, "metadata": {}, "outputs": [ { @@ -1777,10 +1784,10 @@ " " ], "text/plain": [ - "" + "" ] }, - "execution_count": 16, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } From fadba778ba4b323a6eaab07836b09a61edf1a6b8 Mon Sep 17 00:00:00 2001 From: Andrew Gartland Date: Thu, 28 May 2020 23:09:21 -0700 Subject: [PATCH 2/2] Added embedding and fixed distance --- important_notebooks/PB1_NP_tree.html | 6 +- important_notebooks/hierdiff_example.ipynb | 1124 +++++++++++--------- 2 files changed, 619 insertions(+), 511 deletions(-) diff --git a/important_notebooks/PB1_NP_tree.html b/important_notebooks/PB1_NP_tree.html index 8573036..12e47c4 100644 --- a/important_notebooks/PB1_NP_tree.html +++ b/important_notebooks/PB1_NP_tree.html @@ -31,13 +31,13 @@ }