tskit icon indicating copy to clipboard operation
tskit copied to clipboard

Can I get a list of descendants of a branch (edge)?

Open hanbin973 opened this issue 2 years ago • 11 comments

Hi there, thank you for developing a terrific library. I'm trying to perform certain matrix operations using tskit.

Suppose that A is a matrix in which the number of rows (N) are individuals, and the number of columns (E) are edges (brancehs). The value is 1 if the node is a descendant of an edge and 0 otherwise (not only the direct descendant but all descendants). A is the same as the genotype matrix, given one mutation for each branch.

I'm willing to multiply this matrix A with a phenotype matrix X of individuals (X = N x P, where P is the number of phenotypes) to get A^TX. Is this possible within the statistics functionality of tskit?

hanbin973 avatar Dec 19 '23 11:12 hanbin973