Skip to content

Commit c210e16

Browse files
Junbum KimJunbum Kim
Junbum Kim
authored and
Junbum Kim
committed
corrected typo in package
1 parent a317157 commit c210e16

6 files changed

+15
-209
lines changed

documentation/CyCIF Lung Cancer.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242
"name": "python",
243243
"nbconvert_exporter": "python",
244244
"pygments_lexer": "ipython3",
245-
"version": "3.8.10"
245+
"version": "3.8.2"
246246
}
247247
},
248248
"nbformat": 4,

documentation/IMC Bladder Cancer.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@
782782
"name": "python",
783783
"nbconvert_exporter": "python",
784784
"pygments_lexer": "ipython3",
785-
"version": "3.8.10"
785+
"version": "3.8.2"
786786
},
787787
"toc-autonumbering": true
788788
},

documentation/IMC Breast Cancer.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@
13941394
"name": "python",
13951395
"nbconvert_exporter": "python",
13961396
"pygments_lexer": "ipython3",
1397-
"version": "3.8.10"
1397+
"version": "3.8.2"
13981398
},
13991399
"toc-autonumbering": true
14001400
},

documentation/IMC Healthy Lung.ipynb

+6-12
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,7 @@
2121
"execution_count": 2,
2222
"id": "6b1da404",
2323
"metadata": {},
24-
"outputs": [
25-
{
26-
"name": "stdout",
27-
"output_type": "stream",
28-
"text": [
29-
"Warning, OS could not be easily identified. Using default dir ~/.utag to store resources but that might not work!\n"
30-
]
31-
}
32-
],
24+
"outputs": [],
3325
"source": [
3426
"import matplotlib.pyplot as plt\n",
3527
"import pandas as pd\n",
@@ -38,14 +30,16 @@
3830
"from utag import utag\n",
3931
"\n",
4032
"from utag.segmentation import evaluate_performance\n",
33+
"\n",
4134
"from utag.utils import celltype_connectivity, domain_connectivity\n",
42-
"from utag.vizualize import (\n",
35+
"'''\n",
36+
"from utag.visualize import (\n",
4337
" add_scale_box_to_fig,\n",
4438
" add_spatial_image,\n",
4539
" adj2chord,\n",
4640
" draw_network,\n",
4741
")\n",
48-
"\n",
42+
"'''\n",
4943
"sc.settings.set_figure_params(dpi=100, dpi_save=300, fontsize=6)\n",
5044
"import matplotlib\n",
5145
"matplotlib.rcParams[\"pdf.fonttype\"] = 42\n",
@@ -3762,7 +3756,7 @@
37623756
"name": "python",
37633757
"nbconvert_exporter": "python",
37643758
"pygments_lexer": "ipython3",
3765-
"version": "3.8.10"
3759+
"version": "3.8.2"
37663760
},
37673761
"toc-autonumbering": true
37683762
},

documentation/IMC Lung Infection.ipynb

