Skip to content
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

vignette! #48

Merged
merged 3 commits into from
Aug 7, 2019
Merged

vignette! #48

merged 3 commits into from
Aug 7, 2019

Conversation

petrelharp
Copy link
Contributor

Here's a draft of the answer to @gbradburd's nice suggestion in #47. It'd be great if some other folks could read this over and give suggestions or make edits. In particular,

  1. I'm sure there needs to be more explanation in some places of what's going on. Which places are those?
  2. The spatial simulation could probably be tweaked to make a nicer demonstration?

Any input, @gbradburd, @bhaller, @cjbattey? To view the html version of this, you should be able to do make in the docs/ directory.

we've kept the individuals in a dict, so that for instance
`corners["topleft"]` is an array of all the individual IDs that are in the top left corner.
The IDs of the ancient individuals we will work with are kept in the array `ancient`.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey look you can make notes at specific locations. Like this one: here would be a good place to double-check that all the ancient samples are from a while ago, like:

for i in corners["ancient"]:
   ind = ts.individual(i)
   assert(ind.time >= 500 and ind.time < 520)

print(f"The tree sequence now has {ts.num_trees} trees,"
f" and {ts.num_mutations} mutations.")

Note since :meth:`mutate <msprime.mutate>` is an msprime method, it does not return a pyslim
Copy link
Member

Choose a reason for hiding this comment

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

Could use a `.. noteor.. warning`` block here to make this stand out.

We should check this: plot where these individuals lie
relative to everyone else.
The individuals locations are available in individual metadata,
but to make things easier, it's also present in a `num_individuals x 2`
Copy link
Member

Choose a reason for hiding this comment

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

looks like N x 3 below?

@jeromekelleher
Copy link
Member

I had a read through @petrelharp, looks excellent to me. This will really help people out.

We've got to get VCF and metadata sorted out soon in tskit, the last bit really is unnecessarily awkward and confusing.

@petrelharp
Copy link
Contributor Author

We've got to get VCF and metadata sorted out soon in tskit, the last bit really is unnecessarily awkward and confusing.

omg, yes.

@cjbattey
Copy link

cjbattey commented Aug 6, 2019

looks great - very helpful. It may be useful to add a note that the rates in recapitate( ) and mutate( ) are per-timestep and not per-generation. This is also relevant around line 230-235 where you discuss keeping SLiM mutations, because the rates in SLiM and the rates applied by mutate( ) will be in different units. Also very much yes on the VCF output.

if ind_group[i] == "ancient" or ind_group[j] == "ancient":
pair_colors[k] = 1

fig = plt.figure(figsize=(6, 6))
Copy link

Choose a reason for hiding this comment

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

Suggested change
fig = plt.figure(figsize=(6, 6))
fig = plt.figure(figsize=(6, 6),dpi=300)

will make things a little prettier.

@gbradburd
Copy link

This looks great and I think will be super useful, especially to me! Agreed that the last chunk is a little complicated, so that it'd be nice to have some of it taken care of by write_vcf(), but I recognize that that's complicated. Thanks for putting the vignette together, and feel free to close #47 as you see fit.

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.

4 participants