Git Product home page Git Product logo

bdsky's Introduction

bdsky - Birth Death Serial Skyline Model for BEAST2

Unit/integration tests

Citation

Please cite Stadler2013 for the following models:

  • Birth-death skyline serial;
  • Birth-death skyline contemporary;
  • Birth-death skyline contemporary BDS (birth, death, sampling rate);
  • Birth-death skyline multi-rho.

If sampled ancestors are used, please also cite: Gavryushkina2014

License

BDSKY is free software, and is distributed under the terms of the GNU General Public License version 3. A copy of this license can be found in the root directory of this repository.

bdsky's People

Contributors

alexeid avatar denisekuehnert avatar gavryushkina avatar laduplessis avatar rbouckaert avatar simongreenhill avatar tgvaughan avatar walterxie avatar zhangchicool avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bdsky's Issues

BEAUTI template

The latest version of BDSKY does not allow setting up a prior on the reproductive ratio in BEAUTI.

BDSKY depends on SA package

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.

new parameterization

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

BDSKY has been failing a unit test since January 2019.

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.

Installation failed

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

Cannot select Birth Death Skyline Contemporary in BEAUti

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. )

logP being positive infinity

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?

Trouble resuming BirthDeathSkylineModel

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.

BDSKY 1.3.3 release breaks backward compatibility of XML files built with previous BDSKY module versions

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

InputEditor for rates and rateChangeTimes

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.

BDSKY for HIV

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

R0->Reproductive number

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.