beast2-dev / bdsky Goto Github PK
View Code? Open in Web Editor NEWBirth Death Serial Skyline Model for BEAST2
License: GNU General Public License v3.0
Birth Death Serial Skyline Model for BEAST2
License: GNU General Public License v3.0
One of the likelihood SABirthDeathSkylineModel unit tests testLikelihoodCalculationTwoIntervalsWithRhoConditionOnRhoSamplingAndRoot
was broken by a merge commit 6f6e6d4.
One of the two lineages involved in the merge introduced this test, together with an R script for computing the likelihood value. This lineage was released as v1.4.3. The merge with the second lineage resulted in the modification of the following snippet in BirthDeathSkylineModel:
rho[i]= //rhoSamplingChangeTimes.contains(times[i]) ? rhos[rhoSamplingChangeTimes.indexOf(times[i])] : 0.;
(rhoChanges>0 || rhoSamplingTimes.get()!=null && rhos.length>1)?
rhoSamplingChangeTimes.contains(times[i]) ? rhos[rhoSamplingChangeTimes.indexOf(times[i])] : 0.
: rhos[0]
;
with the addition of the && rhos.length>1
expression. Removing this expression allows the unit test to again pass.
Once we fix this, I suggest adding automatic unit testing to this repository to help prevent this kind of thing happening again. BDSKY is a very popular BEAST 2 package, and although bugs happen, I think we need to try harder to ensure preventable errors like this don't appear.
R0 is a confusing name for the parameter because if there are several intervals then R0 corresponds to the Reproductive number at the first interval. "reproductiveNumber"would be a better name.
To reproduce in BEAST 2.4.3: install BDSKY, restart BEAUti, load an alignment, then select Birth Death Skyline Contemprary from the tree prior drop-down menu in the Priors panel. The selection is immediately replaced with Birth Death Skyline Multi Rho. None of the other available tree prior options seem to have this problem.
(This came up in a workshop on Monday, preventing people from following along with the Taming the BEAST skyline plot tutorial. )
With a 10000 year old tree, rho sampling and no sampling rates, I had trouble resuming because the restored tree had a tip height that differed more than 1e-10 from a rho sampling time (consequently, the isRhoTip array marked the tip as 'false', and a sampling rate was assumed for that node, giving a zero likelihood for BirthDeathSkylineModel).
This larger difference is due to the fact sample ages are not stored in the state file to that resolution. It should be sufficient to do the check that node age does not differ from rho sampling time relative to root age. That is, check that
(node age - rho time)/root age < 1e-10
instead of
(node age - rho time) < 1e-10
which we have now.
The BDSKY package contains templates for sampled ancestor analyses that depend on having the SA package installed. Either these templates should be moved to the SA package, or there should be a dependency added to the version.xml file. For now, I added a dependency in the packages.xml file in CBAN.
A BEAUti input editor that will handle multidimensional entries for rateChangeTimes parameters is needed. Also it would be good if this editor takes care of keeping the dimensions for the rate and respective rateChangeTimes parameters the same.
When conditioning on rho sampling and the root the likelihood is missing lambda1.
If there is rho-sampling it might be useful to add conditioning on rho-sampling (that is, condition on sampling at least one individual at the last rho-sampling time, at present).
See issue 290 in Beast2.
The beauti template TreePriorsBDSKY.xml
is missing from the latest release.
This might happen if R0,delta and s parameterisation is used.
In rare cases, (say psi is very large, so Ai is very large too, then g() is zero [line 765]), the tree log likelihood becomes positive infinity.
It checks Double.isInfinite(logP)) then returns logP, then logAlpha in MCMC.java is positive infinity too, casing the move being accepted and ending up with prior being Infinity.
Should it be
if (Double.isInfinite(logP)) return Double.NEGATIVE_INFINITY;
so that the move can be rejected properly?
I just added a new parameterization to the bdsky package, defined below:
/* nd = lambda - mu - r * psi lambda = nd / (1 - to)
to = (mu + r * psi) / lambda --> mu = lambda * to * (1 - sp) / (1 - sp + r * sp)
sp = psi / (mu + psi) psi = mu * sp / (1 - sp)
SAModel: 0 <= rp < 1; No SA: rp = 1
*/
I added a few new junit tests and they passed for the new parameterization. So I created pull request #6
/Chi
Hi All,
I'm trying to install the package but I receive this message:
"Install failed because: No subject alternative DNS name matching github-releases.githubusercontent.com found"
The version of my BEAST is 2.5.2.
Regards,
Stephanie
BEAUti template for latest version does not allow for estimation of sampling proportion.
It looks like this is a simple omission in the BDSKY_params fragment.
This is because canHandleTipDates returns m_rho.get() == null although in FBD model there are both rho and psi-samples. Possible fix would be to return !contemp
Greetings from Taming the BEAST down under. This duplication in names causes the scale operator to be incorporated or not at random when the BDSKY_contemp prior is chosen, thus causing problems with the skyline tutorial (https://taming-the-beast.org/tutorials/Skyline-plots/). There are probably other operators that cause problems, so better check the uniqueness of operator names in these templates.
One can not condition on root in the FBD skyline model.
The latest version of BDSKY does not allow setting up a prior on the reproductive ratio in BEAUTI.
Hello
I am setting up a new analysis for a large set of HIV data and I was wondering which clock rates params you would suggest for serially sampled data
UCLN or strick?
and for the clock.rate and ucldMmean priors, which distribution? LogNormal? gamma? others?
thanks for the advices
a
XML files built with BDSKY version prior 1.3.3 generate the following error during execution.
Error 130 parsing the xml input file
nullThis BEASTInterface (BirthDeathSkySerial.t:clean_H1N1_NA) has no input with name R0. Choose one of these inputs: birthRateChangeTimes,deathRateChangeTimes,samplingRateChangeTimes,removalProbabilityChangeTimes,intervalTimes,birthRateTimesRelative,deathRateTimesRelative,samplingRateTimesRelative,reverseTimeArrays,rhoSamplingTimes,origin,originIsRootEdge,conditionOnRoot,birthRate,deathRate,samplingRate,removalProbability,rho,contemp,reproductiveNumber,becomeUninfectiousRate,samplingProportion,netDiversification,turnOver,forceRateChange,conditionOnSurvival,conditionOnRhoSampling,tree,treeIntervals
Temporary fix: manually search and replace R0
with reproductiveNumber
in the XML file
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.