Skip to content

Commit e10a4ac

Browse files
authored
Make clone labels consistent (#133)
* recode names of some clones that were inconsistent * update ks test between misclassified samples * recreate figure with updated clone labels other minor tweaks * restrict figure to only those clones used in the paper
1 parent 11e711f commit e10a4ac

10 files changed

+495
-392
lines changed

5.signature-exploration/2.summarize_singscore_accuracy.ipynb

Lines changed: 61 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,22 @@
336336
"full_singscore_df.incorrect = ~(full_singscore_df.incorrect > 0)\n",
337337
"full_singscore_df.incorrect = full_singscore_df.incorrect.astype(int)\n",
338338
"\n",
339+
"# Recode many of the samples to the correct/consistent number\n",
340+
"clone_recode_dict = {\n",
341+
" \"WT clone 01\": \"WT001\",\n",
342+
" \"WT clone 02\": \"WT002\",\n",
343+
" \"WT clone 03\": \"WT003\",\n",
344+
" \"WT clone 04\": \"WT004\",\n",
345+
" \"WT clone 05\": \"WT005\",\n",
346+
" \"WT clone 10\": \"WT010\",\n",
347+
" \"WT clone 12\": \"WT012\",\n",
348+
" \"WT clone 13\": \"WT013\",\n",
349+
" \"WT clone 14\": \"WT014\",\n",
350+
" \"WT clone 15\": \"WT015\",\n",
351+
"}\n",
352+
"\n",
353+
"full_singscore_df.Metadata_clone_number = full_singscore_df.Metadata_clone_number.replace(clone_recode_dict)\n",
354+
"\n",
339355
"# Output to file\n",
340356
"full_singscore_df.to_csv(output_singscore_file, index=False, sep=\"\\t\")\n",
341357
"\n",
@@ -389,15 +405,15 @@
389405
" <tr>\n",
390406
" <th>1</th>\n",
391407
" <td>otherclone</td>\n",
392-
" <td>WT clone 15</td>\n",
408+
" <td>WT015</td>\n",
393409
" <td>16</td>\n",
394410
" <td>15.0</td>\n",
395411
" <td>0.937500</td>\n",
396412
" </tr>\n",
397413
" <tr>\n",
398414
" <th>2</th>\n",
399415
" <td>otherclone</td>\n",
400-
" <td>WT clone 10</td>\n",
416+
" <td>WT010</td>\n",
401417
" <td>16</td>\n",
402418
" <td>12.0</td>\n",
403419
" <td>0.750000</td>\n",
@@ -413,7 +429,7 @@
413429
" <tr>\n",
414430
" <th>4</th>\n",
415431
" <td>holdout</td>\n",
416-
" <td>WT clone 01</td>\n",
432+
" <td>WT001</td>\n",
417433
" <td>4</td>\n",
418434
" <td>2.0</td>\n",
419435
" <td>0.500000</td>\n",
@@ -465,10 +481,10 @@
465481
"text/plain": [
466482
" Metadata_model_split Metadata_clone_number total_samples \\\n",
467483
"0 otherclone BZ006 8 \n",
468-
"1 otherclone WT clone 15 16 \n",
469-
"2 otherclone WT clone 10 16 \n",
484+
"1 otherclone WT015 16 \n",
485+
"2 otherclone WT010 16 \n",
470486
"3 inference BZ007 3 \n",
471-
"4 holdout WT clone 01 4 \n",
487+
"4 holdout WT001 4 \n",
472488
"5 inference BZ006 3 \n",
473489
"6 test CloneA 24 \n",
474490
"7 inference WT_parental 6 \n",
@@ -1058,19 +1074,6 @@
10581074
" <tbody>\n",
10591075
" <tr>\n",
10601076
" <th>0</th>\n",
1061-
" <td>WT clone 15</td>\n",
1062-
" <td>16</td>\n",
1063-
" <td>15.0</td>\n",
1064-
" <td>0</td>\n",
1065-
" <td>0</td>\n",
1066-
" <td>16</td>\n",
1067-
" <td>0.937500</td>\n",
1068-
" <td>0.000000</td>\n",
1069-
" <td>0.000000</td>\n",
1070-
" <td>1.000000</td>\n",
1071-
" </tr>\n",
1072-
" <tr>\n",
1073-
" <th>1</th>\n",
10741077
" <td>BZ006</td>\n",
10751078
" <td>11</td>\n",
10761079
" <td>9.0</td>\n",
@@ -1083,30 +1086,43 @@
10831086
" <td>1.000000</td>\n",
10841087
" </tr>\n",
10851088
" <tr>\n",
1089+
" <th>1</th>\n",
1090+
" <td>WT015</td>\n",
1091+
" <td>19</td>\n",
1092+
" <td>15.0</td>\n",
1093+
" <td>0</td>\n",
1094+
" <td>1</td>\n",
1095+
" <td>18</td>\n",
1096+
" <td>0.789474</td>\n",
1097+
" <td>0.000000</td>\n",
1098+
" <td>0.052632</td>\n",
1099+
" <td>0.947368</td>\n",
1100+
" </tr>\n",
1101+
" <tr>\n",
10861102
" <th>2</th>\n",
1087-
" <td>WT clone 10</td>\n",
1088-
" <td>16</td>\n",
1103+
" <td>WT010</td>\n",
1104+
" <td>19</td>\n",
10891105
" <td>12.0</td>\n",
10901106
" <td>0</td>\n",
1091-
" <td>0</td>\n",
1092-
" <td>16</td>\n",
1093-
" <td>0.750000</td>\n",
1094-
" <td>0.000000</td>\n",
1107+
" <td>1</td>\n",
1108+
" <td>18</td>\n",
1109+
" <td>0.631579</td>\n",
10951110
" <td>0.000000</td>\n",
1096-
" <td>1.000000</td>\n",
1111+
" <td>0.052632</td>\n",
1112+
" <td>0.947368</td>\n",
10971113
" </tr>\n",
10981114
" <tr>\n",
10991115
" <th>3</th>\n",
1100-
" <td>WT clone 01</td>\n",
1101-
" <td>7</td>\n",
1116+
" <td>WT001</td>\n",
1117+
" <td>10</td>\n",
11021118
" <td>2.0</td>\n",
1103-
" <td>2</td>\n",
11041119
" <td>3</td>\n",
1120+
" <td>6</td>\n",
11051121
" <td>4</td>\n",
1106-
" <td>0.285714</td>\n",
1107-
" <td>0.285714</td>\n",
1108-
" <td>0.428571</td>\n",
1109-
" <td>0.571429</td>\n",
1122+
" <td>0.200000</td>\n",
1123+
" <td>0.300000</td>\n",
1124+
" <td>0.600000</td>\n",
1125+
" <td>0.400000</td>\n",
11101126
" </tr>\n",
11111127
" <tr>\n",
11121128
" <th>4</th>\n",
@@ -1127,24 +1143,24 @@
11271143
],
11281144
"text/plain": [
11291145
" Metadata_clone_number total_samples completely_incorrect high_confidence \\\n",
1130-
"0 WT clone 15 16 15.0 0 \n",
1131-
"1 BZ006 11 9.0 0 \n",
1132-
"2 WT clone 10 16 12.0 0 \n",
1133-
"3 WT clone 01 7 2.0 2 \n",
1146+
"0 BZ006 11 9.0 0 \n",
1147+
"1 WT015 19 15.0 0 \n",
1148+
"2 WT010 19 12.0 0 \n",
1149+
"3 WT001 10 2.0 3 \n",
11341150
"4 BZ007 11 2.0 8 \n",
11351151
"\n",
11361152
" accurate incorrect prop_completely_incorrect prop_high_confidence \\\n",
1137-
"0 0 16 0.937500 0.000000 \n",
1138-
"1 0 11 0.818182 0.000000 \n",
1139-
"2 0 16 0.750000 0.000000 \n",
1140-
"3 3 4 0.285714 0.285714 \n",
1153+
"0 0 11 0.818182 0.000000 \n",
1154+
"1 1 18 0.789474 0.000000 \n",
1155+
"2 1 18 0.631579 0.000000 \n",
1156+
"3 6 4 0.200000 0.300000 \n",
11411157
"4 8 3 0.181818 0.727273 \n",
11421158
"\n",
11431159
" prop_accurate prop_inaccurate \n",
11441160
"0 0.000000 1.000000 \n",
1145-
"1 0.000000 1.000000 \n",
1146-
"2 0.000000 1.000000 \n",
1147-
"3 0.428571 0.571429 \n",
1161+
"1 0.052632 0.947368 \n",
1162+
"2 0.052632 0.947368 \n",
1163+
"3 0.600000 0.400000 \n",
11481164
"4 0.727273 0.272727 "
11491165
]
11501166
},
@@ -1174,7 +1190,7 @@
11741190
],
11751191
"metadata": {
11761192
"kernelspec": {
1177-
"display_name": "Python [conda env:resistance-mechanisms-signature] *",
1193+
"display_name": "Python [conda env:resistance-mechanisms-signature]",
11781194
"language": "python",
11791195
"name": "conda-env-resistance-mechanisms-signature-py"
11801196
},

5.signature-exploration/3.evaluate_misclassified_featurespace.ipynb

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@
405405
"name": "stdout",
406406
"output_type": "stream",
407407
"text": [
408-
"(46, 10)\n"
408+
"(36, 10)\n"
409409
]
410410
},
411411
{
@@ -444,19 +444,6 @@
444444
" <tbody>\n",
445445
" <tr>\n",
446446
" <th>0</th>\n",
447-
" <td>WT clone 15</td>\n",
448-
" <td>16</td>\n",
449-
" <td>15.0</td>\n",
450-
" <td>0</td>\n",
451-
" <td>0</td>\n",
452-
" <td>16</td>\n",
453-
" <td>0.937500</td>\n",
454-
" <td>0.000000</td>\n",
455-
" <td>0.000000</td>\n",
456-
" <td>1.000000</td>\n",
457-
" </tr>\n",
458-
" <tr>\n",
459-
" <th>1</th>\n",
460447
" <td>BZ006</td>\n",
461448
" <td>11</td>\n",
462449
" <td>9.0</td>\n",
@@ -469,30 +456,43 @@
469456
" <td>1.000000</td>\n",
470457
" </tr>\n",
471458
" <tr>\n",
459+
" <th>1</th>\n",
460+
" <td>WT015</td>\n",
461+
" <td>19</td>\n",
462+
" <td>15.0</td>\n",
463+
" <td>0</td>\n",
464+
" <td>1</td>\n",
465+
" <td>18</td>\n",
466+
" <td>0.789474</td>\n",
467+
" <td>0.000000</td>\n",
468+
" <td>0.052632</td>\n",
469+
" <td>0.947368</td>\n",
470+
" </tr>\n",
471+
" <tr>\n",
472472
" <th>2</th>\n",
473-
" <td>WT clone 10</td>\n",
474-
" <td>16</td>\n",
473+
" <td>WT010</td>\n",
474+
" <td>19</td>\n",
475475
" <td>12.0</td>\n",
476476
" <td>0</td>\n",
477-
" <td>0</td>\n",
478-
" <td>16</td>\n",
479-
" <td>0.750000</td>\n",
477+
" <td>1</td>\n",
478+
" <td>18</td>\n",
479+
" <td>0.631579</td>\n",
480480
" <td>0.000000</td>\n",
481-
" <td>0.000000</td>\n",
482-
" <td>1.000000</td>\n",
481+
" <td>0.052632</td>\n",
482+
" <td>0.947368</td>\n",
483483
" </tr>\n",
484484
" <tr>\n",
485485
" <th>3</th>\n",
486-
" <td>WT clone 01</td>\n",
487-
" <td>7</td>\n",
486+
" <td>WT001</td>\n",
487+
" <td>10</td>\n",
488488
" <td>2.0</td>\n",
489-
" <td>2</td>\n",
490489
" <td>3</td>\n",
490+
" <td>6</td>\n",
491491
" <td>4</td>\n",
492-
" <td>0.285714</td>\n",
493-
" <td>0.285714</td>\n",
494-
" <td>0.428571</td>\n",
495-
" <td>0.571429</td>\n",
492+
" <td>0.200000</td>\n",
493+
" <td>0.300000</td>\n",
494+
" <td>0.600000</td>\n",
495+
" <td>0.400000</td>\n",
496496
" </tr>\n",
497497
" <tr>\n",
498498
" <th>4</th>\n",
@@ -513,24 +513,24 @@
513513
],
514514
"text/plain": [
515515
" Metadata_clone_number total_samples completely_incorrect high_confidence \\\n",
516-
"0 WT clone 15 16 15.0 0 \n",
517-
"1 BZ006 11 9.0 0 \n",
518-
"2 WT clone 10 16 12.0 0 \n",
519-
"3 WT clone 01 7 2.0 2 \n",
516+
"0 BZ006 11 9.0 0 \n",
517+
"1 WT015 19 15.0 0 \n",
518+
"2 WT010 19 12.0 0 \n",
519+
"3 WT001 10 2.0 3 \n",
520520
"4 BZ007 11 2.0 8 \n",
521521
"\n",
522522
" accurate incorrect prop_completely_incorrect prop_high_confidence \\\n",
523-
"0 0 16 0.937500 0.000000 \n",
524-
"1 0 11 0.818182 0.000000 \n",
525-
"2 0 16 0.750000 0.000000 \n",
526-
"3 3 4 0.285714 0.285714 \n",
523+
"0 0 11 0.818182 0.000000 \n",
524+
"1 1 18 0.789474 0.000000 \n",
525+
"2 1 18 0.631579 0.000000 \n",
526+
"3 6 4 0.200000 0.300000 \n",
527527
"4 8 3 0.181818 0.727273 \n",
528528
"\n",
529529
" prop_accurate prop_inaccurate \n",
530530
"0 0.000000 1.000000 \n",
531-
"1 0.000000 1.000000 \n",
532-
"2 0.000000 1.000000 \n",
533-
"3 0.428571 0.571429 \n",
531+
"1 0.052632 0.947368 \n",
532+
"2 0.052632 0.947368 \n",
533+
"3 0.600000 0.400000 \n",
534534
"4 0.727273 0.272727 "
535535
]
536536
},
@@ -556,7 +556,7 @@
556556
{
557557
"data": {
558558
"text/plain": [
559-
"['WT clone 15', 'BZ006', 'WT clone 10']"
559+
"['BZ006', 'WT015', 'WT010']"
560560
]
561561
},
562562
"execution_count": 7,
@@ -579,7 +579,7 @@
579579
{
580580
"data": {
581581
"text/plain": [
582-
"['WT clone 02', 'WT clone 12', 'WT clone 13', 'WT clone 14', 'BZ003', 'BZ007']"
582+
"['WT012', 'WT013', 'WT002', 'BZ007', 'BZ003', 'WT014']"
583583
]
584584
},
585585
"execution_count": 8,
@@ -610,8 +610,8 @@
610610
"# Manually define these samples in specific dictionaries\n",
611611
"sample_comparison_dict = {\n",
612612
" \"wildtype\": {\n",
613-
" \"correct\": [\"WT clone 02\", \"WT clone 12\", \"WT clone 13\", \"WT clone 14\"],\n",
614-
" \"incorrect\": [\"WT clone 15\", \"WT clone 10\"]\n",
613+
" \"correct\": [\"WT002\", \"WT012\", \"WT013\", \"WT014\"],\n",
614+
" \"incorrect\": [\"WT015\", \"WT010\"]\n",
615615
" },\n",
616616
" \"resistant\": {\n",
617617
" \"correct\": [\"BZ003\", \"BZ007\"],\n",
@@ -665,8 +665,8 @@
665665
" <th>0</th>\n",
666666
" <td>Cells_AreaShape_Zernike_4_2</td>\n",
667667
" <td>wildtype</td>\n",
668-
" <td>0.179330</td>\n",
669-
" <td>4.461730e-03</td>\n",
668+
" <td>0.277778</td>\n",
669+
" <td>7.342544e-01</td>\n",
670670
" </tr>\n",
671671
" <tr>\n",
672672
" <th>1</th>\n",
@@ -679,8 +679,8 @@
679679
" <th>2</th>\n",
680680
" <td>Cells_Correlation_K_DNA_AGP</td>\n",
681681
" <td>wildtype</td>\n",
682-
" <td>0.214869</td>\n",
683-
" <td>3.162436e-04</td>\n",
682+
" <td>0.407407</td>\n",
683+
" <td>2.724839e-01</td>\n",
684684
" </tr>\n",
685685
" <tr>\n",
686686
" <th>3</th>\n",
@@ -693,20 +693,20 @@
693693
" <th>4</th>\n",
694694
" <td>Cells_Correlation_Manders_Mito_ER</td>\n",
695695
" <td>wildtype</td>\n",
696-
" <td>0.169118</td>\n",
697-
" <td>8.729040e-03</td>\n",
696+
" <td>0.333333</td>\n",
697+
" <td>5.082990e-01</td>\n",
698698
" </tr>\n",
699699
" </tbody>\n",
700700
"</table>\n",
701701
"</div>"
702702
],
703703
"text/plain": [
704704
" feature clone_type ks_stat ks_pval\n",
705-
"0 Cells_AreaShape_Zernike_4_2 wildtype 0.179330 4.461730e-03\n",
705+
"0 Cells_AreaShape_Zernike_4_2 wildtype 0.277778 7.342544e-01\n",
706706
"1 Cells_AreaShape_Zernike_4_2 resistant 0.705397 6.321256e-22\n",
707-
"2 Cells_Correlation_K_DNA_AGP wildtype 0.214869 3.162436e-04\n",
707+
"2 Cells_Correlation_K_DNA_AGP wildtype 0.407407 2.724839e-01\n",
708708
"3 Cells_Correlation_K_DNA_AGP resistant 0.633651 2.272664e-17\n",
709-
"4 Cells_Correlation_Manders_Mito_ER wildtype 0.169118 8.729040e-03"
709+
"4 Cells_Correlation_Manders_Mito_ER wildtype 0.333333 5.082990e-01"
710710
]
711711
},
712712
"execution_count": 10,
@@ -754,7 +754,7 @@
754754
],
755755
"metadata": {
756756
"kernelspec": {
757-
"display_name": "Python [conda env:resistance-mechanisms-signature] *",
757+
"display_name": "Python [conda env:resistance-mechanisms-signature]",
758758
"language": "python",
759759
"name": "conda-env-resistance-mechanisms-signature-py"
760760
},

0 commit comments

Comments
 (0)