Browse code

attempt to fix vignette errors on Bioc build server

MikeDMorgan authored on 16/10/2024 17:39:46
Showing 5 changed files

... ...
@@ -1,7 +1,7 @@
1 1
 Package: miloR
2 2
 Type: Package
3 3
 Title: Differential neighbourhood abundance testing on a graph
4
-Version: 2.1.2
4
+Version: 2.1.3
5 5
 Authors@R:
6 6
     c(person("Mike", "Morgan", role=c("aut", "cre"), email="[email protected]",
7 7
      comment=c(ORCID="0000-0003-0757-0711")),
... ...
@@ -71,7 +71,7 @@ Suggests:
71 71
     curl,
72 72
     scRNAseq,
73 73
     graphics
74
-RoxygenNote: 7.3.1
74
+RoxygenNote: 7.3.2
75 75
 NeedsCompilation: no
76 76
 Packaged: 2020-07-31 14:15:28 UTC; morgan02
77 77
 Collate: 
... ...
@@ -17,6 +17,7 @@ fitGLMM(
17 17
     NULL, init.u = NULL, solver = NULL),
18 18
   dispersion = 1,
19 19
   geno.only = FALSE,
20
+  intercept.type = "fixed",
20 21
   solver = NULL
21 22
 )
22 23
 }
... ...
@@ -44,6 +45,12 @@ initial parameter values for the fixed (init.beta) and random effects (init.u),
44 45
 
45 46
 \item{geno.only}{A logical value that flags the model to use either just the \code{matrix} `Kin` or the supplied random effects.}
46 47
 
48
+\item{intercept.type}{A character scalar, either \emph{fixed} or \emph{random} that sets the type of the global
49
+intercept variable in the model. This only applies to the GLMM case where additional random effects variables are
50
+already included. Setting \code{intercept.type="fixed"} or \code{intercept.type="random"} will require the user to
51
+test their model for failures with each. In the case of using a kinship matrix, \code{intercept.type="fixed"} is
52
+set automatically.}
53
+
47 54
 \item{solver}{a character value that determines which optimisation algorithm is used for the variance components. Must be either
48 55
 HE (Haseman-Elston regression) or Fisher (Fisher scoring).}
49 56
 }
... ...
@@ -11,6 +11,8 @@ plotNhoodGraph(
11 11
   subset.nhoods = NULL,
12 12
   size_range = c(0.5, 3),
13 13
   node_stroke = 0.3,
14
+  is.da = FALSE,
15
+  highlight.da = FALSE,
14 16
   ...
15 17
 )
16 18
 }
... ...
@@ -30,6 +32,14 @@ in the graph)}
30 32
 
31 33
 \item{node_stroke}{a numeric indicating the desired thickness of the border around each node}
32 34
 
35
+\item{is.da}{logical scalar that tells plotNhoodGraph to order nhoods by |LFC| which can help to visually
36
+emphasise which nhoods are DA.}
37
+
38
+\item{highlight.da}{logical or numeric scalar that emphasises the DA nhoods in the layout by adjusting the transparency
39
+of the non-DA nhoods. Can only be used if \code{is.da=TRUE}, otherwise will give a warning. If highlight.da is a numeric
40
+then it explicitly sets the transparency level (must be between 0 and 1). If highlight.da is logical then the
41
+transparency is set to 0.1}
42
+
33 43
 \item{...}{arguments to pass to \code{ggraph}}
34 44
 }
35 45
 \value{
... ...
@@ -73,10 +73,20 @@ these should have the same \code{length} as \code{nrow} of \code{nhoodCounts}. I
73 73
 to correspond to indices of \code{nhoodCounts} - if the maximal index is greater than \code{nrow(nhoodCounts(x))}
74 74
 an error will be produced.}
75 75
 
76
+\item{intercept.type}{A character scalar, either \emph{fixed} or \emph{random} that sets the type of the global
77
+intercept variable in the model. This only applies to the GLMM case where additional random effects variables are
78
+already included. Setting \code{intercept.type="fixed"} or \code{intercept.type="random"} will require the user to
79
+test their model for failures with each. In the case of using a kinship matrix, \code{intercept.type="fixed"} is
80
+set automatically.}
81
+
76 82
 \item{fail.on.error}{A logical scalar the determines the behaviour of the error reporting. Used for debugging only.}
77 83
 
78 84
 \item{BPPARAM}{A \linkS4class{BiocParallelParam} object specifying the arguments for parallelisation. By default
79 85
 this will evaluate using \code{SerialParam()}. See \code{details}on how to use parallelisation in \code{testNhoods}.}
86
+
87
+\item{force}{A logical scalar that overrides the default behaviour to nicely error when N < 50 and using a mixed
88
+effect model. This is because model parameter estimation may be unstable with these sample sizes, and hence the
89
+fixed effect GLM is recommended instead. If used with the LMM, a warning will be produced.}
80 90
 }
81 91
 \value{
82 92
 A \code{data.frame} of model results, which contain:
... ...
@@ -126,6 +136,14 @@ parallelise - for details see the \code{BiocParallel} package.
126 136
 need this to be the first variable. A future update will harmonise these behaviours for
127 137
 consistency. While it is strictly feasible to compute multiple contrasts at once, the
128 138
 recommendation, for ease of interpretability, is to compute one at a time.
139
+
140
+If using the GLMM option, i.e. including a random effect variable in the \code{design}
141
+formula, then \code{testNhoods} will check for the sample size of the analysis. If this is
142
+less than 60 it will stop and produce an error. It is \emph{strongly} recommended that
143
+the GLMM is not used with relatively small sample sizes, i.e. N<60, and even up to N~100
144
+may have unstable parameter estimates across nhoods. This behaviour can be overriden by
145
+setting \code{force=TRUE}, but also be aware that parameter estimates may not be
146
+accurate. A warning will be produced to alert you to this fact.
129 147
 }
130 148
 \examples{
131 149
 library(SingleCellExperiment)
... ...
@@ -236,7 +236,7 @@ pbmc.milo <- buildNhoodGraph(pbmc.milo, overlap=25)
236 236
 
237 237
 # we need to subset the plotting results as it can't handle the NAs internally.
238 238
 plotUMAP(pbmc.milo, colour_by="adjmfc.time") + plotNhoodGraphDA(pbmc.milo, da_results[!is.na(da_results$logFC), ],
239
-                                                                subset.nhoods=!is.na(da_results$logFC), alpha=0.1) +
239
+                                                                alpha=0.1) +
240 240
   plot_layout(guides="auto" )
241 241
 ```
242 242