provide method for getting the nodes that correspond to a set of individuals
See original GitHub issueProposal: this should be like:
def individual_nodes(inds):
out = np.repeat(-1, len(inds) * 2).reshape((len(inds), 2))
for k, ind in enumerate(inds):
out[k, :] = self.individual(ind).nodes
so returns an array with one row per individual that can be flattened to get just a flat list of the nodes corresponding to the genomes of the individuals whose IDs are inds. And, should insert tskit.NULL
as appropriate in the array when individuals are of mixed ploidy.
(moved from https://github.com/tskit-dev/pyslim/issues/39)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Find all reachable nodes from every node present in a given set
One straight forward solution is to do a BFS traversal for every node present in the set and then find all the reachable...
Read more >3. py2neo.matching – Entity matching
The py2neo.matching module provides functionality to match nodes and relationships according to certain criteria. For each entity type, a Matcher class and ...
Read more >get all relationships for a node with cypher - Stack Overflow
The simplest way to get all relationships for a single node is like this: MATCH (:User {username: 'user6'})-[r]-() RETURN r.
Read more >MATCH - Cypher Manual - Neo4j
The MATCH clause allows you to specify the patterns Neo4j will search for in the database. This is the primary way of getting...
Read more >Closeness Centrality - an overview | ScienceDirect Topics
Closeness centrality indicates how close a node is to all other nodes in the network. It is calculated as the average of the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sure, we can forget about this. And this is plenty fast even for big tree sequences. I do think that we should streamline working with individuals generally - eg to avoid the error where one passes indiviual IDs to the ‘samples’ argument of simplify - but this is maybe better done by adding an
individuals
argument to various methods.Can you add it to the 0.2.0 milestone so please if you’d like it in?