kgori / sigfit

Flexible Bayesian inference of mutational signatures
GNU General Public License v3.0
33 stars 8 forks source link

get reconstructed mutation catalogues #48

Closed MariaCartolano closed 5 years ago

MariaCartolano commented 5 years ago

Hello,

I have performed the fit_extract_signatures(), selected the desired additional de novo signatures step and now would like to obtain the reconstructed catalogue from my final model: fitted+extracted.

I have used the function get_reconstructions(), but I failed to understand its output.

Could you please help me with this? Thank you for your help, Maria

baezortega commented 5 years ago

Hi Maria,

I think get_reconstructions is an internal function we use within the package to get the MCMC samples of the reconstructed spectra (I think it is by mistake that users can access the function).

You can get point estimates and HPD intervals for the reconstructed spectra using

reconstructions <- retrieve_pars(output, "reconstructions")

with output being the object you get from running fit_extract_signatures(). The result is a list with three matrices (with same dimensions as your original spectra), corresponding to the mean values of the reconstructed spectra, and the lower and upper ends of their HPD intervals. If what you want is to compare the reconstructed catalogues to the original ones, then the mean matrix should be fine. The only issue with this matrix is that it doesn't tell you which proportion of each component in the spectrum comes from each signature (but you can find that out by multiplying signatures and exposures).

You can also plot the reconstructions using plot_reconstruction() or plot_all().

Best, Adrian