Coder Social home page Coder Social logo

geneclocks's Introduction

Geneclocks project

For now, only simulation of reconstructed trees is supported.

Installation

  1. Install Stack.

  2. Clone this project.

     git clone https://github.com/dschrempf/geneclocks
    
  3. Build.

     cd geneclocks
     stack build
    
  4. Run simulate-trees. For instance, read the help message.

    stack exec simulate-trees -- -h
    
    --
    
    Simulate reconstructed trees
    
    Usage: simulate-trees [-t|--nTrees INT] [-n|--nLeaves INT] [-H|--height DOUBLE]
                          [-l|--lambda DOUBLE] [-m|--mu DOUBLE]
                          [-s|--summary-statistics] [-v|--verbosity] [-q|--quiet]
      Simulate reconstructed trees using the point process. See Gernhard, T. (2008).
      The conditioned reconstructed process. Journal of Theoretical Biology, 253(4),
      769โ€“778. http://doi.org/10.1016/j.jtbi.2008.04.005
    
    Available options:
      -h,--help                Show this help text
      -t,--nTrees INT          Number of trees (default: 10)
      -n,--nLeaves INT         Number of leaves per tree (default: 5)
      -H,--height DOUBLE       Fix tree height (no default)
      -l,--lambda DOUBLE       Birth rate lambda (default: 1.0)
      -m,--mu DOUBLE           Death rate mu (default: 0.9)
      -s,--summary-statistics  Only output number of children for each branch
      -v,--verbosity           Verbosity
      -q,--quiet               Be quiet
    
    If no tree height is given, the heights will be randomly drawn from the expected
    distribution given the number of leaves, the birth and the death rate.
    

    Or do a test simulation.

    stack exec simulate-trees
    
    --
    
    Reconstructed trees simulator version 0.1.0.0.
    Command line: simulate-trees 
    
    -- Arguments
    Number of simulated trees: 10
    Number of species per tree: 5
    Height of trees: 1.0
    Birth rate: 1.0
    Death rate: 0.9
    Verbosity: False
    Quiet: False
    
    -- Simulation
    (0:0.3774855500765698,((1:2.0154241024089484e-2,2:2.0154241024089484e-2)0:0.2194498304554361,(3:0.18875196496260377,4:0.18875196496260377)0:5.085210651692179e-2)0:0.13788147859704425)0:0.6225144499234302;
    ((0:0.5177388882792351,1:0.5177388882792351)0:0.17579988502229682,((2:2.4071319480028328e-3,3:2.4071319480028328e-3)0:0.5087754559038138,4:0.5111825878518166)0:0.18235618544971532)0:0.3064612266984681;
    (0:0.5844174857147952,(1:0.5698359606751093,(2:0.4090026429825453,(3:9.963595012789103e-2,4:9.963595012789103e-2)0:0.30936669285465423)0:0.16083331769256404)0:1.4581525039685905e-2)0:0.41558251428520476;
    (0:0.45748809145221386,((1:3.1144304318300375e-3,2:3.1144304318300375e-3)0:0.27978666828928417,(3:5.2227265132491034e-2,4:5.2227265132491034e-2)0:0.23067383358862315)0:0.17458699273109968)0:0.5425119085477861;
    (((0:6.735311917877203e-2,1:6.735311917877203e-2)0:3.0393396323536895e-2,(2:7.177846060176821e-2,3:7.177846060176821e-2)0:2.5968054900540716e-2)0:0.13914199440844016,4:0.23688850991074908)0:0.7631114900892509;
    ((0:0.2100809945775664,(1:0.15777006486332162,2:0.15777006486332162)0:5.231092971424478e-2)0:3.0252921468290034e-2,(3:0.1501753882670414,4:0.1501753882670414)0:9.015852777881503e-2)0:0.7596660839541436;
    ((((0:3.2439737590665e-2,1:3.2439737590665e-2)0:0.36980767383515173,2:0.4022474114258167)0:6.58267022258962e-2,3:0.4680741136517129)0:0.40516374800937494,4:0.8732378616610879)0:0.12676213833891214;
    ((((0:0.11196444537163554,1:0.11196444537163554)0:5.056354677189623e-3,2:0.11702080004882516)0:0.28450453494869715,3:0.4015253349975223)0:2.0093485295044233e-2,4:0.42161882029256653)0:0.5783811797074334;
    (0:0.9803439102203049,(((1:4.690857183501333e-2,2:4.690857183501333e-2)0:3.103274247509455e-2,3:7.794131431010788e-2)0:0.5342528598722517,4:0.6121941741823596)0:0.3681497360379453)0:1.965608977969513e-2;
    ((0:0.3170383445505747,1:0.3170383445505747)0:0.40209444148245527,((2:0.1770647724894815,3:0.1770647724894815)0:0.4894164144749219,4:0.6664811869644034)0:5.26515990686266e-2)0:0.28086721396697;
    

    You can also use quiet mode (only print simulated trees).

    stack exec simulate-trees -- -q
    
    --
    
    ((0:0.68534719435169,1:0.68534719435169)0:0.21528252085106026,(2:0.3609135961613327,(3:0.22004788342525208,4:0.22004788342525208)0:0.1408657127360806)0:0.5397161190414176)0:9.937028479724974e-2;
    ((0:0.5436590952526373,1:0.5436590952526373)0:0.10984879686076143,((2:0.3646311967978449,3:0.3646311967978449)0:0.1502264583081801,4:0.514857655106025)0:0.13865023700737378)0:0.34649210788660123;
    (((0:0.3008707041549576,(1:0.271374763205572,2:0.271374763205572)0:2.949594094938557e-2)0:2.8234253178400948e-2,3:0.32910495733335854)0:5.8409296357698426e-2,4:0.38751425369105696)0:0.612485746308943;
    (((0:3.74908528727916e-2,(1:1.3349768604509465e-2,2:1.3349768604509465e-2)0:2.4141084268282136e-2)0:1.915156490140029e-2,3:5.664241777419189e-2)0:5.6816091240475486e-2,4:0.11345850901466738)0:0.8865414909853326;
    ((0:5.442608353607999e-2,(1:3.155629285750777e-2,2:3.155629285750777e-2)0:2.286979067857222e-2)0:0.7517814558302057,(3:0.14172123866053613,4:0.14172123866053613)0:0.6644863007057497)0:0.19379246063371425;
    (((0:0.41327220897168615,1:0.41327220897168615)0:0.11338569839383617,(2:0.3029320951884167,3:0.3029320951884167)0:0.22372581217710563)0:0.16023726627105084,4:0.6868951736365732)0:0.31310482636342685;
    (0:0.7524695865441795,((1:0.4856958670853718,2:0.4856958670853718)0:0.19805060662336038,(3:9.289763476186218e-2,4:9.289763476186218e-2)0:0.59084883894687)0:6.87231128354473e-2)0:0.2475304134558205;
    ((0:0.3118323950570037,1:0.3118323950570037)0:0.5344516596304831,((2:0.37152779665907054,3:0.37152779665907054)0:1.1784860724386448e-3,4:0.3727062827315092)0:0.4735777719559776)0:0.1537159453125132;
    (0:0.5527626238311962,(1:0.34894677621430875,((2:1.2708873676922612e-2,3:1.2708873676922612e-2)0:0.24866670306415153,4:0.26137557674107414)0:8.75711994732346e-2)0:0.20381584761688748)0:0.44723737616880377;
    ((0:0.12476268814676579,1:0.12476268814676579)0:0.5616208523887856,((2:0.28734210014844747,3:0.28734210014844747)0:0.3197180138417644,4:0.6070601139902119)0:7.932342654533953e-2)0:0.3136164594644486;
    
    
  5. Install (take care that the binary is installed into your PATH).

     stack install geneclocks:\exe:\simulate-trees
    

geneclocks's People

Contributors

dschrempf avatar

Watchers

 avatar  avatar

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.