Browse code

LazyData: false hangover

Andrew McDavid authored on 30/09/2020 20:17:48
Showing 15 changed files

... ...
@@ -1,11 +1,11 @@
1 1
 ^.*\.Rproj$
2 2
 ^\.Rproj\.user$
3 3
 extdata/.*\.json$
4
-^inst/script/*.csv
5
-^inst/script/*.json
6
-^inst/script/*.h5
4
+script/.*\.csv$
5
+script/.*\.json$
6
+script/.*\.h5$
7 7
 extdata/refdata-cellranger-vdj-GRCh38-alts-ensembl-2.0.0/
8
-^doc$
8
+^docs$
9 9
 ^Meta$
10 10
 manuscript/
11 11
 ^_pkgdown\.yml$
... ...
@@ -13,4 +13,4 @@ manuscript/
13 13
 ^pkgdown$
14 14
 .ignore
15 15
 R/immcantation-utils.R
16
-^inst/WORDLIST
16
+^WORDLIST$
... ...
@@ -140,6 +140,7 @@ replace_cdb = function(x, name, value){
140 140
 #' @export
141 141
 #' @aliases ContigCellDB-mutate
142 142
 #' @examples
143
+#' data(ccdb_ex)
143 144
 #' ccdb_ex$contig_tbl
144 145
 #' ccdb_ex$cell_tbl
145 146
 #' ccdb_ex$cluster_tbl
... ...
@@ -150,6 +151,7 @@ setMethod("$", signature = c(x = 'ContigCellDB'), access_cdb)
150 151
 #' @export
151 152
 #'
152 153
 #' @examples
154
+#' data(ccdb_ex)
153 155
 #' ccdb_ex$contig_pk = c("sample","barcode","contig_id") # 'pop' is technically redundant with 'sample'
154 156
 #' # Take a subset of ccdb_ex
155 157
 #' ccdb_ex
... ...
@@ -106,6 +106,7 @@ cdhit = function(seqs, identity = NULL, kmerSize = NULL, min_length = 6, s = 1,
106 106
 ##' @export
107 107
 ##' @seealso [cdhit()]
108 108
 ##' @examples
109
+##' data(ccdb_ex)
109 110
 ##' res = cdhit_ccdb(ccdb_ex, 'cdr3_nt', type = 'DNA',
110 111
 ##' cluster_name = 'DNA97', identity = .965, min_length = 12, G = 1)
111 112
 ##' res$cluster_tbl
... ...
@@ -10,6 +10,7 @@ globalVariables('ngrp')
10 10
 #' @export
11 11
 #'
12 12
 #' @examples
13
+#' data(ccdb_ex)
13 14
 #' ccdb_ex = cluster_germline(ccdb_ex)
14 15
 #' ccdb_ex$cluster_tbl
15 16
 cluster_germline = function(ccdb, segment_keys = c('v_gene', 'j_gene', 'chain'), cluster_name = 'cluster_idx'){
... ...
@@ -13,6 +13,8 @@
13 13
 #'  3. `sample`: An artificial "replicate" from the original data defined by subsampling with replacement
14 14
 #'  4. `celltype`: The putative cell type of the contig.
15 15
 #'
16
+#' @name contigs_qc
17
+#' @usage data(contigs_qc)
16 18
 "contigs_qc"
17 19
 
18 20
 #' A preconstructed `ContigClusterDB` from the `contigs_qc` data
... ...
@@ -21,4 +23,6 @@
21 23
 #' \code{ccdb_ex = ContigCellDB_10XVDJ(contigs_qc, contig_pk = c('pop',   'sample', 'barcode', 'contig_id'), cell_pk = c('pop',   'sample', 'barcode'))}
22 24
 #' @seealso [contigs_qc]
23 25
 #'
26
+#' @name ccdb_ex
27
+#' @usage data(ccdb_ex)
24 28
 "ccdb_ex"
... ...
@@ -48,6 +48,7 @@ canonicalize_by_chain = function(tbl,  cell_identifiers = 'barcode', sort_factor
48 48
 #' @seealso [canonicalize_cluster()]
49 49
 #' @examples
50 50
 #' # Report beta chain with highest umi-count, breaking ties with reads
51
+#' data(ccdb_ex)
51 52
 #' beta = canonicalize_cell(ccdb_ex, chain == 'TRB',
52 53
 #' tie_break_keys = c('umis', 'reads'),
53 54
 #' contig_fields = c('umis', 'reads', 'chain', 'v_gene', 'd_gene', 'j_gene'))
... ...
@@ -1,4 +1,5 @@
1 1
 library(dplyr)
2
+data(ccdb_ex)
2 3
 ccdb_ex_small = ccdb_ex
3 4
 ccdb_ex_small$cell_tbl = ccdb_ex_small$cell_tbl[1:200,]
4 5
 ccdb_ex_small = cdhit_ccdb(ccdb_ex_small,
... ...
@@ -44,6 +44,7 @@ Fields in \code{contig_fields} will be copied over to the \code{cell_tbl}.
44 44
 }
45 45
 \examples{
46 46
 # Report beta chain with highest umi-count, breaking ties with reads
47
+data(ccdb_ex)
47 48
 beta = canonicalize_cell(ccdb_ex, chain == 'TRB',
48 49
 tie_break_keys = c('umis', 'reads'),
49 50
 contig_fields = c('umis', 'reads', 'chain', 'v_gene', 'd_gene', 'j_gene'))
... ...
@@ -46,6 +46,7 @@ Find a canonical contig to represent a cluster
46 46
 }
47 47
 \examples{
48 48
 library(dplyr)
49
+data(ccdb_ex)
49 50
 ccdb_ex_small = ccdb_ex
50 51
 ccdb_ex_small$cell_tbl = ccdb_ex_small$cell_tbl[1:200,]
51 52
 ccdb_ex_small = cdhit_ccdb(ccdb_ex_small,
... ...
@@ -24,9 +24,11 @@ Update or return a slot of \code{\link[=ContigCellDB]{ContigCellDB()}}
24 24
 Access public members of ContigCellDB object
25 25
 }
26 26
 \examples{
27
+data(ccdb_ex)
27 28
 ccdb_ex$contig_tbl
28 29
 ccdb_ex$cell_tbl
29 30
 ccdb_ex$cluster_tbl
31
+data(ccdb_ex)
30 32
 ccdb_ex$contig_pk = c("sample","barcode","contig_id") # 'pop' is technically redundant with 'sample'
31 33
 # Take a subset of ccdb_ex
32 34
 ccdb_ex
... ...
@@ -8,7 +8,7 @@
8 8
 \code{ccdb_ex = ContigCellDB_10XVDJ(contigs_qc, contig_pk = c('pop',   'sample', 'barcode', 'contig_id'), cell_pk = c('pop',   'sample', 'barcode'))}
9 9
 }
10 10
 \usage{
11
-ccdb_ex
11
+data(ccdb_ex)
12 12
 }
13 13
 \description{
14 14
 A preconstructed \code{ContigClusterDB} from the \code{contigs_qc} data
... ...
@@ -41,6 +41,7 @@ something smaller is passed.}
41 41
 Use \code{\link[=cdhit]{cdhit()}} to cluster a \code{\link[=ContigCellDB]{ContigCellDB()}}
42 42
 }
43 43
 \examples{
44
+data(ccdb_ex)
44 45
 res = cdhit_ccdb(ccdb_ex, 'cdr3_nt', type = 'DNA',
45 46
 cluster_name = 'DNA97', identity = .965, min_length = 12, G = 1)
46 47
 res$cluster_tbl
... ...
@@ -24,6 +24,7 @@ cluster_germline(
24 24
 Cluster contigs by germline properties
25 25
 }
26 26
 \examples{
27
+data(ccdb_ex)
27 28
 ccdb_ex = cluster_germline(ccdb_ex)
28 29
 ccdb_ex$cluster_tbl
29 30
 }
... ...
@@ -16,7 +16,7 @@ The following fields were defined ex post facto.
16 16
 }
17 17
 }
18 18
 \usage{
19
-contigs_qc
19
+data(contigs_qc)
20 20
 }
21 21
 \description{
22 22
 Data for c57bl6 and balbc mice TCR were downloaded from 10x Genomics website as
... ...
@@ -40,6 +40,7 @@ Perform additional clustering of sequences within groups
40 40
 }
41 41
 \examples{
42 42
 library(dplyr)
43
+data(ccdb_ex)
43 44
 ccdb_ex_small = ccdb_ex
44 45
 ccdb_ex_small$cell_tbl = ccdb_ex_small$cell_tbl[1:200,]
45 46
 ccdb_ex_small = cdhit_ccdb(ccdb_ex_small,