Skip to content

Commit a03cb0f

Browse files
author
tdefa
committed
update
1 parent e40aee9 commit a03cb0f

2 files changed

Lines changed: 118 additions & 28 deletions

File tree

5-Assess in-situ cell type calling in smFISH simulation.py.ipynb

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
"source": [
77
"# Assess in-situ cell type calling in smFISH simulation\n",
88
"\n",
9-
"In this step we assess the cell type calling accuracy that we can achieve in with cell expression vector identified in the smFISH simulation. Hence this accuracy depend of the previous choice of the Marker list and the RNA assignement method that were used. A high cell type accuracy on smFISH simulation would confirm that our marker genes and RNA assignement method are relevant to detect thetargeted cell type\n"
9+
"In this step we assess the cell type calling accuracy that we can achieve in with cell expression vector identified in the smFISH simulation. This estimated accuracy can be interpret as the accuracy that would be obtained in the experiment while taking into account difficulties span by the limited number of markers and the RNA-cell assignement. \n",
10+
"\n",
11+
"This accuracy depend of the previous choice of the marker list and the RNA assignement method that were used. A high cell type accuracy on smFISH simulation would confirm that our marker genes and RNA assignement method are relevant to detect thetargeted cell type\n"
1012
]
1113
},
1214
{
@@ -15,8 +17,8 @@
1517
"source": [
1618
"#### RNA assignement error estimation\n",
1719
"\n",
18-
"Assignement of RNA to cell is error prone in tissue due to the complexity of the cell shape and the possible high density of the nuclei. Error in the RNA assignememnt to cell lead to error in the estimated RNA profile of the spatilly resolve cell and hence may lead to incorrect cell type calling. \n",
19-
" In this notebook we start by estimation the RNA assignememnt error using the mean jaccard index. In our context the jaccard index is\n",
20+
"Assignement of RNA to cell is error prone in tissue due to the complexity of the cell shape, the possible high density of the nuclei and the lack of cytoplasm staining. Error in the RNA assignememnt to cell lead to error in the estimated RNA profile of the spatilly resolve cell and hence may lead to incorrect cell type calling. \n",
21+
" In this notebook we start by estimation the RNA assignememnt error using the mean jaccard index (also called IoU at the molecule level). In our context the jaccard index is\n",
2022
"$$\n",
2123
" \\frac{GT\\cap P}{GT\\cup P}\\\n",
2224
"$$\n",
@@ -76,7 +78,7 @@
7678
"cell_type": "markdown",
7779
"metadata": {},
7880
"source": [
79-
"The jaccard index is not equal to 1, hence estimated RNA profiles have some errors. We will try tp classify theses estimated RNA profile to see if theses errors are small enought to not be detrimental for the cell type calling"
81+
"The jaccard index is not equal to 1, hence estimated RNA profiles have some errors. We will try to classify theses estimated RNA profile to see if theses errors are small enought to not be detrimental for the cell type calling"
8082
]
8183
},
8284
{
@@ -198,30 +200,6 @@
198200
" scrna_centroids.append(mean)\n"
199201
]
200202
},
201-
{
202-
"cell_type": "code",
203-
"execution_count": 36,
204-
"metadata": {
205-
"scrolled": true
206-
},
207-
"outputs": [
208-
{
209-
"data": {
210-
"text/plain": [
211-
"array([ 0., 0., 0., 0., 0., 0., 48., 0., 0., 0., 0., 0., 6.,\n",
212-
" 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 3., 0., 0.,\n",
213-
" 0., 0., 3., 0., 0., 0., 0., 0.])"
214-
]
215-
},
216-
"execution_count": 36,
217-
"metadata": {},
218-
"output_type": "execute_result"
219-
}
220-
],
221-
"source": [
222-
"anndata.X[i]"
223-
]
224-
},
225203
{
226204
"cell_type": "code",
227205
"execution_count": 42,
@@ -264,6 +242,13 @@
264242
"print(f\"cell type accuracy{acc}\")"
265243
]
266244
},
245+
{
246+
"cell_type": "markdown",
247+
"metadata": {},
248+
"source": [
249+
"The obtain cell type accuracy is 0.94"
250+
]
251+
},
267252
{
268253
"cell_type": "code",
269254
"execution_count": 47,
@@ -299,6 +284,22 @@
299284
"fig, ax = plt.subplots(figsize=(10,10))\n",
300285
"disp.plot(ax=ax, xticks_rotation = \"vertical\")"
301286
]
287+
},
288+
{
289+
"cell_type": "markdown",
290+
"metadata": {},
291+
"source": [
292+
"the confusion matrix above give information about which cell type is miss-classified. As example, some T-cell are miss-identify as NK-cell or Neutriphilis. \n",
293+
"\n",
294+
"For the purpose of this tutorail we only use a very small number of cells but those notebooks can be run on larger scale."
295+
]
296+
},
297+
{
298+
"cell_type": "code",
299+
"execution_count": null,
300+
"metadata": {},
301+
"outputs": [],
302+
"source": []
302303
}
303304
],
304305
"metadata": {

rankcorr/markers.csv

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
,gene,cluster
2+
0,Kcnn3,AM
3+
1,Atp6v0d2,AM
4+
2,Olr1,AM
5+
3,F7,AM
6+
4,Popdc3,AT1
7+
5,Spock2,AT1
8+
6,Rtkn2,AT1
9+
7,Akap5,AT1
10+
8,Lama3,AT1
11+
9,S100g,AT2
12+
10,Egfl6,AT2
13+
11,Lgi3,AT2
14+
12,Mlc1,AT2
15+
13,Il33,AT2
16+
14,Fcmr,B_cells
17+
15,Cd79a,B_cells
18+
16,Ebf1,B_cells
19+
17,Ms4a1,B_cells
20+
18,Fcer1a,Basophils
21+
19,Mcpt8,Basophils
22+
20,Cyp11a1,Basophils
23+
21,Il4,Basophils
24+
22,Ms4a2,Basophils
25+
23,Spag17,Ciliated
26+
24,Stk33,Ciliated
27+
25,Gm867,Ciliated
28+
26,4833427G06Rik,Ciliated
29+
27,Stmnd1,Ciliated
30+
28,Fmo3,Club
31+
29,Cldn10,Club
32+
30,Gabrp,Club
33+
31,Chad,Club
34+
32,Clec9a,DC
35+
33,Tnni2,DC
36+
34,Ccl17,DC
37+
35,Xcr1,DC
38+
36,Sept3,DC
39+
37,Tspan7,EC
40+
38,Adgrl4,EC
41+
39,Cdh5,EC
42+
40,Ramp2,EC
43+
41,Clec14a,EC
44+
42,Pdgfra,Fibroblasts
45+
43,Col13a1,Fibroblasts
46+
44,Cdh11,Fibroblasts
47+
45,Dpep1,Fibroblasts
48+
46,Abca8a,Fibroblasts
49+
47,C1qb,IM
50+
48,C1qc,IM
51+
49,C1qa,IM
52+
50,C3ar1,IM
53+
51,Ms4a7,IM
54+
52,Wt1,Mesotheliocytes
55+
53,Bnc1,Mesotheliocytes
56+
54,Chst4,Mesotheliocytes
57+
55,Lgals2,Mesotheliocytes
58+
56,Clec4a1,Monocytes
59+
57,Ifitm6,Monocytes
60+
58,Gpr141,Monocytes
61+
59,Adgre4,Monocytes
62+
60,Nkg7,NK_T_cells
63+
61,Eomes,NK_T_cells
64+
62,Ccl5,NK_T_cells
65+
63,Gzmk,NK_T_cells
66+
64,Il2rb,NK_T_cells
67+
65,Ctsw,NK_T_cells
68+
66,Ms4a4b,NK_T_cells
69+
67,Klrb1c,NK_cells
70+
68,Klre1,NK_cells
71+
69,Ncr1,NK_cells
72+
70,Gzmb,NK_cells
73+
71,Cxcr2,Neutrophils
74+
72,Mmp9,Neutrophils
75+
73,Csf3r,Neutrophils
76+
74,Acod1,Neutrophils
77+
75,Retnlg,Neutrophils
78+
76,Gm21541,Platelets
79+
77,Ccl21a,Platelets
80+
78,Reln,Platelets
81+
79,Mmrn1,Platelets
82+
80,Lmod1,SMC
83+
81,Actg2,SMC
84+
82,Myocd,SMC
85+
83,Map3k7cl,SMC
86+
84,Trbc2,T_cells
87+
85,Cd3g,T_cells
88+
86,Cd3d,T_cells
89+
87,Cd3e,T_cells

0 commit comments

Comments
 (0)