Browse code

Start to address BiocCheck

Andrew McDavid authored on 02/09/2019 04:34:06
Showing 8 changed files

... ...
@@ -11,8 +11,10 @@ Authors@R:
11 11
       person(given = "Yu",
12 12
              family = "Gu",
13 13
              role = "aut",
14
-             email = "Yu_Gu@urmc.rochester.edu"))
15
-Maintainer: Andrew McDavid <Andrew_McDavid@urmc.rochester.edu>
14
+             email = "Yu_Gu@urmc.rochester.edu"),
15
+      person(given = 'Thomas Lin',
16
+             family = 'Pedersen', 
17
+             role = 'ctb'))
16 18
 Description: Methods to cluster and analyze high-throughput
17 19
     single cell immune cell repertoires, especially from the 10X Genomics
18 20
     VDJ solution. Contains an R interface to CD-HIT (Li and Godzik 2006).   
... ...
@@ -36,7 +38,9 @@ Imports:
36 38
     S4Vectors,
37 39
     tidyr,
38 40
     forcats,
39
-    progress
41
+    progress,
42
+    stats,
43
+    utils
40 44
 Suggests: 
41 45
     testthat,
42 46
     readr,
... ...
@@ -61,3 +65,5 @@ RoxygenNote: 6.1.1
61 65
 URL: https://github.com/amcdavid/CellaRepertorium
62 66
 BugReports: https://github.com/amcdavid/CellaRepertorium/issues
63 67
 Roxygen: list(markdown = TRUE)
68
+biocViews: RNASeq, Transcriptomics, SingleCell, TargetedResequencing, 
69
+    Technology, ImmunoOncology, Clustering
... ...
@@ -19,6 +19,7 @@ cluster_test_by = function(ccdb, fields  = 'chain', tbl = 'cluster_tbl', ...){
19 19
 #' @inheritParams canonicalize_cell
20 20
 #' @return table with one row per cluster/term.
21 21
 #' @export
22
+#' @importFrom stats as.formula
22 23
 #'
23 24
 #' @examples
24 25
 #' library(dplyr)
... ...
@@ -159,7 +159,7 @@ pairing_tables = function(ccdb,  canonicalize_fun = canonicalize_by_chain, table
159 159
     # In how many cells do each cluster pairing appear?
160 160
     cluster_pair_tbl = oligo_cluster_pairs %>% group_by(!!!syms(cluster_ids)) %>% summarize(n_clone_pairs = dplyr::n())
161 161
     # which clusters are expanded
162
-    expanded_cluster = cluster_pair_tbl %>% dplyr::filter(n_clone_pairs >= min_expansion) %>% dplyr::filter_at(.vars = cluster_ids, .vars_predicate = all_vars(!is.na(.)))
162
+    expanded_cluster = cluster_pair_tbl %>% dplyr::filter(n_clone_pairs >= min_expansion) %>% dplyr::filter_at(.vars = cluster_ids, .vars_predicate = dplyr::all_vars(!is.na(.)))
163 163
     expanded_cluster = ungroup(expanded_cluster) %>% dplyr::select(!!!syms(cluster_ids_to_select), max_pairs = n_clone_pairs)
164 164
     if(!is.null(cluster_whitelist)){
165 165
         expanded_cluster = bind_rows(expanded_cluster, cluster_whitelist)
... ...
@@ -78,6 +78,7 @@ cluster_permute_test = function(ccdb, cell_covariate_keys,
78 78
 #' @param labels \code{factor} of length n
79 79
 #' @param covariates \code{factor} of length n
80 80
 #' @param statistic function of label and covariate
81
+#' @return a list containing the observed value of the statistic, its expectation (under independence), a p-value, and the Monte Carlo standard error (of the expected value).
81 82
 #' @inheritParams cluster_permute_test
82 83
 .cluster_permute_test = function(labels, covariates, statistic, n_perm, alternative,  ...){
83 84
     permp = rep(NA, n_perm)
... ...
@@ -20,6 +20,9 @@
20 20
 
21 21
 \item{...}{passed to \code{statistic}}
22 22
 }
23
+\value{
24
+a list containing the observed value of the statistic, its expectation (under independence), a p-value, and the Monte Carlo standard error (of the expected value).
25
+}
23 26
 \description{
24 27
 Cell permutation tests (internal)
25 28
 }
... ...
@@ -15,6 +15,9 @@ equalize_ccdb(x, cell = TRUE, contig = TRUE, cluster = TRUE)
15 15
 
16 16
 \item{cluster}{\code{logical} equalize clusters}
17 17
 }
18
+\value{
19
+\code{\link[=ContigCellDB]{ContigCellDB()}}
20
+}
18 21
 \description{
19 22
 The cells in \code{cell_tbl}, and clusters in \code{cluster_tbl} can potentially be a superset of the \code{contig_tbl}.
20 23
 }
... ...
@@ -13,6 +13,9 @@
13 13
 
14 14
 \item{deparse.level}{ignored}
15 15
 }
16
+\value{
17
+\code{\link[=ContigCellDB]{ContigCellDB()}}
18
+}
16 19
 \description{
17 20
 The union of the rows in each of the objects is taken,
18 21
 thus removing any rows that has an exact duplicate.  This
... ...
@@ -34,6 +34,9 @@
34 34
 
35 35
 \item{drop}{ignored}
36 36
 }
37
+\value{
38
+See details.
39
+}
37 40
 \description{
38 41
 A \code{ContigCellDB} pretend to be a \code{cell_tbl} data.frame in several regards.
39 42
 This is to enable nesting \code{ContigCellDB} objects in the \code{colData} of a \code{SingleCellExperiment}