Skip to content

Commit c9c34ed

Browse files
2 parents 2e3c862 + 4a36b40 commit c9c34ed

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

R/topTableBC.R

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# lfc = 0
99
# sigma2post = fit$s2.post
1010

11+
1112
.toptableTBC <- function(fit,
1213
n,
1314
design = NULL,
@@ -40,6 +41,7 @@
4041
fit$coefficients <- as.matrix(fit$coefficients)
4142
rn <- rownames(fit$coefficients)
4243

44+
4345
# Check coef is length 1
4446
if (length(coef) > 1) {
4547
coef <- coef[1]
@@ -129,7 +131,6 @@
129131
})
130132
}
131133

132-
133134
# Extract statistics for table
134135
M <- fit$coefficients[, coef] - bias[coef]
135136
se_coef <- as.matrix(fit$coefficients / eb$t)[, coef]
@@ -178,15 +179,16 @@
178179
tstat <- as.matrix(M / se_coef)
179180
}
180181
df_coef <- matrix(eb$df.total,
181-
dimnames = list(names(tstat))
182+
183+
dimnames = list(names(tstat))
182184
)
183185
P.Value <- as.matrix(2 * pt(abs(tstat),
184-
df = df_coef, lower.tail = FALSE
185-
))
186-
186+
df = df_coef, lower.tail = FALSE
187+
))
188+
187189
# Apply multiple testing adjustment
188190
adj.P.Value <- p.adjust(P.Value, method = adjust.method)
189-
191+
190192
# Thin out fit by p.value and lfc thresholds
191193
if (p.value < 1 || lfc > 0) {
192194
sig <- (adj.P.Value <= p.value) & (abs(M) >= lfc)
@@ -227,7 +229,6 @@
227229
none = seq_along(M)
228230
)
229231
top <- ord[1:number]
230-
231232
# Assemble output data.frame
232233
if (is.null(genelist)) {
233234
tab <- data.frame(logFC = M[top])
@@ -253,6 +254,7 @@
253254
tab <- data.frame(tab,
254255
t = tstat[top], P.Value = P.Value[top],
255256
adj.P.Val = adj.P.Value[top]
257+
256258
)
257259
rownames(tab) <- rn[top]
258260
} else if (returnVars) {
@@ -270,6 +272,7 @@
270272
var.coef = se_coef[top]^2,
271273
var.mode = var_mode[top],
272274
cov.mode = cov_mode[top]
275+
273276
)
274277
}
275278
rownames(tab) <- rn[top]
@@ -559,7 +562,6 @@ topTableBC <- function(fit,
559562
# Gordon Smyth
560563
# 4 August 2003. Last modified 20 Aug 2022.
561564

562-
563565
# Check fit
564566
if (!is(fit, "MArrayLM")) stop("fit must be an MArrayLM object")
565567
if (is.null(fit$t) && is.null(fit$F)) {
@@ -609,7 +611,6 @@ topTableBC <- function(fit,
609611
}
610612
}
611613

612-
613614
# Check adjust.method
614615
if (is.null(adjust.method)) adjust.method <- "BH"
615616

README.Rmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ devtools::install_github("koenvandenberge/voomCLR")
3333
The vignette of voomCLR walks you through the basics of using `voomCLR`.
3434

3535

36+
# Analysis code of the paper
37+
38+
All analysis code of the paper can be found at https://github.com/koenvandenberge/voomCLRPaper.
3639

3740

3841

vignettes/voomCLR.Rmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ These situations share that the compositional bias can be expected to be similar
245245

246246

247247

248+
248249
# Citing `voomCLR`
249250

250251
We hope that `r Biocpkg("voomCLR")` will be useful for your research. Please use the following information to cite the package and the overall approach. Thank you!

0 commit comments

Comments
 (0)