-
Notifications
You must be signed in to change notification settings - Fork 8
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
Switch to turn off population frequency plot #144
Comments
Can we calculate these on-the-fly instead? |
Impractical at chromosome scale I'm afraid. Possible for a small window, though? |
Don't you just need to do it for the single mutation that's been clicked on? |
Yes, it's only for the single mutation that's clicked on. We considered on-the-fly calculations, but I think one of the reasons we thought it would be easier to pass the whole set of arrays to the browser, was so interactivity is smoother for larger datasets. The reason for creating this issue was that a big machine was needed everytime we served the dataset, even when we didn't care about the population frequencies. Now that we have the preprocess logic, perhaps this issue is not as relevant? I'll check with a couple of datasets and confirm. |
If we're doing it for a single mutation then maybe it is feasible. You'd have to do this: tree = ts.at(mutation_position)
nodes = tree.preorder(mutation_node) # numpy array
subtree_population = ts.nodes_population[nodes]
# return a data frame of the counts |
Moving this to MVP+1 as it isn't a showstopper and we have a good solution. |
We can now view population frequencies of a mutation by clicking on a data point in the main mutations view. For this, we're computing a numpy array of shape num_nodes x num_populations. With large number of populations (e.g. >200 in the Unified Genealogies dataset) this array grows extremely big and tsqc runs out of memory, getting killed. We should make frequency plots optional, which users can choose to switch on only when sufficient memory is available.
The text was updated successfully, but these errors were encountered: