{ "metadata": { "name": "player" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": "execfile('/Users/alanrw/work/sourcecode/python/leiden/DataHackLeiden/tavernaPlayerClient/TavernaPlayerClient.py')", "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "code", "collapsed": false, "input": "execfile('/Users/alanrw/work/sourcecode/python/leiden/DataHackLeiden/tavernaPlayerClient/Workflow.py')", "language": "python", "metadata": {}, "outputs": [], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": "execfile('/Users/alanrw/work/sourcecode/python/leiden/DataHackLeiden/tavernaPlayerClient/RunTemplate.py')", "language": "python", "metadata": {}, "outputs": [], "prompt_number": 3 }, { "cell_type": "code", "collapsed": false, "input": "execfile('/Users/alanrw/work/sourcecode/python/leiden/DataHackLeiden/tavernaPlayerClient/Run.py')", "language": "python", "metadata": {}, "outputs": [], "prompt_number": 4 }, { "cell_type": "code", "collapsed": false, "input": "client = TavernaPlayerClient('http://dev.at.biovel.eu', 'player', 'player')", "language": "python", "metadata": {}, "outputs": [], "prompt_number": 5 }, { "cell_type": "code", "collapsed": false, "input": "workflows = client.getWorkflows()", "language": "python", "metadata": {}, "outputs": [], "prompt_number": 6 }, { "cell_type": "code", "collapsed": false, "input": "for w in workflows:\n print str(w.identifier) + ' = ' + w.title", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "1 = Various output types\n2 = Ecological niche modelling workflow v20\n4 = Select Model For Me with components\n5 = Define with PartitionFinder, infer and validate Phylogeny - short run\n6 = Partitioning environmental sequencing data using categorical and phylogenetic information using PhyloH with parsing Qiime\n10 = Partitioning environmental sequencing data using categorical and phylogenetic information using PhyloH with parsing Qiime\n11 = A workflow\n12 = Partitioning environmental sequencing data using categorical and phylogenetic information using PhyloH with parsing Qiime\n13 = Bioclim workflow with interaction\n15 = A workflow\n16 = A workflow\n19 = BioVeL ESW DIFF - ENM Statistical Workflow with raster difference computation\n20 = BioVeL ESW STACK - ENM Statistical Workflow with raster stack computation\n21 = Data Refinement Workflow v13\n24 = Biome-BGC ESI Regulation, test & demo version 1.0\n25 = Define with PartitionFinder, infer and validate Phylogeny - short run\n31 = Biome-BGC CARBON test & demo version 1.0 annotated\n32 = Select Model For Me with components\n33 = Bioclim workflow with interaction\n36 = Phylogenetic Inference:Select Model For me- no component\n40 = Phylogenetic Inference:Select Model For me- no component no questions\n42 = Ecological niche modelling workflow v21\n43 = Ecological niche modelling workflow\n46 = [BETA] Data Refinement Workflow v14\n48 = Matrix Population Model analysis v10\n49 = WebDAV Component Test\n50 = A workflow\n52 = Multi-interaction\n53 = Partitioning environmental sequencing data using categorical and phylogenetic information using PhyloH with parsing Qiime\n54 = All File Lister using external tool\n56 = All File Lister using external tool\n57 = Ecological niche modelling workflow\n58 = Data Refinement Workflow v13\n59 = Biome-BGC SA test & demo version 1.0 annotated\n97 = A workflow\n98 = Biome-BGC MCE test & demo version 1.1 annotated\n103 = Data Refinement Workflow v14\n105 = A workflow\n107 = A workflow\n115 = Data Refinement Workflow v14\n117 = A workflow\n118 = Simple ask\n119 = BioVeL ESW STACK - ENM Statistical Workflow with raster stack computation\n120 = Retrieving FASTA format\n130 = Data Refinement Workflow v15\n131 = List output\n" } ], "prompt_number": 7 }, { "cell_type": "code", "collapsed": false, "input": "w = filter(lambda x: x.identifier == 48, workflows)[0]", "language": "python", "metadata": {}, "outputs": [], "prompt_number": 8 }, { "cell_type": "code", "collapsed": false, "input": "print w.description", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "The Matrix Population Models Workflow provides an environment to perform several analyses on a stage-matrix with no density dependence:\n- Eigen analysis;\n- Age specific survival;\n- Generation time (T);\n- Net reproductive rate (Ro);\n- Transient Dynamics;\n- Bootstrap of observed census transitions (Confidence intervals of lambda);\n- Survival curve;\n- Keyfitz delta;\n- Cohen's cumulative distance.\n\nThis workflow requires an instance of Rserve on localhost\n\nThis workflow has been created by the Biodiversity Virtual e-Laboratory (BioVeL http://www.biovel.eu/) project. BioVeL is funded by the EU\u2019s Seventh Framework Program, grant no. 283359. \n\nThis workflow uses R packages \u2018popbio\u2019 (Stubben & Milligan 2007; Stubben, Milligan & Nantel 2011) and 'popdemo' (Stott, Hodgson and Townley 2013).\n\nReferences:\n\nCaswell, H. 1986. Life cycle models for plants. Lectures on Mathematics in the Life Sciences 18: 171-233.\n\nCaswell, H. 2001. Matrix population models: Construction, analysis and interpretation, 2nd Edition. Sinauer Associates, Sunderland, Massachusetts.\n\nde Kroon, H. J., A. Plaiser, J. van Groenendael, and H. Caswell. 1986. Elasticity: The relative contribution of demographic parameters to population growth rate. Ecology 67: 1427-1431. \n\nHorvitz, C., D.W. Schemske, and Hal Caswell. 1997. The relative \"importance\" of life-history stages to population growth: Prospective and retrospective analyses. In S. Tuljapurkar and H. Caswell. Structured population models in terrestrial and freshwater systems. Chapman and Hall, New York.\n\nJongejans E. & H. de Kroon. 2012. Matrix models. Chapter in Encyclopaedia of Theoretical Ecology (eds. Hastings A & Gross L) University of California, p415-423\n\nMesterton-Gibbons, M. 1993. Why demographic elasticities sum to one: A postscript to de Kroon et al. Ecology 74: 2467-2468.\n\nOostermeijer J.G.B., M.L. Brugman; E.R. de Boer; H.C.M. Den Nijs. 1996. Temporal and Spatial Variation in the Demography of Gentiana pneumonanthe, a Rare Perennial Herb. The Journal of Ecology, Vol. 84(2): 153-166.\n\nStott, I., S. Townley and D.J. Hodgson 2011. A framework for studying transient dynamics of population projection matrix models. Ecology Letters 14: 959\u2013970\n\nStubben, C & B. Milligan. 2007. Estimating and Analysing Demographic Models Using the popbio Package in R. Journal of Statistical Software 22 (11): 1-23\n\nStubben, C., B. Milligan, P. Nantel. 2011. Package \u2018popbio\u2019. Construction and analysis of matrix population models. Version 2.3.1\n\nvan Groenendael, J., H. de Kroon, S. Kalisz, and S. Tuljapurkar. 1994. Loop analysis: Evaluating life history pathways in population projection matrices. Ecology 75: 2410-2415.\n" } ], "prompt_number": 9 }, { "cell_type": "code", "collapsed": false, "input": "rt = w.getRunTemplate()", "language": "python", "metadata": {}, "outputs": [], "prompt_number": 10 }, { "cell_type": "code", "collapsed": false, "input": "print rt.inputs", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "{u'longTermYears': u'50', u'label': u'Gentiana pneumonanthe, Terschelling', u'iterations': u'10000', u'stageMatrixFile': u'0.0000\\t0.0000\\t0.0000\\t7.6660\\t0.0000\\r\\n0.0579\\t0.0100\\t0.0000\\t8.5238\\t0.0000\\r\\n0.4637\\t0.8300\\t0.9009\\t0.2857\\t0.8604\\r\\n0.0000\\t0.0400\\t0.0090\\t0.6190\\t0.1162\\r\\n0.0000\\t0.0300\\t0.0180\\t0.0000\\t0.0232', u'stages': u'[S, J, V, G, D]', u'shortTermYears': u'10'}\n" } ], "prompt_number": 11 }, { "cell_type": "code", "collapsed": false, "input": "outputs = w.run('leiden', {})", "language": "python", "metadata": {}, "outputs": [ { "html": "", "metadata": {}, "output_type": "display_data" } ], "prompt_number": 12 }, { "cell_type": "code", "collapsed": false, "input": "import imghdr", "language": "python", "metadata": {}, "outputs": [], "prompt_number": 13 }, { "cell_type": "code", "collapsed": false, "input": "from IPython.display import *", "language": "python", "metadata": {}, "outputs": [], "prompt_number": 14 }, { "cell_type": "code", "collapsed": false, "input": "for k in outputs:\n v = outputs[k]\n display_html(HTML('