... | ... |
@@ -95,8 +95,63 @@ importMultipleSources <- function(allImportEntries, delayedArray = FALSE) { |
95 | 95 |
} |
96 | 96 |
|
97 | 97 |
} |
98 |
+ |
|
99 |
+ # Begin Set Tags |
|
100 |
+ if(entry$type %in% c("cellRanger2", "cellRanger3", "starSolo", "busTools", "seqc", "optimus", "example")){ |
|
101 |
+ newSce <- expSetDataTag( |
|
102 |
+ inSCE = newSce, |
|
103 |
+ assayType = "raw", |
|
104 |
+ assays = assayNames(newSce)) |
|
105 |
+ } |
|
106 |
+ else if(entry$type %in% c("rds", "files")){ |
|
107 |
+ # Check if tags already stored in uploaded rds/files |
|
108 |
+ if(is.null(metadata(newSce)$assayType)){ |
|
109 |
+ try({ |
|
110 |
+ counts(newSce) |
|
111 |
+ newSce <- expSetDataTag( |
|
112 |
+ inSCE = newSce, |
|
113 |
+ assayType = "raw", |
|
114 |
+ assays = "counts") |
|
115 |
+ }, silent = TRUE) |
|
116 |
+ |
|
117 |
+ try({ |
|
118 |
+ logcounts(newSce) |
|
119 |
+ newSce <- expSetDataTag( |
|
120 |
+ inSCE = newSce, |
|
121 |
+ assayType = "transformed", |
|
122 |
+ assays = "logcounts") |
|
123 |
+ }, silent = TRUE) |
|
124 |
+ |
|
125 |
+ try({ |
|
126 |
+ normcounts(newSce) |
|
127 |
+ newSce <- expSetDataTag( |
|
128 |
+ inSCE = newSce, |
|
129 |
+ assayType = "transformed", |
|
130 |
+ assays = "normcounts") |
|
131 |
+ }, silent = TRUE) |
|
132 |
+ |
|
133 |
+ try({ |
|
134 |
+ decontXcounts(newSce) |
|
135 |
+ newSce <- expSetDataTag( |
|
136 |
+ inSCE = newSce, |
|
137 |
+ assayType = "raw", |
|
138 |
+ assays = "decontXcounts") |
|
139 |
+ }, silent = TRUE) |
|
140 |
+ |
|
141 |
+ untaggedAssays <- assayNames(newSce) |
|
142 |
+ untaggedAssays <- untaggedAssays[! untaggedAssays %in% c('counts', 'logcounts', 'normcounts', 'decontX')] |
|
143 |
+ |
|
144 |
+ newSce <- expSetDataTag( |
|
145 |
+ inSCE = newSce, |
|
146 |
+ assayType = "uncategorized", |
|
147 |
+ assays = untaggedAssays) |
|
148 |
+ } |
|
149 |
+ # End Set Tags |
|
150 |
+ } |
|
151 |
+ |
|
98 | 152 |
sceObjs = c(sceObjs, list(newSce)) |
99 | 153 |
} |
154 |
+ |
|
100 | 155 |
return(combineSCE(sceList = sceObjs, |
101 | 156 |
by.r = Reduce(base::intersect, lapply(sceObjs, function(x) { colnames(rowData(x))})), |
102 | 157 |
by.c = Reduce(base::intersect, lapply(sceObjs, function(x) { colnames(colData(x))})), |
... | ... |
@@ -27,11 +27,10 @@ expDeleteDataTag <- function(inSCE, assay){ |
27 | 27 |
#' @param inSCE Input \code{SingleCellExperiment} object. |
28 | 28 |
#' @param assayType Specify a \code{character(1)} value as a tag that should be set against a data item. |
29 | 29 |
#' @param assays Specify name(s) \code{character()} of data item(s) against which the tag should be set. |
30 |
-#' @param append A \code{logical} value indicating if this assay should be appended to the object or overridden. Default value is \code{TRUE} indicating that it should be appended. |
|
31 | 30 |
#' @return The input \code{SingleCellExperiment} object with tag information stored in the metadata slot. |
32 | 31 |
#' @export |
33 | 32 |
#' |
34 |
-expSetDataTag <- function(inSCE, assayType, assays, append = TRUE){ |
|
33 |
+expSetDataTag <- function(inSCE, assayType, assays){ |
|
35 | 34 |
tbl <- NULL |
36 | 35 |
if(is.null(S4Vectors::metadata(inSCE)$assayType)){ |
37 | 36 |
tbl <- tibble::tibble(assayTag = assayType, assayName = assays) |
... | ... |
@@ -865,13 +865,12 @@ shinyServer(function(input, output, session) { |
865 | 865 |
if (!is.null(vals$original)) { |
866 | 866 |
vals$counts <- vals$original |
867 | 867 |
#store assayType information in the metadata |
868 |
- if (!"assayType" %in% names(metadata(vals$counts))) { |
|
869 |
- vals$counts <- expSetDataTag( |
|
870 |
- inSCE = vals$counts, |
|
871 |
- assayType = "raw", |
|
872 |
- assays = assayNames(vals$counts), |
|
873 |
- append = FALSE) |
|
874 |
- } |
|
868 |
+ # if (!"assayType" %in% names(metadata(vals$counts))) { |
|
869 |
+ # vals$counts <- expSetDataTag( |
|
870 |
+ # inSCE = vals$counts, |
|
871 |
+ # assayType = "raw", |
|
872 |
+ # assays = assayNames(vals$counts)) |
|
873 |
+ # } |
|
875 | 874 |
if (any(duplicated(rownames(vals$counts)))) { |
876 | 875 |
warning("Duplicated rownames detected, making them unique...") |
877 | 876 |
vals$counts <- dedupRowNames(vals$counts) |
... | ... |
@@ -5,7 +5,7 @@ |
5 | 5 |
\title{expSetDataTag |
6 | 6 |
Set tag to an assay or a data item in the input SCE object.} |
7 | 7 |
\usage{ |
8 |
-expSetDataTag(inSCE, assayType, assays, append = TRUE) |
|
8 |
+expSetDataTag(inSCE, assayType, assays) |
|
9 | 9 |
} |
10 | 10 |
\arguments{ |
11 | 11 |
\item{inSCE}{Input \code{SingleCellExperiment} object.} |
... | ... |
@@ -13,8 +13,6 @@ expSetDataTag(inSCE, assayType, assays, append = TRUE) |
13 | 13 |
\item{assayType}{Specify a \code{character(1)} value as a tag that should be set against a data item.} |
14 | 14 |
|
15 | 15 |
\item{assays}{Specify name(s) \code{character()} of data item(s) against which the tag should be set.} |
16 |
- |
|
17 |
-\item{append}{A \code{logical} value indicating if this assay should be appended to the object or overridden. Default value is \code{TRUE} indicating that it should be appended.} |
|
18 | 16 |
} |
19 | 17 |
\value{ |
20 | 18 |
The input \code{SingleCellExperiment} object with tag information stored in the metadata slot. |