Identify marker genes for all or selected clusters based on scran's implementation of findMarkers.

findScranMarkers(
  gobject,
  spat_unit = NULL,
  feat_type = NULL,
  expression_values = c("normalized", "scaled", "custom"),
  cluster_column,
  subset_clusters = NULL,
  group_1 = NULL,
  group_1_name = NULL,
  group_2 = NULL,
  group_2_name = NULL,
  verbose = TRUE,
  ...
)

Arguments

gobject

giotto object

spat_unit

spatial unit

feat_type

feature type

expression_values

gene expression values to use

cluster_column

clusters to use

subset_clusters

selection of clusters to compare

group_1

group 1 cluster IDs from cluster_column for pairwise comparison

group_1_name

custom name for group_1 clusters

group_2

group 2 cluster IDs from cluster_column for pairwise comparison

group_2_name

custom name for group_2 clusters

verbose

be verbose (default = FALSE)

...

additional parameters for the findMarkers function in scran

Value

data.table with marker genes

Details

This is a minimal convenience wrapper around the findMarkers function from the scran package.

To perform differential expression between custom selected groups of cells you need to specify the cell_ID column to parameter cluster_column and provide the individual cell IDs to the parameters group_1 and group_2

By default group names will be created by pasting the different id names within each selected group. When you have many different ids in a single group it is recommend to provide names for both groups to group_1_name and group_2_name

Examples

g <- GiottoData::loadGiottoMini("visium")
#> 1. read Giotto object
#> 2. read Giotto feature information
#> 3. read Giotto spatial information
#> 3.1 read Giotto spatial shape information
#> 3.2 read Giotto spatial centroid information
#> 3.3 read Giotto spatial overlap information
#> 4. read Giotto image information
#> python already initialized in this session
#>  active environment : '/usr/bin/python3'
#>  python version : 3.10
#> checking default envname 'giotto_env'
#> a system default python environment was found
#> Using python path:
#>  "/usr/bin/python3"

