Skip to content

Commit

Permalink
update with error for degenerates cases
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardobergamin committed Nov 7, 2023
1 parent c16f7ef commit 496b28d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions R/evodynamics.R
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,18 @@ mu_posterior <- function(fit,
genome_length %>% filter(karyotype == karyo) %>% pull(length))

}

good_karyo = (subclonal_mutations > 0) & (f_min < f_max)

subclonal_mutations = subclonal_mutations[good_karyo]
f_min = f_min[ good_karyo]
f_max = f_max[ good_karyo]

if(sum(good_karyo) == 0)
{
warning("Missing karyotype with enough mutations")
stop("Will not compute mutation rate")
}

# calculate alpha e beta mutation rate posterior

Expand Down

0 comments on commit 496b28d

Please sign in to comment.