1. Trang chủ
  2. » Thể loại khác

Introduction to modeling for biosciences

329 41 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Cấu trúc

  • Cover

  • Introduction to Modeling for Biosciences

    • ISBN 1849963258

    • Preface

    • Contents

  • Chapter 1 Foundations of Modeling

    • Simulation vs. Analytic Results

    • Stochastic vs. Deterministic Models

    • Fundamentals of Modeling

    • Validity and Purpose of Models

  • Chapter 2 Agent-Based Modeling

    • Mathematical and Computational Modeling

      • Limits to Modeling

        • Randomness

        • Heterogeneity

        • Interactions

    • Agent-Based Models

      • The Structure of ABMs

        • Agents

        • Environment

        • Interactions

      • Algorithms

      • Time-Driven Algorithms

      • Event-Driven Models

    • Game of Life

    • Malaria

      • A Digression

      • Stochastic Systems

      • Immobile Agents

    • General Consideration when Analyzing a Model

      • How to Test ABMs?

    • Case Study: The Evolution of Fimbriation

      • Group Selection

      • The Model

        • Group Selection Without Dilemmas

        • Fimbriation in E.coli

        • Designing a Model of Fimbriation

        • Agents

        • Environment

        • Interactions

        • The Simulation Algorithm

        • Testing the Model

        • Exploring the Behavior of the Model

        • Summary

  • Chapter 3 ABMs Using Repast and Java

    • The Basics of Agent-Based Modeling

    • An Outline of Repast Concepts

      • Contexts and Projections

      • Model Parameterization

    • The Game of Life in Repast S

      • The model.score File

      • The Agent Class

        • Properties

        • The Issue of Update Ordering

        • Behavior and Interaction

        • Setting a Random Initial State

        • Calculating the Next State

      • The Model Initializer

      • Summary of Model Creation

      • Running the Model

      • Creating a Display

      • Creating an Agent Style Class

      • Inspecting Agents at Runtime

      • Review

    • Malaria Model in Repast Using Java

      • The Malaria Model

      • The model.score File

      • Commonalities in the Agent Types

      • Building the Root Context

      • Accessing Runtime Parameter Values

      • Creating a Projection

      • Implementing the Common Elements of the Agents

      • Completing the Mosquito Agent

      • Scheduling the Actions

      • Visualizing the Model

      • Charts

      • Outputting Data

      • A Statistics-Gathering Agent

      • Summary of Concepts Relating to the Malaria Model

      • Running Repast Models Outside Eclipse

      • Going Further with Repast S

  • Chapter 4 Differential Equations

    • Differentiation

      • A Mathematical Example

      • Digression

    • Integration

    • Differential Equations

      • Limits to Growth

      • Steady State

      • Bacterial Growth Revisited

    • Case Study: Malaria

      • A Brief Note on Stability

    • Chemical Reactions

      • Michaelis-Menten and Hill Kinetics

      • Modeling Gene Expression

    • Case Study: Cherry and Adler's Bistable Switch

    • Summary

  • Chapter 5 Mathematical Tools

    • A Word of Warning: Pitfalls of CAS

    • Existing Tools and Types of Systems

    • Maxima: Preliminaries

    • Maxima: Simple Sample Sessions

      • The Basics

      • Saving and Recalling Sessions

    • Maxima: Beyond Preliminaries

      • Solving Equations

      • Matrices and Eigenvalues

      • Graphics and Plotting

      • Integrating and Differentiating

    • Maxima: Case Studies

      • Gene Expression

      • Malaria

      • Cherry and Adler's Bistable Switch

    • Summary

  • Chapter 6 Other Stochastic Methods and Prism

    • The Master Equation

    • Partition Functions

      • Preferences

      • Binding to DNA

      • Codon Bias in Proteins

    • Markov Chains

      • Absorbing Markov Chains

      • Continuous Time Markov Chains

      • An Example from Gene Activation

    • Analyzing Markov Chains: Sample Paths

    • Analyzing Markov Chains: Using PRISM

      • The PRISM Modeling Language

      • Running PRISM

      • Rewards

        • Rewards for States

        • Rewards for Transitions

      • Simulation in PRISM

      • The PRISM GUI

    • Examples

      • Fim Switching

      • Stochastic Versions of a Differential Equation

      • Tricks for PRISM Models

  • Chapter 7 Simulating Biochemical Systems

    • The Gillespie Algorithms

      • Gillespie's Direct Method

      • Gillespie's First Reaction Method

      • Java Implementation of the Direct Method

      • A Single Reaction

      • Multiple Reactions

      • The Lotka-Volterra Equation

    • The Gibson-Bruck Algorithm

      • The Dependency Graph

      • The Indexed Priority Queue

      • Updating the tau Values

      • Analysis

    • A Constant Time Method

      • Selection Procedure

      • Reaction Selection

    • Practical Implementation Considerations

      • Data Structures-The Dependency Tree

      • Programming Techniques-Tree Updating

      • Runtime Environment

    • The Tau-Leap Method

    • Dizzy

    • Delayed Stochastic Models

    • The Stochastic Genetic Networks Simulator

    • Summary

  • Appendix A Reference Material

    • Repast Batch Running

    • Some Common Rules of Differentiation and Integration

      • Common Differentials

      • Common Integrals

    • Maxima Notation

    • PRISM Notation Summary

    • Some Mathematical Concepts

      • Vectors and Matrices

      • Probability

      • Probability Distributions

      • Taylor Expansion

  • References

  • Index

