@@ -300,7 +300,7 @@ <h4 class="author">Peter Carbonetto</h4>
300
300
< div class ="tab-content ">
301
301
< div id ="summary " class ="tab-pane fade in active ">
302
302
< p >
303
- < strong > Last updated:</ strong > 2025-02-19
303
+ < strong > Last updated:</ strong > 2025-02-20
304
304
</ p >
305
305
< p >
306
306
< strong > Checks:</ strong > < span
@@ -432,15 +432,15 @@ <h4 class="author">Peter Carbonetto</h4>
432
432
< div class ="panel panel-default ">
433
433
< div class ="panel-heading ">
434
434
< p class ="panel-title ">
435
- < a data-toggle ="collapse " data-parent ="#workflowr-checks " href ="#strongRepositoryversionstrongahrefhttpsgithubcomstephenslabsinglecelljamboreetreeb36508bf5db1e33dca218ea14dc03f3683da85b7targetblankb36508ba ">
435
+ < a data-toggle ="collapse " data-parent ="#workflowr-checks " href ="#strongRepositoryversionstrongahrefhttpsgithubcomstephenslabsinglecelljamboreetree9440e05bc58ce8e42a1d61a79ffdfd18896e60cbtargetblank9440e05a ">
436
436
< span class ="glyphicon glyphicon-ok text-success "
437
437
aria-hidden ="true "> </ span > < strong > Repository version:</ strong >
438
- < a href ="https://github.com/stephenslab/single-cell-jamboree/tree/b36508bf5db1e33dca218ea14dc03f3683da85b7 " target ="_blank "> b36508b </ a >
438
+ < a href ="https://github.com/stephenslab/single-cell-jamboree/tree/9440e05bc58ce8e42a1d61a79ffdfd18896e60cb " target ="_blank "> 9440e05 </ a >
439
439
</ a >
440
440
</ p >
441
441
</ div >
442
442
< div
443
- id ="strongRepositoryversionstrongahrefhttpsgithubcomstephenslabsinglecelljamboreetreeb36508bf5db1e33dca218ea14dc03f3683da85b7targetblankb36508ba "
443
+ id ="strongRepositoryversionstrongahrefhttpsgithubcomstephenslabsinglecelljamboreetree9440e05bc58ce8e42a1d61a79ffdfd18896e60cbtargetblank9440e05a "
444
444
class ="panel-collapse collapse ">
445
445
< div class ="panel-body ">
446
446
< p >
@@ -450,7 +450,7 @@ <h4 class="author">Peter Carbonetto</h4>
450
450
</ p >
451
451
< p >
452
452
The results in this page were generated with repository version
453
- < a href ="https://github.com/stephenslab/single-cell-jamboree/tree/b36508bf5db1e33dca218ea14dc03f3683da85b7 " target ="_blank "> b36508b </ a > .
453
+ < a href ="https://github.com/stephenslab/single-cell-jamboree/tree/9440e05bc58ce8e42a1d61a79ffdfd18896e60cb " target ="_blank "> 9440e05 </ a > .
454
454
See the < em > Past versions</ em > tab to see a history of the changes made
455
455
to the R Markdown and HTML files.
456
456
</ p >
@@ -519,6 +519,109 @@ <h4 class="author">Peter Carbonetto</h4>
519
519
Rmd
520
520
</ td >
521
521
< td >
522
+ < a href ="https://github.com/stephenslab/single-cell-jamboree/blob/9440e05bc58ce8e42a1d61a79ffdfd18896e60cb/analysis/pancreas_annotate.Rmd " target ="_blank "> 9440e05</ a >
523
+ </ td >
524
+ < td >
525
+ Peter Carbonetto
526
+ </ td >
527
+ < td >
528
+ 2025-02-20
529
+ </ td >
530
+ < td >
531
+ workflowr::wflow_publish("pancreas_annotate.Rmd", verbose = TRUE,
532
+ </ td >
533
+ </ tr >
534
+ < tr >
535
+ < td >
536
+ Rmd
537
+ </ td >
538
+ < td >
539
+ < a href ="https://github.com/stephenslab/single-cell-jamboree/blob/07d482e89a8eb0c9c4dd09a4956d97eb7f23c27b/analysis/pancreas_annotate.Rmd " target ="_blank "> 07d482e</ a >
540
+ </ td >
541
+ < td >
542
+ Peter Carbonetto
543
+ </ td >
544
+ < td >
545
+ 2025-02-19
546
+ </ td >
547
+ < td >
548
+ Fixed a few words in the pancreas_annotate analysis.
549
+ </ td >
550
+ </ tr >
551
+ < tr >
552
+ < td >
553
+ Rmd
554
+ </ td >
555
+ < td >
556
+ < a href ="https://github.com/stephenslab/single-cell-jamboree/blob/b2641524e0077583153d91147cffe78c153ea854/analysis/pancreas_annotate.Rmd " target ="_blank "> b264152</ a >
557
+ </ td >
558
+ < td >
559
+ Peter Carbonetto
560
+ </ td >
561
+ < td >
562
+ 2025-02-19
563
+ </ td >
564
+ < td >
565
+ A bit of formatting adjustment to the pancreas_annotate rmarkdown.
566
+ </ td >
567
+ </ tr >
568
+ < tr >
569
+ < td >
570
+ Rmd
571
+ </ td >
572
+ < td >
573
+ < a href ="https://github.com/stephenslab/single-cell-jamboree/blob/20ddb4746c716ceb0b761006c0af730ed64aabbe/analysis/pancreas_annotate.Rmd " target ="_blank "> 20ddb47</ a >
574
+ </ td >
575
+ < td >
576
+ Peter Carbonetto
577
+ </ td >
578
+ < td >
579
+ 2025-02-19
580
+ </ td >
581
+ < td >
582
+ Added another note.
583
+ </ td >
584
+ </ tr >
585
+ < tr >
586
+ < td >
587
+ Rmd
588
+ </ td >
589
+ < td >
590
+ < a href ="https://github.com/stephenslab/single-cell-jamboree/blob/190f7c317ecffc6fda8811a6a7421b347b4171bd/analysis/pancreas_annotate.Rmd " target ="_blank "> 190f7c3</ a >
591
+ </ td >
592
+ < td >
593
+ Peter Carbonetto
594
+ </ td >
595
+ < td >
596
+ 2025-02-19
597
+ </ td >
598
+ < td >
599
+ Edited a note about interpretation to the pancreas_annotate analysis.
600
+ </ td >
601
+ </ tr >
602
+ < tr >
603
+ < td >
604
+ html
605
+ </ td >
606
+ < td >
607
+ < a href ="https://rawcdn.githack.com/stephenslab/single-cell-jamboree/1f9368602d75ed06fc1c50a66401a25350634cec/docs/pancreas_annotate.html " target ="_blank "> 1f93686</ a >
608
+ </ td >
609
+ < td >
610
+ Peter Carbonetto
611
+ </ td >
612
+ < td >
613
+ 2025-02-19
614
+ </ td >
615
+ < td >
616
+ Added an ‘interpretable’ annotation plot to the pancreas_annotate
617
+ analysis.
618
+ </ td >
619
+ </ tr >
620
+ < tr >
621
+ < td >
622
+ Rmd
623
+ </ td >
624
+ < td >
522
625
< a href ="https://github.com/stephenslab/single-cell-jamboree/blob/b36508bf5db1e33dca218ea14dc03f3683da85b7/analysis/pancreas_annotate.Rmd " target ="_blank "> b36508b</ a >
523
626
</ td >
524
627
< td >
@@ -667,6 +770,43 @@ <h2>Structure plot</h2>
667
770
structure_plot(L[,-1],grouping = celltype,gap = 10,perplexity = 70,n = Inf) +
668
771
labs(y = "membership",fill = "factor",color = "factor")</ code > </ pre >
669
772
< p > < img src ="figure/pancreas_annotate.Rmd/structure-plot-flashier-nmf-1.png " width ="960 " style ="display: block; margin: auto; " /> </ p >
773
+ < p >
774
+ < button type ="button " class ="btn btn-default btn-xs btn-workflowr btn-workflowr-fig " data-toggle ="collapse " data-target ="#fig-structure-plot-flashier-nmf-1 ">
775
+ Past versions of structure-plot-flashier-nmf-1.png
776
+ </ button >
777
+ </ p >
778
+ < div id ="fig-structure-plot-flashier-nmf-1 " class ="collapse ">
779
+ < div class ="table-responsive ">
780
+ < table class ="table table-condensed table-hover ">
781
+ < thead >
782
+ < tr >
783
+ < th >
784
+ Version
785
+ </ th >
786
+ < th >
787
+ Author
788
+ </ th >
789
+ < th >
790
+ Date
791
+ </ th >
792
+ </ tr >
793
+ </ thead >
794
+ < tbody >
795
+ < tr >
796
+ < td >
797
+ < a href ="https://github.com/stephenslab/single-cell-jamboree/blob/1f9368602d75ed06fc1c50a66401a25350634cec/docs/figure/pancreas_annotate.Rmd/structure-plot-flashier-nmf-1.png " target ="_blank "> 1f93686</ a >
798
+ </ td >
799
+ < td >
800
+ Peter Carbonetto
801
+ </ td >
802
+ < td >
803
+ 2025-02-19
804
+ </ td >
805
+ </ tr >
806
+ </ tbody >
807
+ </ table >
808
+ </ div >
809
+ </ div >
670
810
< p > Note that the first factor was omitted in the Structure plot because
671
811
it is a “baseline” factor, and not particularly interesting to look
672
812
at.</ p >
@@ -708,6 +848,43 @@ <h2>Annotating the factors by “driving genes”</h2>
708
848
theme(plot.title = element_text(face = "plain",size = 9))
709
849
plot_grid(p1,p2,nrow = 1,ncol = 2)</ code > </ pre >
710
850
< p > < img src ="figure/pancreas_annotate.Rmd/annotation-plot-flashier-nmf-1.png " width ="720 " style ="display: block; margin: auto; " /> </ p >
851
+ < p >
852
+ < button type ="button " class ="btn btn-default btn-xs btn-workflowr btn-workflowr-fig " data-toggle ="collapse " data-target ="#fig-annotation-plot-flashier-nmf-1 ">
853
+ Past versions of annotation-plot-flashier-nmf-1.png
854
+ </ button >
855
+ </ p >
856
+ < div id ="fig-annotation-plot-flashier-nmf-1 " class ="collapse ">
857
+ < div class ="table-responsive ">
858
+ < table class ="table table-condensed table-hover ">
859
+ < thead >
860
+ < tr >
861
+ < th >
862
+ Version
863
+ </ th >
864
+ < th >
865
+ Author
866
+ </ th >
867
+ < th >
868
+ Date
869
+ </ th >
870
+ </ tr >
871
+ </ thead >
872
+ < tbody >
873
+ < tr >
874
+ < td >
875
+ < a href ="https://github.com/stephenslab/single-cell-jamboree/blob/1f9368602d75ed06fc1c50a66401a25350634cec/docs/figure/pancreas_annotate.Rmd/annotation-plot-flashier-nmf-1.png " target ="_blank "> 1f93686</ a >
876
+ </ td >
877
+ < td >
878
+ Peter Carbonetto
879
+ </ td >
880
+ < td >
881
+ 2025-02-19
882
+ </ td >
883
+ </ tr >
884
+ </ tbody >
885
+ </ table >
886
+ </ div >
887
+ </ div >
711
888
< pre > < code > # Features selected for plot: INS IAPP SCGN SLC30A8 ABCC8 G6PC2 NPTX2 HADH GCG CHGB TM4SF4 TTR SCG2 SCG5 ALDH1A1 PCSK2 SST RBP4 PCSK1 CPE PPY SEC11C ISL1
712
889
c("INS", "IAPP", "SCGN", "SLC30A8", "ABCC8", "G6PC2", "NPTX2",
713
890
"HADH", "GCG", "CHGB", "TM4SF4", "TTR", "SCG2", "SCG5", "ALDH1A1",
@@ -731,8 +908,9 @@ <h2>Annotating the factors by “driving genes”</h2>
731
908
provides both options. These selection strategies can also reveal
732
909
complementary insights and so in many situations it may be better to use
733
910
both.</ p >
734
- < div id ="a-more-interpretable-annotation-plot " class ="section level3 ">
735
- < h3 > A more interpretable annotation plot</ h3 >
911
+ < div id ="a-more-interpretable-annotation-heatmap "
912
+ class ="section level3 ">
913
+ < h3 > A more interpretable annotation heatmap</ h3 >
736
914
< p > Above we sounded a note of caution about interpreting elements of L
737
915
across factors/columns. The same applies to the F matrix. To provide a
738
916
more even footing, above we employed the simple heuristic of scaling the
@@ -754,19 +932,109 @@ <h3>A more interpretable annotation plot</h3>
754
932
colnames(F) <- paste0("k",1:9)
755
933
annotation_heatmap(F,select_features = genes,font_size = 9)</ code > </ pre >
756
934
< p > < img src ="figure/pancreas_annotate.Rmd/annotation-plot-flashier-nmf-2-1.png " width ="390 " style ="display: block; margin: auto; " /> </ p >
935
+ < p >
936
+ < button type ="button " class ="btn btn-default btn-xs btn-workflowr btn-workflowr-fig " data-toggle ="collapse " data-target ="#fig-annotation-plot-flashier-nmf-2-1 ">
937
+ Past versions of annotation-plot-flashier-nmf-2-1.png
938
+ </ button >
939
+ </ p >
940
+ < div id ="fig-annotation-plot-flashier-nmf-2-1 " class ="collapse ">
941
+ < div class ="table-responsive ">
942
+ < table class ="table table-condensed table-hover ">
943
+ < thead >
944
+ < tr >
945
+ < th >
946
+ Version
947
+ </ th >
948
+ < th >
949
+ Author
950
+ </ th >
951
+ < th >
952
+ Date
953
+ </ th >
954
+ </ tr >
955
+ </ thead >
956
+ < tbody >
957
+ < tr >
958
+ < td >
959
+ < a href ="https://github.com/stephenslab/single-cell-jamboree/blob/1f9368602d75ed06fc1c50a66401a25350634cec/docs/figure/pancreas_annotate.Rmd/annotation-plot-flashier-nmf-2-1.png " target ="_blank "> 1f93686</ a >
960
+ </ td >
961
+ < td >
962
+ Peter Carbonetto
963
+ </ td >
964
+ < td >
965
+ 2025-02-19
966
+ </ td >
967
+ </ tr >
968
+ </ tbody >
969
+ </ table >
970
+ </ div >
971
+ </ div >
757
972
< p > Visually, this plot looks quite similar to before, but now the effect
758
973
sizes are on a different scale. With this rescaling, the effect sizes
759
974
have the following interpretation:</ p >
975
+ < div style ="margin:1em; padding:1em; border:1px solid black; ">
760
976
< p > < span class ="math inline "> \(f_{jk}\)</ span > is (approximately) the
761
- < em > log-fold change</ em > (LFC) of gene < span
762
- class ="math inline "> \(j\)</ span > in a cell < span
763
- class ="math inline "> \(i\)</ span > with the largest membership in factor
764
- < span class ="math inline "> \(k\)</ span > (< span
765
- class ="math inline "> \(l_{ik} =
766
- 1\)</ span > ) relative to a cell < span
767
- class ="math inline "> \(i'\)</ span > with no membership in factor < span
977
+ log-fold change (LFC) of gene < span class ="math inline "> \(j\)</ span > in
978
+ a hypothetical cell < span class ="math inline "> \(i\)</ span > with the
979
+ largest possible membership to factor < span
980
+ class ="math inline "> \(k\)</ span > (< span class ="math inline "> \(l_{ik} =
981
+ 1\)</ span > ) relative to another hypothetical cell < span
982
+ class ="math inline "> \(i'\)</ span > with no membership to factor < span
768
983
class ="math inline "> \(k\)</ span > (< span
769
984
class ="math inline "> \(l_{i'k} = 0\)</ span > ).</ p >
985
+ </ div >
986
+ < p > Also note that this same idea could have been also applied to the
987
+ other annotation heatmap (using the first selection strategy)—we showed
988
+ this with just the second annotation heatmap for illustration.</ p >
989
+ </ div >
990
+ </ div >
991
+ < div id ="annotating-the-semi-nmf " class ="section level2 ">
992
+ < h2 > Annotating the semi-NMF</ h2 >
993
+ < p > Previously, we found the semi-non-negative matrix factorization
994
+ (semi-NMF) produced by flashier yields a more hierarchical decomposition
995
+ of the cell types, capturing structure at different levels of
996
+ cell-type-specifity:</ p >
997
+ < pre class ="r "> < code > L <- fl_snmf_ldf$L
998
+ colnames(L) <- paste0("k",1:9)
999
+ structure_plot(L[,-c(1,5)],grouping = celltype,gap = 10,
1000
+ perplexity = 70,n = Inf) +
1001
+ labs(y = "membership",fill = "factor",color = "factor")</ code > </ pre >
1002
+ < p > < img src ="figure/pancreas_annotate.Rmd/structure-plot-flashier-snmf-1.png " width ="960 " style ="display: block; margin: auto; " /> </ p >
1003
+ < p > As a result, we would expect that the factors themselves would tend
1004
+ to pick more “distinctive” features; for example, factor 8 capturing
1005
+ expression specific to dselta, gamma and epsilon cells doesn’t need to
1006
+ include the expression that is shared with alpha cells because factor 4
1007
+ already captures this. Still, it is helpful to explore these two
1008
+ selection strategies for the islet cell factors (3, 4 and 8) in the
1009
+ annotation heatmap:</ p >
1010
+ < pre class ="r "> < code > F <- fl_snmf_ldf$F
1011
+ colnames(F) <- paste0("k",1:9)
1012
+ kset <- paste0("k",c(3,4,8))
1013
+ F <- F[,c(3,4,8,1,2,5,6,7,9)]
1014
+ p1 <- annotation_heatmap(F,n = 8,dims = kset,
1015
+ select_features = "largest",
1016
+ feature_sign = "positive",
1017
+ font_size = 9) +
1018
+ labs(title = "select_features = \"largest\"") +
1019
+ theme(plot.title = element_text(face = "plain",size = 9))
1020
+ p2 <- annotation_heatmap(F,n = 8,dims = kset,
1021
+ select_features = "distinctive",
1022
+ compare_dims = kset,
1023
+ feature_sign = "positive",
1024
+ font_size = 9) +
1025
+ labs(title = "select_features = \"distinctive\"") +
1026
+ theme(plot.title = element_text(face = "plain",size = 9))
1027
+ plot_grid(p1,p2,nrow = 1,ncol = 2)</ code > </ pre >
1028
+ < p > < img src ="figure/pancreas_annotate.Rmd/annotation-plot-flashier-snmf-1.png " width ="720 " style ="display: block; margin: auto; " /> </ p >
1029
+ < pre > < code > # Features selected for plot: GCG TTR TM4SF4 GC CHGB PCSK2 MALAT1 IGFBP7 INS IAPP HADH NPTX2 MAFA RBP4 PCSK1 SCD5 SST AQP3 PPY LEPR DPYSL3 AKAP12
1030
+ c("GCG", "TTR", "TM4SF4", "GC", "CHGB", "PCSK2", "MALAT1", "IGFBP7",
1031
+ "INS", "IAPP", "HADH", "NPTX2", "MAFA", "RBP4", "PCSK1", "SCD5",
1032
+ "SST", "AQP3", "PPY", "LEPR", "DPYSL3", "AKAP12")
1033
+ # Features selected for plot: GCG GC TTR TM4SF4 FAP LOXL4 IRX2 ALDH1A1 INS IAPP MAFA NPTX2 ADCYAP1 PFKFB2 MEG3 DLK1 SST AQP3 LEPR AKAP12 MTUS1 EGR1 PPY S100A6
1034
+ c("GCG", "GC", "TTR", "TM4SF4", "FAP", "LOXL4", "IRX2", "ALDH1A1",
1035
+ "INS", "IAPP", "MAFA", "NPTX2", "ADCYAP1", "PFKFB2", "MEG3",
1036
+ "DLK1", "SST", "AQP3", "LEPR", "AKAP12", "MTUS1", "EGR1", "PPY",
1037
+ "S100A6")</ code > </ pre >
770
1038
< br >
771
1039
< p >
772
1040
< button type ="button " class ="btn btn-default btn-workflowr btn-workflowr-sessioninfo " data-toggle ="collapse " data-target ="#workflowr-sessioninfo " style ="display: block; ">
@@ -794,7 +1062,7 @@ <h3>A more interpretable annotation plot</h3>
794
1062
# [1] stats graphics grDevices utils datasets methods base
795
1063
#
796
1064
# other attached packages:
797
- # [1] cowplot_1.1.3 ggplot2_3.5.0 fastTopics_0.7-21 flashier_1.0.55
1065
+ # [1] cowplot_1.1.3 ggplot2_3.5.0 fastTopics_0.7-24 flashier_1.0.55
798
1066
# [5] ebnm_1.1-34 Matrix_1.6-5
799
1067
#
800
1068
# loaded via a namespace (and not attached):
@@ -830,7 +1098,6 @@ <h3>A more interpretable annotation plot</h3>
830
1098
# [88] pkgconfig_2.0.3</ code > </ pre >
831
1099
</ div >
832
1100
</ div >
833
- </ div >
834
1101
835
1102
836
1103
<!-- Adjust MathJax settings so that all math formulae are shown using
0 commit comments