+6-194
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"from utag import utag\n",
4747
"\n",
4848
"from utag.utils import celltype_connectivity, domain_connectivity\n",
49-
"from utag.vizualize import (\n",
49+
"from utag.visualize import (\n",
5050
" add_scale_box_to_fig,\n",
5151
" add_spatial_image,\n",
5252
" adj2chord,\n",
@@ -447,186 +447,7 @@
447447
"id": "441dbd76-d44d-4cd6-b0fb-61ba6301ae32",
448448
"metadata": {},
449449
"source": [
450-
"## Visualizing Results"
451-
]
452-
},
453-
{
454-
"cell_type": "code",
455-
"execution_count": null,
456-
"id": "618ed50b-1d71-4139-9170-5ea8f489f317",
457-
"metadata": {},
458-
"outputs": [],
459-
"source": [
460-
"import squidpy as sq\n",
461-
"import numpy as np\n",
462-
"\n",
463-
"UTAG_lab = \"UTAG Label\"\n",
464-
"sc.settings.set_figure_params(dpi=300, dpi_save=300, fontsize=6)\n",
465-
"for img in results.obs[\"roi\"].unique():\n",
466-
" if img in ['20200708_COVID_21_LATE-10','20200804_NL1933A_RUN2-03', '20200804_NL1933A_RUN2-02', '20200701_COVID_11_LATE-08']:\n",
467-
" try:\n",
468-
" fig, ax = plt.subplots(1,4, dpi = 500, figsize = (40,16))\n",
469-
" a1 = results[results.obs[\"roi\"] == img, :].copy()\n",
470-
"\n",
471-
" roi = img.split('-')[0]\n",
472-
" a1.obs[['Y_centroid', 'X_centroid']] = a1.obs[['Y', 'X']]\n",
473-
" path = f'../covid-imc1/processed/{roi}/tiffs/{img}_full.tiff'\n",
474-
" print(path)\n",
475-
" #sc.pp.neighbors(a1)\n",
476-
" sq.gr.spatial_neighbors(a1, radius = 40, coord_type = 'generic')\n",
477-
"\n",
478-
" result_batch = add_spatial_image(adata = a1,\n",
479-
" image_path = path,\n",
480-
" rgb_channels = [31, 4, 14], # Col1, aSMA, CD31\n",
481-
" gamma = 1, gain = 0.3,\n",
482-
" log_transform = True)\n",
483-
"\n",
484-
" sc.pl.spatial(a1, color=UTAG_lab, spot_size=12, title=str(img) + '\\nCol1, aSMA, CD31', frameon=False, ax = ax[0], show = False, alpha = 0, legend_loc = None)\n",
485-
" add_scale_box_to_fig(a1.uns[\"spatial\"]['image'][\"images\"]['hires'], ax[0], box_width = 200)\n",
486-
"\n",
487-
"\n",
488-
" result_batch = add_spatial_image(adata = a1,\n",
489-
" image_path = path,\n",
490-
" rgb_channels = [24, 17, 10], # KRT8, VIM, CD163\n",
491-
" gamma = 1, gain = 0.3,\n",
492-
" log_transform = True)\n",
493-
"\n",
494-
" sc.pl.spatial(a1, color=UTAG_lab, spot_size=12, title=str(img) + '\\nCD8, VIM, CD163', frameon=False, ax = ax[1], show = False, alpha = 0, legend_loc = None)\n",
495-
" add_scale_box_to_fig(a1.uns[\"spatial\"]['image'][\"images\"]['hires'], ax[1], box_width = 200)\n",
496-
"\n",
497-
" result_batch = add_spatial_image(adata = a1,\n",
498-
" image_path = path,\n",
499-
" rgb_channels = [35, 19, 36], # MPO, CD4, CD8\n",
500-
" gamma = 1, gain = 1,\n",
501-
" log_transform = True)\n",
502-
"\n",
503-
" sc.pl.spatial(a1, color=UTAG_lab, spot_size=12, title=str(img) + '\\nMPO, CD4, KRT8', frameon=False, ax = ax[2], show = False, alpha = 0, legend_loc = None)\n",
504-
" add_scale_box_to_fig(a1.uns[\"spatial\"]['image'][\"images\"]['hires'], ax[2], box_width = 200)\n",
505-
"\n",
506-
" sc.pl.spatial(a1, color=UTAG_lab, spot_size=12, title='Domain Interaction Graph', frameon=False, ax = ax[3], alpha_img = 0, show = False, edges = True, edges_width = 0.2, neighbors_key=\"spatial_neighbors\")\n",
507-
"\n",
508-
" #plt.savefig(f'figures/slides/{img}.pdf', bbox_inches = 'tight')\n",
509-
" #plt.savefig(f'figures/slides/{img}.jpg', bbox_inches = 'tight')\n",
510-
" plt.show()\n",
511-
" plt.close()\n",
512-
" except FileNotFoundError:\n",
513-
" pass\n",
514-
" "
515-
]
516-
},
517-
{
518-
"cell_type": "code",
519-
"execution_count": null,
520-
"id": "ea42a305-c90c-4051-bef3-a089b8e4e9a7",
521-
"metadata": {},
522-
"outputs": [],
523-
"source": [
524-
"import squidpy as sq\n",
525-
"import numpy as np\n",
526-
"\n",
527-
"UTAG_lab = \"UTAG Label\"\n",
528-
"sc.settings.set_figure_params(dpi=300, dpi_save=300, fontsize=6)\n",
529-
"for img in results.obs[\"roi\"].unique():\n",
530-
"\n",
531-
" try:\n",
532-
" fig, ax = plt.subplots(1, 4, dpi=300, figsize=(20, 8))\n",
533-
" a1 = results[results.obs[\"roi\"] == img, :].copy()\n",
534-
"\n",
535-
" roi = img.split(\"-\")[0]\n",
536-
" a1.obs[[\"Y_centroid\", \"X_centroid\"]] = a1.obs[[\"Y\", \"X\"]]\n",
537-
" path = f\"../covid-imc1/processed/{roi}/tiffs/{img}_full.tiff\"\n",
538-
" print(path)\n",
539-
" # sc.pp.neighbors(a1)\n",
540-
" sq.gr.spatial_neighbors(a1, radius=40, coord_type=\"generic\")\n",
541-
"\n",
542-
" result_batch = add_spatial_image(\n",
543-
" adata=a1,\n",
544-
" image_path=path,\n",
545-
" rgb_channels=[36, 4, 40], # Col1, aSMA, CD31\n",
546-
" gamma=1,\n",
547-
" gain=0.3,\n",
548-
" log_transform=True,\n",
549-
" )\n",
550-
"\n",
551-
" sc.pl.spatial(\n",
552-
" a1,\n",
553-
" color=UTAG_lab,\n",
554-
" spot_size=12,\n",
555-
" title=str(img) + \"\\nKRT8, aSMA, DNA1\",\n",
556-
" frameon=False,\n",
557-
" ax=ax[0],\n",
558-
" show=False,\n",
559-
" alpha=0,\n",
560-
" legend_loc=None,\n",
561-
" )\n",
562-
" add_scale_box_to_fig(\n",
563-
" a1.uns[\"spatial\"][\"image\"][\"images\"][\"hires\"], ax[0], box_width=200\n",
564-
" )\n",
565-
"\n",
566-
" result_batch = add_spatial_image(\n",
567-
" adata=a1,\n",
568-
" image_path=path,\n",
569-
" rgb_channels=[24, 31, 10], # KRT8, VIM, CD163\n",
570-
" gamma=1,\n",
571-
" gain=0.3,\n",
572-
" log_transform=True,\n",
573-
" )\n",
574-
"\n",
575-
" sc.pl.spatial(\n",
576-
" a1,\n",
577-
" color=UTAG_lab,\n",
578-
" spot_size=12,\n",
579-
" title=str(img) + \"\\nCD8, VIM, CD163\",\n",
580-
" frameon=False,\n",
581-
" ax=ax[1],\n",
582-
" show=False,\n",
583-
" alpha=0,\n",
584-
" legend_loc=None,\n",
585-
" )\n",
586-
" add_scale_box_to_fig(\n",
587-
" a1.uns[\"spatial\"][\"image\"][\"images\"][\"hires\"], ax[1], box_width=200\n",
588-
" )\n",
589-
"\n",
590-
" result_batch = add_spatial_image(\n",
591-
" adata=a1,\n",
592-
" image_path=path,\n",
593-
" rgb_channels=[35, 19, 36], # MPO, CD4, CD8\n",
594-
" gamma=1,\n",
595-
" gain=1,\n",
596-
" log_transform=True,\n",
597-
" )\n",
598-
"\n",
599-
" sc.pl.spatial(\n",
600-
" a1,\n",
601-
" color=UTAG_lab,\n",
602-
" spot_size=12,\n",
603-
" title=str(img) + \"\\nMPO, CD4, KRT8\",\n",
604-
" frameon=False,\n",
605-
" ax=ax[2],\n",
606-
" show=False,\n",
607-
" alpha=0,\n",
608-
" legend_loc=None,\n",
609-
" )\n",
610-
" add_scale_box_to_fig(\n",
611-
" a1.uns[\"spatial\"][\"image\"][\"images\"][\"hires\"], ax[2], box_width=200\n",
612-
" )\n",
613-
"\n",
614-
" sc.pl.spatial(\n",
615-
" a1,\n",
616-
" color=UTAG_lab,\n",
617-
" spot_size=12,\n",
618-
" title=\"Domain Interaction Graph\",\n",
619-
" frameon=False,\n",
620-
" ax=ax[3],\n",
621-
" alpha_img=0,\n",
622-
" show=False\n",
623-
" )\n",
624-
"\n",
625-
" plt.savefig(f\"figures/slides/{img}_no_edge.pdf\", bbox_inches=\"tight\")\n",
626-
" plt.savefig(f\"figures/slides/{img}_no_edge.jpg\", bbox_inches=\"tight\")\n",
627-
" plt.close()\n",
628-
" except FileNotFoundError:\n",
629-
" pass"
450+
"## Domain Cell Type Proportions and Interaction Analysis"
630451
]
631452
},
632453
{
@@ -4137,21 +3958,12 @@
41373958
},
41383959
{
41393960
"cell_type": "code",
4140-
"execution_count": 55,
3961+
"execution_count": null,
41413962
"id": "b097b1e6-3f9b-4bb8-86e4-27c3c0e555bd",
41423963
"metadata": {},
4143-
"outputs": [
4144-
{
4145-
"ename": "SyntaxError",
4146-
"evalue": "invalid syntax (Temp/ipykernel_24944/844197969.py, line 1)",
4147-
"output_type": "error",
4148-
"traceback": [
4149-
"\u001b[1;36m File \u001b[1;32m\"C:\\Users\\jkim0\\AppData\\Local\\Temp/ipykernel_24944/844197969.py\"\u001b[1;36m, line \u001b[1;32m1\u001b[0m\n\u001b[1;33m mport numpy as np\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
4150-
]
4151-
}
4152-
],
3964+
"outputs": [],
41533965
"source": [
4154-
"mport numpy as np\n",
3966+
"import numpy as np\n",
41553967
"utag_mat = utag.iloc[:, 1:7] # / utag.loc[:,'roi_size'][:,np.newaxis]\n",
41563968
"cell_type_mat = cell_type.iloc[:, 1:-3] # / cell_type.loc[:,'roi_size'][:,np.newaxis]\n",
41573969
"utag_mat[\"disease\"] = utag[\"phenotypes\"]\n",
@@ -5058,7 +4870,7 @@
50584870
"name": "python",
50594871
"nbconvert_exporter": "python",
50604872
"pygments_lexer": "ipython3",
5061-
"version": "3.8.10"
4873+
"version": "3.8.2"
50624874
},
50634875
"toc-autonumbering": true
50644876
},
File renamed without changes.

0 commit comments

Comments
 (0)