Skip to content

Kingman prototype#1

Open
JereKoskela wants to merge 6 commits intojeromekelleher:masterfrom
JereKoskela:master
Open

Kingman prototype#1
JereKoskela wants to merge 6 commits intojeromekelleher:masterfrom
JereKoskela:master

Conversation

@JereKoskela
Copy link
Copy Markdown
Contributor

Two new functions:

  • sim_setup_arg uses 1 child, 1 parent jumps to move all lineages to a single pixel. Spatial parameters and a virtual event location are overwritten so that lineages can only intersect with a single pixel, and are unable to migrate out.
  • sim_simulate_arg simulates the arg phase using the two types of transitions we discussed: 2 children, one parent for a merger and 1 child, two parents for a recombination. The different recombination mechanism in the ARG has led to some changes to the sim_generate_parents function, and spatial locations are still set so that every lineage intersects with one single pixel only.

I've tried some trial simulations with small numbers of lineages and both few and many loci, and everything looks good. Valgrind also reports no memory leaks. But I haven't done extensive testing, which would probably be easier with a Python wrapper.

Comment thread lib/sim.c Outdated
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor style nit: there should be a space between the if and the bracket.

@jeromekelleher
Copy link
Copy Markdown
Owner

This is superb, thanks @JereKoskela! I think this is a great framework, and we'll be able to build the remaining functionality pretty easily on top of this. There are some minor changes I'd like to see:

  1. Some binary files have been included in the git commit. These should be removed.
  2. I think we're using some pretty recent C features which might cause trouble for portability. C99 is the version I'd like to target.
  3. I've made some superficial style comments also, just to try to keep the style consistent through the codebase.

@JereKoskela
Copy link
Copy Markdown
Contributor Author

I think I caught all the style discrepancies and removed the binary files. I also split up the z[] and r inits like we discussed. Self->num_parents still gets modified as before. Let me know if you spot anything else.

Comment thread lib/.directory Outdated
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be removed as well (KDE eh?).

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also need to remove 'main' from the commit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both done

Comment thread lib/main.c Outdated
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

space needed here - if (..)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants