-
Notifications
You must be signed in to change notification settings - Fork 89
Selective Sweep based on reading from a file with rudimentary ability to… #2410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… to run on multiple demes Code to run a selective sweep based on reading the events from a binary file in a specified format. The C side also implements nearest neighbour migration with multiple demes. This does not interface with the Python version yet.
… to run on multiple demes Code to run a selective sweep based on reading the events from a binary file in a specified format. The C side also implements nearest neighbour migration with multiple demes. This does not interface with the Python version yet.
Wow, this looks great @Aalhad-Bhatt! I'll need to spend some time with it, but from a first glance it looks like you've done an excellent job. We are trying to get version 1.4 shipped (https://github.com/tskit-dev/msprime/milestone/19), so I think what we'll do is get that out the door as soon as possible and then focus on merging this in, and figuring out the next steps. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have to remove the reliance on a file before we can merge here @Aalhad-Bhatt as the code is currently untestable and we'll end up doing a bunch of work to accomodate the file pattern than we later undo.
For the first pass, I think what we want is
- Remove the reliance on a file, where we pass in the arrays when we call set_simulation_model., which we take copies of.
- For the C tests, we just need some example trajectories that'll help us test the code. Nothing realistic is needed.
Given that, I think It would be easier to back out of the Python level changes for the moment, and try and get the C side of things basically ironed out. If we have full test coverage on the new code, then I think we can merge happily enough as it doesn't affect other models.
Following that, we can then add Python support and perhaps some ways of generating useful trajectories from Python.
Does this sound like a good path?
msp_set_node_mapping_block_size(&msp, 65536); | ||
msp_set_segment_block_size(&msp, 65536); | ||
|
||
ret = msp_set_simulation_model_sweep_genic_selection_reverse( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, here instead of passing in the filename we would pass parameters required to describe the sweep.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the C code tests we won't need anything realistic, just some way of generating trajectories that'll test all the different code paths.
|
||
typedef struct _sweep_reverse_t { | ||
double position; | ||
const char *filename; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we need to include the paramters required to describe the sweep, so from your code above:
1. Number of steps
2. Number of demes
3. Pop size
4. Migration rate
5. State after finishing the backward sim
6. state at the start of the backward sim
8. Time, type, and start and end locations for each event
So, I think 1-6 are just standard variables and the you have 4 arrays to describe the events? This would looks something like
typedef struct _sweep_reverse_t {
double position;
// other params
tsk_id_t *end_deme;
}
So, the struct holds pointers, which we can fill in with arrays later as needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is super helpful. Thanks!
Folder notebooks, with forward sim and sample file
Folder notebooks, with forward sim and sample file
… to run on multiple demes
Code to run a selective sweep based on reading the events from a binary file in a specified format. The C side also implements nearest neighbour migration with multiple demes. This does not interface with the Python version yet.