Browse code

Add basic usage example to README

Milan Malfait authored on 11/03/2021 08:46:18
Showing 2 changed files

... ...
@@ -53,6 +53,18 @@ if (!requireNamespace("BiocManager", quietly = TRUE)) {
53 53
 BiocManager::install("sales-lab/spatialDE")
54 54
 ```
55 55
 
56
+
57
+## Basic usage
58
+
59
+```{r usage, eval=TRUE}
60
+library(spatialDE)
61
+spe <- mockSVG(return_SPE = TRUE)
62
+de_results <- spatialDE(spe)
63
+head(de_results)
64
+```
65
+
66
+
67
+
56 68
 ## Citation
57 69
 
58 70
 <!-- TODO: update once pkg on BioC -->
... ...
@@ -45,6 +45,36 @@ if (!requireNamespace("BiocManager", quietly = TRUE)) {
45 45
 BiocManager::install("sales-lab/spatialDE")
46 46
 ```
47 47
 
48
+## Basic usage
49
+
50
+``` r
51
+library(spatialDE)
52
+spe <- mockSVG(return_SPE = TRUE)
53
+de_results <- spatialDE(spe)
54
+head(de_results)
55
+#>            FSV M         g   l    max_delta      max_ll max_mu_hat max_s2_t_hat
56
+#> 0 6.893971e-01 4 Gene_0001 0.5 4.480494e-01 -12.5057349  -44.97443 1.016237e+03
57
+#> 1 2.049747e-09 4 Gene_0002 0.5 4.851652e+08 -23.3349972  -25.89877 1.382703e-06
58
+#> 2 2.049747e-09 4 Gene_0003 0.5 4.851652e+08  -3.8319606  -47.30915 4.613312e-06
59
+#> 3 2.049747e-09 4 Gene_0004 0.5 4.851652e+08  -0.8721812  -51.75744 5.521607e-06
60
+#> 4 2.049747e-09 4 Gene_0006 0.5 4.851652e+08 -22.7027842  -22.22222 1.018043e-06
61
+#> 5 2.049747e-09 4 Gene_0008 0.5 4.851652e+08  -1.4240589  -43.55167 3.909613e-06
62
+#>   model   n     s2_FSV  s2_logdelta        time      BIC max_ll_null
63
+#> 0    SE 100  4.1604136 9.981394e+01 0.001912832 43.43215  -13.070591
64
+#> 1    SE 100  0.6775166 1.167603e+17 0.003101826 65.09068  -23.337514
65
+#> 2    SE 100  0.1014734 1.748749e+16 0.003578186 26.08460   -3.834477
66
+#> 3    SE 100  2.1406586 3.689118e+17 0.003778219 20.16504   -0.874698
67
+#> 4    SE 100 11.2472218 1.938297e+18 0.002474070 63.82625  -22.705301
68
+#> 5    SE 100  0.4912790 8.466489e+16 0.004010916 21.26880   -1.426576
69
+#>           LLR      pval      qval
70
+#> 0 0.564856105 0.4523102 0.9599889
71
+#> 1 0.002516790 0.9599888 0.9599889
72
+#> 2 0.002516786 0.9599888 0.9599889
73
+#> 3 0.002516791 0.9599888 0.9599889
74
+#> 4 0.002516792 0.9599888 0.9599889
75
+#> 5 0.002516790 0.9599888 0.9599889
76
+```
77
+
48 78
 ## Citation
49 79
 
50 80
 <!-- TODO: update once pkg on BioC -->