cbg-ethz / pmhn Goto Github PK
View Code? Open in Web Editor NEWPersonalised mutual hazard networks
Home Page: https://cbg-ethz.github.io/pMHN/
License: MIT License
Personalised mutual hazard networks
Home Page: https://cbg-ethz.github.io/pMHN/
License: MIT License
Implement the tree generative TreeMHN process. It should be based on the Algorithm 1 (pseudocode) from Supplementary Information.
Backend for calculating loglikelihood and its derivatives.
It can be based e.g., on LearnMHN package and joblib parallelisation.
Tasks:
We want to have functions of signatures:
def loglikelihood(genotype: Bool[Array, " M"], theta: Float[Array, "M M"]) -> float:
...
def gradient(genotype: Bool[Array, " M", theta: Float[Array, "M M") -> Float[Array, "M M"]:
...
implementing the loglikelihood and the gradient for a particular genotype.
Apart from that we want to have vectorized versions as described above.
Create a PyMC Op
object which can be used to calculate loglikelihood and the gradient of MHN.
Note: this issue depends on #3.
We want to add the utility of calculating the gradient to the backend.
def gradient(tree: Tree, theta: np.ndarray) -> np.ndarray:
...
Note that it is not the priority at the start of the project: we will try to do the modelling as soon as possible, starting with a sequential Monte Carlo sampler and Metropolis transitions using small simulated data.
Only after initial experiments (we will probably see that it's not scalable), we'll consider switching to Hamiltonian Monte Carlo (which requires gradients).
We want to be able to simulate a discrete Markov chain from the Markov process given by MHN.
Utilities:
Add a PyMC Op
which takes full genotype matrix as well as an array of shape (patients, genes, genes)
representing the MHNs and evaluating:
(patients, genes, genes)
)We want to have a backend implementing a function of essentially the following signature:
def loglikelihood(tree: Tree, theta: np.ndarray) -> float:
"""Calculates the loglikelihood and the gradient.
Args:
tree: tree
theta: unconstrained (log-) theta matrix of shape `(n_genes, n_genes)`
Returns:
loglikelihood, `log P(tree | theta)`
"""
raise NotImplementedError
The implementation should be accompanied by unit tests, where the answer is known (either manually calculated or using original implementation)
Note that this task may be already too large to be accomplished in one sprint. After we discuss it, we can split it into several smaller subtasks.
As Xiang has noticed:
We may also want to add functions to check if the trees contain the following cases
A -> B -> B
B <- A -> B
because TreeMHN does not allow repeated mutations in the same lineage or identical siblings.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.