Skip to content

Commit

Permalink
remove saving state after exp to moran switch
Browse files Browse the repository at this point in the history
  • Loading branch information
fraterenz committed Sep 4, 2024
1 parent 6bcfea9 commit 05fb285
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
19 changes: 5 additions & 14 deletions src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,6 @@ impl HscDynamics {
}
let mut moran =
exp.switch_to_moran(options_moran.distributions, options_save, filename, rng);
// save at the end of the exp phase
moran
.save(
moran.time,
&SavingCells::WholePopulation,
moran.save_sfs_only,
rng,
)
.expect("cannot save simulation at the end of the exponential phase");
if options_moran.gillespie_options.verbosity > 0 {
println!("{} simulating Moran phase", Utc::now());
}
Expand Down Expand Up @@ -427,9 +418,6 @@ impl Moran {
//! 2. else, compute the variant counts
//! 3. and sample from any clone based on the weights defined by
//! the variant counts
if self.verbosity > 2 {
println!("keeping the cell population constant");
}
// remove a cell from a random subclone based on the frequencies of
// the clones at the current state
let variants = Variants::variant_counts(&self.subclones);
Expand All @@ -441,8 +429,11 @@ impl Moran {
.with_context(|| "found empty subclone")?;
self.tree
.remove_cell_from_tree(cell2remove.id, self.verbosity)?;
if self.verbosity > 2 {
println!("removing one cell from clone {}", id2remove);
if self.verbosity > 1 {
println!(
"keep the cell pop constant by removing cell with id {} from clone {}",
cell2remove.id, id2remove
);
}
Ok(())
}
Expand Down
10 changes: 8 additions & 2 deletions src/proliferation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ impl Proliferation {
self.last_id += 1;
new_cell.id = self.last_id;
if verbosity > 1 {
println!("Adding the sibling cell on a new node");
println!(
"adding the sibling cell with id {} on a new node",
self.last_id
);
}
assign_divisional_mutations(
&mut new_cell,
Expand Down Expand Up @@ -212,7 +215,10 @@ impl Proliferation {
self.last_id += 1;
new_cell.id = self.last_id;
if verbosity > 1 {
println!("Adding the sibling cell on a new node");
println!(
"adding the sibling cell with id {} on a new node",
self.last_id
);
}
assign_divisional_mutations(
&mut new_cell,
Expand Down

0 comments on commit 05fb285

Please sign in to comment.