@@ -254,15 +254,75 @@ function(input, output, session) {
254
254
withProgress(message = " Please wait, preparing the data for download." ,
255
255
value = 0.5 , {
256
256
257
- shinyFeedback :: feedbackWarning(" p1_height" , is.na(input $ p1_height ), " Required value" )
258
- shinyFeedback :: feedbackWarning(" p1_width" , is.na(input $ p1_width ), " Required value" )
257
+ data_sc <- req( single_cell_data_reac() )
258
+
259
+ # Filtering features and cells based on the counts and % of mito contamination.
260
+ # single_cell_data_filt <- base::subset(data_sc,
261
+ # subset = nFeature_RNA > input$min_count &
262
+ # nFeature_RNA < input$max_count &
263
+ # percent.mt < input$max_mito_perc)
264
+
265
+ test_cond <- if ( ! is.na(input $ max_count ) && ! is.na(input $ min_count ) ) {
266
+
267
+ shinyFeedback :: feedbackWarning(" max_count" ,
268
+ input $ min_count > input $ max_count ,
269
+ " No cells will be selected by appling this parameters!" )
270
+
271
+ shinyFeedback :: feedbackWarning(" min_count" ,
272
+ input $ min_count > input $ max_count ,
273
+ " No cells will be selected by appling this parameters!" )
274
+
275
+ validate(need(input $ min_count < input $ max_count , " Error: No cells will be selected by appling this parameters!" ))
276
+
277
+ }
278
+
279
+
280
+ if ( ! is.na(input $ min_count ) ) {
281
+
282
+ # Filtering features and cells based on the counts and % of mito contamination.
283
+ data_sc <- base :: subset(data_sc ,
284
+ subset = nFeature_RNA > input $ min_count )
285
+
286
+ }
287
+
288
+ if ( ! is.na(input $ max_count ) ) {
289
+
290
+ shinyFeedback :: feedbackWarning(" max_count" ,
291
+ input $ max_count < = 0 ,
292
+ " No cells will be selected by appling this parameters!" )
293
+
294
+ validate(need(input $ max_count > 0 , " Error: No cells will be selected by appling this parameters!" ))
295
+
296
+ # Filtering features and cells based on the counts and % of mito contamination.
297
+ data_sc <- base :: subset(data_sc ,
298
+ subset = nFeature_RNA < input $ max_count )
299
+
300
+
301
+
302
+ }
303
+
304
+ if ( ! is.na(input $ max_mito_perc ) ) {
305
+
306
+ shinyFeedback :: feedbackWarning(" max_mito_perc" ,
307
+ input $ max_mito_perc < = 0 ,
308
+ " No cells will be selected by appling this parameters!" )
309
+
310
+ validate(need(input $ max_mito_perc > 0 , " Error: No cells will be selected by appling this parameters!" ))
311
+
312
+ # Filtering features and cells based on the counts and % of mito contamination.
313
+ data_sc <- base :: subset(data_sc ,
314
+ subset = percent.mt < input $ max_mito_perc )
315
+
316
+ }
317
+
318
+
259
319
260
320
height <- as.numeric( req( input $ p1_height ) )
261
321
width <- as.numeric( req( input $ p1_width ) )
262
322
res <- as.numeric( req( input $ p1_res ) )
263
323
264
324
265
- p <- Seurat :: VlnPlot(req( single_cell_data_filt() ) ,
325
+ p <- Seurat :: VlnPlot(data_sc ,
266
326
features = c(" nFeature_RNA" , " nCount_RNA" , " percent.mt" ),
267
327
ncol = 3 ,
268
328
split.plot = F )
0 commit comments