findScranMarkers(g, cluster_column = "leiden_clus")
#> Using 'Scran' to detect marker genes. If used in published
#>         research, please cite:
#>         Lun ATL, McCarthy DJ, Marioni JC (2016).
#>         'A step-by-step workflow for low-level analysis of single-cell RNA-seq
#>         data with Bioconductor.'
#>         F1000Res., 5, 2122. doi: 10.12688/f1000research.9501.2.
#> [[1]]
#>        Top      p.value          FDR summary.logFC     logFC.2      logFC.3
#>      <int>        <num>        <num>         <num>       <num>        <num>
#>   1:     1 2.304174e-04 6.573796e-03    0.90645500  0.37802208  0.906455001
#>   2:     1 2.488503e-04 6.573796e-03    0.73714285  0.35023787  0.285465533
#>   3:     1 3.573331e-02 2.824072e-01   -0.65006774 -0.65006774 -0.310767600
#>   4:     1 5.986157e-17 3.795223e-14    1.29002259  0.11152501 -0.003955259
#>   5:     1 9.144098e-03 1.183134e-01    0.71476651 -0.15878804  0.086193959
#>  ---                                                                       
#> 630:   392 8.170461e-01 9.963036e-01    0.12019791  0.12019791  0.066849413
#> 631:   409 8.469325e-01 9.963036e-01    0.28779748  0.04379729  0.099088405
#> 632:   410 9.981090e-01 9.981090e-01   -0.11016023  0.03910845 -0.110160233
#> 633:   460 9.958793e-01 9.981090e-01   -0.05961090 -0.05961090  0.007542745
#> 634:   471 9.542557e-01 9.963036e-01   -0.03719674 -0.03719674 -0.033661719
#>            logFC.4     logFC.5       logFC.6      logFC.7  feats cluster
#>              <num>       <num>         <num>        <num> <char>  <char>
#>   1:  0.2628823782  0.45234522  0.3483568624  0.861221868 Arpp19       1
#>   2:  0.1417528118  0.25891761  0.7371428514  0.743099124  Nr4a1       1
#>   3:  0.1593223354 -0.59127151 -0.2332950800 -0.172305095  Grb14       1
#>   4: -0.0549709160 -0.20970272 -0.3019308099  1.290022593     F3       1
#>   5:  0.1355646082  0.71476651  0.4749149442  1.159030178    Mgp       1
#>  ---                                                                    
#> 630: -0.1191742596 -0.11774369 -0.1085689549 -0.132165513  Ly6c1       1
#> 631: -0.1038916802 -0.08677730  0.1468124449  0.287797484 Cadps2       1
#> 632: -0.0370309299  0.08793704 -0.0007125669  0.160973282  Zfhx3       1
#> 633:  0.0008977208  0.01361647  0.0494467014  0.002896235 Ube2l6       1
#> 634: -0.0066309208 -0.02467083 -0.0237548120  0.020868744   Tie1       1
#> 
#> [[2]]
#>        Top      p.value          FDR summary.logFC     logFC.1      logFC.3
#>      <int>        <num>        <num>         <num>       <num>        <num>
#>   1:     1 4.493099e-04 1.238533e-02    0.98709500  0.51179478  0.287395704
#>   2:     1 1.686308e-02 1.979851e-01    0.80939008  0.65006774  0.339300141
#>   3:     1 4.882728e-12 3.095650e-09    1.17849759 -0.11152501 -0.115480266
#>   4:     1 1.685305e-03 3.561612e-02    0.87355455  0.15878804  0.244982000
#>   5:     1 1.435589e-02 1.857476e-01    0.75902888  0.59003057  0.759028878
#>  ---                                                                       
#> 630:   384 8.843225e-01 9.954992e-01    0.10905760  0.05961090  0.067153648
#> 631:   390 9.681886e-01 9.954992e-01   -0.18631844 -0.13596775 -0.011582149
#> 632:   397 8.170828e-01 9.954992e-01    0.15793618 -0.06470923  0.086129945
#> 633:   403 8.469325e-01 9.954992e-01   -0.14768897 -0.04379729  0.055291116
#> 634:   471 9.780374e-01 9.954992e-01    0.03719674  0.03719674  0.003535019
#>          logFC.4     logFC.5     logFC.6    logFC.7   feats cluster
#>            <num>       <num>       <num>      <num>  <char>  <char>
#>   1:  0.98709500  0.36235238  0.37944760 0.68255672 Carhsp1       2
#>   2:  0.80939008  0.05879623  0.41677266 0.47776265   Grb14       2
#>   3: -0.16649592 -0.32122773 -0.41345582 1.17849759      F3       2
#>   4:  0.29435265  0.87355455  0.63370298 1.31781822     Mgp       2
#>   5:  0.77054700  0.36936712  0.06646966 0.95356486   Prr18       2
#>  ---                                                               
#> 630:  0.06050862  0.07322737  0.10905760 0.06250714  Ube2l6       2
#> 631: -0.18631844  0.13414898  0.07512455 0.13773810 Neurod6       2
#> 632:  0.15793618  0.06086162  0.11227616 0.23929012     Hlf       2
#> 633: -0.14768897 -0.13057459  0.10301516 0.24400019  Cadps2       2
#> 634:  0.03056582  0.01252591  0.01344193 0.05806548    Tie1       2
#> 
#> [[3]]
#>        Top      p.value          FDR summary.logFC      logFC.1      logFC.2
#>      <int>        <num>        <num>         <num>        <num>        <num>
#>   1:     1 2.041188e-02 2.696069e-01    0.50498456  0.504984557  0.402682581
#>   2:     1 2.304174e-04 1.327988e-02   -0.90645500 -0.906455001 -0.528432923
#>   3:     1 4.477933e-03 8.871905e-02    0.30442144  0.205947496  0.176755272
#>   4:     1 1.758868e-11 1.115122e-08    1.29397785  0.003955259  0.115480266
#>   5:     1 1.186323e-02 1.979287e-01   -0.85347407 -0.739522029 -0.511888427
#>  ---                                                                        
#> 630:   401 9.681886e-01 9.955840e-01   -0.17473629 -0.124385599  0.011582149
#> 631:   413 8.946801e-01 9.955840e-01   -0.12170101 -0.121701007 -0.078984900
#> 632:   420 9.915440e-01 9.955840e-01   -0.07998884 -0.046764443 -0.079988838
#> 633:   436 9.913842e-01 9.955840e-01   -0.06715365 -0.007542745 -0.067153648
#> 634:   500 9.780374e-01 9.955840e-01    0.03366172  0.033661719 -0.003535019
#>           logFC.4      logFC.5      logFC.6     logFC.7   feats cluster
#>             <num>        <num>        <num>       <num>  <char>  <char>
#>   1:  0.169203980  0.493700297  0.017217739  0.68881115    Bcam       3
#>   2: -0.643572623 -0.454109779 -0.558098138 -0.04523313  Arpp19       3
#>   3:  0.241349413  0.237414552  0.304421441 -0.04306167 Aldh1a2       3
#>   4: -0.051015657 -0.205747465 -0.297975551  1.29397785      F3       3
#>   5: -0.853474068 -0.630817196 -0.669008913 -0.70085278  Hpcal4       3
#>  ---                                                                   
#> 630: -0.174736288  0.145731128  0.086706697  0.14932025 Neurod6       3
#> 631:  0.088504889  0.101981067 -0.048113349  0.23111255   Rab3c       3
#> 632: -0.002089627 -0.030261178  0.091251923 -0.09796174   Cpne8       3
#> 633: -0.006645024  0.006073720  0.041903956 -0.00464651  Ube2l6       3
#> 634:  0.027030799  0.008990887  0.009906907  0.05453046    Tie1       3
#> 
#> [[4]]
#>        Top      p.value          FDR summary.logFC       logFC.1     logFC.2
#>      <int>        <num>        <num>         <num>         <num>       <num>
#>   1:     1 4.493099e-04 2.589659e-02   -0.98709500 -0.4753002269 -0.98709500
#>   2:     1 5.078518e-03 1.341575e-01    0.63286874  0.2471766190  0.03863261
#>   3:     1 2.625294e-10 1.664436e-07    1.34499351  0.0549709160  0.16649592
#>   4:     1 6.317306e-03 1.540451e-01    0.77121823  0.7712182292  0.63261566
#>   5:     1 5.436870e-03 1.378790e-01   -0.49047596 -0.2909354996 -0.49047596
#>  ---                                                                        
#> 630:   375 9.718823e-01 9.963231e-01    0.25621852 -0.0073971898 -0.07536530
#> 631:   388 9.359774e-01 9.963231e-01   -0.18941904 -0.1371096029 -0.18941904
#> 632:   464 9.915440e-01 9.963231e-01   -0.07789921 -0.0446748158 -0.07789921
#> 633:   498 9.963231e-01 9.963231e-01   -0.06050862 -0.0008977208 -0.06050862
#> 634:   532 9.542557e-01 9.963231e-01   -0.03056582  0.0066309208 -0.03056582
#>           logFC.3     logFC.5     logFC.6      logFC.7   feats cluster
#>             <num>       <num>       <num>        <num>  <char>  <char>
#>   1: -0.699699298 -0.62474263 -0.60764740 -0.304538282 Carhsp1       4
#>   2:  0.287423926  0.23942405  0.63286874  0.254403628    Pdyn       4
#>   3:  0.051015657 -0.15473181 -0.24695989  1.344993509      F3       4
#>   4:  0.497192512  0.41653024  0.81838388  0.173456117   Pcdh8       4
#>   5: -0.326046063 -0.55954648 -0.63876080 -0.022109950  Galnt6       4
#>  ---                                                                  
#> 630: -0.105810362  0.07316508 -0.01604273  0.256218524   Shox2       4
#> 631:  0.049030572  0.02565367 -0.11877136  0.160893184   Pvalb       4
#> 632:  0.002089627 -0.02817155  0.09334155 -0.095872118   Cpne8       4
#> 633:  0.006645024  0.01271874  0.04854898  0.001998515  Ube2l6       4
#> 634: -0.027030799 -0.01803991 -0.01712389  0.027499665    Tie1       4
#> 
#> [[5]]
#>        Top      p.value          FDR summary.logFC     logFC.1     logFC.2
#>      <int>        <num>        <num>         <num>       <num>       <num>
#>   1:     1 5.593922e-02 6.149128e-01   -0.49370030  0.01128426 -0.09101772
#>   2:     1 6.920551e-03 2.437572e-01    0.39256404  0.17396056  0.16375244
#>   3:     1 1.123889e-11 7.125455e-09    1.49972532  0.20970272  0.32122773
#>   4:     1 1.685305e-03 7.632025e-02   -0.87355455 -0.71476651 -0.87355455
#>   5:     1 1.087374e-02 3.133614e-01    0.55954648  0.26861098  0.06907052
#>  ---                                                                      
#> 630:   389 9.306563e-01 9.968179e-01   -0.12557085 -0.12557085 -0.06086162
#> 631:   400 9.322696e-01 9.968179e-01    0.12151310 -0.01650327 -0.04972766
#> 632:   425 9.594927e-01 9.968179e-01    0.11239339  0.11239339 -0.01440080
#> 633:   448 9.803600e-01 9.968179e-01   -0.07322737 -0.01361647 -0.07322737
#> 634:   540 9.959609e-01 9.968179e-01    0.02467083  0.02467083 -0.01252591
#>           logFC.3     logFC.4       logFC.6     logFC.7  feats cluster
#>             <num>       <num>         <num>       <num> <char>  <char>
#>   1: -0.493700297 -0.32449632 -0.4764825581  0.19511086   Bcam       5
#>   2:  0.141852032  0.10981295  0.3925640424  0.14215547     Cp       5
#>   3:  0.205747465  0.15473181 -0.0922280856  1.49972532     F3       5
#>   4: -0.628572547 -0.57920190 -0.2398515625  0.44426367    Mgp       5
#>   5:  0.233500418  0.55954648 -0.0792143163  0.53743653 Galnt6       5
#>  ---                                                                  
#> 630:  0.025268327  0.09707457  0.0514145381  0.17842850    Hlf       5
#> 631:  0.030261178  0.02817155  0.1215131007 -0.06770057  Cpne8       5
#> 632: -0.020039113 -0.04836938  0.0446992547  0.11626795 Vstm2a       5
#> 633: -0.006073720 -0.01271874  0.0358302361 -0.01072023 Ube2l6       5
#> 634: -0.008990887  0.01803991  0.0009160208  0.04553958   Tie1       5
#> 
#> [[6]]
#>        Top      p.value         FDR summary.logFC       logFC.1      logFC.2
#>      <int>        <num>       <num>         <num>         <num>        <num>
#>   1:     1 3.397885e-03 0.161814023   -0.21860348 -0.2186034850 -0.228811601
#>   2:     1 4.477933e-03 0.161814023   -0.30442144 -0.0984739449 -0.127666169
#>   3:     1 2.488503e-04 0.026295183   -0.73714285 -0.7371428514 -0.386904982
#>   4:     1 2.214999e-03 0.142773240   -0.59423614 -0.3856921243 -0.594236137
#>   5:     1 5.527494e-06 0.003504431    1.59195340  0.3019308099  0.413455817
#>  ---                                                                        
#> 630:   439 9.954992e-01 0.999269911   -0.10316260 -0.1031626015  0.001392101
#> 631:   441 8.607175e-01 0.999269911    0.15481148 -0.0555131172 -0.061205578
#> 632:   475 9.981090e-01 0.999269911   -0.10944767  0.0007125669  0.039821013
#> 633:   522 9.167732e-01 0.999269911   -0.09306864  0.0676941335 -0.059100050
#> 634:   557 9.959609e-01 0.999269911    0.02375481  0.0237548120 -0.013441926
#>           logFC.3     logFC.4       logFC.5      logFC.7   feats cluster
#>             <num>       <num>         <num>        <num>  <char>  <char>
#>   1: -0.250712011 -0.28275109 -0.3925640424 -0.250408572      Cp       6
#>   2: -0.304421441 -0.06307203 -0.0670068886 -0.347483107 Aldh1a2       6
#>   3: -0.451677319 -0.59539004 -0.4782252394  0.005956272   Nr4a1       6
#>   4: -0.345444817 -0.63286874 -0.3934446919 -0.378465115    Pdyn       6
#>   5:  0.297975551  0.24695989  0.0922280856  1.591953403      F3       6
#>  ---                                                                    
#> 630: -0.006672761  0.07105764 -0.0320322801 -0.125109657 Tmem100       6
#> 631:  0.099145148  0.15481148  0.1291902545 -0.143563712   Sox10       6
#> 632: -0.109447666 -0.03631836  0.0886496029  0.161685849   Zfhx3       6
#> 633: -0.064738368 -0.09306864 -0.0446992547  0.071568694  Vstm2a       6
#> 634: -0.009906907  0.01712389 -0.0009160208  0.044623556    Tie1       6
#> 
#> [[7]]
#>        Top      p.value          FDR summary.logFC      logFC.1     logFC.2
#>      <int>        <num>        <num>         <num>        <num>       <num>
#>   1:     1 5.986157e-17 3.795223e-14   -1.29002259 -1.290022593 -1.17849759
#>   2:     2 2.601482e-11 4.123350e-09   -0.80632925 -0.806329248 -0.85701198
#>   3:     2 6.222905e-13 1.315107e-10   -0.91299388 -0.912993882 -0.95549842
#>   4:     2 1.632817e-13 5.176031e-11   -1.07608973 -1.076089728 -0.84140367
#>   5:     3 4.570002e-10 5.794763e-08   -0.75975639 -0.759756385 -0.72428750
#>  ---                                                                       
#> 630:   515 9.951443e-01 9.995295e-01   -0.16463733 -0.003874561 -0.13066874
#> 631:   516 9.437524e-01 9.995295e-01    0.14414795  0.090391089 -0.04581802
#> 632:   526 9.016343e-01 9.995295e-01    0.16876674 -0.147756604  0.09518521
#> 633:   543 9.442058e-01 9.995295e-01   -0.05806548 -0.020868744 -0.05806548
#> 634:   564 9.963231e-01 9.995295e-01   -0.06250714 -0.002896235 -0.06250714
#>          logFC.3      logFC.4     logFC.5     logFC.6  feats cluster
#>            <num>        <num>       <num>       <num> <char>  <char>
#>   1: -1.29397785 -1.344993509 -1.49972532 -1.59195340     F3       7
#>   2: -0.91264376 -0.953070757 -0.92818993 -1.24705822  Phkg1       7
#>   3: -1.06086870 -0.487032401 -0.97877848 -1.00052882  Pde8a       7
#>   4: -0.75568738 -0.540543087 -0.69790200 -0.97585842  Dkkl1       7
#>   5: -0.67456185 -0.822037085 -0.61893080 -1.19424107  Npas3       7
#>  ---                                                                
#> 630: -0.13630706 -0.164637330 -0.11626795 -0.07156869 Vstm2a       7
#> 631: -0.05162772  0.059370626 -0.13158806  0.14414795   Cd82       7
#> 632:  0.16876674 -0.106073111 -0.09744106  0.11742053   Lmo3       7
#> 633: -0.05453046 -0.027499665 -0.04553958 -0.04462356   Tie1       7
#> 634:  0.00464651 -0.001998515  0.01072023  0.04655047 Ube2l6       7
#>