Skip to content

Commit

Permalink
Merge branch 'binomial_noise' of https://github.com/caravagnalab/mobster
Browse files Browse the repository at this point in the history
 into binomial_noise
  • Loading branch information
riccardobergamin committed Nov 7, 2023
2 parents 496b28d + 61bb3e5 commit 2acb0e2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions R/assign_mutation_posteriori.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ assign_mutations_posteriori <- function(x) {

to_assign <- x$data %>% filter(is.na(cluster),
karyotype %in% names(x$model_parameters),
VAF <= x$run_parameters$min_vaf,
NV <= x$run_parameters$NV_filter)
VAF >= x$run_parameters$min_vaf,
NV >= x$run_parameters$NV_filter)

if(nrow(to_assign) == 0) {
cli::cli_alert_info("No mutations to assign, returning input object!")
Expand Down
18 changes: 9 additions & 9 deletions R/evodynamics.R
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,8 @@ get_genome_length = function(fit, exome = FALSE, build = "hg38", karyotypes = NU

if(!is.null(karyotypes)) seg %>% filter(karyotype %in% karyotypes)

lengths = seg %>% group_by(karyotype) %>%
summarize(length = sum(to-from))
lengths = seg %>% dplyr::group_by(karyotype) %>%
dplyr::summarize(length = sum(to-from))

return(lengths)

Expand Down Expand Up @@ -644,19 +644,19 @@ get_genome_length = function(fit, exome = FALSE, build = "hg38", karyotypes = NU
s_posterior = function(fit,N_max,ncells = 1,u = 0,sigma = 1){


if(class(fit$best) == "dbpmmh"){
if(class(fit) == "dbpmmh"){

m = fit$best$data %>% filter(cluster == 'S1',karyotype == "1:1") %>% nrow()
mu = mu_posterior(fit$best,ncells = ncells) %>% pull(mean)
ccf = (fit$best$data %>% filter(cluster == 'S1',karyotype == "1:1") %>% pull(VAF) %>% mean())*2
length_diploid_genome = get_genome_length(fit$best) %>% filter(karyotype == "1:1") %>%
m = fit$data %>% filter(cluster == 'S1',karyotype == "1:1") %>% nrow()
mu = mu_posterior(fit,ncells = ncells) %>% pull(mean)
ccf = (fit$data %>% filter(cluster == 'S1',karyotype == "1:1") %>% pull(VAF) %>% mean())*2
length_diploid_genome = get_genome_length(fit) %>% filter(karyotype == "1:1") %>%
pull(length)

}else{

m = fit$best$data %>% filter(cluster == 'C2') %>% nrow()
m = fit$data %>% filter(cluster == 'C2') %>% nrow()
mu = mutationrate(fit,ncells = ncells)/(2*3*10^9)
ccf = (fit$best$data %>% filter(cluster == 'C2') %>% pull(VAF) %>% mean())*2
ccf = (fit$data %>% filter(cluster == 'C2') %>% pull(VAF) %>% mean())*2
length_diploid_genome = 3*10^9

}
Expand Down

0 comments on commit 2acb0e2

Please sign in to comment.