Skip to content

Commit 4e71b2d

Browse files
committed
changes I don't remember to have made
Merge branch 'master' of git.bioconductor.org:packages/tidySummarizedExperiment into unnest_SE Conflicts: DESCRIPTION
2 parents 1cd5e66 + bba72cc commit 4e71b2d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

R/tidyr_methods.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,22 +159,22 @@ unnest_summarized_experiment <- function(data, cols, ..., keep_empty=FALSE, pt
159159
# If both nested not by transcript nor sample
160160
if(! s_(se)$name %in% colnames(data) & !f_(se)$name %in% colnames(data) ){
161161

162-
se = pull(data, !!cols) %>% .[[1]]
162+
my_se = pull(.data_, !!cols) %>% .[[1]]
163163

164164
# Mark if columns belong to feature or sample
165165
my_unnested_tibble =
166166
mutate(data, !!cols := map(!!cols, ~ as_tibble(.x))) %>%
167-
select(-suppressWarnings( one_of(s_(se)$name, f_(se)$name))) %>%
167+
select(-suppressWarnings( one_of(s_(my_se)$name, f_(my_se)$name))) %>%
168168
unnest(!!cols)
169169

170170
# Get which column is relative to feature or sample
171-
sample_columns = my_unnested_tibble %>% get_subset_columns(!!s_(se)$symbol)
172-
transcript_columns = my_unnested_tibble %>% get_subset_columns(!!f_(se)$symbol)
171+
sample_columns = my_unnested_tibble %>% get_subset_columns(!!s_(my_se)$symbol)
172+
transcript_columns = my_unnested_tibble %>% get_subset_columns(!!f_(my_se)$symbol)
173173

174174
source_column =
175175
c(
176-
rep(s_(se)$name, length(sample_columns)) %>% setNames(sample_columns),
177-
rep(f_(se)$name, length(transcript_columns)) %>% setNames(transcript_columns)
176+
rep(s_(my_se)$name, length(sample_columns)) %>% setNames(sample_columns),
177+
rep(f_(my_se)$name, length(transcript_columns)) %>% setNames(transcript_columns)
178178
)
179179

180180
# Do my trick to unnest
@@ -185,14 +185,14 @@ unnest_summarized_experiment <- function(data, cols, ..., keep_empty=FALSE, pt
185185

186186
# Attach back the columns used for nesting
187187
.data_ %>%
188-
select(-!!cols, -suppressWarnings( one_of(s_(se)$name, f_(se)$name))) %>%
188+
select(-!!cols, -suppressWarnings( one_of(s_(my_se)$name, f_(my_se)$name))) %>%
189189
slice(rep(.y, ncol(.x) * nrow(.x))),
190190

191191
# Column sample-wise or feature-wise
192192
column_belonging =
193193
source_column[
194194
.data_ %>%
195-
select(-!!cols, -suppressWarnings( one_of(s_(se)$name, f_(se)$name))) %>%
195+
select(-!!cols, -suppressWarnings( one_of(s_(my_se)$name, f_(my_se)$name))) %>%
196196
colnames()
197197
]
198198
)

0 commit comments

Comments
 (0)