Skip to content

Commit b39d804

Browse files
committed
update remaining documentations
cleaning R CMD CHECK
1 parent defd391 commit b39d804

24 files changed

+1464
-1553
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ Imports:
3838
stringr,
3939
cli,
4040
fansi,
41-
stats
41+
stats,
42+
pkgconfig
4243
Suggests:
4344
BiocStyle,
4445
testthat,

NAMESPACE

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,8 @@ S3method(tidy,SummarizedExperiment)
3737
S3method(unite,SummarizedExperiment)
3838
S3method(unnest,tidySummarizedExperiment_nested)
3939
export("%>%")
40-
export(as_tibble)
41-
export(extract)
42-
export(nest)
43-
export(pivot_longer)
44-
export(pivot_wider)
4540
export(plot_ly)
46-
export(separate)
4741
export(tidy)
48-
export(unite)
49-
export(unnest)
5042
export(unnest_summarized_experiment)
5143
importFrom(S4Vectors,"metadata<-")
5244
importFrom(S4Vectors,DataFrame)
@@ -55,10 +47,14 @@ importFrom(S4Vectors,head)
5547
importFrom(S4Vectors,metadata)
5648
importFrom(SummarizedExperiment,"assays<-")
5749
importFrom(SummarizedExperiment,"colData<-")
50+
importFrom(SummarizedExperiment,"elementMetadata<-")
5851
importFrom(SummarizedExperiment,"rowData<-")
52+
importFrom(SummarizedExperiment,assay)
53+
importFrom(SummarizedExperiment,assayNames)
5954
importFrom(SummarizedExperiment,assays)
6055
importFrom(SummarizedExperiment,cbind)
6156
importFrom(SummarizedExperiment,colData)
57+
importFrom(SummarizedExperiment,elementMetadata)
6258
importFrom(SummarizedExperiment,rbind)
6359
importFrom(SummarizedExperiment,rowData)
6460
importFrom(SummarizedExperiment,rowRanges)
@@ -85,7 +81,6 @@ importFrom(dplyr,slice)
8581
importFrom(dplyr,summarise)
8682
importFrom(dplyr,summarize)
8783
importFrom(dplyr,vars)
88-
importFrom(ellipsis,check_dots_unnamed)
8984
importFrom(ellipsis,check_dots_used)
9085
importFrom(fansi,strwrap_ctl)
9186
importFrom(ggplot2,aes)
@@ -97,11 +92,13 @@ importFrom(magrittr,equals)
9792
importFrom(magrittr,set_rownames)
9893
importFrom(methods,.hasSlot)
9994
importFrom(methods,as)
95+
importFrom(methods,getMethod)
10096
importFrom(methods,is)
10197
importFrom(pillar,align)
10298
importFrom(pillar,get_extent)
10399
importFrom(pillar,style_subtle)
104100
importFrom(pillar,tbl_format_header)
101+
importFrom(pkgconfig,get_config)
105102
importFrom(plotly,plot_ly)
106103
importFrom(purrr,imap)
107104
importFrom(purrr,map)
@@ -113,17 +110,18 @@ importFrom(purrr,pmap)
113110
importFrom(purrr,reduce)
114111
importFrom(purrr,when)
115112
importFrom(rlang,":=")
113+
importFrom(rlang,.data)
116114
importFrom(rlang,dots_values)
117115
importFrom(rlang,enquo)
118116
importFrom(rlang,enquos)
119117
importFrom(rlang,expr)
120118
importFrom(rlang,flatten_if)
121-
importFrom(rlang,is_empty)
122119
importFrom(rlang,is_spliced)
123120
importFrom(rlang,names2)
124121
importFrom(rlang,quo_is_null)
125122
importFrom(rlang,quo_name)
126123
importFrom(rlang,quo_squash)
124+
importFrom(stats,setNames)
127125
importFrom(stringr,regex)
128126
importFrom(stringr,str_detect)
129127
importFrom(stringr,str_replace)

