Skip to content

Commit 814516c

Browse files
committed
dropped pbmc_small from the package
1 parent cab11b7 commit 814516c

19 files changed

+99
-100
lines changed

R/data.R

-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
#' Example data set
2-
#'
3-
#'
4-
"pbmc_small"
5-
61
#' Example data set 2
72
#'
83
#'

R/dplyr_methods.R

+19-10
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ bind_cols.Seurat <- bind_cols_
197197
#' @examples
198198
#'
199199
#' `%>%` = magrittr::`%>%`
200+
#' data("pbmc_small")
200201
#' pbmc_small %>% distinct(groups)
201202
#'
202203
#' @rdname dplyr-methods
@@ -258,6 +259,7 @@ distinct.Seurat <- function (.data, ..., .keep_all = FALSE)
258259
#' @examples
259260
#'
260261
#' `%>%` = magrittr::`%>%`
262+
#' data("pbmc_small")
261263
#' pbmc_small %>% filter(groups == "g1")
262264
#'
263265
#' # Learn more in ?dplyr_eval
@@ -318,6 +320,7 @@ filter.Seurat <- function (.data, ..., .preserve = FALSE)
318320
#' @export
319321
#' @examples
320322
#' `%>%` = magrittr::`%>%`
323+
#' data("pbmc_small")
321324
#' pbmc_small %>% group_by(groups)
322325
#'
323326
NULL
@@ -369,6 +372,7 @@ group_by.Seurat <- function (.data, ..., .add = FALSE, .drop = group_by_drop_def
369372
#' @examples
370373
#'
371374
#' `%>%` = magrittr::`%>%`
375+
#' data("pbmc_small")
372376
#' pbmc_small %>% summarise(mean(nCount_RNA))
373377
#'
374378
#' @export
@@ -455,6 +459,7 @@ summarise.Seurat <- function (.data, ...)
455459
#'
456460
#' @examples
457461
#' `%>%` = magrittr::`%>%`
462+
#' data("pbmc_small")
458463
#' pbmc_small %>% mutate(nFeature_RNA = 1)
459464
#'
460465
NULL
@@ -512,6 +517,7 @@ mutate.Seurat <- function(.data, ...)
512517
#' @export
513518
#' @examples
514519
#' `%>%` = magrittr::`%>%`
520+
#' data("pbmc_small")
515521
#' pbmc_small %>% rename(s_score = nFeature_RNA)
516522
#'
517523
NULL
@@ -592,9 +598,8 @@ rowwise.Seurat <- function(data, ...)
592598
#'
593599
#' @examples
594600
#' `%>%` = magrittr::`%>%`
595-
#'
596-
#' tt = pbmc_small
597-
#' tt %>% left_join(tt %>% distinct(groups) %>% mutate(new_column = 1:2))
601+
#' data("pbmc_small")
602+
#' pbmc_small %>% left_join(pbmc_small %>% distinct(groups) %>% mutate(new_column = 1:2))
598603
#'
599604
NULL
600605

@@ -641,8 +646,8 @@ left_join.Seurat <- function (x, y, by = NULL, copy = FALSE, suffix = c(".x", ".
641646
#' @examples
642647
#' `%>%` = magrittr::`%>%`
643648
#'
644-
#' tt = pbmc_small
645-
#' tt %>% inner_join(tt %>% distinct(groups) %>% mutate(new_column = 1:2) %>% slice(1))
649+
#' data("pbmc_small")
650+
#' pbmc_small %>% inner_join(pbmc_small %>% distinct(groups) %>% mutate(new_column = 1:2) %>% slice(1))
646651
#'
647652
#' @rdname dplyr-methods
648653
#' @name inner_join
@@ -692,8 +697,8 @@ inner_join.Seurat <- function (x, y, by = NULL, copy = FALSE, suffix = c(".x", "
692697
#' @examples
693698
#' `%>%` = magrittr::`%>%`
694699
#'
695-
#' tt = pbmc_small
696-
#' tt %>% right_join(tt %>% distinct(groups) %>% mutate(new_column = 1:2) %>% slice(1))
700+
#' data("pbmc_small")
701+
#' pbmc_small %>% right_join(pbmc_small %>% distinct(groups) %>% mutate(new_column = 1:2) %>% slice(1))
697702
#'
698703
#' @rdname dplyr-methods
699704
#' @name right_join
@@ -744,9 +749,8 @@ right_join.Seurat <- function (x, y, by = NULL, copy = FALSE, suffix = c(".x", "
744749
#'
745750
#' @examples
746751
#' `%>%` = magrittr::`%>%`
747-
#'
748-
#' tt = pbmc_small
749-
#' tt %>% full_join(tibble::tibble(groups = "g1", other=1:4))
752+
#' data("pbmc_small")
753+
#' pbmc_small %>% full_join(tibble::tibble(groups = "g1", other=1:4))
750754
#'
751755
#' @rdname dplyr-methods
752756
#' @name full_join
@@ -821,6 +825,7 @@ full_join.Seurat <- function (x, y, by = NULL, copy = FALSE, suffix = c(".x", ".
821825
#' @examples
822826
#'
823827
#' `%>%` = magrittr::`%>%`
828+
#' data("pbmc_small")
824829
#' pbmc_small %>% slice(1)
825830
NULL
826831

@@ -871,6 +876,7 @@ slice.Seurat <- function (.data, ..., .preserve = FALSE)
871876
#' @examples
872877
#'
873878
#' `%>%` = magrittr::`%>%`
879+
#' data("pbmc_small")
874880
#' pbmc_small %>% select(cell, orig.ident )
875881
#'
876882
#' @family single table verbs
@@ -928,6 +934,7 @@ select.Seurat <- function (.data, ...)
928934
#' @examples
929935
#'
930936
#' `%>%` = magrittr::`%>%`
937+
#' data("pbmc_small")
931938
#' pbmc_small %>% sample_n(50)
932939
#' pbmc_small %>% sample_frac(0.1)
933940
#'
@@ -1033,6 +1040,7 @@ sample_frac.Seurat <- function(tbl, size = 1, replace = FALSE,
10331040
#' @examples
10341041
#'
10351042
#' `%>%` = magrittr::`%>%`
1043+
#' data("pbmc_small")
10361044
#' pbmc_small %>% count(groups)
10371045
#'
10381046
#'
@@ -1115,6 +1123,7 @@ add_count.Seurat <- function(x, ..., wt = NULL, sort = FALSE, name = NULL, .drop
11151123
#' @examples
11161124
#'
11171125
#' `%>%` = magrittr::`%>%`
1126+
#' data("pbmc_small")
11181127
#' pbmc_small %>% pull(groups)
11191128
#'
11201129
NULL

R/methods.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ setMethod(
7777
#'
7878
#' @examples
7979
#'
80+
#' data("pbmc_small")
8081
#' pbmc_small %>%
81-
#'
8282
#' join_features(features = c("HLA-DRA", "LYZ"))
8383
#'
8484
#'

R/print_method.R

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
#'
5656
#' @examples
5757
#' library(dplyr)
58+
#' data("pbmc_small")
5859
#' pbmc_small %>% print()
5960
#' @name print
6061
NULL

R/tibble_methods.R

+2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
#'
5858
#' @export
5959
#' @examples
60+
#' data("pbmc_small")
6061
#' pbmc_small %>% as_tibble()
6162
NULL
6263

@@ -133,6 +134,7 @@ as_tibble.Seurat = function(x, ...,
133134
#'
134135
#' @export
135136
#' @examples
137+
#' data("pbmc_small")
136138
#' pbmc_small %>% tidy %>% glimpse()
137139
#'
138140
#'

R/tidyr_methods.R

+6
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
#' @examples
4242
#'
4343
#' library(dplyr)
44+
#' data("pbmc_small")
4445
#' pbmc_small %>% nest(data = -groups) %>% unnest(data)
4546
#'
4647
#'
@@ -114,6 +115,7 @@ unnest.tidyseurat_nested <- function(
114115
#' @examples
115116
#'
116117
#' library(dplyr)
118+
#' data("pbmc_small")
117119
#' pbmc_small %>% nest(data = -groups) %>% unnest(data)
118120
#'
119121
#' @rdname tidyr-methods
@@ -187,6 +189,7 @@ nest.Seurat <- function (.data, ..., .names_sep = NULL)
187189
#' @export
188190
#' @examples
189191
#'
192+
#' data("pbmc_small")
190193
#' pbmc_small %>% extract(groups, into = "g", regex = "g([0-9])", convert = TRUE)
191194
#'
192195
#' @return A Seurat object or a tibble depending on input
@@ -303,6 +306,7 @@ extract.Seurat <- function (data, col, into, regex = "([[:alnum:]]+)", remove =
303306
#' # See vignette("pivot") for examples and explanation
304307
#'
305308
#' library(dplyr)
309+
#' data("pbmc_small")
306310
#' pbmc_small %>% pivot_longer(c(orig.ident, groups), names_to = "name", values_to = "value")
307311
#'
308312
NULL
@@ -376,6 +380,7 @@ pivot_longer.Seurat <- function(data,
376380
#' @export
377381
#' @examples
378382
#'
383+
#' data("pbmc_small")
379384
#' pbmc_small %>% unite("new_col", c(orig.ident, groups))
380385
#'
381386
#'
@@ -441,6 +446,7 @@ unite.Seurat <- function(data, col, ..., sep = "_", remove = TRUE, na.rm = FALSE
441446
#' @export
442447
#' @examples
443448
#'
449+
#' data("pbmc_small")
444450
#' un = pbmc_small %>% unite("new_col", c(orig.ident, groups))
445451
#' un %>% separate(col = new_col, into= c("orig.ident", "groups"))
446452
#'

data/pbmc_small.rda

-52.2 KB
Binary file not shown.

man/count.Rd

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/dplyr-methods.Rd

+18-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/fragments/intro.Rmd

+6-26
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ library(tidyseurat)
7171
This is a seurat object but it is evaluated as tibble. So it is fully compatible both with Seurat and tidyverse APIs.
7272

7373
```{r}
74-
pbmc_small <- tidyseurat::pbmc_small
74+
data("pbmc_small")
7575
```
7676

7777
**It looks like a tibble**
@@ -86,26 +86,6 @@ pbmc_small
8686
pbmc_small@assays
8787
```
8888

89-
# Annotation polishing
90-
91-
We may have a column that contains the directory each run was taken from, such as the "file" column in `pbmc_small`.
92-
93-
```{r}
94-
pbmc_small$file[1:5]
95-
```
96-
97-
We may want to extract the run/sample name out of it into a separate column. Tidyverse `extract` can be used to convert a character column into multiple columns using regular expression groups.
98-
99-
```{r}
100-
# Create sample column
101-
pbmc_small_polished <-
102-
pbmc_small %>%
103-
tidyseurat::extract(file, "sample", "../data/([a-z0-9]+)/outs.+", remove = FALSE)
104-
# Reorder to have sample column up front
105-
pbmc_small_polished %>%
106-
select(sample, everything())
107-
```
108-
10989
# Preliminary plots
11090

11191
Set colours and theme for plots.
@@ -135,12 +115,12 @@ my_theme <-
135115
)
136116
```
137117

138-
We can treat `pbmc_small_polished` effectively as a normal tibble for plotting.
118+
We can treat `pbmc_small` effectively as a normal tibble for plotting.
139119

140120
Here we plot number of features per cell.
141121

142122
```{r plot1}
143-
pbmc_small_polished %>%
123+
pbmc_small %>%
144124
tidyseurat::ggplot(aes(nFeature_RNA, fill = groups)) +
145125
geom_histogram() +
146126
my_theme
@@ -149,7 +129,7 @@ pbmc_small_polished %>%
149129
Here we plot total features per cell.
150130

151131
```{r plot2}
152-
pbmc_small_polished %>%
132+
pbmc_small %>%
153133
tidyseurat::ggplot(aes(groups, nCount_RNA, fill = groups)) +
154134
geom_boxplot(outlier.shape = NA) +
155135
geom_jitter(width = 0.1) +
@@ -159,7 +139,7 @@ pbmc_small_polished %>%
159139
Here we plot abundance of two features for each group.
160140

161141
```{r}
162-
pbmc_small_polished %>%
142+
pbmc_small %>%
163143
join_features(features = c("HLA-DRA", "LYZ")) %>%
164144
ggplot(aes(groups, abundance_RNA + 1, fill = groups)) +
165145
geom_boxplot(outlier.shape = NA) +
@@ -174,7 +154,7 @@ Also you can treat the object as Seurat object and proceed with data processing.
174154

175155
```{r preprocess}
176156
pbmc_small_pca <-
177-
pbmc_small_polished %>%
157+
pbmc_small %>%
178158
SCTransform(verbose = FALSE) %>%
179159
FindVariableFeatures(verbose = FALSE) %>%
180160
RunPCA(verbose = FALSE)

0 commit comments

Comments
 (0)