Browse code

Formatting

Peter Hickey authored on 12/06/2018 19:56:44
Showing 4 changed files

... ...
@@ -41,8 +41,7 @@ Suggests:
41 41
     beachmat,
42 42
     Matrix,
43 43
     HDF5Array,
44
-    doParallel,
45
-    testthat
44
+    doParallel
46 45
 Collate:
47 46
     utils.R
48 47
     hasGRanges.R
... ...
@@ -121,11 +121,19 @@ makeClusters <- function(hasGRanges, maxGap = 10^8) {
121 121
 # TODO: To benefit from error recovery requires that bpStopOnError(BPPARAM) is
122 122
 #       TRUE but the default is FALSE. How to help the user? Probably don't
123 123
 #       want to override the user-specified value.
124
-BSmooth <- function(BSseq, ns = 70, h = 1000, maxGap = 10^8,
124
+BSmooth <- function(BSseq,
125
+                    ns = 70,
126
+                    h = 1000,
127
+                    maxGap = 10^8,
128
+                    keep.se = FALSE,
129
+                    verbose = TRUE,
130
+                    BPREDO = list(),
131
+                    BPPARAM = bpparam(),
132
+                    BACKEND = getRealizationBackend(),
133
+                    ...,
125 134
                     parallelBy = c("sample", "chromosome"),
126
-                    mc.preschedule = FALSE, mc.cores = 1, keep.se = FALSE,
127
-                    verbose = TRUE, BPREDO = list(), BPPARAM = bpparam(),
128
-                    BACKEND = getRealizationBackend(), ...) {
135
+                    mc.preschedule = FALSE,
136
+                    mc.cores = 1) {
129 137
     # Argument checks-----------------------------------------------------------
130 138
 
131 139
     # Check if this is a re-do.
... ...
@@ -8,6 +8,7 @@
8 8
     set to \code{2 * maxGap + 1} instead of \code{maxGap}. This likely did not
9 9
     affect results for users who left the default value of \code{maxGap = 10^8}
10 10
     but may have affected results for small values of \code{maxGap}.
11
+    }
11 12
   }
12 13
 }
13 14
 
... ...
@@ -4,34 +4,41 @@
4 4
   BSmooth, smoothing bisulfite sequence data
5 5
 }
6 6
 \description{
7
-  This implements the BSmooth algorithm for estimating methylation levels from
8
-  bisulfite sequencing data.}
7
+  This implements the BSmooth algorithm for estimating methylation levels from bisulfite sequencing data.}
9 8
 \usage{
10
-BSmooth(BSseq, ns = 70, h = 1000, maxGap = 10^8,
11
-  parallelBy = c("sample", "chromosome"), mc.preschedule = FALSE,
12
-  mc.cores = 1, keep.se = FALSE, verbose = TRUE, BPREDO = list(),
13
-  BPPARAM = bpparam(), BACKEND = getRealizationBackend(), ...)
9
+BSmooth(BSseq,
10
+        ns = 70,
11
+        h = 1000,
12
+        maxGap = 10^8,
13
+        keep.se = FALSE,
14
+        verbose = TRUE,
15
+        BPREDO = list(),
16
+        BPPARAM = bpparam(),
17
+        BACKEND = getRealizationBackend(),
18
+        ...,
19
+        parallelBy = c("sample", "chromosome"),
20
+        mc.preschedule = FALSE,
21
+        mc.cores = 1)
14 22
 }
