Skip to content

Commit

Permalink
v4.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
fraterenz committed May 1, 2024
1 parent c365803 commit d42c470
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog
The semantic versioning is kind of random.

## 4.3.7
### BugFix
- When switching from exp. to Moran, do not try to add background mutations to cell if they have their last division time greater than `TIME_AT_BIRTH`. This is a problem when `tau-exp` is not correctly set.

## 4.3.6
### BugFix
- The previous version didn't match the number of expanded clones from the SDE mode. So, we remove factor 2 and restore solution from `v4.3.4`, even though we initiate fit variants at size 2 instead of 1 (but has small prob. of p squared).
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "hsc"
version = "4.3.6"
version = "4.3.7"
edition = "2021"

[dependencies]
Expand Down
11 changes: 10 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ fn main() {
proliferation,
options.gillespie_options.verbosity,
);
if options.gillespie_options.verbosity > 0 {
println!("start simulating exp. phase");
}

let stop = simulate(
state,
Expand All @@ -145,7 +148,7 @@ fn main() {
&options.gillespie_options,
rng,
);
if options.gillespie_options.verbosity > 1 {
if options.gillespie_options.verbosity > 0 {
println!(
"exponential simulation {} stopped because {:#?}, nb cells {}",
idx,
Expand All @@ -165,6 +168,9 @@ fn main() {
);
let moran_distributions =
Distributions::new(probs_moran, app.options_moran.gillespie_options.verbosity);
if options.gillespie_options.verbosity > 0 {
println!("switching to moran");
}
// switch_to_moran start with time 0
exp.switch_to_moran(
ProcessOptions {
Expand Down Expand Up @@ -209,6 +215,9 @@ fn main() {
app.options_moran.gillespie_options.verbosity,
)
};
if app.options_moran.gillespie_options.verbosity > 0 {
println!("simulating Moran phase");
}

let stop = simulate(
state,
Expand Down
16 changes: 9 additions & 7 deletions src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,15 @@ impl Exponential {
println!("updating the neutral background mutations for all cells");
}
for stem_cell in self.subclones.get_mut_cells() {
assign_background_mutations(
stem_cell,
TIME_AT_BIRTH,
&self.distributions.neutral_poisson,
rng,
self.verbosity,
);
if stem_cell.get_last_division_time() < &TIME_AT_BIRTH {
assign_background_mutations(
stem_cell,
TIME_AT_BIRTH,
&self.distributions.neutral_poisson,
rng,
self.verbosity,
);
}
// this is required as we are restarting the time
stem_cell.set_last_division_time(0f32).unwrap();
}
Expand Down

0 comments on commit d42c470

Please sign in to comment.