@@ -373,15 +373,17 @@ setMethod(f="model_apply",
373
373
M $ fold_change = as.data.frame(2 ^ FC )
374
374
M $ lower_ci = as.data.frame(2 ^ LCI )
375
375
M $ upper_ci = as.data.frame(2 ^ UCI )
376
- M $ significant = as.data.frame((UCI < (- log2(M $ threshold ))) | (LCI > log2(M $ threshold )))
377
376
} else {
378
377
M $ fold_change = as.data.frame(FC )
379
378
M $ lower_ci = as.data.frame(LCI )
380
379
M $ upper_ci = as.data.frame(UCI )
381
- M $ significant = as.data.frame((UCI < (- M $ threshold )) | (LCI > (M $ threshold )))
382
380
}
383
381
382
+ check1 = M $ lower_ci > M $ threshold
383
+ check2 = M $ upper_ci < 1 / M $ threshold
384
+ M $ significant = data.frame (significant = check1 | check2 )
384
385
colnames(M $ significant )= comp
386
+ rownames(M $ significant )= colnames(D )
385
387
return (M )
386
388
}
387
389
)
@@ -506,6 +508,7 @@ ci_delta_nu = function(y1,y2,alpha=0.05,paired=FALSE) {
506
508
stop(' the same number of samples must be present in all groups for a paired comparison' )
507
509
}
508
510
r = y1 / y2
511
+ r = r [! is.na(r )]
509
512
mr = mean(r )
510
513
md = median(r )
511
514
s = sd(r )/ sqrt(length(r )) # standard error of mean
@@ -530,6 +533,9 @@ ci.mean.bs <- function(alpha, y1, y2){
530
533
# y2: n2 x 1 vector of scores for group 2
531
534
# Returns:
532
535
# confidence interval
536
+ y1 = y1 [! is.na(y1 )]
537
+ y2 = y2 [! is.na(y2 )]
538
+
533
539
n1 <- length(y1 )
534
540
n2 <- length(y2 )
535
541
m1 <- mean(y1 )
@@ -551,11 +557,13 @@ ci.mean.bs <- function(alpha, y1, y2){
551
557
552
558
553
559
ci.mean.paired = function (alpha ,x ,y ) {
554
-
555
560
r = x / y
561
+ r = r [! is.na(r )]
562
+
556
563
mr = mean(r )
557
- s = sd(r )/ sqrt(length(x )) # standard error of mean
558
- z = qt(1 - (alpha / 2 ),length(x )- 1 )
564
+
565
+ s = sd(r )/ sqrt(length(r )) # standard error of mean
566
+ z = qt(1 - (alpha / 2 ),length(r )- 1 )
559
567
560
568
out = t(c(mr ,mr - (z * s ),mr + z * s ))
561
569
colnames(out )= c(' fold_change' ,' lower_ci' ,' upper_ci' )
@@ -575,6 +583,8 @@ ci.median.bs <- function(alpha, y1, y2) {
575
583
# y2: n2 x 1 vector of scores for group 2
576
584
# Returns:
577
585
# confidence interval
586
+ y1 = y1 [! is.na(y1 )]
587
+ y2 = y2 [! is.na(y2 )]
578
588
z <- qnorm(1 - alpha / 2 )
579
589
n1 <- length(y1 )
580
590
y1 <- sort(y1 )
0 commit comments