15 23
 \arguments{
16 24
   \item{BSseq}{An object of class \code{BSseq}.}
17 25
   \item{ns}{The minimum number of methylation loci in a smoothing window.}
18 26
   \item{h}{The minimum smoothing window, in bases.}
19
-  \item{maxGap}{The maximum gap between two methylation loci, before the
20
-    smoothing is broken across the gap. The default smoothes each
21
-    chromosome separately.}
22
-  \item{parallelBy}{\strong{Deprecated}. See section, 'Parallelization and
23
-    progress monitoring'.}
24
-  \item{mc.preschedule}{\strong{Deprecated}. See section, 'Parallelization and
25
-    progress monitoring'.}
26
-  \item{mc.cores}{\strong{Deprecated}. See section, 'Parallelization and
27
-    progress monitoring'.}
27
+  \item{maxGap}{The maximum gap between two methylation loci, before the smoothing is broken across the gap.
28
+  The default smoothes each chromosome separately.}
29
+  \item{parallelBy}{\strong{Deprecated}.
30
+    See section 'Parallelization and progress monitoring' for further details.}
31
+  \item{mc.preschedule}{\strong{Deprecated}.
32
+    See section 'Parallelization and progress monitoring' for further details.}
33
+  \item{mc.cores}{\strong{Deprecated}.
34
+    See section 'Parallelization and progress monitoring' for further details.}
28 35
   \item{keep.se}{Should the estimated standard errors from the smoothing
29 36
     algorithm be kept. This will make the return object roughly 30
30 37
     percent bigger and is currently not be used for anything in \pkg{bsseq}.}
31
-  \item{verbose}{\strong{Deprecated}. See section, 'Parallelization and progress
32
-    monitoring'.}
33
-  \item{BPREDO}{Typically not used. See section, 'Parallelization and progress
34
-    monitoring'.}
38
+  \item{verbose}{\strong{Deprecated}.
39
+    See section, 'Parallelization and progress monitoring' for further details.}
40
+  \item{BPREDO}{Typically not used.
41
+    See section, 'Parallelization and progress monitoring' for further details.}
35 42
   \item{BPPARAM}{An optional \linkS4class{BiocParallelParam} instance
36 43
     determining the parallel back-end to be used during evaluation. Currently
37 44
     supported are \linkS4class{SerialParam} (Unix, Mac, Windows),
... ...
@@ -42,10 +49,11 @@ BSmooth(BSseq, ns = 70, h = 1000, maxGap = 10^8,
42 49
     monitoring' and 'Realization backends' for further details.}
43 50
   \item{BACKEND}{\code{NULL} or a single string specifying the name of the
44 51
     realization backend. When the backend is set to \code{NULL}, the
45
-    \code{coef} and \code{se.coef} assays are realized in memory as an ordinary
46
-    matrix.}
52
+    \code{coef} and \code{se.coef} assays are realized in memory as ordinary
53
+    matrices, otherwise these are realized with the given \code{BACKEND}.}
47 54
   \item{...}{Additional arguments passed to the \linkS4class{RealizationSink}
48
-    constructor. See section, 'Realization backends'.}
55
+    constructor.
56
+    See section 'Realization backends' for further details.}
49 57
 }
50 58
 \details{
51 59
   \code{ns} and \code{h} are passed to the \code{locfit} function. The
... ...
@@ -53,7 +61,8 @@ BSmooth(BSseq, ns = 70, h = 1000, maxGap = 10^8,
53 61
   and a width big enough to contain \code{ns} number of methylation
54 62
   loci.
55 63
 }
56
-\section{Realization backend}{
64
+
65
+\section{Realization backends}{
57 66
   The \code{BSmooth()} function creates a new assay to store the coefficients
58 67
   used to construct the smoothed methylation estimates ((\code{coef}). An
59 68
   additional assay is also created if \code{keep.se == TRUE} (\code{se.coef}).
... ...
@@ -91,11 +100,10 @@ BSmooth(BSseq, ns = 70, h = 1000, maxGap = 10^8,
91 100
   relevant \linkS4class{RealizationSink} constructor. For example, the
92 101
   \code{...} argument can be used to specify the path to the HDF5 file to be
93 102
   used by \code{BSmooth()}. Please see the examples at the bottom of the page.
94
-
95 103
 }
96 104
 
97 105
 \section{Parallelization and progress monitoring}{
98
-  \code{BSmooth} now uses the \pkg{BiocParallel} package to implement
106
+  \code{BSmooth()} now uses the \pkg{BiocParallel} package to implement
99 107
   parallelization. This brings some notable improvements:
100 108
 
101 109
   \itemize{