Skip to content

Commit 10720d8

Browse files
committed
resolve bug pass fit
1 parent 07cf578 commit 10720d8

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

DESCRIPTION

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ Imports:
3232
ttBulk,
3333
testthat,
3434
benchmarkme,
35-
multidplyr
35+
multidplyr,
36+
KernSmooth,
37+
cluster,
38+
survival
3639
Remotes:
3740
github::stemangiola/ttBulk, github::stan-dev/rstantools, github::tidyverse/multidplyr
3841
LinkingTo:

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ importFrom(tidyr,nest)
4040
importFrom(tidyr,separate)
4141
importFrom(tidyr,spread)
4242
importFrom(tidyr,unnest)
43-
importFrom(ttBulk,normalise_abundance)
43+
importFrom(ttBulk,scale_abundance)
4444
useDynLib(ppcSeq, .registration = TRUE)

R/ppcSeq.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,7 @@ check_if_any_NA = function(input.df, sample_column, gene_column, value_column, s
809809
#' @importFrom magrittr multiply_by
810810
#' @importFrom purrr map2
811811
#' @importFrom purrr map_int
812-
#' @importFrom ttBulk normalise_abundance
812+
#' @importFrom ttBulk scale_abundance
813813
#'
814814
#' @param my_df A tibble including a gene name column | sample name column | read counts column | covariates column
815815
#' @param formula A formula
@@ -1149,7 +1149,7 @@ format_input = function(input.df, formula, sample_column, gene_column, value_col
11491149
#' @importFrom magrittr multiply_by
11501150
#' @importFrom purrr map2
11511151
#' @importFrom purrr map_int
1152-
#' @importFrom ttBulk normalise_abundance
1152+
#' @importFrom ttBulk scale_abundance
11531153
#' @importFrom benchmarkme get_ram
11541154
#' @importFrom magrittr multiply_by
11551155
#'
@@ -1289,7 +1289,7 @@ ppc_seq = function(input.df,
12891289
# Build better scales for the inference
12901290
exposure_rate_multiplier =
12911291
my_df %>%
1292-
normalise_abundance(!!sample_column,!!gene_column,!!value_column) %>%
1292+
scale_abundance(!!sample_column,!!gene_column,!!value_column) %>%
12931293
distinct(!!sample_column, TMM, multiplier) %>%
12941294
mutate(l = multiplier %>% log) %>%
12951295
summarise(l %>% sd) %>%
@@ -1298,7 +1298,7 @@ ppc_seq = function(input.df,
12981298
# Build better scales for the inference
12991299
intercept_shift_scale =
13001300
my_df %>%
1301-
normalise_abundance(!!sample_column,!!gene_column,!!value_column) %>%
1301+
scale_abundance(!!sample_column,!!gene_column,!!value_column) %>%
13021302
mutate(cc =
13031303
!!as.symbol(sprintf(
13041304
"%s normalised", quo_name(value_column)
@@ -1376,6 +1376,7 @@ ppc_seq = function(input.df,
13761376
adj_prob_theshold = adj_prob_theshold_2, # If check only deleterious is one side test
13771377
# * 2 because we just test one side of the distribution
13781378
how_many_posterior_draws = how_many_posterior_draws_2,
1379+
pass_fit = pass_fit,
13791380
to_exclude = to_exclude,
13801381
save_generated_quantities = save_generated_quantities,
13811382
tol_rel_obj = tol_rel_obj,
@@ -1387,11 +1388,10 @@ ppc_seq = function(input.df,
13871388
merge_results(res_discovery, res_test, formula, gene_column, value_column, sample_column, do_check_only_on_detrimental) %>%
13881389

13891390
# Add fit attribute if any
1390-
add_attr(res_test %>% attr("fit"), "fit") %>%
1391+
add_attr(res_discovery %>% attr("fit"), "fit 1") %>%
1392+
add_attr(res_test %>% attr("fit"), "fit 2") %>%
13911393

13921394
# Add total draws
13931395
add_attr(res_test %>% attr("total_draws"), "total_draws")
13941396

1395-
1396-
13971397
}

tests/testthat/test-ppcSeq.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ test_that("VB post approx",{
1414
approximate_posterior_inference = T,
1515
approximate_posterior_analysis = T,
1616
how_many_negative_controls = 50,
17-
cores=1
17+
cores=1,pass_fit = T
1818
)
1919

2020
expect_equal(

0 commit comments

Comments
 (0)