-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:stemangiola/sccomp # Conflicts: # DESCRIPTION
- Loading branch information
Showing
89 changed files
with
5,200 additions
and
3,272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,19 +6,17 @@ Authors@R: c(person("Stefano", "Mangiola", email = "[email protected]", | |
) | ||
Description: A robust and outlier-aware method for testing differential tissue composition from single-cell data. This model can infer changes in tissue composition and heterogeneity, and can produce realistic data simulations based on any existing dataset. This model can also transfer knowledge from a large set of integrated datasets to increase accuracy further. | ||
License: GPL-3 | ||
URL: https://github.com/MangiolaLaboratory/sccomp | ||
BugReports: https://github.com/MangiolaLaboratory/sccomp/issues | ||
Encoding: UTF-8 | ||
LazyData: true | ||
Roxygen: list(markdown = TRUE) | ||
RoxygenNote: 7.3.1 | ||
Biarch: true | ||
Depends: | ||
R (>= 4.2.0) | ||
Imports: | ||
methods, | ||
Rcpp (>= 0.12.0), | ||
RcppParallel (>= 5.0.1), | ||
rstantools (>= 2.1.1), | ||
rstan (>= 2.26.0), | ||
RoxygenNote: 7.3.2 | ||
Depends: R (>= 4.2.0) | ||
Imports: | ||
instantiate (>= 0.2.3), | ||
callr, | ||
fs, | ||
stats, | ||
SeuratObject, | ||
SingleCellExperiment, | ||
parallel, | ||
|
@@ -40,44 +38,28 @@ Imports: | |
readr, | ||
scales, | ||
stringr, | ||
glue | ||
glue, | ||
withr, | ||
digest | ||
Suggests: | ||
cmdstanr (>= 0.6.0), | ||
knitr, | ||
rmarkdown, | ||
BiocStyle, | ||
testthat (>= 3.0.0), | ||
markdown, | ||
knitr, | ||
loo, | ||
prettydoc, | ||
tidyseurat, | ||
tidySingleCellExperiment, | ||
prettydoc | ||
Enhances: | ||
furrr, | ||
extraDistr | ||
LinkingTo: | ||
BH (>= 1.66.0), | ||
Rcpp (>= 0.12.0), | ||
RcppEigen (>= 0.3.3.3.0), | ||
RcppParallel (>= 5.0.1), | ||
rstan (>= 2.26.0), | ||
StanHeaders (>= 2.26.0) | ||
SystemRequirements: GNU make | ||
VignetteBuilder: | ||
knitr | ||
RdMacros: | ||
lifecycle | ||
biocViews: | ||
ImmunoOncology, | ||
Normalization, | ||
Sequencing, | ||
RNASeq, | ||
Software, | ||
GeneExpression, | ||
Transcriptomics, | ||
SingleCell, | ||
Clustering | ||
LazyDataCompression: xz | ||
Config/testthat/edition: 3 | ||
URL: https://github.com/stemangiola/sccomp | ||
BugReports: https://github.com/stemangiola/sccomp/issues | ||
bayesplot, | ||
posterior | ||
Remotes: | ||
wlandau/instantiate | ||
Additional_repositories: | ||
https://mc-stan.org/r-packages/ | ||
SystemRequirements: CmdStan (https://mc-stan.org/users/interfaces/cmdstan) | ||
biocViews: Bayesian, Regression, DifferentialExpression, SingleCell | ||
LazyData: true | ||
VignetteBuilder: knitr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
|
||
sample_safe <- function(model, fx, ...) { | ||
tryCatch( | ||
{ | ||
# Attempt to run the arbitrary fx with additional arguments | ||
result <- fx(model, ...) | ||
return(result) | ||
}, | ||
error = function(e) { | ||
# Check if the error message is "model not compiled" | ||
if (grepl("Model not compiled", e$message)) { | ||
message("Model not compiled. Compiling.") | ||
# Load the model with force=TRUE | ||
model <- model$compile(cpp_options = list(stan_threads = TRUE)) # load_model("glm_multi_beta_binomial_generate_data", force = TRUE) | ||
# Retry the arbitrary fx with additional arguments | ||
result <- fx(model, ...) | ||
return(result) | ||
} else { | ||
# If a different error, rethrow the error | ||
stop(e) | ||
} | ||
} | ||
) | ||
} | ||
|
||
|
||
sample_fx <- function(model, ...) { | ||
model$sample(...) | ||
} | ||
|
||
pathfinder_fx <- function(model, ...) { | ||
model$pathfinder(...) | ||
} | ||
|
||
variational_fx <- function(model, ...) { | ||
model$variational(...) | ||
} | ||
|
||
generate_quantities_fx <- function(model, ...) { | ||
model$generate_quantities(...) | ||
} |
Oops, something went wrong.