Nội dung

Introduction to Modeling for Biosciences David J Barnes Dominique Chu Introduction to Modeling for Biosciences David J Barnes Computing Laboratory University of Kent Canterbury, Kent CT2 7NF UK d.j.barnes@kent.ac.uk Dr Dominique Chu Computing Laboratory University of Kent Canterbury, Kent CT2 7NF UK D.F.Chu@kent.ac.uk ISBN 978-1-84996-325-1 e-ISBN 978-1-84996-326-8 DOI 10.1007/978-1-84996-326-8 Springer London Dordrecht Heidelberg New York British Library Cataloguing in Publication Data A catalogue record for this book is available from the British Library Library of Congress Control Number: 2010931520 © Springer-Verlag London Limited 2010 Apart from any fair dealing for the purposes of research or private study, or criticism or review, as permitted under the Copyright, Designs and Patents Act 1988, this publication may only be reproduced, stored or transmitted, in any form or by any means, with the prior permission in writing of the publishers, or in the case of reprographic reproduction in accordance with the terms of licenses issued by the Copyright Licensing Agency Enquiries concerning reproduction outside those terms should be sent to the publishers The use of registered names, trademarks, etc., in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant laws and regulations and therefore free for general use The publisher makes no representation, express or implied, with regard to the accuracy of the information contained in this book and cannot accept any legal responsibility or liability for any errors or omissions that may be made Cover art by snailsnail Cover design: KünkelLopka GmbH, Heidelberg Printed on acid-free paper Springer is part of Springer Science+Business Media (www.springer.com) David dedicates this book to Helen, Ben, (Hannah and John), John and Sarah Preface In this book we seek to provide a detailed introduction to a range of modeling techniques that are appropriate for modeling in biosciences The book is primarily intended for bioscientists, but will be equally useful for anybody wishing to start modeling in biosciences and related fields The topics we discuss include agentbased models, stochastic modeling techniques, differential equations and Gillespie’s stochastic simulation algorithm Throughout, we pay particular attention to the needs of the novice modeler We recognise that modeling in science in general (and in biology, in particular) requires both skills (i.e., programming, developing algorithms, and solving equations) and techniques (i.e., the ability to recognise what is important and needs to be represented in the model, and what can and should be left out) In our experience with novice modelers we have noticed that: (i) both skill and technique are equally important; and (ii) both are normally lacking to some degree The philosophy of this book, therefore, is to discuss both aspects—the technical side, and the side that concerns being able to identify the right degree of abstraction As far as the latter area is concerned, we not believe that there is a set of rules that, if followed, will necessarily lead to a successful modeling result Therefore, we have not provided a list of such rules Instead, we adopt a practical approach which involves walking the reader through realistic and concrete modeling projects In doing so, we highlight and comment on the process of abstracting the real system into a model The motivation for this approach is that it is akin to apprenticeship, allowing the reader both to observe practical expertise and to generate personal understanding and intuition, that will ultimately help them to formulate their own models Included in the book are practical introductions to a number of useful tools, such as the Maxima computer algebra system, the PRISM model checker, and the Repast Simphony agent modeling environment Some of the chapters also include exercises to help the reader sharpen their understanding of the topics The book is supported by a web site, http://www.cs.kent.ac.uk/imb/, that includes source code of many of the example models we discuss Canterbury, UK David J Barnes Dominique Chu vii Contents Foundations of Modeling 1.1 Simulation vs Analytic Results 1.2 Stochastic vs Deterministic Models 1.3 Fundamentals of Modeling 1.4 Validity and Purpose of Models 11 Agent-Based Modeling 2.1 Mathematical and Computational Modeling 2.1.1 Limits to Modeling 2.2 Agent-Based Models 2.2.1 The Structure of ABMs 2.2.2 Algorithms 2.2.3 Time-Driven Algorithms 2.2.4 Event-Driven Models 2.3 Game of Life 2.4 Malaria 2.4.1 A Digression 2.4.2 Stochastic Systems 2.4.3 Immobile Agents 2.5 General Consideration when Analyzing a Model 2.5.1 How to Test ABMs? 2.6 Case Study: The Evolution of Fimbriation 2.6.1 Group Selection 2.6.2 The Model 15 15 17 21 22 25 26 28 30 34 37 39 43 46 47 48 49 51 ABMs Using Repast and Java 3.1 The Basics of Agent-Based Modeling 3.2 An Outline of Repast Concepts 3.2.1 Contexts and Projections 3.2.2 Model Parameterization 3.3 The Game of Life in Repast S 3.3.1 The model.score File 79 80 83 84 86 87 88 ix x Contents 3.3.2 The Agent Class 3.3.3 The Model Initializer 3.3.4 Summary of Model Creation 3.3.5 Running the Model 3.3.6 Creating a Display 3.3.7 Creating an Agent Style Class 3.3.8 Inspecting Agents at Runtime 3.3.9 Review 3.4 Malaria Model in Repast Using Java 3.4.1 The Malaria Model 3.4.2 The model.score File 3.4.3 Commonalities in the Agent Types 3.4.4 Building the Root Context 3.4.5 Accessing Runtime Parameter Values 3.4.6 Creating a Projection 3.4.7 Implementing the Common Elements of the Agents 3.4.8 Completing the Mosquito Agent 3.4.9 Scheduling the Actions 3.4.10 Visualizing the Model 3.4.11 Charts 3.4.12 Outputting Data 3.4.13 A Statistics-Gathering Agent 3.4.14 Summary of Concepts Relating to the Malaria Model 3.4.15 Running Repast Models Outside Eclipse 3.4.16 Going Further with Repast S 89 103 104 105 106 107 109 109 110 110 111 112 112 113 114 115 118 119 120 121 124 124 127 128 130 Differential Equations 4.1 Differentiation 4.1.1 A Mathematical Example 4.1.2 Digression 4.2 Integration 4.3 Differential Equations 4.3.1 Limits to Growth 4.3.2 Steady State 4.3.3 Bacterial Growth Revisited 4.4 Case Study: Malaria 4.4.1 A Brief Note on Stability 4.5 Chemical Reactions 4.5.1 Michaelis-Menten and Hill Kinetics 4.5.2 Modeling Gene Expression 4.6 Case Study: Cherry and Adler’s Bistable Switch 4.7 Summary 131 131 136 139 141 144 147 150 152 154 161 166 168 173 177 182 Mathematical Tools 183 5.1 A Word of Warning: Pitfalls of CAS 183 Contents 5.2 Existing Tools and Types of Systems 5.3 Maxima: Preliminaries 5.4 Maxima: Simple Sample Sessions 5.4.1 The Basics 5.4.2 Saving and Recalling Sessions 5.5 Maxima: Beyond Preliminaries 5.5.1 Solving Equations 5.5.2 Matrices and Eigenvalues 5.5.3 Graphics and Plotting 5.5.4 Integrating and Differentiating 5.6 Maxima: Case Studies 5.6.1 Gene Expression 5.6.2 Malaria 5.6.3 Cherry and Adler’s Bistable Switch 5.7 Summary xi 185 187 189 189 194 195 196 198 200 205 209 209 210 212 214 Other Stochastic Methods and Prism 6.1 The Master Equation 6.2 Partition Functions 6.2.1 Preferences 6.2.2 Binding to DNA 6.2.3 Codon Bias in Proteins 6.3 Markov Chains 6.3.1 Absorbing Markov Chains 6.3.2 Continuous Time Markov Chains 6.3.3 An Example from Gene Activation 6.4 Analyzing Markov Chains: Sample Paths 6.5 Analyzing Markov Chains: Using PRISM 6.5.1 The PRISM Modeling Language 6.5.2 Running PRISM 6.5.3 Rewards 6.5.4 Simulation in PRISM 6.5.5 The PRISM GUI 6.6 Examples 6.6.1 Fim Switching 6.6.2 Stochastic Versions of a Differential Equation 6.6.3 Tricks for PRISM Models 215 217 225 227 231 235 236 240 242 244 246 248 249 251 257 261 263 264 265 268 270 Simulating Biochemical Systems 7.1 The Gillespie Algorithms 7.1.1 Gillespie’s Direct Method 7.1.2 Gillespie’s First Reaction Method 7.1.3 Java Implementation of the Direct Method 7.1.4 A Single Reaction 7.1.5 Multiple Reactions 273 273 274 275 276 278 279 xii Contents 7.1.6 The Lotka-Volterra Equation 7.2 The Gibson-Bruck Algorithm 7.2.1 The Dependency Graph 7.2.2 The Indexed Priority Queue 7.2.3 Updating the τ Values 7.2.4 Analysis 7.3 A Constant Time Method 7.3.1 Selection Procedure 7.3.2 Reaction Selection 7.4 Practical Implementation Considerations 7.4.1 Data Structures—The Dependency Tree 7.4.2 Programming Techniques—Tree Updating 7.4.3 Runtime Environment 7.5 The Tau-Leap Method 7.6 Dizzy 7.7 Delayed Stochastic Models 7.8 The Stochastic Genetic Networks Simulator 7.9 Summary A 281 284 285 285 286 288 289 290 292 293 294 295 296 297 297 301 303 305 Reference Material A.1 Repast Batch Running A.2 Some Common Rules of Differentiation and Integration A.2.1 Common Differentials A.2.2 Common Integrals A.3 Maxima Notation A.4 PRISM Notation Summary A.5 Some Mathematical Concepts A.5.1 Vectors and Matrices A.5.2 Probability A.5.3 Probability Distributions A.5.4 Taylor Expansion 307 307 307 307 308 309 310 310 310 313 314 315 References 317 Index 319 308 A Reference Material @echo off rem Unofficial configuration file for running Repast Simphony rem in batch mode rem Author: David J Barnes (d.j.barnes@kent.ac.uk) rem http://www.cs.kent.ac.uk/~djb/ rem Version: 2009.12.03 rem rem Adjust Repast version and local paths below rem Windows users: prefer the form rem c:\progra~1 over c:\Program files rem in order to avoid spaces in folder names rem rem The version of Repast Simphony being used set VERSION=1.2.0 rem The installed path of Repast set REPAST=c:\progra~1\RepastSimphony-%VERSION% rem The installed path of Eclipse set ECLIPSE=c:\progra~1\RepastSimphony-%VERSION%\eclipse rem The plugins path of Eclipse set PLUGINS=%ECLIPSE%\plugins rem The workspace containing the Repast model set WORKSPACE=%REPAST%\workspace rem The name of the model This might be case-sensitive set MODELNAME=MalariaModelBatch rem The folder of the model This might be case-sensitive set MODELFOLDER=%WORKSPACE%\%MODELNAME% rem The file containing the batch parameters set BATCHPARAMS=%MODELFOLDER%\batch\batch_params.xml rem Execute in batch mode rem NB: The following lines, up to ".rs" must be joined to be rem a single line with no spaces! java -cp %PLUGINS%/repast.simphony.batch_%VERSION%/bin; %PLUGINS%/repast.simphony.runtime_%VERSION%/lib/*; %PLUGINS%/repast.simphony.core_%VERSION%/lib/*; %PLUGINS%/repast.simphony.core_%VERSION%/bin; %PLUGINS%/repast.simphony.bin_and_src_%VERSION%/*; %PLUGINS%/repast.simphony.score.runtime_%VERSION%/lib/*; %PLUGINS%/repast.simphony.data_%VERSION%/lib/*; %MODEL%/bin repast.simphony.batch.BatchMain -params %BATCHPARAMS% %MODELFOLDER%\%MODELNAME%.rs Code A.1 Windows script file for running Repast in batch mode A.2.2 Common Integrals b The notation a f (x)dx represents the definite integral of f (x) over the interval [a, b] The interval limits are omitted for indefinite integrals Common integrals can usually be inferred from the corresponding differential (see Table A.1), with the addition of an integration constant, C Table A.2 illustrates the integrals of some common functions A.3 Maxima Notation Table A.1 Common simple differentials 309 f (x) f (x) a xa ax a−1 ax ln(a)a x ex ex (from above) loga (x) x ln(a) x (from ln(x) Table A.2 Common simple integrals sin(x) cos(x) cos(x) −sin(x) tan(x) cos2 (x) f (x) above) f (x)dx a ax + C ax xa ax ln(a) x a+1 a+1 x ln(|x|) + C loga (x) x loga (x) − sin(x) −cos(x) + C cos(x) sin(x) + C tan(x) −ln(| cos(x)|) + C +C +C x ln(a) +C Table A.3 Commonly-used notation in Maxima %e Euler’s e number %i Imaginary unit (i.e (%i)2 = −1) %pi Pi log(x) Natural logarithm of x (i.e., ln(x) is *not* implemented in Maxima) inf Infinity realpart(c) Returns the real part of c imagpart(c) Returns the imaginary part of c binom(a,b) a b A.3 Maxima Notation Full documentation on Maxima can be found in the documentation section at maxima.sourceforge.net Table A.3 illustrates some commonly-used Maxima notation 310 A Reference Material Table A.4 PRISM query summary P=?[A U[T1,T2] B] Probability that between time t = T1 and t = T2 first A is true and then B is true P=?[true U B{IC}] Starting from initial conditions I C, what is the probability that B will be true? P=?[F B{IC}] Equivalent to the above P>=0[G B] Returns true if B is always true (independent of random choices) S>=0[b=4] Returns true if b has a non-zero probability of taking a value of in steady state R=?[S] Returns the reward in steady state R=?[C

Ngày đăng: 06/09/2021, 16:36