R/dplyr_methods.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,8 @@ select.SummarizedExperiment <- function(.data, ...) {
581581
# colnames_col <- get_colnames_col(.data)
582582
# colnames_row <- get_rownames_col(.data)
583583
# colnames_assay = .data@assays@data |> names()
584-
584+
585+
. <- NULL
585586
# Deprecation of special column names
586587
.cols <- enquos(..., .ignore_empty="all") %>%
587588
map(~ quo_name(.x)) %>% unlist()
@@ -783,6 +784,7 @@ count.SummarizedExperiment <- function(x, ..., wt=NULL,
783784
#'
784785
#' @importFrom ellipsis check_dots_used
785786
#' @importFrom dplyr pull
787+
#' @importFrom SummarizedExperiment assay
786788
#' @export
787789
pull.SummarizedExperiment <- function(.data, var=-1, name=NULL, ...) {
788790

@@ -799,7 +801,7 @@ pull.SummarizedExperiment <- function(.data, var=-1, name=NULL, ...) {
799801
.data,
800802
quo_name(var)
801803
)) {
802-
.data= ping_old_special_column_into_metadata(.data)
804+
.data <- ping_old_special_column_into_metadata(.data)
803805
}
804806

805807
# If Ranges column not in query perform fast as_tibble
@@ -810,7 +812,7 @@ pull.SummarizedExperiment <- function(.data, var=-1, name=NULL, ...) {
810812

811813
# Subset column annotation
812814
if (all(c(quo_names(var), quo_name_name) %in% colnames(colData(.data)))) {
813-
return(colData(.data)[,quo_names(var)] %>%
815+
return(colData(.data)[, quo_names(var)] %>%
814816
.[rep(1:length(.), each=nrow(.data) )])
815817
}
816818

@@ -837,7 +839,7 @@ pull.SummarizedExperiment <- function(.data, var=-1, name=NULL, ...) {
837839

838840
# reorder assay colnames before printing
839841
# Rearrange if assays has colnames and rownames
840-
.data = order_assays_internally_to_be_consistent(.data)
842+
.data <- order_assays_internally_to_be_consistent(.data)
841843

842844
}
843845
return(assay(.data, quo_names(var)) |> as.matrix() |> as.vector())

R/methods.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#' @importFrom methods getMethod
12
setMethod(
23
f="show",
34
signature="SummarizedExperiment",
@@ -22,7 +23,8 @@ setMethod(
2223
}
2324
)
2425

25-
setClass("tidySummarizedExperiment", contains=c("SummarizedExperiment", "RangedSummarizedExperiment"))
26+
setClass("tidySummarizedExperiment",
27+
contains=c("SummarizedExperiment", "RangedSummarizedExperiment"))
2628

2729
#' @name tidy
2830
#' @rdname tidy
@@ -54,15 +56,13 @@ tidy_ <- function(object) {
5456
}
5557

5658
#' @importFrom methods as
57-
#'
59+
#' @rdname tidy
5860
#' @param object A SummarizedExperiment object
59-
#'
6061
#' @export
6162
tidy.SummarizedExperiment <- tidy_
6263

6364
#' @importFrom methods as
64-
#'
65+
#' @rdname tidy
6566
#' @param object A SummarizedExperiment object
66-
#'
6767
#' @export
6868
tidy.RangedSummarizedExperiment <- tidy_

R/plotly_methods.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ plot_ly.tbl_df <- function(data=data.frame(), ..., type=NULL, name=NULL,
5050

5151
#' @rdname plotly
5252
#' @export
53-
plot_ly.SummarizedExperiment <- function(data=data.frame(), ..., type=NULL, name=NULL,
53+
plot_ly.SummarizedExperiment <- function(data=data.frame(),
54+
..., type=NULL, name=NULL,
5455
color=NULL, colors=NULL, alpha=NULL,
5556
stroke=NULL, strokes=NULL, alpha_stroke=1,
5657
size=NULL, sizes=c(10, 100),

R/print_method.R

Lines changed: 9 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -42,81 +42,24 @@ tbl_format_header.tidySummarizedExperiment <- function(x, setup, ...) {
4242
style_subtle(pillar___format_comment(header, width=setup$width))
4343
}
4444

45-
#' Printing tibbles
46-
#'
47-
#' @description
48-
#' `r lifecycle::badge("maturing")`
49-
#'
50-
#' One of the main features of the `tbl_df` class is the printing:
51-
#'
52-
#' * Tibbles only print as many rows and columns as fit on one screen,
53-
#' supplemented by a summary of the remaining rows and columns.
54-
#' * Tibble reveals the type of each column, which keeps the user informed about
55-
#' whether a variable is, e.g., `<chr>` or `<fct>` (character versus factor).
56-
#'
57-
#' Printing can be tweaked for a one-off call by calling `print()` explicitly
58-
#' and setting arguments like `n` and `width`. More persistent control is
59-
#' available by setting the options described below.
60-
#'
61-
#' @inheritSection pillar::`pillar-package` Package options
62-
#' @section Package options:
63-
#'
64-
#' The following options are used by the tibble and pillar packages
65-
#' to format and print `tbl_df` objects.
66-
#' Used by the formatting workhorse `trunc_mat()` and, therefore,
67-
#' indirectly, by `print.tbl()`.
68-
#'
69-
#' * `tibble.print_max`: Row number threshold: Maximum number of rows printed.
70-
#' Set to `Inf` to always print all rows. Default: 20.
71-
#' * `tibble.print_min`: Number of rows printed if row number threshold is
72-
#' exceeded. Default: 10.
73-
#' * `tibble.width`: Output width. Default: `NULL` (use `width` option).
74-
#' * `tibble.max_extra_cols`: Number of extra columns printed in reduced form.
75-
#' Default: 100.
76-
#'
77-
78-
#'
79-
#' @param x Object to format or print.
80-
#' @param ... Other arguments passed on to individual methods.
81-
#' @param n Number of rows to show. If `NULL`, the default, will print all rows
82-
#' if less than option `tibble.print_max`. Otherwise, will print
83-
#' `tibble.print_min` rows.
84-
#' @param width Width of text output to generate. This defaults to `NULL`, which
85-
#' means use `getOption("tibble.width")` or (if also `NULL`)
86-
#' `getOption("width")`; the latter displays only the columns that fit on one
87-
#' screen. You can also set `options(tibble.width = Inf)` to override this
88-
#' default and always print all columns.
89-
#' @param n_extra Number of extra columns to print abbreviated information for,
90-
#' if the width is too small for the entire tibble. If `NULL`, the default,
91-
#' will print information about at most `tibble.max_extra_cols` extra columns.
92-
#'
93-
#' @return Nothing
94-
#'
95-
#' @examples
96-
97-
#' @name formatting
98-
NULL
99-
100-
101-
10245
#' @name formatting
10346
#' @rdname formatting
10447
#' @aliases print
10548
#' @inherit tibble::formatting
10649
#' @return Prints a message to the console describing
107-
#' the contents of the `tidyseurat`.
108-
#'
50+
#' the contents of the `tidySingleCellExperiment`.
51+
#'
10952
#' @param n_extra Number of extra columns to print abbreviated information for,
11053
#' if the width is too small for the entire tibble. If `NULL`, the default,
11154
#' will print information about at most `tibble.max_extra_cols` extra columns.
11255
#'
11356
#' @examples
114-
#' library(dplyr)
115-
#' pasilla %>% print()
57+
#' data(pasilla)
58+
#' print(pasilla)
11659
#'
11760
#' @importFrom vctrs new_data_frame
118-
#' @importFrom rlang is_empty
119-
#' @importFrom stringr str_replace
61+
#' @importFrom SummarizedExperiment assayNames
62+
#' @importFrom stats setNames
12063
#' @export
12164
print.SummarizedExperiment <- function(x, ..., n=NULL,
12265
width=NULL, n_extra=NULL) {
@@ -149,9 +92,9 @@ print.SummarizedExperiment <- function(x, ..., n=NULL,
14992

15093
my_tibble |>
15194
new_data_frame(class=c("tidySummarizedExperiment", "tbl")) %>%
152-
add_attr( nrow(x), "number_of_features") %>%
153-
add_attr( ncol(x), "number_of_samples") %>%
154-
add_attr( assays(x) %>% names , "assay_names") %>%
95+
add_attr(nrow(x), "number_of_features") %>%
96+
add_attr(ncol(x), "number_of_samples") %>%
97+
add_attr(assays(x) %>% names , "assay_names") %>%
15598

15699
# Set fake dimensions for efficiancy
157100
add_attr(

0 commit comments

Comments
 (0)