File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -106,12 +106,13 @@ save_experiment_data <- function(data,
106
106
# ' @param sce A `SingleCellExperiment` object.
107
107
# ' @importFrom SummarizedExperiment assay assays colData
108
108
# ' @importFrom SingleCellExperiment SingleCellExperiment
109
+ # ' @importFrom rlang set_names
109
110
# ' @return A modified `SingleCellExperiment` object with the single-column assay
110
111
# ' duplicated if applicable. If the assay already has more than one column, the
111
112
# ' function returns the original object unchanged.
112
113
duplicate_single_column_assay <- function (sce ) {
113
114
114
- assay = sce | > assays() | > names() | > magrittr :: extract2(1 )
115
+ assay_name = sce | > assays() | > names() | > magrittr :: extract2(1 )
115
116
116
117
if (ncol(assay(sce )) == 1 ) {
117
118
@@ -124,7 +125,7 @@ duplicate_single_column_assay <- function(sce) {
124
125
cd = cd | > rbind(cd )
125
126
rownames(cd )[2 ] = paste0(" DUMMY" , " ___" , rownames(cd )[2 ])
126
127
127
- sce = SingleCellExperiment(assay = list (X = my_assay ), colData = cd )
128
+ sce = SingleCellExperiment(assay = list (my_assay ) | > set_names( assay_name ), colData = cd )
128
129
sce
129
130
}
130
131
sce
You can’t perform that action at this time.
0 commit comments