@@ -269,8 +269,13 @@ Summarize <- function(txi, tx2gene, annotation, args, metadata, species) {
269
269
" genes." ))
270
270
ribo.genes <- which(grepl(" ^RP[SL]" , scaled_df [, " symbol" ], ignore.case = T ))
271
271
272
- first_quartile <- function (x ) { y <- quantile(x , c(0.25 , 0.5 , 0.75 ), type = 1 )
273
- return (y [[1 ]])
272
+
273
+
274
+ first_quartile <- function (x ) {
275
+ # > first_quartile(c(0,0,0,0,0,0,0,1,10,10))
276
+ # [1] 1
277
+ y <- quantile(x , c(0.25 , 0.5 , 0.75 ), type = 1 )
278
+ return (y [[3 ]])
274
279
}
275
280
276
281
message(paste(" Excluding" , length(ribo.genes ), " ribosomal genes from TMM scaling factor calulation." ))
@@ -389,7 +394,7 @@ deseq_analysis <- function(contrasts, txi.gene, contrast.metadata, formula, fail
389
394
} else {
390
395
deseq.dataset <- DESeqDataSetFromTximport(txi.gene , contrast.metadata , as.formula(paste0(" ~" , contrasts $ Factor [1 ])))}
391
396
message(paste(" Filtering" , length(failing.quartile.filter ), " genes failing --quartile-expression cutoff from DESeq2 dataset." ))
392
- deseq.dataset <- deseq.dataset [failing.quartile.filter ,]
397
+ deseq.dataset <- deseq.dataset [- failing.quartile.filter ,]
393
398
message(" Running DESeq2..." )
394
399
395
400
deseq.dataset <- DESeq(deseq.dataset )
0 commit comments