Comments (1)
This looks like expected behavior to me: in your slim script you have these bits:
// create admixing population
1 late() {
sim.treeSeqRememberIndividuals(sim.subpopulations.individuals);
}
5 late() {
sim.treeSeqOutput("3.slim2.trees");
}
The call to treeSeqRememberIndividuals
ensures that those individuals from generation will be present in the output tree sequence, with their nodes marked as samples. (They are marked as "samples" because, along with the final generation, the output tree sequence has their entire genealogical history.)
This checks out: in the tree sequence the samples whose time
is not 0.0
are all at 4.0
(in the past, so from generation 1):
>>> for n in ts.samples():
... if ts.node(n).time > 0.0:
... print(ts.node(n))
...
{'id': 8, 'time': 4.0, 'population': 0, 'individual': 10, 'metadata': b'\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'flags': 1}
{'id': 9, 'time': 4.0, 'population': 0, 'individual': 10, 'metadata': b'\t\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'flags': 1}
{'id': 10, 'time': 4.0, 'population': 0, 'individual': 11, 'metadata': b'\n\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'flags': 1}
{'id': 11, 'time': 4.0, 'population': 0, 'individual': 11, 'metadata': b'\x0b\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'flags': 1}
{'id': 12, 'time': 4.0, 'population': 1, 'individual': 12, 'metadata': b'\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'flags': 1}
{'id': 13, 'time': 4.0, 'population': 1, 'individual': 12, 'metadata': b'\r\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'flags': 1}
{'id': 14, 'time': 4.0, 'population': 1, 'individual': 13, 'metadata': b'\x0e\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'flags': 1}
{'id': 15, 'time': 4.0, 'population': 1, 'individual': 13, 'metadata': b'\x0f\x00\x00\x00\x00\x00\x00\x00\x00\x00', 'flags': 1}
Perhaps the documentation for treeSeqRememberIndividuals
could be improved? The SLiM manual says
treeSeqRememberIndividuals() is for permanently adding particular individuals to the retained sample.
which doesn't seem bad but doesn't explicitly comment on this point. (I'm not sure if it should, though?) What do you think?
from pyslim.
Related Issues (20)
- post-SLiM-v4 release tasks HOT 1
- Recapitation with recent demographic events + historical sampling ? HOT 2
- Error with pyslim.load 'AttributeError: can't set attribute' HOT 4
- first() events can now do more stuff than before HOT 1
- Issues with recapitate tutorial on pyslim manual HOT 8
- say in 'installation' how to find/install other versions
- remove inkscape dependency for docs build
- read new section on time units HOT 14
- deprecate unique_labels_by_group
- Release tasks
- write example using `max_slim_id( )`
- Docs build failing
- release tasks
- recapitating merged trees HOT 9
- add VCF example to tutorial
- recapitate has surprisingly small diversity if WF simulation is started and saved in `late` HOT 7
- release tasks
- tsinfered tree sequences don't have 'type' key in top-level metdata but `set_tree_sequence_metadata` expects they do
- provide example of annotating existing mutations
- test on annotating tsinfer'ed tree sequence
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyslim.