Skip to content

Commit c430833

Browse files
authored
Merge pull request #11 from stemangiola/fix-zero-sigma
Fix zero sigma
2 parents 8b31eef + 53ab5c0 commit c430833

File tree

9 files changed

+32
-32
lines changed

9 files changed

+32
-32
lines changed

DESCRIPTION

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: ppcseq
22
Title: Probabilistic Outlier Identification for RNA Sequencing Generalized Linear Models
3-
Version: 0.99.7
3+
Version: 0.99.16
44
Authors@R:
55
person(given = "Stefano",
66
family = "Mangiola",
@@ -28,7 +28,7 @@ Encoding: UTF-8
2828
LazyData: true
2929
Biarch: true
3030
Depends:
31-
R (>= 4.0.0)
31+
R (>= 4.1.0)
3232
Imports:
3333
methods,
3434
Rcpp (>= 0.12.0),
@@ -49,7 +49,9 @@ Imports:
4949
benchmarkme,
5050
parallel,
5151
rlang,
52-
stats
52+
stats,
53+
utils,
54+
graphics
5355
LinkingTo:
5456
BH (>= 1.66.0),
5557
Rcpp (>= 0.12.0),
@@ -59,7 +61,8 @@ LinkingTo:
5961
Suggests:
6062
knitr,
6163
testthat,
62-
BiocStyle
64+
BiocStyle,
65+
rmarkdown
6366
VignetteBuilder:
6467
knitr
6568
RdMacros:

R/ppcseq-package.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#'
1616
#' @usage data(counts)
1717
#'
18-
#'
18+
#' @return See documentation
1919
#'
2020
#' @references
2121
#' Stan Development Team (2019). RStan: the R interface to Stan. R package version 2.19.2. https://mc-stan.org

R/ppcseq.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#'
5353
#' data("counts")
5454
#'
55+
#' if(Sys.info()[['sysname']] != "Windows")
5556
#' result =
5657
#' counts %>%
5758
#' dplyr::mutate( is_significant = ifelse(symbol %in% c("SLC16A12", "CYP1A1", "ART3"), TRUE, FALSE) ) %>%
@@ -140,7 +141,7 @@ identify_outliers = function(.data,
140141
stop("There are NAs in the .transcript. Please filter those records")
141142

142143
# Check if the counts column is an integer
143-
if (.data %>% select(!!.abundance) %>% map_chr(~ class(.x)) != "integer")
144+
if (.data %>% pull(!!.abundance) %>% is("integer") %>% not())
144145
stop(
145146
sprintf(
146147
"The column %s must be of class integer. You can do as mutate(`%s` = `%s` %%>%% as.integer)",
@@ -375,6 +376,7 @@ identify_outliers = function(.data,
375376
#'
376377
#' data("counts")
377378
#'
379+
#' if(Sys.info()[['sysname']] != "Windows"){
378380
#' result =
379381
#' counts %>%
380382
#' dplyr::mutate( is_significant = ifelse(symbol %in% c("SLC16A12", "CYP1A1", "ART3"), TRUE, FALSE) ) %>%
@@ -392,6 +394,7 @@ identify_outliers = function(.data,
392394
#' )
393395
#'
394396
#' result_plot = result %>% plot_credible_intervals()
397+
#' }
395398
#'
396399
#' @export
397400
#'

R/utilities.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,7 @@ identify_outliers_1_step = function(.data,
11841184
stop("There are NAs in the .transcript. Please filter those records")
11851185

11861186
# Check if the counts column is an integer
1187-
if (.data %>% select(!!.abundance) %>% map_chr(~ class(.x)) != "integer")
1187+
if (.data %>% pull(!!.abundance) %>% is("integer") %>% not())
11881188
stop(
11891189
sprintf(
11901190
"The column %s must be of class integer. You can do as mutate(`%s` = `%s` %%>%% as.integer)",

inst/stan/negBinomial_MPI.stan

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,14 @@ functions{
8080
// Vectorise lpmf
8181
//vector[symbol_end[G_per_shard+1]] lambda_MPI_c;
8282
vector[symbol_end[G_per_shard+1]] sigma_MPI_c;
83+
84+
// print(rows(local_parameters));
85+
// print(local_parameters);
86+
// print("----");
87+
// print(lambda_MPI);
88+
// print(sigma_MPI);
89+
// print(exposure_rate);
90+
8391
for(g in 1:G_per_shard){
8492
int how_many = symbol_end[g+1] - (symbol_end[g]);
8593
//lambda_MPI_c[(symbol_end[g]+1):symbol_end[g+1]] = rep_vector(lambda_MPI[g], how_many);

man/identify_outliers.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plot_credible_intervals.Rd

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/ppcseq-package.Rd

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-ppcSeq.R

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ context('ppcseq')
22

33
data("counts")
44

5+
if(Sys.info()[['sysname']] != "Windows"){
6+
57
test_that("VB post approx no correction",{
68

79
res =
@@ -28,31 +30,6 @@ test_that("VB post approx no correction",{
2830

2931
})
3032

31-
test_that("VB post approx yes correction",{
32-
33-
res =
34-
ppcseq::identify_outliers(
35-
dplyr::mutate(counts, is_significant = ifelse(symbol %in% c("SLC16A12", "CYP1A1", "ART3"), TRUE, FALSE) ),
36-
formula = ~ Label,
37-
sample, symbol, value,
38-
.significance = PValue,
39-
.do_check = is_significant,
40-
percent_false_positive_genes = 1,
41-
tol_rel_obj = 0.01,
42-
approximate_posterior_inference =TRUE,
43-
approximate_posterior_analysis =TRUE,
44-
how_many_negative_controls = 50,
45-
cores=1,pass_fit = TRUE
46-
)
47-
48-
expect_equal(
49-
50-
as.integer(unlist(res[,4])),
51-
c(0,1,0)
52-
)
53-
54-
})
55-
5633
test_that("VB post full",{
5734

5835
res =
@@ -78,3 +55,6 @@ test_that("VB post full",{
7855

7956
})
8057

58+
} else{
59+
print("tests for windows are temporarily disabled")
60+
}

0 commit comments

Comments
 (0)