Skip to content

Commit dcbf659

Browse files
authored
Merge pull request #329 from zhanchen/fix_scale_multiplier
fix multiplier calcuation
2 parents 137e4d1 + 937fab0 commit dcbf659

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: tidybulk
33
Title: Brings transcriptomics to the tidyverse
4-
Version: 1.21.0
4+
Version: 1.21.1
55
Authors@R: c(person("Stefano", "Mangiola", email = "[email protected]",
66
role = c("aut", "cre")),
77
person("Maria", "Doyle", email = "[email protected]",

R/methods_SE.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,12 @@ setMethod("tidybulk", "RangedSummarizedExperiment", .tidybulk_se)
161161

162162
# Calculate multiplier
163163
multiplier =
164-
1 %>%
165-
divide_by(library_size_filtered * nf) %>%
164+
# Relecting the ratio of effective library size of the reference sample to the effective library size of each sample
165+
(library_size_filtered[reference] * nf[reference]) %>%
166+
divide_by(library_size_filtered * nf)
166167

167168
# NOT HELPING - Put everything to the reference sample scale
168-
multiply_by(library_size_filtered[reference])
169+
# multiply_by(library_size_filtered[reference])
169170

170171
# At the moment no because would be different from TIBBLE behaviour
171172
# %>%

tests/testthat/test-bulk_methods_SummarizedExperiment.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ test_that("tidybulk SummarizedExperiment normalisation subset",{
130130

131131
expect_equal(
132132
unique(SummarizedExperiment::colData(res)$multiplier),
133-
c(1.3648110, 1.5756592, 1.1651309, 2.1282288, 1.2110911, 0.9574359, 1.4434610, 1.4897840),
133+
c(1.425486, 1.645707, 1.216928, 2.222842, 1.264932, 1.000000, 1.507632, 1.556014),
134134
tolerance=1e-3
135135
)
136136

0 commit comments

Comments
 (0)