AngryMaciek / warlock

Warlock is a snakemake workflow to spawn multiple demons (deme-based oncology models) as jobs running around on a cluster environment 😈😈
https://github.com/AngryMaciek/warlock
Apache License 2.0
2 stars 0 forks source link

chore: interactive notebook w/ example runs #3

Closed AngryMaciek closed 2 years ago

AngryMaciek commented 2 years ago

Add examples of how to run the simulation bash script and some post-processing of the results.


Maybe present in an interactive notebook via Binder? Alongside with something similar to: https://github.com/robjohnnoble/demonanalysis


Yes, tutorial through a notebook (with binder) would be good.

Later include some code to post-process the data. With the R script? Install it within the binder?

AngryMaciek commented 2 years ago

Actually, I need some feedback here as well @robjohnnoble:

I need a set of demon parameters which would result in a nice, presentable results. I would like to prepare an interactive example so it also need to have a reasonable runtime (a few minutes is OK). It may be a toy example population, just so that we may show and let others trigger the workflow and inspect the results themselves.

Also: I understand that the repository of yours (above) works out-of-the-box to generate Muller plots? That would be very desirable.

I plan to set up an interactive Jupyter notebook which would clone this repo, install its dependencies, install your package too and start an interactive notebook where users could trigger the workflow and then generate some simple plots out of the results.

vesmanojlovic commented 2 years ago

A set of parameters which gives quite nice looking Muller plots is:

parameters
{
    spatial_structure
    {
        log2_deme_carrying_capacity 9
    }
    dispersal
    {
        migration_type 0
        init_migration_rate 2e-03
        migration_edge_only 1
        migration_rate_scales_with_K 1
    }
    mutation_rates
    {
        mu_driver_birth 1e-05
        mu_passenger 0.1
        mu_driver_migration 0
        passenger_pop_threshold -1
    }
    fitness_effects
    {
        normal_birth_rate 0.8
        baseline_death_rate 0
        s_driver_birth 0.1
        s_passenger 0
        s_driver_migration 0
        max_relative_birth_rate 10
        max_relative_migration_rate 10
    }
    non_biological_parameters
    {
        init_pop 1
        matrix_max -1
        max_pop 100000
        max_time 86400
        max_generations 2000
        seed 10
        write_grid 0
        write_clones_file 0
        write_demes_file 0
        record_matrix 0
        write_phylo 0
        calculate_total_diversity 0
        biopsy_size_per_sample 100
    }
}

Should run in a couple minutes. The Muller plot function is plot_all_images("path_to_output_folder"), and there's also plot_all_charts("path_to_output_folder") which outputs evolutionary parameter graphs. I really like the idea of having a more user-friendly way to converse with demon btw!